org.xith3d.ui.hud.menusystem
Class MenuGroup

java.lang.Object
  extended by org.xith3d.ui.hud.menusystem.MenuGroup

public abstract class MenuGroup
extends java.lang.Object

The MenuGroup manages Menu items and notifies MenuSystemListeners of state changes.


Constructor Summary
MenuGroup(java.lang.String name)
          Creates a new MenuGroup.
MenuGroup(java.lang.String name, MenuGroup previousMenuGroup)
          Creates a new MenuGroup.
 
Method Summary
 void addActionButton(java.lang.String caption, java.lang.Object target)
          Adds a Button to the MenuGroup.
 void addMenu(java.lang.String accessorCaption, java.lang.String caption, Menu menu)
          Adds a Menu item and an accessor Widget (like a Button) to the MenuGroup.
protected  Button addMenuImpl(java.lang.String accessorCaption, java.lang.String caption, Menu menu)
          Adds a Menu item and an accessor Widget (like a button) to the MenuGroup.
protected abstract  MenuGroupWidget createMenuSystemWidget(float width, float height, float resolutionX, float resolutionY)
           
 boolean fireOnMenuActionPerformed(java.lang.String action)
           
 void fireOnSettingChanged(Menu menu, java.lang.String setting, java.lang.Object value)
           
 Menu getCurrentActiveMenu()
           
 Menu getMenu(int index)
           
 Menu getMenu(java.lang.String name)
           
 MenuGroupWidget getMenuGroupWidget()
           
 java.util.List<Menu> getMenus()
           
 int getMenusCount()
           
 MenuSystem getMenuSystem()
           
 java.lang.String getName()
           
 MenuGroup getPreviousMenuGroup()
           
protected  void init(MenuSystem menuSystem)
           
protected  void initMenus(Button.Description accessorDesc, org.openmali.vecmath2.Colorf menuBGColor, org.openmali.vecmath2.Colorf menuBorderColor, HUDFont menuCaptionFont, org.openmali.vecmath2.Colorf menuFontColor)
           
 boolean isVisible()
           
 void setCurrentActiveMenu(Menu menu)
          Sets the current active Menu.
 void setPreviousMenuGroup(MenuGroup menuGroup)
           
 void setVisible(boolean visible)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MenuGroup

public MenuGroup(java.lang.String name,
                 MenuGroup previousMenuGroup)
Creates a new MenuGroup.

Parameters:
name -
previousMenuGroup -

MenuGroup

public MenuGroup(java.lang.String name)
Creates a new MenuGroup.

Parameters:
name -
Method Detail

getName

public final java.lang.String getName()

getMenuSystem

public final MenuSystem getMenuSystem()

setPreviousMenuGroup

public void setPreviousMenuGroup(MenuGroup menuGroup)

getPreviousMenuGroup

public MenuGroup getPreviousMenuGroup()

fireOnSettingChanged

public void fireOnSettingChanged(Menu menu,
                                 java.lang.String setting,
                                 java.lang.Object value)

fireOnMenuActionPerformed

public boolean fireOnMenuActionPerformed(java.lang.String action)

setCurrentActiveMenu

public void setCurrentActiveMenu(Menu menu)
Sets the current active Menu.


getCurrentActiveMenu

public final Menu getCurrentActiveMenu()
Returns:
the current active Menu.

getMenuGroupWidget

public final MenuGroupWidget getMenuGroupWidget()
Returns:
the MenuGroupWidget, that handles the layout of this MenuGroup.

addMenuImpl

protected Button addMenuImpl(java.lang.String accessorCaption,
                             java.lang.String caption,
                             Menu menu)
Adds a Menu item and an accessor Widget (like a button) to the MenuGroup.

Parameters:
accessorCaption -
caption -
menu -
Returns:
the accessor Button.

addMenu

public final void addMenu(java.lang.String accessorCaption,
                          java.lang.String caption,
                          Menu menu)
Adds a Menu item and an accessor Widget (like a Button) to the MenuGroup.

Parameters:
accessorCaption -
caption -
menu -

addActionButton

public void addActionButton(java.lang.String caption,
                            java.lang.Object target)
Adds a Button to the MenuGroup.

Parameters:
caption - the caption of the accessor Button
target - the processed value of target is either its name, if it is a NamedObject, or the value of the toString() method.

getMenus

public final java.util.List<Menu> getMenus()

getMenu

public final Menu getMenu(int index)

getMenu

public final Menu getMenu(java.lang.String name)

getMenusCount

public final int getMenusCount()

setVisible

public void setVisible(boolean visible)

isVisible

public final boolean isVisible()

createMenuSystemWidget

protected abstract MenuGroupWidget createMenuSystemWidget(float width,
                                                          float height,
                                                          float resolutionX,
                                                          float resolutionY)

initMenus

protected void initMenus(Button.Description accessorDesc,
                         org.openmali.vecmath2.Colorf menuBGColor,
                         org.openmali.vecmath2.Colorf menuBorderColor,
                         HUDFont menuCaptionFont,
                         org.openmali.vecmath2.Colorf menuFontColor)
Parameters:
accessorDesc -
menuBGColor -
menuBorderColor -
menuCaptionFont -
menuFontColor -

init

protected void init(MenuSystem menuSystem)