org.apache.jmeter.gui

Class ReportMainFrame

Implemented Interfaces:
Remoteable, TestListener

public class ReportMainFrame
extends JFrame
implements TestListener, Remoteable

ReportMainFrame is based on MainFrame. it uses the same basic structure, but with changes for the report gui.

Nested Class Summary

protected static class
ReportMainFrame.WindowHappenings
A window adapter used to detect when the main JMeter frame is being closed.

Field Summary

protected JScrollPane
mainPanel
The main panel where components display their GUIs.
protected ReportMenuBar
menuBar
The menu bar.
protected JTree
tree
The test tree.
protected JScrollPane
treePanel
The panel where the test tree is shown.

Constructor Summary

ReportMainFrame()
ReportMainFrame(ActionListener actionHandler, TreeModel treeModel, ReportTreeListener treeListener)
Create a new JMeter frame.

Method Summary

void
closeMenu()
Close the currently selected menu.
protected JScrollPane
createMainPanel()
Create the main panel where components can display their GUIs.
protected Component
createToolBar()
Create the JMeter tool bar pane containing the running indicator.
protected JScrollPane
createTreePanel()
Create the panel where the GUI representation of the test tree is displayed.
void
drawDraggedComponent(Component dragIcon, int x, int y)
protected TreeCellRenderer
getCellRenderer()
Create the tree cell renderer used to draw the nodes in the test tree.
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
setFileSaveEnabled(boolean enabled)
Specify whether or not the File|Save menu item should be enabled.
void
setMainPanel(JComponent comp)
void
showStoppingMessage(String host)
Show a dialog indicating that JMeter threads are stopping on a particular host.
void
testEnded()
Not sure if this should be in the ReportMainFrame, since the report component doesn't really test, it generates reports. for now, I will use it to trigger reporting.
void
testEnded(String host)
Not sure if this should be in the ReportMainFrame, since the report component doesn't really test, it generates reports. for now, I will use it to trigger reporting.
void
testIterationStart(LoopIterationEvent event)
void
testStarted()
Not sure if this should be in the ReportMainFrame, since the report component doesn't really test, it generates reports. for now, I will use it to trigger reporting.
void
testStarted(String host)
Not sure if this should be in the ReportMainFrame, since the report component doesn't really test, it generates reports. for now, I will use it to trigger reporting.

Field Details

mainPanel

protected JScrollPane mainPanel
The main panel where components display their GUIs.

menuBar

protected ReportMenuBar menuBar
The menu bar.

tree

protected JTree tree
The test tree.

treePanel

protected JScrollPane treePanel
The panel where the test tree is shown.

Constructor Details

ReportMainFrame

public ReportMainFrame()

ReportMainFrame

public ReportMainFrame(ActionListener actionHandler,
                       TreeModel treeModel,
                       ReportTreeListener 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.

createMainPanel

protected JScrollPane createMainPanel()
Create the main panel where components can display their GUIs.
Returns:
the main scroll pane

createToolBar

protected Component createToolBar()
Create the JMeter tool bar pane containing the running indicator.
Returns:
a panel containing the running indicator

createTreePanel

protected JScrollPane createTreePanel()
Create the panel where the GUI representation of the test tree is displayed. The tree should already be created before calling this method.
Returns:
a scroll pane containing the test tree GUI

drawDraggedComponent

public void drawDraggedComponent(Component dragIcon,
                                 int x,
                                 int y)

getCellRenderer

protected TreeCellRenderer getCellRenderer()
Create the tree cell renderer used to draw the nodes in the test tree.
Returns:
a renderer to draw the test tree nodes

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

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)

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()
Not sure if this should be in the ReportMainFrame, since the report component doesn't really test, it generates reports. for now, I will use it to trigger reporting. Later we can refactor MainFrame and create an abstract base class.
Specified by:
testEnded in interface TestListener

testEnded

public void testEnded(String host)
Not sure if this should be in the ReportMainFrame, since the report component doesn't really test, it generates reports. for now, I will use it to trigger reporting. Later we can refactor MainFrame and create an abstract base class.
Specified by:
testEnded in interface TestListener

testIterationStart

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

testStarted

public void testStarted()
Not sure if this should be in the ReportMainFrame, since the report component doesn't really test, it generates reports. for now, I will use it to trigger reporting. Later we can refactor MainFrame and create an abstract base class.
Specified by:
testStarted in interface TestListener

testStarted

public void testStarted(String host)
Not sure if this should be in the ReportMainFrame, since the report component doesn't really test, it generates reports. for now, I will use it to trigger reporting. Later we can refactor MainFrame and create an abstract base class.
Specified by:
testStarted in interface TestListener

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