|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xith3d.ui.hud.base.WidgetBase
org.xith3d.ui.hud.base.RectangularWidget
org.xith3d.ui.hud.base.WidgetContainerBase
public abstract class WidgetContainerBase
This class is the base for each Widget container. A Panel is the most simple idea of an implementation. A WidgetContainer can hold a set of Widgets, which can be WidgetContainers themselfes, too.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.xith3d.ui.hud.base.WidgetContainer |
|---|
WidgetContainer.FocusMoveDirection |
| Nested classes/interfaces inherited from interface org.xith3d.ui.hud.base.Widget |
|---|
Widget.DescriptionBase |
| Field Summary | |
|---|---|
TransformGroup |
childrenTG
|
| Fields inherited from class org.xith3d.ui.hud.base.WidgetBase |
|---|
containerListeners, transformGroup, translation, Z_INDEX_UNIT, Z_INDEX_UNIT_ASSEMBLER |
| Constructor Summary | |
|---|---|
WidgetContainerBase(float width,
float height,
float resX,
float resY,
int zIndex)
Creates a new WidgetContainer with the given width, height and z-index. |
|
WidgetContainerBase(float width,
float height,
float resX,
float resY,
int zIndex,
org.openmali.vecmath2.Colorf backgroundColor)
Creates a new WidgetContainer with the given width, height and z-index. |
|
WidgetContainerBase(float width,
float height,
float resX,
float resY,
int zIndex,
java.lang.String backgroundTex)
Creates a new WidgetContainer with the given width, height and z-index. |
|
WidgetContainerBase(float width,
float height,
float resX,
float resY,
int zIndex,
Texture backgroundTex)
Creates a new WidgetContainer with the given width, height and z-index. |
|
| Method Summary | |
|---|---|
void |
addContainerScrollListener(ContainerScrollListener l)
Adds a ContainerScrollListener to the list of notified objects
when the children-offset has changed. |
Widget |
addWidget(Widget widget)
Adds a Widget to this container at the Widget's location. |
Widget |
addWidget(Widget widget,
float locX,
float locY)
Adds a Widget to this container at the given location. |
Widget |
addWidget(Widget widget,
float locX,
float locY,
int zIndex)
Adds a Widget to this container at the given location. |
Widget |
addWidget(Widget widget,
float locX,
float locY,
int zIndex,
java.lang.Object constraints)
Adds a Widget to this container at the given location. |
Widget |
addWidget(Widget widget,
float locX,
float locY,
java.lang.Object constraints)
Adds a Widget to this container at the given location. |
Widget |
addWidget(Widget widget,
java.lang.Object constraints)
Adds a Widget to this container at the Widget's location. |
Widget |
addWidget(Widget widget,
org.openmali.vecmath2.Tuple2f location)
Adds a Widget to this container at the given location. |
Widget |
addWidget(Widget widget,
org.openmali.vecmath2.Tuple2f location,
int zIndex)
Adds a Widget to this container at the given location. |
Widget |
addWidget(Widget widget,
org.openmali.vecmath2.Tuple2f location,
int zIndex,
java.lang.Object constraints)
Adds a Widget to this container at the given location. |
Widget |
addWidget(Widget widget,
org.openmali.vecmath2.Tuple2f location,
java.lang.Object constraints)
Adds a Widget to this container at the given location. |
Widget |
addWidgetCentered(Widget widget)
Adds a Widget to this container at the center. |
Widget |
addWidgetCentered(Widget widget,
int zIndex)
Adds a Widget to this container at the center. |
void |
clear()
Removes all Widgets from this WidgetContainer. |
Widget |
focus(Widget widget)
Focusses the given Widget (non thread-safe). |
org.openmali.vecmath2.Tuple2f |
getChildrenOffset()
|
float |
getChildrenOffsetX()
|
float |
getChildrenOffsetY()
|
Widget |
getCurrentFocusedWidget()
|
Widget |
getCurrentFocusedWidget(boolean getLeaf)
|
float |
getEqualHeight(float width)
Calculates a height that's visually equal to the given width. |
float |
getEqualWidth(float height)
|
float |
getInnerAspect()
|
float |
getInnerHeight()
|
org.openmali.vecmath2.Tuple2f |
getInnerSize()
|
float |
getInnerWidth()
|
LayoutManager |
getLayout()
|
org.openmali.vecmath2.Tuple2f |
getLocationCanvas2HUD(int x,
int y,
org.openmali.vecmath2.Tuple2f buffer)
Calculates HUD location from these Canvas3D-values. |
org.openmali.vecmath2.Tuple2i |
getLocationHUD2Canvas(float x,
float y,
org.openmali.vecmath2.Tuple2i buffer)
Calculates Canvas3D location from these HUD-values. |
org.openmali.vecmath2.Tuple2f |
getLocationHUD2SG(float x,
float y,
org.openmali.vecmath2.Tuple2f buffer)
Calculates scenegraph location from these HUD-values. |
org.openmali.vecmath2.Tuple2f |
getLocationSG2HUD(float x,
float y,
org.openmali.vecmath2.Tuple2f buffer)
Calculates HUD location from these scenegraph-values. |
float |
getPaddingBottom()
|
float |
getPaddingLeft()
|
float |
getPaddingRight()
|
float |
getPaddingTop()
|
float |
getResAspect()
|
org.openmali.vecmath2.Tuple2f |
getResolution()
|
float |
getResX()
|
float |
getResY()
|
org.openmali.vecmath2.Tuple2f |
getScrollScale()
|
float |
getScrollScaleX()
|
float |
getScrollScaleY()
|
GroupNode |
getSGGroup()
|
float |
getSGPixelHeight()
|
org.openmali.types.twodee.Dim2f |
getSGPixelSize()
|
float |
getSGPixelWidth()
|
org.openmali.types.twodee.Dim2f |
getSizeCanvas2HUD(int x,
int y,
org.openmali.types.twodee.Dim2f buffer)
Calculates HUD size from these Canvas3D-values. |
org.openmali.types.twodee.Dim2i |
getSizeHUD2Canvas(float x,
float y,
org.openmali.types.twodee.Dim2i buffer)
Calculates Canvas3D size from these HUD-values. |
org.openmali.types.twodee.Dim2f |
getSizeHUD2SG(float x,
float y,
org.openmali.types.twodee.Dim2f buffer)
Calculates scenegraph width and height from these HUD-values. |
org.openmali.types.twodee.Dim2f |
getSizeOfPixels(int x,
int y,
org.openmali.types.twodee.Dim2f buffer)
Retrieves the size these pixels have on this WidgetContainer. |
org.openmali.types.twodee.Dim2f |
getSizeOnHUD(float x,
float y,
HUDUnitsMeasurement measure,
org.openmali.types.twodee.Dim2f buffer)
Calculates the HUD coordinates representation of the given size. |
org.openmali.types.twodee.Dim2f |
getSizeSG2HUD(float x,
float y,
org.openmali.types.twodee.Dim2f buffer)
Calculates HUD size from these scenegraph-values. |
java.util.List<Widget> |
getWidgets()
|
boolean |
isClippingEnbaled()
|
Widget |
moveFocus(WidgetContainer.FocusMoveDirection direction)
Moves the focus to the closest widget in the container in the given direction. |
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 |
onMouseUnbound()
This event is fired, when the mouse is released. |
void |
onScrollbarValueChanged(Scrollbar scrollar,
int newValue,
Scrollbar.Direction direction)
This event is fired when the value of a Scrollbar has changed. |
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 |
removeContainerScrollListener(ContainerScrollListener l)
Removes a ContainerScrollListener from the list of notified objects
when the children-offset has changed. |
void |
removeWidget(Widget widget)
Removes a Widget from this container. |
void |
setChildrenOffset(org.openmali.vecmath2.Tuple2f offset)
Sets the display offset for the child-Widgets. |
void |
setClippingEnabled(boolean clippingEnabled)
Enables or disables clipping for this WidgetContainer. |
void |
setContainer(WidgetContainer container)
Sets this Widget's container |
void |
setLayout(LayoutManager layout)
Sets which LayoutManager to use for the child Widgets of this Container. |
boolean |
setPadding(float padding)
Sets padding for this PaddingSettable Widget. |
boolean |
setPadding(float paddingBottom,
float paddingRight,
float paddingTop,
float paddingLeft)
Sets padding for this PaddingSettable Widget. |
void |
setScrollScale(float scrollScaleX,
float scrollScaleY)
Sets how much the children will be moved, when the Scrollbar(s) are moved. |
void |
setScrollScale(org.openmali.vecmath2.Tuple2f scrollScale)
Sets how much the children will be moved, when the Scrollbar(s) are moved. |
protected boolean |
setSize(float width,
float height,
boolean forced)
|
void |
setTransparency(float transparency,
boolean childrenToo)
Sets the whole Widget's Transparency. |
void |
setVisible(boolean visible)
Sets wheather this Widget is visible or not |
void |
update()
Updates the Widget's internals. |
void |
updateTranslation()
Effectively changes the translation of this Widget (location and z-index) |
| Methods inherited from class org.xith3d.ui.hud.base.RectangularWidget |
|---|
getPickHeight, getPickSGZPosition, getPickWidth |
| 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.WidgetContainer |
|---|
getForeground, setForeground, setForeground |
| Methods inherited from interface org.openmali.types.twodee.Sized2f |
|---|
setHeight, setWidth |
| Methods inherited from interface org.xith3d.ui.hud.base.BackgroundSettable |
|---|
getBackground, getBackgroundColor, getBackgroundTileHeight, getBackgroundTileSize, getBackgroundTileWidth, setBackground, setBackground, setBackground, setBackgroundTileSize, setBackgroundTileSize |
| Methods inherited from interface org.xith3d.ui.hud.base.BorderSettable |
|---|
getBorder, setBorder, setBorder |
| Field Detail |
|---|
public final TransformGroup childrenTG
| Constructor Detail |
|---|
public WidgetContainerBase(float width,
float height,
float resX,
float resY,
int zIndex,
Texture backgroundTex)
width - the new width of this Widgetheight - the new height of this WidgetresX - the x-resolution of the WidgetContainerresY - the y-resolution of the WidgetContainerzIndex - the z-index of this WidgetbackgroundTex - the background texture
public WidgetContainerBase(float width,
float height,
float resX,
float resY,
int zIndex,
java.lang.String backgroundTex)
width - the new width of this Widgetheight - the new height of this WidgetresX - the x-resolution of the WidgetContainerresY - the y-resolution of the WidgetContainerzIndex - the z-index of this WidgetbackgroundTex - the background texture
public WidgetContainerBase(float width,
float height,
float resX,
float resY,
int zIndex,
org.openmali.vecmath2.Colorf backgroundColor)
width - the new width of this Widgetheight - the new height of this WidgetresX - the x-resolution of the WidgetContainerresY - the y-resolution of the WidgetContainerzIndex - the z-index of this WidgetbackgroundColor - the background color
public WidgetContainerBase(float width,
float height,
float resX,
float resY,
int zIndex)
width - the new width of this Widgetheight - the new height of this WidgetresX - the x-resolution of the WidgetContainerresY - the y-resolution of the WidgetContainerzIndex - the z-index of this Widget| Method Detail |
|---|
public final GroupNode getSGGroup()
getSGGroup in interface WidgetContainerpublic final float getSGPixelWidth()
getSGPixelWidth in interface WidgetContainerpublic final float getSGPixelHeight()
getSGPixelHeight in interface WidgetContainerpublic final org.openmali.types.twodee.Dim2f getSGPixelSize()
getSGPixelSize in interface WidgetContainer
public final org.openmali.types.twodee.Dim2f getSizeOfPixels(int x,
int y,
org.openmali.types.twodee.Dim2f buffer)
getSizeOfPixels in interface WidgetContainerx - the x-count of pixelsy - the y-count of pixelsbuffer - the buffer to write the values to
public final org.openmali.types.twodee.Dim2f getSizeHUD2SG(float x,
float y,
org.openmali.types.twodee.Dim2f buffer)
getSizeHUD2SG in interface WidgetContainerx - the HUD-x-value to transformy - the HUD-y-value to transformbuffer - the buffer to write the values to
public final org.openmali.vecmath2.Tuple2f getLocationHUD2SG(float x,
float y,
org.openmali.vecmath2.Tuple2f buffer)
getLocationHUD2SG in interface WidgetContainerx - the HUD-x-value to transformy - the HUD-y-value to transformbuffer - the buffer to write the values to
public final org.openmali.types.twodee.Dim2f getSizeSG2HUD(float x,
float y,
org.openmali.types.twodee.Dim2f buffer)
getSizeSG2HUD in interface WidgetContainerx - the scenegraph-x-value to transformy - the scenegraph-y-value to transformbuffer - the buffer to write the values to
public final org.openmali.vecmath2.Tuple2f getLocationSG2HUD(float x,
float y,
org.openmali.vecmath2.Tuple2f buffer)
getLocationSG2HUD in interface WidgetContainerx - the scenegraph-x-value to transformy - the scenegraph-y-value to transformbuffer - the buffer to write the values to
public final org.openmali.types.twodee.Dim2f getSizeCanvas2HUD(int x,
int y,
org.openmali.types.twodee.Dim2f buffer)
getSizeCanvas2HUD in interface WidgetContainerx - the canvas-x-value to transformy - the canvas-y-value to transformbuffer - the buffer to write the values to
public final org.openmali.vecmath2.Tuple2f getLocationCanvas2HUD(int x,
int y,
org.openmali.vecmath2.Tuple2f buffer)
getLocationCanvas2HUD in interface WidgetContainerx - the canvas-x-value to transformy - the canvas-y-value to transformbuffer - the buffer to write the values to
public final org.openmali.types.twodee.Dim2i getSizeHUD2Canvas(float x,
float y,
org.openmali.types.twodee.Dim2i buffer)
getSizeHUD2Canvas in interface WidgetContainerx - the HUD-x-value to transformy - the HUD-y-value to transformbuffer - the buffer to write the values to
public final org.openmali.vecmath2.Tuple2i getLocationHUD2Canvas(float x,
float y,
org.openmali.vecmath2.Tuple2i buffer)
getLocationHUD2Canvas in interface WidgetContainerx - the HUD-x-value to transformy - the HUD-y-value to transformbuffer - the buffer to write the values to
public final org.openmali.types.twodee.Dim2f getSizeOnHUD(float x,
float y,
HUDUnitsMeasurement measure,
org.openmali.types.twodee.Dim2f buffer)
getSizeOnHUD in interface WidgetContainerx - the x-value to transformy - the y-value to transformmeasure - the source measurementbuffer - the buffer to write the values to
public final float getEqualHeight(float width)
getEqualHeight in interface WidgetContainerwidth - the width to calculate a visually equal height
public final float getEqualWidth(float height)
getEqualWidth in interface WidgetContainerheight - the height to calculate a visually equal width
public final float getResX()
getResX in interface WidgetContainerpublic final float getResY()
getResY in interface WidgetContainerpublic final org.openmali.vecmath2.Tuple2f getResolution()
getResolution in interface WidgetContainerpublic final float getResAspect()
getResAspect in interface WidgetContainer
protected boolean setSize(float width,
float height,
boolean forced)
setSize in class WidgetBasepublic void setLayout(LayoutManager layout)
setLayout in interface WidgetContainerlayout - the new LayoutManager to usepublic final LayoutManager getLayout()
getLayout in interface WidgetContainer
public boolean setPadding(float paddingBottom,
float paddingRight,
float paddingTop,
float paddingLeft)
setPadding in interface PaddingSettablepublic final boolean setPadding(float padding)
setPadding in interface PaddingSettablepadding - padding for bottom, right, top and left
public final float getPaddingBottom()
getPaddingBottom in interface PaddingSettablepublic final float getPaddingRight()
getPaddingRight in interface PaddingSettablepublic final float getPaddingTop()
getPaddingTop in interface PaddingSettablepublic final float getPaddingLeft()
getPaddingLeft in interface PaddingSettablepublic final java.util.List<Widget> getWidgets()
getWidgets in interface WidgetContainer
public Widget addWidget(Widget widget,
float locX,
float locY,
int zIndex,
java.lang.Object constraints)
addWidget in interface WidgetContainerwidget - the Widget to addlocX - the x-location to add the Widget atlocY - the y-location to add the Widget atzIndex - the new Widget's z-indexconstraints - the contraints to use for this Widget in the LayoutManager
public final Widget addWidget(Widget widget,
float locX,
float locY,
int zIndex)
addWidget in interface WidgetContainerwidget - the Widget to addlocX - the x-location to add the widget atlocY - the y-location to add the widget atzIndex - the new Widget's z-index
public final Widget addWidget(Widget widget,
org.openmali.vecmath2.Tuple2f location,
int zIndex,
java.lang.Object constraints)
addWidget in interface WidgetContainerwidget - the Widget to addlocation - the location to add the Widget atzIndex - the new Widget's z-indexconstraints - the contraints to use for this Widget in the LayoutManager
public final Widget addWidget(Widget widget,
org.openmali.vecmath2.Tuple2f location,
java.lang.Object constraints)
addWidget in interface WidgetContainerwidget - the Widget to addlocation - the location to add the Widget atconstraints - the contraints to use for this Widget in the LayoutManager
public final Widget addWidget(Widget widget,
org.openmali.vecmath2.Tuple2f location,
int zIndex)
addWidget in interface WidgetContainerwidget - the Widget to addlocation - the location to add the Widget atzIndex - the new Widget's z-index
public final Widget addWidget(Widget widget,
org.openmali.vecmath2.Tuple2f location)
addWidget in interface WidgetContainerwidget - the Widget to addlocation - the location to add the Widget at
public final Widget addWidget(Widget widget,
float locX,
float locY,
java.lang.Object constraints)
addWidget in interface WidgetContainerwidget - the Widget to addlocX - the x-location to add the Widget atlocY - the y-location to add the Widget atconstraints - the contraints to use for this Widget in the LayoutManager
public final Widget addWidget(Widget widget,
float locX,
float locY)
addWidget in interface WidgetContainerwidget - the Widget to addlocX - the x-location to add the widget atlocY - the y-location to add the widget at
public final Widget addWidget(Widget widget,
java.lang.Object constraints)
addWidget in interface WidgetContainerwidget - the widget to addconstraints - the contraints to use for this Widget in the LayoutManagerpublic final Widget addWidget(Widget widget)
addWidget in interface WidgetContainerwidget - the widget to add
public final Widget addWidgetCentered(Widget widget,
int zIndex)
addWidgetCentered in interface WidgetContainerwidget - the widget to add (centered)zIndex - the new Widget's z-indexpublic final Widget addWidgetCentered(Widget widget)
addWidgetCentered in interface WidgetContainerwidget - the widget to add (centered)public void removeWidget(Widget widget)
removeWidget in interface WidgetContainerwidget - the widget to removepublic void clear()
clear in interface WidgetContainerpublic void onDetached()
onDetached in interface WidgetonDetached in class WidgetBasepublic void setVisible(boolean visible)
setVisible in interface WidgetsetVisible in class WidgetBasevisible - visible?
public void setTransparency(float transparency,
boolean childrenToo)
setTransparency in interface WidgetContainerpublic final void addContainerScrollListener(ContainerScrollListener l)
ContainerScrollListener to the list of notified objects
when the children-offset has changed.
l - public final void removeContainerScrollListener(ContainerScrollListener l)
ContainerScrollListener