|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xith3d.ui.hud.base.WidgetBase
public abstract class WidgetBase
This class implements a base for a Widget.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.xith3d.ui.hud.base.Widget |
|---|
Widget.DescriptionBase |
| Field Summary | |
|---|---|
protected java.util.ArrayList<WidgetContainerListener> |
containerListeners
|
protected TransformGroup |
transformGroup
|
protected org.openmali.vecmath2.Vector3f |
translation
|
protected static float |
Z_INDEX_UNIT
|
protected static float |
Z_INDEX_UNIT_ASSEMBLER
|
| Constructor Summary | |
|---|---|
WidgetBase(float width,
float height)
Creates a new Widget with the given width and height |
|
WidgetBase(float width,
float height,
int zIndex)
Creates a new Widget with the given width and height |
|
| Method Summary | |
|---|---|
void |
addContainerListener(WidgetContainerListener l)
Adds a new WidgetContainerListener. |
void |
addFocusListener(WidgetFocusListener l)
Adds a new WidgetFocusListener. |
void |
addInputListener(WidgetInputListener l)
Adds a new WidgetInputListener. |
void |
addLocationListener(WidgetLocationListener l)
Adds a new WidgetLocationListener. |
void |
addSizeListener(WidgetSizeListener l)
Adds a new WidgetSizeListener. |
void |
addVisibilityListener(WidgetVisibilityListener l)
Adds a new WidgetVisibilityListener. |
void |
detach()
Instantly removes the Widget from its Container. |
void |
detach(boolean delayed)
Removes the Widget from its Container. |
float |
getAspect()
|
Widget |
getAssembly()
|
Widget |
getCachedToolTipWidget()
|
WidgetContainer |
getContainer()
The Container which contains this Widget |
ContextMenu |
getContextMenu()
|
Cursor.Type |
getCursor()
|
float |
getHeight()
|
HUD |
getHUD()
|
Cursor.Type |
getInheritedCursor()
|
float |
getLeft()
|
org.openmali.vecmath2.Tuple2f |
getLocation()
|
java.lang.String |
getName()
|
Node |
getSGNode()
|
float |
getSGZPosition()
|
org.openmali.types.twodee.Sized2fRO |
getSize()
|
java.lang.String |
getToolTip()
|
float |
getTop()
|
java.lang.Object |
getUserObject()
|
protected WidgetAssembler |
getWidgetAssembler()
|
float |
getWidth()
|
int |
getZIndex()
|
boolean |
hasFocus()
Is this Widget focused? |
boolean |
hasFocus(boolean testLeaf)
Is this Widget focused? |
boolean |
hasToolTip()
|
protected abstract void |
init()
This method is called when the WidgetContainer is set. |
boolean |
isClickable()
|
boolean |
isDraggable()
|
boolean |
isFocussable()
|
protected boolean |
isInitialized()
Has the init method been executed once? |
protected boolean |
isInitializing()
Is the init method currently being executed? |
boolean |
isPickable()
|
boolean |
isVisible()
|
protected void |
onAddedToContainer(WidgetContainer container)
This event is fired, when this Widget is added to a WidgetContainer. |
protected void |
onAddedToHUD(HUD hud)
This event is fired, when this Widget is added to a WidgetContainer and the container itself is already added to the HUD or is the HUD itself. |
void |
onControllerAxisChanged(org.jagatoo.input.devices.components.ControllerAxis axis,
int axisDelta)
This event is fired when a ControllerAxis has changed and this Widget is the currently focussed one. |
void |
onControllerButtonPressed(org.jagatoo.input.devices.components.ControllerButton button)
This event is fired when a ControllerButton has been pressed and this Widget is the currently focussed one. |
void |
onControllerButtonReleased(org.jagatoo.input.devices.components.ControllerButton button)
This event is fired when a ControllerButton has been released and this Widget is the currently focussed one. |
void |
onDetached()
This method is called right before the Widget has been detached from its WidgetContainer. |
void |
onFocusGained()
This event is fired, when the focus is gained to a Widget. |
void |
onFocusLost()
This event is fired, when the focus is lost by a Widget. |
void |
onInputStateChanged(org.jagatoo.input.devices.components.DeviceComponent comp,
int delta,
int state,
boolean isTopMost,
boolean hasFocus)
This event is fired when the state of any DeviceComponent has changed. |
void |
onKeyPressed(org.jagatoo.input.devices.components.Key key,
long when)
This event is fired, when a key is pressed on a focused Widget. |
void |
onKeyReleased(org.jagatoo.input.devices.components.Key key,
long when)
This event is fired, when a key is released on a focused Widget. |
void |
onKeyTyped(char ch,
long when)
This event is fired when a key is typed on the keyboard. |
void |
onMouseButtonPressed(org.jagatoo.input.devices.components.MouseButton button,
int x,
int y,
long when,
long lastWhen,
boolean isTopMost,
boolean hasFocus)
This event is fired, when a mouse button is pressed on a focused Widget. |
void |
onMouseButtonReleased(org.jagatoo.input.devices.components.MouseButton button,
int x,
int y,
long when,
long lastWhen,
boolean isTopMost,
boolean hasFocus)
This event is fired, when a mouse button is released on a focused Widget. |
void |
onMouseEntered(boolean isTopMost,
boolean hasFocus)
This method is called when the mouse entered the Widget area |
void |
onMouseLeft(boolean isTopMost,
boolean hasFocus)
This method is called when the mouse left the Widget area |
void |
onMouseMoved(int x,
int y,
int buttonsState,
long when,
boolean isTopMost,
boolean hasFocus)
This event is fired, when the mouse is moved on a Widget. |
void |
onMouseStopped(int x,
int y,
long when,
boolean isTopMost,
boolean hasFocus)
This event is fired, when the mouse position has not been changed on this Widget for a certain amount of time. |
void |
onMouseUnbound()
This event is fired, when the mouse is released. |
void |
onMouseWheelMoved(int delta,
boolean isPageMove,
int x,
int y,
long when,
boolean isTopMost)
This event is fired, when the mouse wheel is moved on a Widget. |
protected void |
onRemovedFromContainer(WidgetContainer container)
This event is fired, when this Widget is removed from a WidgetContainer. |
protected HUDPickResult |
pickWidgetAssembler(HUDPickResult hostHPR,
int canvasX,
int canvasY,
HUDPickResult.HUDPickReason pickReason,
org.jagatoo.input.devices.components.MouseButton button,
long when,
long meta,
int flags)
Dispatches the picking to the WidgetAssembler. |
void |
removeContainerListener(WidgetContainerListener l)
Removes a WidgetContainerListener. |
void |
removeFocusListener(WidgetFocusListener l)
Removes a WidgetFocusListener. |
void |
removeInputListener(WidgetInputListener l)
Removes a WidgetInputListener. |
void |
removeLocationListener(WidgetLocationListener l)
Removes a WidgetFocusListener. |
void |
removeSizeListener(WidgetSizeListener l)
Removes a WidgetSizeListener. |
void |
removeVisibilityListener(WidgetVisibilityListener l)
Removes a WidgetVisibilityListener. |
void |
requestFocus()
Requests the focus from the HUD system. |
void |
setAssembly(Widget assembly)
Sets the Widget, which uses this one to assemle itself, if any. |
void |
setCachedToolTipWidget(Widget tooltipWidget)
|
void |
setClickable(boolean isClickable)
Sets wheather this Widget is clickable. |
void |
setContainer(WidgetContainer container)
Sets this Widget's container |
void |
setContextMenu(ContextMenu contextMenu)
Sets the ContextMenu for this Widget and inherits it to all children, if this is a container. |
void |
setCursor(Cursor.Type cursor)
Sets the Cursor type to be used when the cursor is over this Widget and which is inherited to the Children, if this is a container. |
void |
setDraggable(boolean draggable)
Sets wheather this Widget is clickable. |
void |
setFocussable(boolean focussable)
Sets whether this Widget can get the focus or not. |
void |
setHeight(float height)
|
WidgetBase |
setLocation(float locX,
float locY)
Sets this Widget's location relative to the upper-left corner of it's WidgetContainer |
protected boolean |
setLocation(float locX,
float locY,
boolean forced)
|
WidgetBase |
setLocation(org.openmali.vecmath2.Tuple2f loc)
Sets this Widget's location relative to the upper-left corner of it's WidgetContainer |
void |
setName(java.lang.String name)
Sets this Widget's name |
void |
setPickable(boolean isPickable)
Sets wheather this Widget is pickable. |
WidgetBase |
setSize(float width,
float height)
Resizes this Widget to the given width and height. |
protected boolean |
setSize(float width,
float height,
boolean forced)
|
WidgetBase |
setSize(org.openmali.types.twodee.Sized2fRO size)
Resizes this Widget to the given width and height. |
WidgetBase |
setSize(org.openmali.vecmath2.Tuple2f size)
Resizes this Widget to the given width and height. |
void |
setToolTip(java.lang.String tooltip)
Sets the tooltip to be displayed when the mouse stopps over this Widget. |
void |
setTransparency(float transparency)
Sets the whole Widget's Transparency. |
void |
setUserObject(java.lang.Object userObject)
Sets this Widget's user-Object. |
void |
setVisible(boolean visible)
Sets wheather this Widget is visible or not |
void |
setWidth(float width)
|
void |
setZIndex(int zIndex)
Sets the z-index of this Widget. |
java.lang.String |
toString()
|
void |
update()
Updates the Widget's internals. |
protected void |
updateTranslation()
Effectively changes the translation of this Widget (location and z-index) |
| 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.base.Widget |
|---|
getTransparency, pick |
| Field Detail |
|---|
protected final TransformGroup transformGroup
protected static final float Z_INDEX_UNIT
protected static final float Z_INDEX_UNIT_ASSEMBLER
protected org.openmali.vecmath2.Vector3f translation
protected final java.util.ArrayList<WidgetContainerListener> containerListeners
| Constructor Detail |
|---|
public WidgetBase(float width,
float height,
int zIndex)
width - the new width of this Widgetheight - the new height of this WidgetzIndex - the z-index of this Widget
public WidgetBase(float width,
float height)
width - the new width of this Widgetheight - the new height of this Widget| Method Detail |
|---|
public void addInputListener(WidgetInputListener l)
addInputListener in interface Widgetpublic void removeInputListener(WidgetInputListener l)
removeInputListener in interface Widgetpublic void addFocusListener(WidgetFocusListener l)
addFocusListener in interface Widgetpublic void removeFocusListener(WidgetFocusListener l)
removeFocusListener in interface Widgetpublic void addLocationListener(WidgetLocationListener l)
addLocationListener in interface Widgetpublic void removeLocationListener(WidgetLocationListener l)
removeLocationListener in interface Widgetpublic void addSizeListener(WidgetSizeListener l)
addSizeListener in interface Widgetpublic void removeSizeListener(WidgetSizeListener l)
removeSizeListener in interface Widgetpublic void addVisibilityListener(WidgetVisibilityListener l)
addVisibilityListener in interface Widgetpublic void removeVisibilityListener(WidgetVisibilityListener l)
removeVisibilityListener in interface Widgetpublic void addContainerListener(WidgetContainerListener l)
addContainerListener in interface Widgetpublic void removeContainerListener(WidgetContainerListener l)
removeContainerListener in interface Widget
public void onMouseEntered(boolean isTopMost,
boolean hasFocus)
onMouseEntered in interface WidgetisTopMost - is this Widget topMosthasFocus - is this Widget focused
public void onMouseLeft(boolean isTopMost,
boolean hasFocus)
onMouseLeft in interface WidgetisTopMost - is this Widget topMosthasFocus - is this Widget focused
public void onMouseButtonPressed(org.jagatoo.input.devices.components.MouseButton button,
int x,
int y,
long when,
long lastWhen,
boolean isTopMost,
boolean hasFocus)
onMouseButtonPressed in interface Widgetbutton - the button that was pressedx - the current mouse x positiony - the current mouse y positionisTopMost - is this Widget topMosthasFocus - is this Widget focusednet.jtank.input.MouseCode
public void onMouseButtonReleased(org.jagatoo.input.devices.components.MouseButton button,
int x,
int y,
long when,
long lastWhen,
boolean isTopMost,
boolean hasFocus)
onMouseButtonReleased in interface Widgetbutton - the button that was releasedx - the current mouse x positiony - the current mouse y positionisTopMost - is this Widget topMosthasFocus - is this Widget focusednet.jtank.input.MouseCode
public void onMouseMoved(int x,
int y,
int buttonsState,
long when,
boolean isTopMost,
boolean hasFocus)
onMouseMoved in interface Widgetx - the new X coordinatey - the new Y coordinateisTopMost - is this Widget topMosthasFocus - is this Widget focused
public void onMouseStopped(int x,
int y,
long when,
boolean isTopMost,
boolean hasFocus)
onMouseStopped in interface Widgetx - the new X coordinatey - the new Y coordinateisTopMost - is this Widget topMosthasFocus - is this Widget focused
public void onMouseWheelMoved(int delta,
boolean isPageMove,
int x,
int y,
long when,
boolean isTopMost)
onMouseWheelMoved in interface Widgetdelta - a positive value when the wheel was moved upx - the current mouse x positiony - the current mouse y positionisTopMost - is this Widget topMostpublic void setFocussable(boolean focussable)
setFocussable in interface Widgetpublic final boolean isFocussable()
isFocussable in interface Widgetpublic void requestFocus()
requestFocus in interface Widgetpublic void onFocusGained()
onFocusGained in interface Widgetpublic void onFocusLost()
onFocusLost in interface Widgetpublic final boolean hasFocus(boolean testLeaf)
hasFocus in interface WidgettestLeaf - only returns true, if this Widget is focused and is a Leafpublic final boolean hasFocus()
hasFocus in interface Widgetpublic void onMouseUnbound()
onMouseUnbound in interface Widget
public void onKeyPressed(org.jagatoo.input.devices.components.Key key,
long when)
onKeyPressed in interface Widgetkey - the key that was pressedwhen - the keyevent's timestamp
public void onKeyReleased(org.jagatoo.input.devices.components.Key key,
long when)
onKeyReleased in interface Widgetkey - the key that was releasedwhen - the keyevent's timestamp
public void onKeyTyped(char ch,
long when)
onKeyTyped in interface Widgetch - the typed key's characterwhen - the keyevent's timestamppublic void onControllerButtonPressed(org.jagatoo.input.devices.components.ControllerButton button)
onControllerButtonPressed in interface Widgetbutton - the pressed buttonpublic void onControllerButtonReleased(org.jagatoo.input.devices.components.ControllerButton button)
onControllerButtonReleased in interface Widgetbutton - the released button
public void onControllerAxisChanged(org.jagatoo.input.devices.components.ControllerAxis axis,
int axisDelta)
onControllerAxisChanged in interface Widgetaxis - the changed axis
public void onInputStateChanged(org.jagatoo.input.devices.components.DeviceComponent comp,
int delta,
int state,
boolean isTopMost,
boolean hasFocus)
onInputStateChanged in interface Widgetpublic final float getSGZPosition()
getSGZPosition in interface Widgetpublic void setVisible(boolean visible)
setVisible in interface Widgetvisible - visible?public final boolean isVisible()
isVisible in interface Widgetpublic void setTransparency(float transparency)
setTransparency in interface Widgetpublic void setClickable(boolean isClickable)
setClickable in interface Widgetpublic final boolean isClickable()
isClickable in interface Widgetpublic void setDraggable(boolean draggable)
setDraggable in interface Widgetpublic final boolean isDraggable()
isDraggable in interface Widgetpublic void setPickable(boolean isPickable)
setPickable in interface Widgetpublic final boolean isPickable()
isPickable in interface Widgetpublic final void setCursor(Cursor.Type cursor)
setCursor in interface Widgetpublic final Cursor.Type getCursor()
getCursor in interface Widgetpublic final Cursor.Type getInheritedCursor()
getInheritedCursor in interface Widgetpublic void update()
update in interface Widgetprotected void updateTranslation()
protected boolean setLocation(float locX,
float locY,
boolean forced)
public final WidgetBase setLocation(float locX,
float locY)
setLocation in interface org.openmali.types.twodee.Positioned2fsetLocation in interface WidgetlocX - the new x-locationlocY - the new y-location
public final WidgetBase setLocation(org.openmali.vecmath2.Tuple2f loc)
setLocation in interface org.openmali.types.twodee.Positioned2fsetLocation in interface Widgetloc - the new location
public final org.openmali.vecmath2.Tuple2f getLocation()
getLocation in interface org.openmali.types.twodee.Positioned2fROgetLocation in interface Widgetpublic final float getLeft()
getLeft in interface org.openmali.types.twodee.Positioned2fROgetLeft in interface Widgetpublic final float getTop()
getTop in interface org.openmali.types.twodee.Positioned2fROgetTop in interface Widget
protected boolean setSize(float width,
float height,
boolean forced)
public final void setWidth(float width)
setWidth in interface org.openmali.types.twodee.Sized2fpublic final void setHeight(float height)
setHeight in interface org.openmali.types.twodee.Sized2f
public final WidgetBase setSize(float width,
float height)
setSize in interface org.openmali.types.twodee.Sized2fsetSize in interface Widgetwidth - the new width of this Widgetheight - the new height of this Widget
public final WidgetBase setSize(org.openmali.types.twodee.Sized2fRO size)
setSize in interface org.openmali.types.twodee.Sized2fsetSize in interface Widgetsize - the new size of this Widget
public final WidgetBase setSize(org.openmali.vecmath2.Tuple2f size)
setSize in interface org.openmali.types.twodee.Sized2fsetSize in interface Widgetsize - the new size of this Widget
public final float getWidth()
getWidth in interface org.openmali.types.twodee.Sized2fROgetWidth in interface Widgetpublic final float getHeight()
getHeight in interface org.openmali.types.twodee.Sized2fROgetHeight in interface Widgetpublic final org.openmali.types.twodee.Sized2fRO getSize()
getSize in interface Widgetpublic final float getAspect()
getAspect in interface org.openmali.types.twodee.Sized2fROgetAspect in interface Widgetpublic void setZIndex(int zIndex)
setZIndex in interface Widgetpublic final int getZIndex()
getZIndex in interface Widgetprotected abstract void init()
protected final boolean isInitializing()
protected final boolean isInitialized()
protected void onAddedToContainer(WidgetContainer container)
container - the WidgetContainer, the Widget is added toprotected void onAddedToHUD(HUD hud)
hud - the HUD, the Widget is added toprotected void onRemovedFromContainer(WidgetContainer container)
container - the WidgetContainer, the Widget is removed frompublic void setContainer(WidgetContainer container)
setContainer in interface Widgetcontainer - the new Containerpublic void setAssembly(Widget assembly)
setAssembly in interface Widgetpublic final Widget getAssembly()
getAssembly in interface Widgetpublic final WidgetContainer getContainer()
getContainer in interface Widgetpublic final HUD getHUD()
getHUD in interface Widgetpublic void detach(boolean delayed)
detach in interface Widgetdelayed - if true, the widget is detached with the next frame, but not instantly.public final void detach()
detach in interface Widgetpublic void onDetached()
onDetached in interface Widgetpublic final Node getSGNode()
getSGNode in interface Widgetpublic void setName(java.lang.String name)
setName in interface org.jagatoo.datatypes.NamableObjectsetName in interface Widgetpublic final java.lang.String getName()
getName in interface org.jagatoo.datatypes.NamedObjectgetName in interface Widgetpublic void setUserObject(java.lang.Object userObject)
setUserObject in interface WidgetuserObject - the new user-Objectpublic final java.lang.Object getUserObject()
getUserObject in interface Widgetpublic void setContextMenu(ContextMenu contextMenu)
setContextMenu in interface Widgetpublic ContextMenu getContextMenu()
getContextMenu in interface Widgetpublic void setToolTip(java.lang.String tooltip)
HUD.setToolTipFactory(org.xith3d.ui.hud.utils.ToolTipFactory)
and HUD.getToolTipFactory().
setToolTip in interface Widgetpublic final java.lang.String getToolTip()
getToolTip in interface WidgetHUD.setToolTipFactory(org.xith3d.ui.hud.utils.ToolTipFactory)
and HUD.getToolTipFactory().public final boolean hasToolTip()
hasToolTip in interface Widgetpublic void setCachedToolTipWidget(Widget tooltipWidget)
setCachedToolTipWidget in interface Widgetpublic final Widget getCachedToolTipWidget()
getCachedToolTipWidget in interface Widgetprotected final WidgetAssembler getWidgetAssembler()
protected HUDPickResult pickWidgetAssembler(HUDPickResult hostHPR,
int canvasX,
int canvasY,
HUDPickResult.HUDPickReason pickReason,
org.jagatoo.input.devices.components.MouseButton button,
long when,
long meta,
int flags)
public java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR |&nb | |||||||||