Package org.apache.jmeter.gui
Class MainFrame
java.lang.Object
java.awt.Component
java.awt.Container
java.awt.Window
java.awt.Frame
javax.swing.JFrame
org.apache.jmeter.gui.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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionfinal classErrorsAndFatalsCounterLogTarget.Nested classes/interfaces inherited from class javax.swing.JFrame
JFrame.AccessibleJFrameNested classes/interfaces inherited from class java.awt.Frame
Frame.AccessibleAWTFrameNested classes/interfaces inherited from class java.awt.Window
Window.AccessibleAWTWindow, Window.TypeNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
FieldsFields inherited from class javax.swing.JFrame
accessibleContext, rootPane, rootPaneCheckingEnabledFields inherited from class java.awt.Frame
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSORFields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTHFields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.Do not use - only needed for JUnit testsMainFrame(TreeModel treeModel, JMeterTreeListener treeListener) Create a new JMeter frame. -
Method Summary
Modifier and TypeMethodDescriptionvoidactionPerformed(ActionEvent event) Handles click on warnIndicatorvoidClears the current data of the object.voidClose the currently selected menu.protected voidvoiddragEnter(DropTargetDragEvent dtde) voiddragExit(DropTargetEvent dte) voiddragOver(DropTargetDragEvent dtde) voiddrop(DropTargetDropEvent dtde) Handler of Top level DndvoidgetTree()voidSupport for Test Plan Dnd see BUG 52281 (when JDK6 will be minimum JDK target)booleanvoidsetEditAddEnabled(boolean enabled) Specify whether or not the Edit|Add menu item should be enabled.voidsetEditAddMenu(JMenu menu) Set the menu that should be used for the Edit|Add menu.voidsetEditEnabled(boolean enabled) Specify whether or not the Edit menu item should be enabled.voidsetEditMenu(JPopupMenu menu) Set the menu that should be used for the Edit menu.voidsetExtendedFrameTitle(String fname) voidsetFileLoadEnabled(boolean enabled) Specify whether or not the File|Load menu item should be enabled.voidsetFileRevertEnabled(boolean enabled) Specify whether or not the File|Revert item should be enabled.voidsetFileSaveEnabled(boolean enabled) Specify whether or not the File|Save menu item should be enabled.voidsetMainPanel(JComponent comp) voidsetProjectFileLoaded(String file) Specify the project file that was just loadedvoidshowStoppingMessage(String host) Show a dialog indicating that JMeter threads are stopping on a particular host.voidCalled when a test is ended on the local system.voidCalled when a test is ended on the remote system.voidCalled when a test is started on the local system.voidtestStarted(String host) Called when a test is started on a specific host.voidvoidupdateUndoRedoIcons(boolean canUndo, boolean canRedo) Update Undo/Redo icons stateMethods inherited from class javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, updateMethods inherited from class java.awt.Frame
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setBackground, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setOpacity, setResizable, setShape, setState, setTitle, setUndecoratedMethods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, setVisible, show, toBack, toFrontMethods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTreeMethods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setMixingCutoutShape, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.awt.MenuContainer
getFont, postEvent
-
Field Details
-
LOCAL
- See Also:
-
-
Constructor Details
-
MainFrame
Create a new JMeter frame.- Parameters:
treeModel- the model for the test treetreeListener- the listener for the test tree
-
MainFrame
Deprecated.Do not use - only needed for JUnit testsDefault constructor for the JMeter frame. This constructor will not properly initialize the tree, so don't use it.
-
-
Method Details
-
computeTestDuration
-
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
Specify the project file that was just loaded- Parameters:
file- - the full path to the file that was loaded
-
setEditMenu
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
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
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
-
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:
testStartedin interfaceTestStateListener- See Also:
-
testStarted
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:
testStartedin interfaceTestStateListener- 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:
testEndedin interfaceTestStateListener- See Also:
-
testEnded
Called when a test is ended on the remote system. This implementation stops the running indicator and closes the stopping message dialog.- Specified by:
testEndedin interfaceTestStateListener- 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
-
dragEnter
- Specified by:
dragEnterin interfaceDropTargetListener
-
dragExit
- Specified by:
dragExitin interfaceDropTargetListener
-
dragOver
- Specified by:
dragOverin interfaceDropTargetListener
-
drop
Handler of Top level Dnd- Specified by:
dropin interfaceDropTargetListener
-
openJmxFilesFromDragAndDrop
public boolean openJmxFilesFromDragAndDrop(Transferable tr) throws UnsupportedFlavorException, IOException -
dropActionChanged
- Specified by:
dropActionChangedin interfaceDropTargetListener
-
clearData
public void clearData()Description copied from interface:ClearableClears the current data of the object. -
actionPerformed
Handles click on warnIndicator- Specified by:
actionPerformedin interfaceActionListener
-
updateUndoRedoIcons
public void updateUndoRedoIcons(boolean canUndo, boolean canRedo) Update Undo/Redo icons state- Parameters:
canUndo- Flag whether the undo button should be enabledcanRedo- Flag whether the redo button should be enabled
-