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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final class
MainFrame.ErrorsAndFatalsCounterLogTarget
ErrorsAndFatalsCounterLogTarget.
-
Field Summary
Fields Modifier and Type Field Description public final static String
LOCAL
public JTree
tree
public int
defaultCloseOperation
public TransferHandler
transferHandler
public final static int
DEFAULT_CURSOR
public final static int
CROSSHAIR_CURSOR
public final static int
TEXT_CURSOR
public final static int
WAIT_CURSOR
public final static int
SW_RESIZE_CURSOR
public final static int
SE_RESIZE_CURSOR
public final static int
NW_RESIZE_CURSOR
public final static int
NE_RESIZE_CURSOR
public final static int
N_RESIZE_CURSOR
public final static int
S_RESIZE_CURSOR
public final static int
W_RESIZE_CURSOR
public final static int
E_RESIZE_CURSOR
public final static int
HAND_CURSOR
public final static int
MOVE_CURSOR
public final static int
NORMAL
public final static int
ICONIFIED
public final static int
MAXIMIZED_HORIZ
public final static int
MAXIMIZED_VERT
public final static int
MAXIMIZED_BOTH
public Rectangle
maximizedBounds
public String
title
public MenuBar
menuBar
public int
state
public final static int
DO_NOTHING_ON_CLOSE
public final static int
HIDE_ON_CLOSE
public final static int
DISPOSE_ON_CLOSE
public final static int
EXIT_ON_CLOSE
public String
warningString
public Dialog.ModalExclusionType
modalExclusionType
public transient InputContext
inputContext
public boolean
focusableWindowState
public volatile float
opacity
public Shape
shape
public Window.Type
type
public transient FocusTraversalPolicy
focusTraversalPolicy
public transient Container
parent
public int
x
public int
y
public int
width
public int
height
public Color
foreground
public Color
background
public volatile Font
font
public Cursor
cursor
public Locale
locale
public transient BufferStrategy
bufferStrategy
public boolean
ignoreRepaint
public DropTarget
dropTarget
public String
name
public boolean
focusTraversalKeysEnabled
public transient ComponentOrientation
componentOrientation
public final static float
TOP_ALIGNMENT
public final static float
CENTER_ALIGNMENT
public final static float
BOTTOM_ALIGNMENT
public final static float
LEFT_ALIGNMENT
public final static float
RIGHT_ALIGNMENT
public final static int
WIDTH
public final static int
HEIGHT
public final static int
PROPERTIES
public final static int
SOMEBITS
public final static int
FRAMEBITS
public final static int
ALLBITS
public final static int
ERROR
public final static int
ABORT
-
Constructor Summary
Constructors Constructor Description MainFrame(TreeModel treeModel, JMeterTreeListener treeListener)
Create a new JMeter frame. MainFrame()
Default constructor for the JMeter frame.
-
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 treetreeListener
- 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
-
updateCounts
void updateCounts()
-
setMainPanel
void setMainPanel(JComponent comp)
-
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)
-
setExtendedFrameTitle
void setExtendedFrameTitle(String fname)
-
dragEnter
void dragEnter(DropTargetDragEvent dtde)
-
dragExit
void dragExit(DropTargetEvent dte)
-
dragOver
void dragOver(DropTargetDragEvent dtde)
-
drop
void drop(DropTargetDropEvent dtde)
Handler of Top level Dnd
-
openJmxFilesFromDragAndDrop
boolean openJmxFilesFromDragAndDrop(Transferable tr)
-
dropActionChanged
void dropActionChanged(DropTargetDragEvent dtde)
-
clearData
void clearData()
Clears the current data of the object.
-
actionPerformed
void actionPerformed(ActionEvent event)
Handles click on warnIndicator
-
updateUndoRedoIcons
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
-
-
-
-