Class MainFrame

All Implemented Interfaces:
DropTargetListener, ActionListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, RootPaneContainer, WindowConstants, Clearable, Remoteable, TestStateListener

public class MainFrame extends JFrame implements TestStateListener, Remoteable, DropTargetListener, Clearable, ActionListener
The main JMeter frame, containing the menu bar, test tree, and an area for JMeter component GUIs.
See Also:
  • Field Details

  • Constructor Details

    • MainFrame

      public MainFrame(TreeModel treeModel, JMeterTreeListener treeListener)
      Create a new JMeter frame.
      Parameters:
      treeModel - the model for the test tree
      treeListener - the listener for the test tree
    • MainFrame

      @Deprecated public MainFrame()
      Deprecated.
      Do not use - only needed for JUnit tests
      Default constructor for the JMeter frame. This constructor will not properly initialize the tree, so don't use it.
  • Method Details

    • computeTestDuration

      protected void computeTestDuration(ActionEvent evt)
    • setFileLoadEnabled

      public void setFileLoadEnabled(boolean enabled)
      Specify whether or not the File|Load menu item should be enabled.
      Parameters:
      enabled - true if the menu item should be enabled, false otherwise
    • setFileSaveEnabled

      public void setFileSaveEnabled(boolean enabled)
      Specify whether or not the File|Save menu item should be enabled.
      Parameters:
      enabled - true if the menu item should be enabled, false otherwise
    • setFileRevertEnabled

      public void setFileRevertEnabled(boolean enabled)
      Specify whether or not the File|Revert item should be enabled.
      Parameters:
      enabled - true if the menu item should be enabled, false otherwise
    • setProjectFileLoaded

      public void setProjectFileLoaded(String file)
      Specify the project file that was just loaded
      Parameters:
      file - - the full path to the file that was loaded
    • setEditMenu

      public void setEditMenu(JPopupMenu menu)
      Set the menu that should be used for the Edit menu.
      Parameters:
      menu - the new Edit menu
    • setEditEnabled

      public void setEditEnabled(boolean enabled)
      Specify whether or not the Edit menu item should be enabled.
      Parameters:
      enabled - true if the menu item should be enabled, false otherwise
    • setEditAddMenu

      public void setEditAddMenu(JMenu menu)
      Set the menu that should be used for the Edit|Add menu.
      Parameters:
      menu - the new Edit|Add menu
    • setEditAddEnabled

      public void setEditAddEnabled(boolean enabled)
      Specify whether or not the Edit|Add menu item should be enabled.
      Parameters:
      enabled - true if the menu item should be enabled, false otherwise
    • closeMenu

      public void closeMenu()
      Close the currently selected menu.
    • showStoppingMessage

      public void showStoppingMessage(String host)
      Show a dialog indicating that JMeter threads are stopping on a particular host.
      Parameters:
      host - the host where JMeter threads are stopping
    • updateCounts

      public void updateCounts()
    • setMainPanel

      public void setMainPanel(JComponent comp)
    • getTree

      public JTree getTree()
    • testStarted

      public void testStarted()
      Called when a test is started on the local system. This implementation sets the running indicator and ensures that the menubar is enabled and in the running state.
      Specified by:
      testStarted in interface TestStateListener
      See Also:
    • testStarted

      public void testStarted(String host)
      Called when a test is started on a specific host. This implementation sets the running indicator and ensures that the menubar is in the running state.
      Specified by:
      testStarted in interface TestStateListener
      Parameters:
      host - the host where the test is starting
      See Also:
    • testEnded

      public void testEnded()
      Called when a test is ended on the local system. This implementation disables the menubar, stops the running indicator, and closes the stopping message dialog.
      Specified by:
      testEnded in interface TestStateListener
      See Also:
    • testEnded

      public void testEnded(String host)
      Called when a test is ended on the remote system. This implementation stops the running indicator and closes the stopping message dialog.
      Specified by:
      testEnded in interface TestStateListener
      Parameters:
      host - the host where the test is ending
      See Also:
    • initTopLevelDndHandler

      public void initTopLevelDndHandler()
      Support for Test Plan Dnd see BUG 52281 (when JDK6 will be minimum JDK target)
    • setExtendedFrameTitle

      public void setExtendedFrameTitle(String fname)
    • dragEnter

      public void dragEnter(DropTargetDragEvent dtde)
      Specified by:
      dragEnter in interface DropTargetListener
    • dragExit

      public void dragExit(DropTargetEvent dte)
      Specified by:
      dragExit in interface DropTargetListener
    • dragOver

      public void dragOver(DropTargetDragEvent dtde)
      Specified by:
      dragOver in interface DropTargetListener
    • drop

      public void drop(DropTargetDropEvent dtde)
      Handler of Top level Dnd
      Specified by:
      drop in interface DropTargetListener
    • openJmxFilesFromDragAndDrop

      public boolean openJmxFilesFromDragAndDrop(Transferable tr) throws UnsupportedFlavorException, IOException
      Throws:
      UnsupportedFlavorException
      IOException
    • dropActionChanged

      public void dropActionChanged(DropTargetDragEvent dtde)
      Specified by:
      dropActionChanged in interface DropTargetListener
    • clearData

      public void clearData()
      Description copied from interface: Clearable
      Clears the current data of the object.
      Specified by:
      clearData in interface Clearable
    • actionPerformed

      public void actionPerformed(ActionEvent event)
      Handles click on warnIndicator
      Specified by:
      actionPerformed in interface ActionListener
    • updateUndoRedoIcons

      public void updateUndoRedoIcons(boolean canUndo, boolean canRedo)
      Update Undo/Redo icons state
      Parameters:
      canUndo - Flag whether the undo button should be enabled
      canRedo - Flag whether the redo button should be enabled