Class AbstractVisualizer

    • Field Detail

      • isStats

        protected boolean isStats
    • Constructor Detail

      • AbstractVisualizer

        public AbstractVisualizer()
    • Method Detail

      • isStats

        public boolean isStats()
        Description copied from interface: Visualizer
        This method is used to indicate a visualizer generates statistics.
        Specified by:
        isStats in interface Visualizer
        Returns:
        true if visualiser generates statistics
      • getErrorLoggingCheckbox

        protected JCheckBox getErrorLoggingCheckbox()
        Gets the checkbox which selects whether or not only errors should be logged. Subclasses don't normally need to worry about this checkbox, because it is automatically added to the GUI in makeTitlePanel(), and the behavior is handled in this base class.
        Returns:
        the error logging checkbox
      • getModel

        protected ResultCollector getModel()
        Provides access to the ResultCollector model class for extending implementations. Using this method and setModel(ResultCollector) is only necessary if your visualizer requires a differently behaving ResultCollector. Using these methods will allow maximum reuse of the methods provided by AbstractVisualizer in this event.
        Returns:
        the associated collector
      • getFilePanel

        protected Component getFilePanel()
        Gets the file panel which allows the user to save results to a file. Subclasses don't normally need to worry about this panel, because it is automatically added to the GUI in makeTitlePanel(), and the behavior is handled in this base class.
        Returns:
        the file panel allowing users to save results
      • setFile

        public void setFile​(String filename)
        Sets the filename which results will be saved to. This will set the filename in the FilePanel. Subclasses don't normally need to call this method, because configuration of the FilePanel is handled in this base class.
        Parameters:
        filename - the new filename
        See Also:
        getFilePanel()
      • getFile

        public String getFile()
        Gets the filename which has been entered in the FilePanel. Subclasses don't normally need to call this method, because configuration of the FilePanel is handled in this base class.
        Returns:
        the current filename
        See Also:
        getFilePanel()
      • stateChanged

        public void stateChanged​(ChangeEvent e)
        Invoked when the target of the listener has changed its state. This implementation assumes that the target is the FilePanel, and will update the result collector for the new filename.
        Specified by:
        stateChanged in interface ChangeListener
        Parameters:
        e - the event that has occurred
      • createTestElement

        public TestElement createTestElement()
        Description copied from interface: JMeterGUIComponent
        JMeter test components are separated into a model and a GUI representation. The model holds the data and the GUI displays it. The GUI class is responsible for knowing how to create and initialize with data the model class that it knows how to display, and this method is called when new test elements are created.
        Specified by:
        createTestElement in interface JMeterGUIComponent
        Returns:
        the Test Element object that the GUI component represents.
      • modifyTestElement

        public void modifyTestElement​(TestElement c)
        Description copied from interface: JMeterGUIComponent
        GUI components are responsible for populating TestElements they create with the data currently held in the GUI components. This method should overwrite whatever data is currently in the TestElement as it is called after a user has filled out the form elements in the gui with new information.
        Specified by:
        modifyTestElement in interface JMeterGUIComponent
        Parameters:
        c - the TestElement to modify
      • configure

        public void configure​(TestElement el)
        Description copied from class: AbstractJMeterGuiComponent
        A newly created gui component can be initialized with the contents of a Test Element object by calling this method. The component is responsible for querying the Test Element object for the relevant information to display in its GUI.

        AbstractJMeterGuiComponent provides a partial implementation of this method, setting the name of the component and its enabled status. Subclasses should override this method, performing their own configuration as needed, but also calling this super-implementation.

        Specified by:
        configure in interface JMeterGUIComponent
        Overrides:
        configure in class AbstractJMeterGuiComponent
        Parameters:
        el - the TestElement to configure
      • configureTestElement

        protected void configureTestElement​(AbstractListenerElement mc)
        This provides a convenience for extenders when they implement the JMeterGUIComponent.createTestElement() method. This method will set the name, gui class, and test class for the created Test Element. It should be called by every extending class when creating Test Elements, as that will best assure consistent behavior.
        Parameters:
        mc - the TestElement being created.
      • makeTitlePanel

        protected Container makeTitlePanel()
        Create a standard title section for JMeter components. This includes the title for the component and the Name Panel allowing the user to change the name for the component. The AbstractVisualizer also adds the FilePanel allowing the user to save the results, and the error logging checkbox, allowing the user to choose whether or not only errors should be logged.

        This method is typically added to the top of the component at the beginning of the component's init method.

        Overrides:
        makeTitlePanel in class AbstractJMeterGuiComponent
        Returns:
        a panel containing the component title, name panel, file panel, and error logging checkbox
      • setModel

        protected void setModel​(ResultCollector collector)
        Provides extending classes the opportunity to set the ResultCollector model for the Visualizer. This is useful to allow maximum reuse of the methods from AbstractVisualizer.
        Parameters:
        collector - ResultCollector for the visualizer
      • clearGui

        public void clearGui()
        Description copied from class: AbstractJMeterGuiComponent
        Provides a default implementation that resets the name field to the value of getStaticLabel(), reset comment and sets enabled to true. Your GUI may need more things cleared, in which case you should override, clear the extra fields, and still call super.clearGui().
        Specified by:
        clearGui in interface ClearGui
        Overrides:
        clearGui in class AbstractJMeterGuiComponent