org.xith3d.ui.hud.contextmenu
Class ContextMenu

java.lang.Object
  extended by org.xith3d.ui.hud.contextmenu.ContextMenu
All Implemented Interfaces:
PopUpable
Direct Known Subclasses:
DefaultContextMenu

public class ContextMenu
extends java.lang.Object
implements PopUpable

This is the root of any Xith3D HUD context menu.
You can add instances of ContextMenuItem.


Constructor Summary
ContextMenu(HUD hud, WidgetContainer menuItemsContainer)
           
 
Method Summary
 void addContextMenuListener(ContextMenuListener l)
           
 void addItem(ContextMenuItem item)
           
protected  WidgetContainer createMenuItemsContainer()
           
 HUD getHUD()
           
 WidgetContainer getMenuItemsContainer()
           
 boolean isPoppedUp()
          
protected  void onItemAdded(ContextMenuItem item, WidgetContainer menuItemsContainer)
           
 void onItemClicked(ContextMenuItem item)
           
protected  void onItemRemoved(ContextMenuItem item, WidgetContainer menuItemsContainer)
           
 void popUp(boolean p)
          Pops up the popupable Widget (or un-pops it)
 void popUp(float posX, float posY)
           
 void popUp(int canvasX, int canvasY)
           
 void removeAllItems()
           
 void removeContextMenuListener(ContextMenuListener l)
           
 void removeItem(ContextMenuItem item)
           
 void setHUD(HUD hud)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContextMenu

public ContextMenu(HUD hud,
                   WidgetContainer menuItemsContainer)
Method Detail

setHUD

public void setHUD(HUD hud)

getHUD

public final HUD getHUD()

getMenuItemsContainer

public final WidgetContainer getMenuItemsContainer()

addContextMenuListener

public void addContextMenuListener(ContextMenuListener l)

removeContextMenuListener

public void removeContextMenuListener(ContextMenuListener l)

onItemAdded

protected void onItemAdded(ContextMenuItem item,
                           WidgetContainer menuItemsContainer)
Parameters:
item -
menuItemsContainer -

addItem

public void addItem(ContextMenuItem item)

onItemRemoved

protected void onItemRemoved(ContextMenuItem item,
                             WidgetContainer menuItemsContainer)
Parameters:
item -
menuItemsContainer -

removeItem

public void removeItem(ContextMenuItem item)

removeAllItems

public final void removeAllItems()

popUp

public void popUp(float posX,
                  float posY)

popUp

public void popUp(int canvasX,
                  int canvasY)

popUp

public void popUp(boolean p)
Pops up the popupable Widget (or un-pops it)

Specified by:
popUp in interface PopUpable
Parameters:
p - if true, the pop-up will be visible

isPoppedUp

public boolean isPoppedUp()

Specified by:
isPoppedUp in interface PopUpable
Returns:
whether the pop-up is currently visible

onItemClicked

public void onItemClicked(ContextMenuItem item)

createMenuItemsContainer

protected WidgetContainer createMenuItemsContainer()