org.xith3d.ui.hud.contextmenu
Class DefaultContextMenuItem

java.lang.Object
  extended by org.xith3d.ui.hud.base.Widget
      extended by org.xith3d.ui.hud.base.BackgroundSettableWidget
          extended by org.xith3d.ui.hud.widgets.Label
              extended by org.xith3d.ui.hud.contextmenu.DefaultContextMenuItem
All Implemented Interfaces:
org.jagatoo.datatypes.Enableable, org.jagatoo.datatypes.NamableObject, org.jagatoo.datatypes.NamedObject, org.openmali.types.twodee.Positioned2f, org.openmali.types.twodee.Positioned2fRO, org.openmali.types.twodee.Sized2f, org.openmali.types.twodee.Sized2fRO, AutoSizable, PaddingSettable, TextWidget, ContextMenuItem

public class DefaultContextMenuItem
extends Label
implements ContextMenuItem

Insert type comment here.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.xith3d.ui.hud.widgets.Label
Label.Description
 
Nested classes/interfaces inherited from class org.xith3d.ui.hud.base.BackgroundSettableWidget
BackgroundSettableWidget.BackgroundSettableDescriptionBase
 
Nested classes/interfaces inherited from class org.xith3d.ui.hud.base.Widget
Widget.DescriptionBase
 
Field Summary
 
Fields inherited from class org.xith3d.ui.hud.widgets.Label
DEFAULT_HEAVYWEIGHT
 
Fields inherited from class org.xith3d.ui.hud.base.Widget
transformHeight_Pixels2HUD, transformWidth_Pixels2HUD
 
Constructor Summary
DefaultContextMenuItem(java.lang.String text)
           
DefaultContextMenuItem(java.lang.String text, Label.Description labelDesc)
           
DefaultContextMenuItem(java.lang.String text, Label.Description labelDesc, java.lang.Object userObject)
           
DefaultContextMenuItem(java.lang.String text, java.lang.Object userObject)
           
 
Method Summary
 boolean clickCausesMenuHide()
          
 ContextMenu getContextMenu()
          
 org.openmali.vecmath2.Colorf getHoveredColor()
           
protected  void markFree()
           
protected  void markHovered()
           
protected  void onItemClicked()
           
protected  void onMouseButtonReleased(org.jagatoo.input.devices.components.MouseButton button, float x, float y, long when, long lastWhen, boolean isTopMost, boolean hasFocus)
          This event is fired, when a mouse button is released on a focused Widget.
protected  void onMouseEntered(boolean isTopMost, boolean hasFocus)
          This method is called when the mouse entered the Widget area.
protected  void onMouseExited(boolean isTopMost, boolean hasFocus)
          This method is called when the mouse exited the Widget area.
 void setContextMenu(ContextMenu contextMenu)
          Sets the ContextMenu for this Widget and inherits it to all children, if this is a container.
 void setHoveredColor(org.openmali.vecmath2.Colorf hoveredColor)
           
 
Methods inherited from class org.xith3d.ui.hud.widgets.Label
drawIcon, drawText, drawWidget, getAlignment, getDisplayedText, getFont, getFont, getFontColor, getFontColor, getFontColorDisabled, getFontDisabled, getIcon, getIconGap, getMinimalHeight, getMinimalSize, getMinimalWidth, getPaddingBottom, getPaddingLeft, getPaddingRight, getPaddingTop, getText, getTextOffsetX, getTextOffsetY, init, initSize, isAutoSizeEnabled, isEnabled, onAttachedToHUD, onSizeChanged, prepareText, setAlignment, setAutoSizeEnabled, setEnabled, setEnabledImpl, setFont, setFontColor, setFontColorDisabled, setFontDisabled, setIcon, setIcon, setIconGap, setMinimalSize, setPadding, setPadding, setText, setText, setText, setTextOffset, updateText
 
Methods inherited from class org.xith3d.ui.hud.base.BackgroundSettableWidget
drawBackground, getBackgroundColor, getBackgroundTexture, getBackgroundTileMode, setBackground, setBackground, setBackground, setBackgroundColor, setBackgroundTexture, setBackgroundTexture, setBackgroundTexture, setBackgroundTexture, setBackgroundTileMode, setNoBackground
 
