org.apache.jmeter.gui

Class MainFrame

Implemented Interfaces:
Remoteable, TestListener

public class MainFrame
extends JFrame
implements TestListener, Remoteable

The main JMeter frame, containing the menu bar, test tree, and an area for JMeter component GUIs.

Constructor Summary

MainFrame()
Deprecated. Do not use - only needed for JUnit tests
MainFrame(ActionListener actionHandler, TreeModel treeModel, JMeterTreeListener treeListener)
Create a new JMeter frame.

Method Summary

void
closeMenu()
Close the currently selected menu.
void
drawDraggedComponent(Component dragIcon, int x, int y)
Repaint pieces of the GUI as needed while dragging.
JTree
getTree()
void
setEditAddEnabled(boolean enabled)
Specify whether or not the Edit|Add menu item should be enabled.
void
setEditAddMenu(JMenu menu)
Set the menu that should be used for the Edit|Add menu.
void
setEditEnabled(boolean enabled)
Specify whether or not the Edit menu item should be enabled.
void
setEditMenu(JPopupMenu menu)
Set the menu that should be used for the Edit menu.
void
setEditRemoveEnabled(boolean enabled)
Specify whether or not the Edit|Remove menu item should be enabled.
void
setExtendedFrameTitle(String fname)
void
setFileLoadEnabled(boolean enabled)
Specify whether or not the File|Load menu item should be enabled.
void
setFileRevertEnabled(boolean enabled)
Specify whether or not the File|Revert item should be enabled.
void
setFileSaveEnabled(boolean enabled)
Specify whether or not the File|Save menu item should be enabled.
void
setMainPanel(JComponent comp)
void
setProjectFileLoaded(String file)
Specify the project file that was just loaded
void
showStoppingMessage(String host)
Show a dialog indicating that JMeter threads are stopping on a particular 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
testIterationStart(LoopIterationEvent event)
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
updateCounts()

Constructor Details

MainFrame

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.

MainFrame

public MainFrame(ActionListener actionHandler,
                 TreeModel treeModel,
                 JMeterTreeListener treeListener)
Create a new JMeter frame.
Parameters:
actionHandler - this parameter is not used
treeModel - the model for the test tree
treeListener - the listener for the test tree

Method Details

closeMenu

public void closeMenu()
Close the currently selected menu.

drawDraggedComponent

public void drawDraggedComponent(Component dragIcon,
                                 int x,
                                 int y)
Repaint pieces of the GUI as needed while dragging. This method should only be called from the Swing event thread.
Parameters:
dragIcon - the component being dragged
x - the current mouse x coordinate
y - the current mouse y coordinate

getTree

public JTree getTree()

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

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

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

setEditMenu

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

setEditRemoveEnabled

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

setExtendedFrameTitle

public void setExtendedFrameTitle(String fname)

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

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

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

setMainPanel

public void setMainPanel(JComponent comp)

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

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

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 TestListener

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 TestListener
Parameters:
host - the host where the test is ending

testIterationStart

public void testIterationStart(LoopIterationEvent event)
Specified by:
testIterationStart in interface TestListener

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 TestListener

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 TestListener
Parameters:
host - the host where the test is starting

updateCounts

public void updateCounts()

Copyright © 1998-2010 Apache Software Foundation. All Rights Reserved.