org.xith3d.ui.hud.contextmenu
Class ContextMenu
java.lang.Object
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.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ContextMenu
public ContextMenu(HUD hud,
WidgetContainer menuItemsContainer)
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)
addItem
public void addItem(ContextMenuItem item)
onItemRemoved
protected void onItemRemoved(ContextMenuItem item,
WidgetContainer 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()