private JPanel createControllerPanel() { loopPanel = new LoopControlPanel(false); LoopController looper = (LoopController) loopPanel.createTestElement(); looper.setLoops(1); loopPanel.configure(looper); return loopPanel; }
/** * Initialize the GUI components and layout for this component. */ private void init() { // WARNING: called from ctor so must not be overridden (i.e. must be private or final) // The Loop Controller panel can be displayed standalone or inside // another panel. For standalone, we want to display the TITLE, NAME, // etc. (everything). However, if we want to display it within another // panel, we just display the Loop Count fields (not the TITLE and // NAME). // Standalone if (displayName) { setLayout(new BorderLayout(0, 5)); setBorder(makeBorder()); add(makeTitlePanel(), BorderLayout.NORTH); JPanel mainPanel = new JPanel(new BorderLayout()); mainPanel.add(createLoopCountPanel(), BorderLayout.NORTH); add(mainPanel, BorderLayout.CENTER); } else { // Embedded setLayout(new BorderLayout()); add(createLoopCountPanel(), BorderLayout.NORTH); } }
private void initGui(){ threadInput.setText("1"); // $NON-NLS-1$ rampInput.setText("1"); // $NON-NLS-1$ loopPanel.clearGui(); if (showDelayedStart) { delayedStart.setSelected(false); } scheduler.setSelected(false); delay.setText(""); // $NON-NLS-1$ duration.setText(""); // $NON-NLS-1$ }
/** * Create a new LoopControlPanel as either a standalone or an embedded * component. * * @param displayName * indicates whether or not this component should display its * name. If true, this is a standalone component. If false, this * component is intended to be used as a subpanel for another * component. */ public LoopControlPanel(boolean displayName) { this.displayName = displayName; init(); setState(1); }
@Override public void modifyTestElement(TestElement te) { super.configureTestElement(te); if (te instanceof SteppingThreadGroup) { SteppingThreadGroup tg = (SteppingThreadGroup) te; tg.setProperty(SteppingThreadGroup.NUM_THREADS, totalThreads.getText()); tg.setThreadGroupDelay(initialDelay.getText()); tg.setInUserCount(incUserCount.getText()); tg.setInUserCountBurst(incUserCountBurst.getText()); tg.setInUserPeriod(incUserPeriod.getText()); tg.setOutUserCount(decUserCount.getText()); tg.setOutUserPeriod(decUserPeriod.getText()); tg.setFlightTime(flightTime.getText()); tg.setRampUp(rampUp.getText()); tg.setSamplerController((LoopController) loopPanel.createTestElement()); refreshPreview(); } }
@Override public void configure(TestElement te) { super.configure(te); SteppingThreadGroup tg = (SteppingThreadGroup) te; totalThreads.setText(tg.getNumThreadsAsString()); initialDelay.setText(tg.getThreadGroupDelay()); incUserCount.setText(tg.getInUserCount()); incUserCountBurst.setText(tg.getInUserCountBurst()); incUserPeriod.setText(tg.getInUserPeriod()); decUserCount.setText(tg.getOutUserCount()); decUserPeriod.setText(tg.getOutUserPeriod()); flightTime.setText(tg.getFlightTime()); rampUp.setText(tg.getRampUp()); TestElement controller = (TestElement) tg.getProperty(AbstractThreadGroup.MAIN_CONTROLLER).getObjectValue(); if (controller != null) { loopPanel.configure(controller); } }
@Override public void modifyTestElement(TestElement lc) { configureTestElement(lc); if (lc instanceof LoopController) { if (loops.getText().length() > 0) { ((LoopController) lc).setLoops(loops.getText()); } else { ((LoopController) lc).setLoops(LoopController.INFINITE_LOOP_COUNT); } } }
@Override public void modifyTestElement(TestElement te) { super.configureTestElement(te); if (te instanceof SteppingThreadGroup) { SteppingThreadGroup tg = (SteppingThreadGroup) te; tg.setProperty(SteppingThreadGroup.NUM_THREADS, totalThreads.getText()); tg.setThreadGroupDelay(initialDelay.getText()); tg.setInUserCount(incUserCount.getText()); tg.setInUserCountBurst(incUserCountBurst.getText()); tg.setInUserPeriod(incUserPeriod.getText()); tg.setOutUserCount(decUserCount.getText()); tg.setOutUserPeriod(decUserPeriod.getText()); tg.setFlightTime(flightTime.getText()); tg.setRampUp(rampUp.getText()); tg.setSamplerController((LoopController) loopPanel.createTestElement()); refreshPreview(); } }
@Override public void configure(TestElement tg) { super.configure(tg); threadInput.setText(tg.getPropertyAsString(AbstractThreadGroup.NUM_THREADS)); rampInput.setText(tg.getPropertyAsString(ThreadGroup.RAMP_TIME)); loopPanel.configure((TestElement) tg.getProperty(AbstractThreadGroup.MAIN_CONTROLLER).getObjectValue()); if (showDelayedStart) { delayedStart.setSelected(tg.getPropertyAsBoolean(ThreadGroup.DELAYED_START)); } scheduler.setSelected(tg.getPropertyAsBoolean(ThreadGroup.SCHEDULER)); toggleSchedulerFields(scheduler.isSelected()); duration.setText(tg.getPropertyAsString(ThreadGroup.DURATION)); delay.setText(tg.getPropertyAsString(ThreadGroup.DELAY)); }
private JPanel createControllerPanel() { loopPanel = new LoopControlPanel(false); LoopController looper = (LoopController) loopPanel.createTestElement(); looper.setLoops(-1); looper.setContinueForever(true); loopPanel.configure(looper); return loopPanel; }
@Override public void modifyTestElement(TestElement te) { super.configureTestElement(te); if (te instanceof SteppingThreadGroup) { SteppingThreadGroup tg = (SteppingThreadGroup) te; tg.setProperty(SteppingThreadGroup.NUM_THREADS, totalThreads.getText()); tg.setThreadGroupDelay(initialDelay.getText()); tg.setInUserCount(incUserCount.getText()); tg.setInUserCountBurst(incUserCountBurst.getText()); tg.setInUserPeriod(incUserPeriod.getText()); tg.setOutUserCount(decUserCount.getText()); tg.setOutUserPeriod(decUserPeriod.getText()); tg.setFlightTime(flightTime.getText()); tg.setRampUp(rampUp.getText()); tg.setSamplerController((LoopController) loopPanel.createTestElement()); refreshPreview(); } }
@Override public void configure(TestElement te) { super.configure(te); SteppingThreadGroup tg = (SteppingThreadGroup) te; totalThreads.setText(tg.getNumThreadsAsString()); initialDelay.setText(tg.getThreadGroupDelay()); incUserCount.setText(tg.getInUserCount()); incUserCountBurst.setText(tg.getInUserCountBurst()); incUserPeriod.setText(tg.getInUserPeriod()); decUserCount.setText(tg.getOutUserCount()); decUserPeriod.setText(tg.getOutUserPeriod()); flightTime.setText(tg.getFlightTime()); rampUp.setText(tg.getRampUp()); TestElement controller = (TestElement) tg.getProperty(AbstractThreadGroup.MAIN_CONTROLLER).getObjectValue(); if (controller != null) { loopPanel.configure(controller); } }
private JPanel createControllerPanel() { loopPanel = new LoopControlPanel(false); LoopController looper = (LoopController) loopPanel.createTestElement(); looper.setLoops(-1); looper.setContinueForever(true); loopPanel.configure(looper); return loopPanel; }
/** * Modifies a given TestElement to mirror the data in the gui components. * * @see org.apache.jmeter.gui.JMeterGUIComponent#modifyTestElement(TestElement) */ @Override public void modifyTestElement(TestElement tg) { super.configureTestElement(tg); if (tg instanceof AbstractThreadGroup) { ((AbstractThreadGroup) tg).setSamplerController((LoopController) loopPanel.createTestElement()); } tg.setProperty(AbstractThreadGroup.NUM_THREADS, threadInput.getText()); tg.setProperty(ThreadGroup.RAMP_TIME, rampInput.getText()); if (showDelayedStart) { tg.setProperty(ThreadGroup.DELAYED_START, delayedStart.isSelected(), false); } tg.setProperty(new BooleanProperty(ThreadGroup.SCHEDULER, scheduler.isSelected())); tg.setProperty(ThreadGroup.DURATION, duration.getText()); tg.setProperty(ThreadGroup.DELAY, delay.getText()); }
@Override public void configure(TestElement te) { super.configure(te); SteppingThreadGroup tg = (SteppingThreadGroup) te; totalThreads.setText(tg.getNumThreadsAsString()); initialDelay.setText(tg.getThreadGroupDelay()); incUserCount.setText(tg.getInUserCount()); incUserCountBurst.setText(tg.getInUserCountBurst()); incUserPeriod.setText(tg.getInUserPeriod()); decUserCount.setText(tg.getOutUserCount()); decUserPeriod.setText(tg.getOutUserPeriod()); flightTime.setText(tg.getFlightTime()); rampUp.setText(tg.getRampUp()); TestElement controller = (TestElement) tg.getProperty(AbstractThreadGroup.MAIN_CONTROLLER).getObjectValue(); if (controller != null) { loopPanel.configure(controller); } }
private JPanel createControllerPanel() { loopPanel = new LoopControlPanel(false); LoopController looper = (LoopController) loopPanel.createTestElement(); looper.setLoops(-1); looper.setContinueForever(true); loopPanel.configure(looper); return loopPanel; }
@Override public void modifyTestElement(TestElement tg) { //log.info("Modify test element"); if (grid.isEditing()) { grid.getCellEditor().stopCellEditing(); } if (tg instanceof UltimateThreadGroup) { UltimateThreadGroup utg = (UltimateThreadGroup) tg; CollectionProperty rows = JMeterPluginsUtils.tableModelRowsToCollectionProperty(tableModel, UltimateThreadGroup.DATA_PROPERTY); utg.setData(rows); utg.setSamplerController((LoopController) loopPanel.createTestElement()); } super.configureTestElement(tg); }
@Override public void configure(TestElement tg) { //log.info("Configure"); super.configure(tg); UltimateThreadGroup utg = (UltimateThreadGroup) tg; //log.info("Configure "+utg.getName()); JMeterProperty threadValues = utg.getData(); if (!(threadValues instanceof NullProperty)) { CollectionProperty columns = (CollectionProperty) threadValues; tableModel.removeTableModelListener(this); JMeterPluginsUtils.collectionPropertyToTableModelRows(columns, tableModel); tableModel.addTableModelListener(this); updateUI(); } else { log.warn("Received null property instead of collection"); } TestElement te = (TestElement) tg.getProperty(AbstractThreadGroup.MAIN_CONTROLLER).getObjectValue(); if (te != null) { loopPanel.configure(te); } buttons.checkDeleteButtonStatus(); }
private JPanel createControllerPanel() { loopPanel = new LoopControlPanel(false); LoopController looper = (LoopController) loopPanel.createTestElement(); looper.setLoops(-1); looper.setContinueForever(true); loopPanel.configure(looper); return loopPanel; }
@Override public void modifyTestElement(TestElement tg) { //log.info("Modify test element"); if (grid.isEditing()) { grid.getCellEditor().stopCellEditing(); } if (tg instanceof UltimateThreadGroup) { UltimateThreadGroup utg = (UltimateThreadGroup) tg; CollectionProperty rows = JMeterPluginsUtils.tableModelRowsToCollectionProperty(tableModel, UltimateThreadGroup.DATA_PROPERTY); utg.setData(rows); utg.setSamplerController((LoopController) loopPanel.createTestElement()); } super.configureTestElement(tg); }