harmonic.mz.gui
Class MenuMaker

java.lang.Object
  |
  +--harmonic.mz.gui.MenuMaker

public class MenuMaker
extends java.lang.Object

This is a utility to making menus in the widget lib from types in this package. To use this, create the MenuMaker, populate it with addX() and begin/endSpawn(), and get the gui menu out with getMenu().


Constructor Summary
MenuMaker()
          Constructs an MenuMaker for createing a new menu.
MenuMaker(HWM_GroupData m)
          Constructs an MenuMaker for adding to given menu.
 
Method Summary
 void addCommand(FunctionStarter action)
          Add a function item to menu.
 void addCommand(java.lang.Object listener, java.lang.String callback, java.lang.String menuText)
          Convenience: addCommand(new FunctionStarter(null, listener, callback, menuText))
 void addField(ModelNode node)
           
 void addField(java.lang.String menuText, javax.swing.ImageIcon icon, ModelNode node)
          Add a field item to the menu.
 void addSeperator()
          Add a separator the menu.
 void beginSpawn(java.lang.String label, Module mod)
          Adds a menu item that spawns others, and creates a sub menu.
 void endSpawn()
          Ends the current sub menu and falls back to its owning menu.
 HWM_GroupData getMenu()
          Returns the data structure to give to the widget library.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MenuMaker

public MenuMaker()
Constructs an MenuMaker for createing a new menu.


MenuMaker

public MenuMaker(HWM_GroupData m)
Constructs an MenuMaker for adding to given menu.

Method Detail

getMenu

public HWM_GroupData getMenu()
Returns the data structure to give to the widget library.


beginSpawn

public void beginSpawn(java.lang.String label,
                       Module mod)
Adds a menu item that spawns others, and creates a sub menu. Untill endSpawn is called the and addX commands will be added to the sub menu,


endSpawn

public void endSpawn()
Ends the current sub menu and falls back to its owning menu. Calling this too many times will print an internal error.


addCommand

public void addCommand(java.lang.Object listener,
                       java.lang.String callback,
                       java.lang.String menuText)
Convenience: addCommand(new FunctionStarter(null, listener, callback, menuText))


addCommand

public void addCommand(FunctionStarter action)
Add a function item to menu.


addField

public void addField(ModelNode node)

addField

public void addField(java.lang.String menuText,
                     javax.swing.ImageIcon icon,
                     ModelNode node)
Add a field item to the menu. A field editor will be started when the field is selected.


addSeperator

public void addSeperator()
Add a separator the menu.