Package ca.spatial.util
Class GuiControl
java.lang.Object
ca.spatial.util.GuiControl
This class assists in controlling and customizing the
Patchworks user interface.
- Simulate the press of buttons on the GUI
- Add menu items to the GUI
You should not need to call this method directly, that will be done by the method that creates the user interface. However, you can call methods on this object, such as
- gui.click("start"); to simulate starting the scheduler
- gui.addMenuItem(menuName, itemName, command, async); To add an item to the menu system.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
add(String label, AbstractButton button)
Store the definition of a button for later usestatic JMenuItem
addMenuItem(JFrame myFrame, String menuName, Action action)
Add a action to the specified menu namestatic JMenuItem
addMenuItem(JMenu jmn, Action action)
Add an action to the given menu.static void
addMenuSeparator(JFrame myFrame, String menuName)
Add a separator to the given menu name.static void
Simulate the click on a button and do not wait for the action to finishstatic void
clickAndWait(String label)
Simulate the click on a button and wait for the aciton to finishReturn a list of known buttonsstatic JMenu
Get the menu of the given name.static boolean
hasCommand(String label)
-
Constructor Details
-
GuiControl
public GuiControl()
-
-
Method Details
-
add
Store the definition of a button for later use -
hasCommand
-
click
Simulate the click on a button and do not wait for the action to finish -
clickAndWait
Simulate the click on a button and wait for the aciton to finish -
getButtonList
Return a list of known buttons -
getMenu
Get the menu of the given name. Fi it does not exist then create it -
addMenuItem
Add an action to the given menu. If the action name already exists then replace it. -
addMenuItem
Add a action to the specified menu name -
addMenuSeparator
Add a separator to the given menu name.
-