Class GuiControl

java.lang.Object
ca.spatial.util.GuiControl

public abstract class GuiControl extends Object
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
This routine provides support for keeping a list of buttons that have been put on the GUI, and simulating clicks on the buttons according to the name given to the button.

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.
Read the comments in the source for this script for more details.
  • Constructor Details

    • GuiControl

      public GuiControl()
  • Method Details

    • add

      public static void add(String label, AbstractButton button)
      Store the definition of a button for later use
    • hasCommand

      public static boolean hasCommand(String label)
    • click

      public static void click(String label)
      Simulate the click on a button and do not wait for the action to finish
    • clickAndWait

      public static void clickAndWait(String label)
      Simulate the click on a button and wait for the aciton to finish
    • getButtonList

      public static List<String> getButtonList()
      Return a list of known buttons
    • getMenu

      public static JMenu getMenu(JFrame myFrame, String menuName)
      Get the menu of the given name. Fi it does not exist then create it
    • addMenuItem

      public static JMenuItem addMenuItem(JMenu jmn, Action action)
      Add an action to the given menu. If the action name already exists then replace it.
    • addMenuItem

      public static JMenuItem addMenuItem(JFrame myFrame, String menuName, Action action)
      Add a action to the specified menu name
    • addMenuSeparator

      public static void addMenuSeparator(JFrame myFrame, String menuName)
      Add a separator to the given menu name.