/** * 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) // Standalone if (displayName) { setLayout(new BorderLayout(0, 5)); setBorder(makeBorder()); add(makeTitlePanel(), BorderLayout.NORTH); JPanel mainPanel = new JPanel(new BorderLayout()); mainPanel.add(createCriticalSectionPanel(), BorderLayout.NORTH); add(mainPanel, BorderLayout.CENTER); } else { // Embedded setLayout(new BorderLayout()); add(createCriticalSectionPanel(), BorderLayout.NORTH); } }
/** * Create a new CriticalSectionPanel 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 CriticalSectionControllerGui(boolean displayName) { this.displayName = displayName; init(); }
/** * Implements JMeterGUIComponent.modifyTestElement(TestElement) */ @Override public void modifyTestElement(TestElement controller) { configureTestElement(controller); if (controller instanceof CriticalSectionController) { CriticalSectionController csController = (CriticalSectionController) controller; csController.setLockName(tfLockName.getText()); } }
/** * Implements JMeterGUIComponent.createTestElement() */ @Override public TestElement createTestElement() { CriticalSectionController controller = new CriticalSectionController(); modifyTestElement(controller); return controller; }