|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Widget
All Widgets to be added to a HUD must implement this interface. Extend WidgetBase for easier work.
| Nested Class Summary | |
|---|---|
static class |
Widget.DescriptionBase
|
| 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()
|
float |
getTransparency()
|
java.lang.Object |
getUserObject()
|
float |
getWidth()
|
int |
getZIndex()
|
boolean |
hasFocus()
Is this Widget focused? |
boolean |
hasFocus(boolean testLeaf)
Is this Widget focused? |
boolean |
hasToolTip()
|
boolean |
isClickable()
|
boolean |
isDraggable()
|
boolean |
isFocussable()
|
boolean |
isPickable()
|
boolean |
isVisible()
|
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. |
HUDPickResult |
pick(int canvasX,
int canvasY,
HUDPickResult.HUDPickReason pickReason,
org.jagatoo.input.devices.components.MouseButton button,
long when,
long meta,
int flags)
Tests whether a Widget is under the cursor and runs the approriate methods if true. |
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. |
Widget |
setLocation(float locX,
float locY)
Sets this Widget's location relative to the upper-left corner of it's WidgetContainer |
Widget |
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. |
Widget |
setSize(float width,
float height)
Resizes this Widget to the given width and height. |
Widget |
setSize(org.openmali.types.twodee.Sized2fRO size)
Resizes this Widget to the given width and height. |
Widget |
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 |
setZIndex(int zIndex)
Sets the z-index of this Widget. |
void |
update()
Updates the Widget's internals. |
| Methods inherited from interface org.openmali.types.twodee.Sized2f |
|---|
setHeight, setWidth |
| Method Detail |
|---|
Node getSGNode()
void setName(java.lang.String name)
setName in interface org.jagatoo.datatypes.NamableObjectjava.lang.String getName()
getName in interface org.jagatoo.datatypes.NamedObjectvoid setUserObject(java.lang.Object userObject)
userObject - the new user-Objectjava.lang.Object getUserObject()
HUD getHUD()
void setAssembly(Widget assembly)
Widget getAssembly()
void detach(boolean delayed)
delayed - if true, the widget is detached with the next frame, but not instantly.void detach()
void onDetached()
void update()
WidgetContainer getContainer()
void setContainer(WidgetContainer container)
container - the new Containerorg.openmali.types.twodee.Sized2fRO getSize()
float getWidth()
getWidth in interface org.openmali.types.twodee.Sized2fROfloat getHeight()
getHeight in interface org.openmali.types.twodee.Sized2fROfloat getAspect()
getAspect in interface org.openmali.types.twodee.Sized2fRO
Widget setSize(float width,
float height)
setSize in interface org.openmali.types.twodee.Sized2fwidth - the new width of this Widgetheight - the new height of this Widget
Widget setSize(org.openmali.types.twodee.Sized2fRO size)
setSize in interface org.openmali.types.twodee.Sized2fsize - the new size of this Widget
Widget setSize(org.openmali.vecmath2.Tuple2f size)
setSize in interface org.openmali.types.twodee.Sized2fsize - the new size of this Widget
Widget setLocation(float locX,
float locY)
setLocation in interface org.openmali.types.twodee.Positioned2flocX - the new x-locationlocY - the new y-location
Widget setLocation(org.openmali.vecmath2.Tuple2f loc)
setLocation in interface org.openmali.types.twodee.Positioned2floc - the new location
org.openmali.vecmath2.Tuple2f getLocation()
getLocation in interface org.openmali.types.twodee.Positioned2fROfloat getLeft()
getLeft in interface org.openmali.types.twodee.Positioned2fROfloat getTop()
getTop in interface org.openmali.types.twodee.Positioned2fROint getZIndex()
void setZIndex(int zIndex)
float getSGZPosition()
void setTransparency(float transparency)
transparency - float getTransparency()
void setVisible(boolean visible)
visible - visible?boolean isVisible()
boolean isDraggable()
void setDraggable(boolean draggable)
void setClickable(boolean isClickable)
boolean isClickable()
void setPickable(boolean isPickable)
boolean isPickable()
void setCursor(Cursor.Type cursor)
cursor - Cursor.Type getCursor()
Cursor.Type getInheritedCursor()
HUDPickResult pick(int canvasX,
int canvasY,
HUDPickResult.HUDPickReason pickReason,
org.jagatoo.input.devices.components.MouseButton button,
long when,
long meta,
int flags)
canvasX - the x position of the mouse on the Canvas3DcanvasY - the y position of the mouse on the Canvas3DpickReason - the action which caused this pick operationbutton - the mouse-button, that caused the pickingwhen - the timestamp of the pickingmeta - this could be either the lastPressTime, lastReleaseTime, buttonsState mask or the page-move-boolean. (depends on the pickReason)flags -
void setFocussable(boolean focussable)
focussable - boolean isFocussable()
void requestFocus()
boolean hasFocus(boolean testLeaf)
testLeaf - only returns true, if this Widget is focused and is a Leafboolean hasFocus()
void onFocusGained()
void onFocusLost()
void onKeyPressed(org.jagatoo.input.devices.components.Key key,
long when)
key - the key that was pressedwhen - the keyevent's timestamp
void onKeyReleased(org.jagatoo.input.devices.components.Key key,
long when)
key - the key that was releasedwhen - the keyevent's timestamp
void onKeyTyped(char ch,
long when)
ch - the typed key's characterwhen - the keyevent's timestamp
void onMouseButtonPressed(org.jagatoo.input.devices.components.MouseButton button,
int x,
int y,
long when,
long lastWhen,
boolean isTopMost,
boolean hasFocus)
button - the button that was pressedx - the current mouse x positiony - the current mouse y positionwhen - lastWhen - isTopMost - is this Widget topMosthasFocus - is this Widget focusednet.jtank.input.MouseCode
void onMouseButtonReleased(org.jagatoo.input.devices.components.MouseButton button,
int x,
int y,
long when,
long lastWhen,
boolean isTopMost,
boolean hasFocus)
button - the button that was releasedx - the current mouse x positiony - the current mouse y positionwhen - lastWhen - isTopMost - is this Widget topMosthasFocus - is this Widget focusednet.jtank.input.MouseCode
void onMouseMoved(int x,
int y,
int buttonsState,
long when,
boolean isTopMost,
boolean hasFocus)
x - the new X coordinatey - the new Y coordinatebuttonsState - when - isTopMost - is this Widget topMosthasFocus - is this Widget focused
void onMouseStopped(int x,
int y,
long when,
boolean isTopMost,
boolean hasFocus)
x - the new X coordinatey - the new Y coordinatewhen - isTopMost - is this Widget topMosthasFocus - is this Widget focused
void onMouseWheelMoved(int delta,
boolean isPageMove,
int x,
int y,
long when,
boolean isTopMost)
delta - a positive value when the wheel was moved upisPageMove - x - the current mouse x positiony - the current mouse y positionwhen - isTopMost - is this Widget topMost
void onMouseEntered(boolean isTopMost,
boolean hasFocus)
isTopMost - is this Widget topMosthasFocus - is this Widget focused
void onMouseLeft(boolean isTopMost,
boolean hasFocus)
isTopMost - is this Widget topMosthasFocus - is this Widget focusedvoid onMouseUnbound()
void onControllerButtonPressed(org.jagatoo.input.devices.components.ControllerButton button)
button - the pressed buttonvoid onControllerButtonReleased(org.jagatoo.input.devices.components.ControllerButton button)
button - the released button
void onControllerAxisChanged(org.jagatoo.input.devices.components.ControllerAxis axis,
int axisDelta)
axis - the changed axisaxisDelta -
void onInputStateChanged(org.jagatoo.input.devices.components.DeviceComponent comp,
int delta,
int state,
boolean isTopMost,
boolean hasFocus)
comp - delta - state - isTopMost - hasFocus - void addInputListener(WidgetInputListener l)
l - void removeInputListener(WidgetInputListener l)
l - void addFocusListener(WidgetFocusListener l)
l - void removeFocusListener(WidgetFocusListener l)
l - void addLocationListener(WidgetLocationListener l)
l - void removeLocationListener(WidgetLocationListener l)
l - void addSizeListener(WidgetSizeListener l)
l - void removeSizeListener(WidgetSizeListener l)
l - void addVisibilityListener(WidgetVisibilityListener l)
l - void removeVisibilityListener(WidgetVisibilityListener l)
l - void addContainerListener(WidgetContainerListener l)
l - void removeContainerListener(WidgetContainerListener l)
l - void setContextMenu(ContextMenu contextMenu)
contextMenu - ContextMenu getContextMenu()
void setToolTip(java.lang.String tooltip)
HUD.setToolTipFactory(org.xith3d.ui.hud.utils.ToolTipFactory)
and HUD.getToolTipFactory().
tooltip - java.lang.String getToolTip()
HUD.setToolTipFactory(org.xith3d.ui.hud.utils.ToolTipFactory)
and HUD.getToolTipFactory().boolean hasToolTip()
void setCachedToolTipWidget(Widget tooltipWidget)
Widget getCachedToolTipWidget()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||