|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xith3d.ui.hud.base.Widget
public abstract class Widget
All Widgets to be added to a HUD must extend this class.
| Nested Class Summary | |
|---|---|
protected static class |
Widget.DescriptionBase
|
| Field Summary | |
|---|---|
protected float |
transformHeight_Pixels2HUD
|
protected float |
transformWidth_Pixels2HUD
|
| Constructor Summary | |
|---|---|
protected |
Widget(boolean isHeavyWeight,
boolean hasWidgetAssembler)
Creates a new Widget. |
protected |
Widget(boolean isHeavyWeight,
boolean hasWidgetAssembler,
float width,
float height)
Creates a new Widget with the given width and height. |
| Method Summary | ||
|---|---|---|
void |
addContainerListener(WidgetContainerListener l)
Adds a new WidgetContainerListener. |
|
void |
addControllerListener(WidgetControllerListener l)
Adds a new WidgetControllerListener. |
|
void |
addFocusListener(WidgetFocusListener l)
Adds a new WidgetFocusListener. |
|
void |
addInputListener(WidgetInputListener l)
Adds a new WidgetInputListener. |
|
void |
addKeyboardListener(WidgetKeyboardListener l)
Adds a new WidgetKeyboardListener. |
|
void |
addLocationListener(WidgetLocationListener l)
Adds a new WidgetLocationListener. |
|
void |
addMouseListener(WidgetMouseListener l)
Adds a new WidgetMouseListener. |
|
void |
addSizeListener(WidgetSizeListener l)
Adds a new WidgetSizeListener. |
|
void |
addVisibilityListener(WidgetVisibilityListener l)
Adds a new WidgetVisibilityListener. |
|
protected void |
bindToGlobalMouseMovement()
|
|
protected boolean |
blocksFocusMoveDeviceComponent(org.jagatoo.input.devices.components.DeviceComponent dc)
Checks, if this Widget blocks the given DeviceComponent for focus-moves. |
|
protected float |
calculateTransformHeight_Pixels2HUD(float contentHeight)
|
|
protected float |
calculateTransformWidth_Pixels2HUD(float contentWidth)
|
|
int |
compareAbsZIndex(Widget widget2)
|
|
protected void |
createShape()
|
|
void |
detach()
Removes the Widget from its Container. |
|
void |
drawAndUpdateWidget(Texture2DCanvas texCanvas,
int offsetX,
int offsetY,
int width,
int height,
boolean drawsSelf)
|
|
protected void |
drawBackground(Texture2DCanvas texCanvas,
int offsetX,
int offsetY,
int width,
int height)
Draws the Widget's background. |
|
protected void |
drawBorder(Border border,
Texture2DCanvas texCanvas,
int offsetX,
int offsetY,
int width,
int height)
|
|
protected abstract void |
drawWidget(Texture2DCanvas texCanvas,
int offsetX,
int offsetY,
int width,
int height,
boolean drawsSelf)
|
|
protected void |
drawWidgetAfterWidgetAssembler(Texture2DCanvas texCanvas,
int offsetX,
int offsetY,
int width,
int height,
boolean drawsSelf)
Draws the part of the Widget, that needs to be drawn after the WidgetAssembler. |
|
protected void |
drawWidgetContents(Texture2DCanvas texCanvas,
int offsetX,
int offsetY,
int width,
int height,
boolean drawsSelf)
|
|
protected
|
getAbsoluteLocationOnHUD_(Tuple2f_ buffer)
Computes the absolute position of the given Widget on the HUD. |
|
float |
getAspect()
|
|
protected Widget |
getAssembly()
|
|
Border |
getBorder()
|
|
WidgetContainer |
getContainer()
The Container which contains this Widget |
|
float |
getContentAspect()
|
|
float |
getContentHeight()
|
|
protected int |
getContentHeightPX()
Gets the height of the widget's content area (minus border and padding) (in pixels). |
|
protected int |
getContentLeftPX()
Gets the left coordinate of where content (0, 0) is (in pixels). |
|
protected
|
getContentOffset(Dim2f_ buffer)
|
|
protected int |
getContentTopPX()
Gets the top coordinate of where content (0, 0) is (in pixels). |
|
float |
getContentWidth()
|
|
protected int |
getContentWidthPX()
Gets the width of the widget's content area (minus border and padding) (in pixels). |
|
ContextMenu |
getContextMenu()
|
|
Cursor.Type |
getCursor()
|
|
protected float |
getEqualHeight_(float width)
Calculates a height that's visually equal to the given width. |
|
protected float |
getEqualWidth_(float height)
|
|
float |
getForcedRedrawFrequency()
Gets the forced frequency, at which a Widget is redrawn. |
|
float |
getHeight()
|
|
protected int |
getHeightPX()
Gets the height of the widget's area (in pixels). |
|
HUD |
getHUD()
|
|
float |
getLeft()
|
|
protected int |
getLevel()
|
|
org.openmali.vecmath2.Tuple2f |
getLocation()
|
|
|
getLocation(Tuple2f_ loc)
|
|
protected
|
getLocationHUD2Pixels_(float x,
float y,
Tuple2i_ buffer)
Calculates pixel location from these HUD-values. |
|
protected
|
getLocationHUD2SG_(float x,
float y,
Tuple2f_ buffer)
Calculates scenegraph location from these HUD-values. |
|
protected
|
getLocationPixels2HUD_(int x,
int y,
Tuple2f_ buffer)
Calculates HUD location from these pixel-values. |
|
protected
|
getLocationSG2HUD_(float x,
float y,
Tuple2f_ buffer)
Calculates HUD location from these scenegraph-values. |
|
static float |
getMaxRedrawFrequency()
Gets the maximum frequency, at which a Widget can be redrawn. |
|
protected float |
getMinHeight()
|
|
protected float |
getMinWidth()
|
|
java.lang.String |
getName()
|
|
Window |
getParentWindow()
Gets, the Window, of which this is the content pane. |
|
protected float |
getPickHeight()
|
|
protected float |
getPickWidth()
|
|
protected
|
getRelLocationHUD2Pixels_(float x,
float y,
Tuple2i_ buffer)
Calculates pixel size from these HUD-values. |
|
protected Widget |
getRootHostWidget()
Returns the Widget, that this lightweight Widget draws on. |
|
Shape3D |
getShape()
Returns the untilized Shape3D to display the Widget. |
|
org.openmali.types.twodee.Sized2fRO |
getSize()
|
|
protected
|
getSizeHUD2Pixels_(float x,
float y,
Dim2i_ buffer)
Calculates pixel size from these HUD-values. |
|
protected
|
getSizeHUD2SG_(float x,
float y,
Dim2f_ buffer)
Calculates scenegraph width and height from these HUD-values. |
|
protected
|
getSizeOfPixels_(int x,
int y,
Dim2f_ buffer)
Retrieves the size these pixels have on this WidgetContainer. |
|
protected
|
getSizePixels2HUD_(int x,
int y,
Dim2f_ buffer)
Calculates HUD size from these pixel-values. |
|
protected
|
getSizeSG2HUD_(float x,
float y,
Dim2f_ buffer)
Calculates HUD size from these scenegraph-values. |
|
java.lang.String |
getToolTip()
|
|
float |
getTop()
|
|
float |
getTransparency()
Gets the whole Widget's transparency. |
|
java.lang.Object |
getUserObject()
|
|
protected WidgetAssembler |
getWidgetAssembler()
|
|
float |
getWidth()
|
|
protected int |
getWidthPX()
Gets the width of the widget's area (in pixels). |
|
int |
getZIndex()
|
|
boolean |
hasDropShadow()
Gets, if this Widget has a drop shadow. |
|
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. |
|
protected void |
initSize()
|
|
protected boolean |
isAHostedWidgetDirty()
|
|
boolean |
isClickable()
|
|
boolean |
isDraggable()
|
|
boolean |
isFocussable()
|
|
boolean |
isHeavyWeight()
Returns true, if the widget has a TransformGroup and DrawTexture. |
|
protected boolean |
isHovered()
|
|
protected boolean |
isInitialized()
Has the init method been executed once? |
|
protected boolean |
isInitializing()
Is the init method currently being executed? |
|
boolean |
isPickable()
|
|
protected boolean |
isThisWidgetDirty()
|
|
boolean |
isVisible()
|
|
protected void |
notifyOnDragStopped()
This method is called to notify all atteched WidgetLocationListeners about this event. |
|
protected void |
onAttachedToContainer(WidgetContainer container)
This event is fired, when this Widget is added to a WidgetContainer. |
|
protected void |
onAttachedToHUD(HUD hud)
This event is fired, when this Widget is added to the HUD live Widget hierarchy. |
|
protected void |
onControllerAxisChanged(org.jagatoo.input.devices.components.ControllerAxis axis,
int axisDelta,
long when)
This event is fired when a ControllerAxis has changed and this Widget is the currently focussed one. |
|
protected void |
onControllerButtonPressed(org.jagatoo.input.devices.components.ControllerButton button,
long when)
This event is fired when a ControllerButton has been pressed and this Widget is the currently focussed one. |
|
protected void |
onControllerButtonReleased(org.jagatoo.input.devices.components.ControllerButton button,
long when)
This event is fired when a ControllerButton has been released and this Widget is the currently focussed one. |
|
protected void |
onDetachedFromContainer(WidgetContainer container)
This event is fired, when this Widget is removed from a WidgetContainer. |
|
protected void |
onDetachedFromHUD(HUD hud)
This event is fired, when this Widget is removed from the HUD live Widget hierarchy. |
|
protected void |
onFocusGained()
This event is fired, when the focus is gained to a Widget. |
|
protected void |
onFocusLost()
This event is fired, when the focus is lost by a Widget. |
|
protected void |
onInputStateChanged(org.jagatoo.input.devices.components.DeviceComponent comp,
int delta,
int state,
long when,
boolean isTopMost,
boolean hasFocus)
This event is fired when the state of any DeviceComponent has changed. |
|
protected void |
onKeyPressed(org.jagatoo.input.devices.components.Key key,
int modifierMask,
long when)
This event is fired, when a key is pressed on a focused Widget. |
|
protected void |
onKeyReleased(org.jagatoo.input.devices.components.Key key,
int modifierMask,
long when)
This event is fired, when a key is released on a focused Widget. |
|
protected void |
onKeyTyped(char ch,
int modifierMask,
long when)
This event is fired when a key is typed on the keyboard. |
|
protected void |
onLocationChanged(float oldLeft,
float oldTop,
float newLeft,
float newTop)
|
|
protected void |
onMouseButtonPressed(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 pressed on a focused Widget. |
|
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. |
|
protected void |
onMouseMoved(float x,
float y,
int buttonsState,
long when,
boolean isTopMost,
boolean hasFocus)
This event is fired, when the mouse is moved on a Widget. |
|
protected void |
onMouseStopped(float x,
float 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. |
|
protected void |
onMouseWheelMoved(int delta,
boolean isPageMove,
float x,
float y,
long when,
boolean isTopMost)
This event is fired, when the mouse wheel is moved on a Widget. |
|
protected void |
onSizeChanged(float oldWidth,
float oldHeight,
float newWidth,
float newHeight)
|
|
protected void |
onVisibilityChanged(boolean visible)
This method is triggered when the visibility state has eeffectively changed. |
|
protected 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. |
|
protected boolean |
pickConditionsMatch(HUDPickResult.HUDPickReason pickReason)
|
|
void |
removeContainerListener(WidgetContainerListener l)
Removes a WidgetContainerListener. |
|
void |
removeControllerListener(WidgetControllerListener l)
Removes a WidgetControllerListener. |
|
void |
removeFocusListener(WidgetFocusListener l)
Removes a WidgetFocusListener. |
|
void |
removeInputListener(WidgetInputListener l)
Removes a WidgetInputListener. |
|
void |
removeKeyboardListener(WidgetKeyboardListener l)
Removes a WidgetKeyboardListener. |
|
void |
removeLocationListener(WidgetLocationListener l)
Removes a WidgetFocusListener. |
|
void |
removeMouseListener(WidgetMouseListener l)
Removes a WidgetMouseListener. |
|
void |
removeSizeListener(WidgetSizeListener l)
Removes a WidgetSizeListener. |
|
void |
removeVisibilityListener(WidgetVisibilityListener l)
Removes a WidgetVisibilityListener. |
|
void |
requestFocus()
Requests the focus from the HUD system. |
|
protected void |
resetWidgetDirty()
|
|
void |
setBorder(Border.Description borderDesc)
Creates a new Border from the given Border.Desctiption and invokes setBorder(Border). |
|
void |
setBorder(Border border)
Sets the Border to use for this BorderSettable Widget. |
|
void |
setClickable(boolean isClickable)
Sets wheather this Widget is clickable. |
|
protected void |
setContentClipRect(Texture2DCanvas texCanvas,
int offsetX,
int offsetY,
int width,
int height)
|
|
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 |
setForcedRedrawFrequency(float freq)
Sets the forced frequency, at which a Widget is redrawn. |
|
void |
setHasDropShadow(boolean b)
Sets, if this Widgets has a drop shadow. |
|
void |
setHeight(float height)
|
|
protected void |
setHostedWidgetDirty()
|
|
protected void |
setHostTextureDirty()
|
|
protected void |
setHostTextureDirty(int flags)
|
|
protected void |
setHostWidget(Widget widget)
|
|
Widget |
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,
boolean needsTextureRefresh)
|
|
Widget |
setLocation(org.openmali.vecmath2.Tuple2f loc)
Sets this Widget's location relative to the upper-left corner of it's WidgetContainer |
|
static void |
setMaxRedrawFrequency(float freq)
Sets the maximum frequency, at which a Widget can be redrawn. |
|
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. |
|
protected boolean |
setSize(float width,
float height,
boolean forced)
|
|
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. |
|
protected void |
setTextureDirty()
|
|
protected void |
setTextureDirty(int flags)
|
|
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. |
|
protected void |
setTransparency(float transparency,
boolean childrenToo)
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 |
|
protected void |
setWidgetDirty()
|
|
void |
setWidth(float width)
|
|
void |
setZIndex(int zIndex)
Sets the z-index of this Widget. |
|
protected void |
startDragging(int canvasX,
int canvasY,
float widgetX,
float widgetY)
|
|
java.lang.String |
toString()
|
|
void |
update()
Updates the Widget's internals. |
|
protected void |
updateAbsZIndex()
|
|
protected void |
updateSizeFactors()
|
|
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 |
| Field Detail |
|---|
protected float transformWidth_Pixels2HUD
protected float transformHeight_Pixels2HUD
| Constructor Detail |
|---|
protected Widget(boolean isHeavyWeight,
boolean hasWidgetAssembler)
isHeavyWeight - hasWidgetAssembler -
protected Widget(boolean isHeavyWeight,
boolean hasWidgetAssembler,
float width,
float height)
isHeavyWeight - hasWidgetAssembler - width - the new width of this Widgetheight - the new height of this WidgetzIndex - the z-index of this Widget| Method Detail |
|---|
public final boolean isHeavyWeight()
public Window getParentWindow()
public void setName(java.lang.String name)
setName in interface org.jagatoo.datatypes.NamableObjectpublic final java.lang.String getName()
getName in interface org.jagatoo.datatypes.NamedObjectpublic void setUserObject(java.lang.Object userObject)
userObject - the new user-Objectpublic final java.lang.Object getUserObject()
public void setContextMenu(ContextMenu contextMenu)
contextMenu - public ContextMenu getContextMenu()
public void setToolTip(java.lang.String tooltip)
HUD.setToolTipFactory(org.xith3d.ui.hud.utils.ToolTipFactory)
and HUD.getToolTipFactory().
tooltip - public final java.lang.String getToolTip()
HUD.setToolTipFactory(org.xith3d.ui.hud.utils.ToolTipFactory)
and HUD.getToolTipFactory().public final boolean hasToolTip()
public void setHasDropShadow(boolean b)
b - DropShadowFactory,
HUD.setDropShadowFactory(DropShadowFactory),
HUD.getDropShadowFactory()public final boolean hasDropShadow()
DropShadowFactory,
HUD.setDropShadowFactory(DropShadowFactory),
HUD.getDropShadowFactory()protected final WidgetAssembler getWidgetAssembler()
protected final float getEqualWidth_(float height)
height - the height to calculate a visually equal height
protected final float getEqualHeight_(float width)
width - the width to calculate a visually equal height
protected final <Dim2f_ extends org.openmali.types.twodee.Dim2f> Dim2f_ getSizePixels2HUD_(int x,
int y,
Dim2f_ buffer)
x - the canvas-x-value to transformy - the canvas-y-value to transformbuffer - the buffer to write the values to
protected final <Tuple2f_ extends org.openmali.vecmath2.Tuple2f> Tuple2f_ getLocationPixels2HUD_(int x,
int y,
Tuple2f_ buffer)
x - the canvas-x-value to transformy - the canvas-y-value to transformbuffer - the buffer to write the values to
protected final <Dim2i_ extends org.openmali.types.twodee.Dim2i> Dim2i_ getSizeHUD2Pixels_(float x,
float y,
Dim2i_ buffer)
x - the HUD-x-value to transformy - the HUD-y-value to transformbuffer - the buffer to write the values to
protected final <Tuple2i_ extends org.openmali.vecmath2.Tuple2i> Tuple2i_ getRelLocationHUD2Pixels_(float x,
float y,
Tuple2i_ buffer)
x - the HUD-x-value to transformy - the HUD-y-value to transformbuffer - the buffer to write the values to
protected final <Tuple2i_ extends org.openmali.vecmath2.Tuple2i> Tuple2i_ getLocationHUD2Pixels_(float x,
float y,
Tuple2i_ buffer)
x - the HUD-x-value to transformy - the HUD-y-value to transformbuffer - the buffer to write the values to
protected final <Dim2f_ extends org.openmali.types.twodee.Dim2f> Dim2f_ getSizeHUD2SG_(float x,
float y,
Dim2f_ buffer)
x - the HUD-x-value to transformy - the HUD-y-value to transformbuffer - the buffer to write the values to
protected final <Tuple2f_ extends org.openmali.vecmath2.Tuple2f> Tuple2f_ getLocationHUD2SG_(float x,
float y,
Tuple2f_ buffer)
x - the HUD-x-value to transformy - the HUD-y-value to transformbuffer - the buffer to write the values to
protected final <Dim2f_ extends org.openmali.types.twodee.Dim2f> Dim2f_ getSizeSG2HUD_(float x,
float y,
Dim2f_ buffer)
x - the scenegraph-x-value to transformy - the scenegraph-y-value to transformbuffer - the buffer to write the values to
protected final <Tuple2f_ extends org.openmali.vecmath2.Tuple2f> Tuple2f_ getLocationSG2HUD_(float x,
float y,
Tuple2f_ buffer)
x - the scenegraph-x-value to transformy - the scenegraph-y-value to transformbuffer - the buffer to write the values to
protected final <Dim2f_ extends org.openmali.types.twodee.Dim2f> Dim2f_ getSizeOfPixels_(int x,
int y,
Dim2f_ buffer)
x - the x-count of pixelsy - the y-count of pixelsbuffer - the buffer to write the values to
protected final <Tuple2f_ extends org.openmali.vecmath2.Tuple2f> Tuple2f_ getAbsoluteLocationOnHUD_(Tuple2f_ buffer)
buffer - public void addKeyboardListener(WidgetKeyboardListener l)
WidgetKeyboardListener.
l - public void removeKeyboardListener(WidgetKeyboardListener l)
WidgetKeyboardListener.
l - public void addMouseListener(WidgetMouseListener l)
WidgetMouseListener.
l - public void removeMouseListener(WidgetMouseListener l)
WidgetMouseListener.
l - public void addControllerListener(WidgetControllerListener l)
WidgetControllerListener.
l - public void removeControllerListener(WidgetControllerListener l)
WidgetControllerListener.
l - public final void addInputListener(WidgetInputListener l)
l - public final void removeInputListener(WidgetInputListener l)
l - public void addFocusListener(WidgetFocusListener l)
l - public void removeFocusListener(WidgetFocusListener l)
l - public void addLocationListener(WidgetLocationListener l)
l - public void removeLocationListener(WidgetLocationListener l)
l - public void addSizeListener(WidgetSizeListener l)
l - public void removeSizeListener(WidgetSizeListener l)
l - public void addVisibilityListener(WidgetVisibilityListener l)
l - public void removeVisibilityListener(WidgetVisibilityListener l)
l - public void addContainerListener(WidgetContainerListener l)
l - public void removeContainerListener(WidgetContainerListener l)
l - public void setFocussable(boolean focussable)
focussable - public final boolean isFocussable()
public void requestFocus()
protected void onFocusGained()
protected void onFocusLost()
public final boolean hasFocus(boolean testLeaf)
testLeaf - only returns true, if this Widget is focused and is a Leafpublic final boolean hasFocus()
protected boolean blocksFocusMoveDeviceComponent(org.jagatoo.input.devices.components.DeviceComponent dc)
dc -
protected final void bindToGlobalMouseMovement()
protected void onMouseEntered(boolean isTopMost,
boolean hasFocus)
isTopMost - is this Widget topMosthasFocus - is this Widget focused
protected void onMouseExited(boolean isTopMost,
boolean hasFocus)
isTopMost - is this Widget topMosthasFocus - is this Widget focused
protected void startDragging(int canvasX,
int canvasY,
float widgetX,
float widgetY)
canvasX - canvasY - widgetX - widgetY -
protected void onMouseButtonPressed(org.jagatoo.input.devices.components.MouseButton button,
float x,
float 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.MouseCodeprotected void notifyOnDragStopped()
WidgetLocationListeners about this event.
protected void onMouseButtonReleased(org.jagatoo.input.devices.components.MouseButton button,
float x,
float 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
protected void onMouseMoved(float x,
float 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
protected void onMouseStopped(float x,
float 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
protected void onMouseWheelMoved(int delta,
boolean isPageMove,
float x,
float 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
protected void onKeyPressed(org.jagatoo.input.devices.components.Key key,
int modifierMask,
long when)
key - the key that was pressedmodifierMask - the mask of modifier keyswhen - the keyevent's timestamp
protected void onKeyReleased(org.jagatoo.input.devices.components.Key key,
int modifierMask,
long when)
key - the key that was releasedmodifierMask - the mask of modifier keyswhen - the keyevent's timestamp
protected void onKeyTyped(char ch,
int modifierMask,
long when)
ch - the typed key's charactermodifierMask - the mask of modifier keyswhen - the keyevent's timestamp
protected void onControllerButtonPressed(org.jagatoo.input.devices.components.ControllerButton button,
long when)
button - the pressed buttonwhen - the gameTime of the event
protected void onControllerButtonReleased(org.jagatoo.input.devices.components.ControllerButton button,
long when)
button - the released buttonwhen - the gameTime of the event
protected void onControllerAxisChanged(org.jagatoo.input.devices.components.ControllerAxis axis,
int axisDelta,
long when)
axis - the changed axisaxisDelta - when - the gameTime of the event
protected void onInputStateChanged(org.jagatoo.input.devices.components.DeviceComponent comp,
int delta,
int state,
long when,
boolean isTopMost,
boolean hasFocus)
comp - delta - state - when - the gameTime of the eventisTopMost - hasFocus - protected final boolean isHovered()
protected void onVisibilityChanged(boolean visible)
visible - public final void setVisible(boolean visible)
visible - visible?public final boolean isVisible()
protected void setTransparency(float transparency,
boolean childrenToo)
transparency - childrenToo - public final void setTransparency(float transparency)
transparency - public final float getTransparency()
public void setClickable(boolean isClickable)
public final boolean isClickable()
public void setDraggable(boolean draggable)
public final boolean isDraggable()
public void setPickable(boolean isPickable)
public final boolean isPickable()
public final void setCursor(Cursor.Type cursor)
cursor - public final Cursor.Type getCursor()
public void setBorder(Border border)
border - the new Border (null for no border)public final void setBorder(Border.Description borderDesc)
borderDesc - the Border.Description to create the new Border from (null for no border)setBorder(Border)public final Border getBorder()
protected int getContentLeftPX()
protected int getContentTopPX()
protected final <Dim2f_ extends org.openmali.types.twodee.Dim2f> Dim2f_ getContentOffset(Dim2f_ buffer)
protected int getContentWidthPX()
protected int getContentHeightPX()
public final float getContentWidth()
public final float getContentHeight()
public final float getContentAspect()
protected final int getLevel()
public void update()
protected void updateAbsZIndex()
protected float calculateTransformWidth_Pixels2HUD(float contentWidth)
contentWidth - protected float calculateTransformHeight_Pixels2HUD(float contentHeight)
contentHeight - protected void updateSizeFactors()
protected void updateTranslation()
protected void onLocationChanged(float oldLeft,
float oldTop,
float newLeft,
float newTop)
oldLeft - oldTop - newLeft - newTop -
protected final boolean setLocation(float locX,
float locY,
boolean forced,
boolean needsTextureRefresh)
public final Widget setLocation(float locX,
float locY)
setLocation in interface org.openmali.types.twodee.Positioned2flocX - the new x-locationlocY - the new y-location
public final Widget setLocation(org.openmali.vecmath2.Tuple2f loc)
setLocation in interface org.openmali.types.twodee.Positioned2floc - the new location
public final org.openmali.vecmath2.Tuple2f getLocation()
getLocation in interface org.openmali.types.twodee.Positioned2fROpublic <Tuple2f_ extends org.openmali.vecmath2.Tuple2f> Tuple2f_ getLocation(Tuple2f_ loc)
getLocation in interface org.openmali.types.twodee.Positioned2fROpublic final float getLeft()
getLeft in interface org.openmali.types.twodee.Positioned2fROpublic final float getTop()
getTop in interface org.openmali.types.twodee.Positioned2fROprotected float getMinWidth()
protected float getMinHeight()
protected void onSizeChanged(float oldWidth,
float oldHeight,
float newWidth,
float newHeight)
oldWidth - oldHeight - newWidth - newHeight -
protected final boolean setSize(float width,
float height,
boolean forced)
public final 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
public final Widget setSize(org.openmali.types.twodee.Sized2fRO size)
setSize in interface org.openmali.types.twodee.Sized2fsize - the new size of this Widget
public final Widget setSize(org.openmali.vecmath2.Tuple2f size)
setSize in interface org.openmali.types.twodee.Sized2fsize - the new size of this Widget
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.Sized2fpublic final float getWidth()
getWidth in interface org.openmali.types.twodee.Sized2fROprotected final int getWidthPX()
public final float getHeight()
getHeight in interface org.openmali.types.twodee.Sized2fROprotected final int getHeightPX()
public final org.openmali.types.twodee.Sized2fRO getSize()
public final float getAspect()
getAspect in interface org.openmali.types.twodee.Sized2fROpublic void setZIndex(int zIndex)
public final int getZIndex()
public final int compareAbsZIndex(Widget widget2)
protected float getPickWidth()
protected float getPickHeight()
protected boolean pickConditionsMatch(HUDPickResult.HUDPickReason pickReason)
protected 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 -
protected final boolean isInitializing()
protected final boolean isInitialized()
protected void initSize()
protected void createShape()
protected abstract void init()
protected void onAttachedToHUD(HUD hud)
hud - the HUD, the Widget is added toprotected void onDetachedFromHUD(HUD hud)
hud - the HUD, the Widget is removed frompublic final HUD getHUD()
protected void onAttachedToContainer(WidgetContainer container)
container - the WidgetContainer, the Widget is added toprotected void onDetachedFromContainer(WidgetContainer container)
container - the WidgetContainer, the Widget is removed frompublic final WidgetContainer getContainer()
protected final Widget getAssembly()
public void detach()
public java.lang.String toString()
toString in class java.lang.Objectpublic Shape3D getShape()
Shape3D to display the Widget.DrawRectangle.
Shape3D to display the Widget.protected void setHostWidget(Widget widget)
protected final Widget getRootHostWidget()
protected void setHostedWidgetDirty()
protected void setWidgetDirty()
protected void resetWidgetDirty()
protected final boolean isThisWidgetDirty()
protected final boolean isAHostedWidgetDirty()
protected void setHostTextureDirty(int flags)
flags - protected final void setHostTextureDirty()
protected void setTextureDirty(int flags)
flags - protected final void setTextureDirty()
protected void drawBackground(Texture2DCanvas texCanvas,
int offsetX,
int offsetY,
int width,
int height)
texCanvas - offsetX - offsetY - width - height - needsClearForNullBackground -
protected abstract void drawWidget(Texture2DCanvas texCanvas,
int offsetX,
int offsetY,
int width,
int height,
boolean drawsSelf)
texCanvas - offsetX - offsetY - width - height - drawsSelf -
protected void drawWidgetAfterWidgetAssembler(Texture2DCanvas texCanvas,
int offsetX,
int offsetY,
int width,
int height,
boolean drawsSelf)
texCanvas - offsetX - offsetY - width - height - drawsSelf -
protected void drawBorder(Border border,
Texture2DCanvas texCanvas,
int offsetX,
int offsetY,
int width,
int height)
protected void setContentClipRect(Texture2DCanvas texCanvas,
int offsetX,
int offsetY,
int width,
int height)
protected void drawWidgetContents(Texture2DCanvas texCanvas,
int offsetX,
int offsetY,
int width,
int height,
boolean drawsSelf)
public void drawAndUpdateWidget(Texture2DCanvas texCanvas,
int offsetX,
int offsetY,
int width,
int height,
boolean drawsSelf)
public static final void setMaxRedrawFrequency(float freq)
freq - frequency in Hzpublic static final float getMaxRedrawFrequency()
public void setForcedRedrawFrequency(float freq)
freq - frequency in Hz (-1 for off)public final float getForcedRedrawFrequency()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||