Methods inherited from class org.xith3d.ui.hud.base.Widget
addContainerListener, addControllerListener, addFocusListener, addInputListener, addKeyboardListener, addLocationListener, addMouseListener, addSizeListener, addVisibilityListener, bindToGlobalMouseMovement, blocksFocusMoveDeviceComponent, calculateTransformHeight_Pixels2HUD, calculateTransformWidth_Pixels2HUD, compareAbsZIndex, createShape, detach, drawAndUpdateWidget, drawBorder, drawWidgetAfterWidgetAssembler, drawWidgetContents, getAbsoluteLocationOnHUD_, getAspect, getAssembly, getBorder, getContainer, getContentAspect, getContentHeight, getContentHeightPX, getContentLeftPX, getContentOffset, getContentTopPX, getContentWidth, getContentWidthPX, getCursor, getEqualHeight_, getEqualWidth_, getForcedRedrawFrequency, getHeight, getHeightPX, getHUD, getLeft, getLevel, getLocation, getLocation, getLocationHUD2Pixels_, getLocationHUD2SG_, getLocationPixels2HUD_, getLocationSG2HUD_, getMaxRedrawFrequency, getMinHeight, getMinWidth, getName, getParentWindow, getPickHeight, getPickWidth, getRelLocationHUD2Pixels_, getRootHostWidget, getShape, getSize, getSizeHUD2Pixels_, getSizeHUD2SG_, getSizeOfPixels_, getSizePixels2HUD_, getSizeSG2HUD_, getToolTip, getTop, getTransparency, getUserObject, getWidgetAssembler, getWidth, getWidthPX, getZIndex, hasDropShadow, hasFocus, hasFocus, hasToolTip, isAHostedWidgetDirty, isClickable, isDraggable, isFocussable, isHeavyWeight, isHovered, isInitialized, isInitializing, isPickable, isThisWidgetDirty, isVisible, notifyOnDragStopped, onAttachedToContainer, onControllerAxisChanged, onControllerButtonPressed, onControllerButtonReleased, onDetachedFromContainer, onDetachedFromHUD, onFocusGained, onFocusLost, onInputStateChanged, onKeyPressed, onKeyReleased, onKeyTyped, onLocationChanged, onMouseButtonPressed, onMouseMoved, onMouseStopped, onMouseWheelMoved, onVisibilityChanged, pick, pickConditionsMatch, removeContainerListener, removeControllerListener, removeFocusListener, removeInputListener, removeKeyboardListener, removeLocationListener, removeMouseListener, removeSizeListener, removeVisibilityListener, requestFocus, resetWidgetDirty, setBorder, setBorder, setClickable, setContentClipRect, setCursor, setDraggable, setFocussable, setForcedRedrawFrequency, setHasDropShadow, setHeight, setHostedWidgetDirty, setHostTextureDirty, setHostTextureDirty, setHostWidget, setLocation, setLocation, setLocation, setMaxRedrawFrequency, setName, setPickable, setSize, setSize, setSize, setSize, setTextureDirty, setTextureDirty, setToolTip, setTransparency, setTransparency, setUserObject, setVisible, setWidgetDirty, setWidth, setZIndex, startDragging, toString, update, updateAbsZIndex, updateSizeFactors, updateTranslation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.xith3d.ui.hud.contextmenu.ContextMenuItem
getUserObject, setUserObject
 

Constructor Detail

DefaultContextMenuItem

public DefaultContextMenuItem(java.lang.String text,
                              Label.Description labelDesc,
                              java.lang.Object userObject)

DefaultContextMenuItem

public DefaultContextMenuItem(java.lang.String text,
                              java.lang.Object userObject)

DefaultContextMenuItem

public DefaultContextMenuItem(java.lang.String text,
                              Label.Description labelDesc)

DefaultContextMenuItem

public DefaultContextMenuItem(java.lang.String text)
Method Detail

setHoveredColor

public void setHoveredColor(org.openmali.vecmath2.Colorf hoveredColor)

getHoveredColor

public org.openmali.vecmath2.Colorf getHoveredColor()

clickCausesMenuHide

public boolean clickCausesMenuHide()

Specified by:
clickCausesMenuHide in interface ContextMenuItem

setContextMenu

public void setContextMenu(ContextMenu contextMenu)
Sets the ContextMenu for this Widget and inherits it to all children, if this is a container.

Specified by:
setContextMenu in interface ContextMenuItem
Overrides:
setContextMenu in class Widget

getContextMenu

public final ContextMenu getContextMenu()

Specified by:
getContextMenu in interface ContextMenuItem
Overrides:
getContextMenu in class Widget
Returns:
the (inherited) ContextMenu.

markHovered

protected void markHovered()

markFree

protected void markFree()

onMouseEntered

protected void onMouseEntered(boolean isTopMost,
                              boolean hasFocus)
Description copied from class: Widget
This method is called when the mouse entered the Widget area.

Overrides:
onMouseEntered in class Widget
Parameters:
isTopMost - is this Widget topMost
hasFocus - is this Widget focused

onMouseExited

protected void onMouseExited(boolean isTopMost,
                             boolean hasFocus)
Description copied from class: Widget
This method is called when the mouse exited the Widget area.

Overrides:
onMouseExited in class Widget
Parameters:
isTopMost - is this Widget topMost
hasFocus - is this Widget focused

onItemClicked

protected void onItemClicked()

onMouseButtonReleased

protected void onMouseButtonReleased(org.jagatoo.input.devices.components.MouseButton button,
                                     float x,
                                     float y,
                                     long when,
                                     long lastWhen,
                                     boolean isTopMost,
                                     boolean hasFocus)
Description copied from class: Widget
This event is fired, when a mouse button is released on a focused Widget.

Overrides:
onMouseButtonReleased in class Widget
Parameters:
button - the button that was released
x - the current mouse x position
y - the current mouse y position
isTopMost - is this Widget topMost
hasFocus - is this Widget focused
See Also:
net.jtank.input.MouseCode