Class MainFrame

  • All Implemented Interfaces:
    java.awt.MenuContainer , java.awt.dnd.DropTargetListener , java.awt.event.ActionListener , java.awt.image.ImageObserver , java.io.Serializable , java.util.EventListener , javax.accessibility.Accessible , javax.swing.RootPaneContainer , javax.swing.TransferHandler.HasGetTransferHandler , javax.swing.WindowConstants , org.apache.jmeter.samplers.Clearable , org.apache.jmeter.samplers.Remoteable , org.apache.jmeter.testelement.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.

    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      JTree getTree()
      void setFileLoadEnabled(boolean enabled) Specify whether or not the File|Load menu item should be enabled.
      void setFileSaveEnabled(boolean enabled) Specify whether or not the File|Save menu item should be enabled.
      void setFileRevertEnabled(boolean enabled) Specify whether or not the File|Revert item should be enabled.
      void setProjectFileLoaded(String file) Specify the project file that was just loaded
      void setEditMenu(JPopupMenu menu) Set the menu that should be used for the Edit menu.
      void setEditEnabled(boolean enabled) Specify whether or not the Edit menu item should be enabled.
      void setEditAddMenu(JMenu menu) Set the menu that should be used for the Edit|Add menu.
      void setEditAddEnabled(boolean enabled) Specify whether or not the Edit|Add menu item should be enabled.
      void closeMenu() Close the currently selected menu.
      void showStoppingMessage(String host) Show a dialog indicating that JMeter threads are stopping on a particular host.
      void updateCounts()
      void setMainPanel(JComponent comp)
      void testStarted() Called when a test is started on the local system.
      void testStarted(String host) Called when a test is started on a specific host.
      void testEnded() Called when a test is ended on the local system.
      void testEnded(String host) Called when a test is ended on the remote system.
      void initTopLevelDndHandler() Support for Test Plan Dnd see BUG 52281 (when JDK6 will be minimum JDK target)
      void setExtendedFrameTitle(String fname)
      void dragEnter(DropTargetDragEvent dtde)
      void dragExit(DropTargetEvent dte)
      void dragOver(DropTargetDragEvent dtde)
      void drop(DropTargetDropEvent dtde) Handler of Top level Dnd
      boolean openJmxFilesFromDragAndDrop(Transferable tr)
      void dropActionChanged(DropTargetDragEvent dtde)
      void clearData() Clears the current data of the object.
      void actionPerformed(ActionEvent event) Handles click on warnIndicator
      void updateUndoRedoIcons(boolean canUndo, boolean canRedo) Update Undo/Redo icons state
      • Methods inherited from class javax.swing.JFrame

        getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setTransferHandler, update
      • Methods inherited from class java.awt.Frame

        addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, removeNotify, setBackground, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setOpacity, setResizable, setShape, setState, setTitle, setUndecorated
      • Methods inherited from class java.awt.Window

        addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getFocusableWindowState, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, getWindows, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusCycleRoot, isFocusableWindow, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setFocusCycleRoot, setFocusableWindowState, setIconImages, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setType, setVisible, show, toBack, toFront
      • Methods inherited from class java.awt.Container

        add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentCount, getComponentZOrder, getComponents, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate
      • Methods inherited from class java.awt.Component

        action, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, contains, createImage, createVolatileImage, disable, dispatchEvent, enable, enableInputMethods, getBaseline, getBaselineResizeBehavior, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusOwner, isFocusTraversable, isFocusable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, printAll, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, requestFocus, requestFocusInWindow, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusTraversalKeysEnabled, setFocusable, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setMixingCutoutShape, setName, setPreferredSize, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
      • Methods inherited from class java.awt.MenuContainer

        getFont
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MainFrame

        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

        MainFrame()
        Default constructor for the JMeter frame.
    • Method Detail

      • setFileLoadEnabled

         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

         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

         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

         void setProjectFileLoaded(String file)

        Specify the project file that was just loaded

        Parameters:
        file - - the full path to the file that was loaded
      • setEditMenu

         void setEditMenu(JPopupMenu menu)

        Set the menu that should be used for the Edit menu.

        Parameters:
        menu - the new Edit menu
      • setEditEnabled

         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

         void setEditAddMenu(JMenu menu)

        Set the menu that should be used for the Edit|Add menu.

        Parameters:
        menu - the new Edit|Add menu
      • setEditAddEnabled

         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

         void closeMenu()

        Close the currently selected menu.

      • showStoppingMessage

         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
      • testStarted

         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.

      • testStarted

         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.

        Parameters:
        host - the host where the test is starting
      • testEnded

         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.

      • testEnded

         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.

        Parameters:
        host - the host where the test is ending
      • initTopLevelDndHandler

         void initTopLevelDndHandler()

        Support for Test Plan Dnd see BUG 52281 (when JDK6 will be minimum JDK target)

      • clearData

         void clearData()

        Clears the current data of the object.

      • updateUndoRedoIcons

         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