org.xith3d.ui.hud.base
Interface WidgetContainer

All Superinterfaces:
BackgroundSettable, BackgroundSettableWidget, BorderSettable, org.jagatoo.datatypes.NamableObject, org.jagatoo.datatypes.NamedObject, PaddingSettable, org.openmali.types.twodee.Positioned2f, org.openmali.types.twodee.Positioned2fRO, ScrollbarListener, org.openmali.types.twodee.Sized2f, org.openmali.types.twodee.Sized2fRO, Widget
All Known Subinterfaces:
MenuGroupWidget
All Known Implementing Classes:
ButtonsLeftMenusCenterMenuGroupWidget, FPIHInputBindingsSettingsMenu, FPIHMainSettingsMenu, GraphicsMainSettingsMenu, HUD, InputBindingsSettingsMenu, MenuBase, Panel, WidgetContainerBase

public interface WidgetContainer
extends Widget, BackgroundSettableWidget, BorderSettable, PaddingSettable, ScrollbarListener

A WidgetContainer is a Widget, that can hold arbitrary Widgets. It can have it's own coordinate system and the contained Widget's transformations are relative to it.


Nested Class Summary
static class WidgetContainer.FocusMoveDirection
           
 
Nested classes/interfaces inherited from interface org.xith3d.ui.hud.base.Widget
Widget.DescriptionBase
 
Method Summary
 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)
           
 Texture getForeground()
           
 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 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.Sized2fRO 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 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 setForeground(java.lang.String texture)
          Sets the foreground texture of the WidgetContainer.
 void setForeground(Texture texture)
          Sets the foreground texture of the WidgetContainer.
 void setLayout(LayoutManager layout)
          Sets which LayoutManager to use for the child Widgets of this Container.
 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.
 void setTransparency(float transparency, boolean childrenToo)
          Sets the whole Widget's Transparency.
 
Methods inherited from interface org.xith3d.ui.hud.base.Widget
addContainerListener, addFocusListener, addInputListener, addLocationListener, addSizeListener, addVisibilityListener, detach, detach, getAspect, getAssembly, getCachedToolTipWidget, getContainer, getContextMenu, getCursor, getHeight, getHUD, getInheritedCursor, getLeft, getLocation, getName, getSGNode, getSGZPosition, getSize, getToolTip, getTop, getTransparency, getUserObject, getWidth, getZIndex, hasFocus, hasFocus, hasToolTip, isClickable, isDraggable, isFocussable, isPickable, isVisible, onControllerAxisChanged, onControllerButtonPressed, onControllerButtonReleased, onDetached, onFocusGained, onFocusLost, onInputStateChanged, onKeyPressed, onKeyReleased, onKeyTyped, onMouseButtonPressed, onMouseButtonReleased, onMouseEntered, onMouseLeft, onMouseMoved, onMouseStopped, onMouseUnbound, onMouseWheelMoved, pick, removeContainerListener, removeFocusListener, removeInputListener, removeLocationListener, removeSizeListener, removeVisibilityListener, requestFocus, setAssembly, setCachedToolTipWidget, setClickable, setContainer, setContextMenu, setCursor, setDraggable, setFocussable, setLocation, setLocation, setName, setPickable, setSize, setSize, setSize, setToolTip, setTransparency, setUserObject, setVisible, setZIndex, update
 
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
 
Methods inherited from interface org.xith3d.ui.hud.base.PaddingSettable
getPaddingBottom, getPaddingLeft, getPaddingRight, getPaddingTop, setPadding, setPadding
 
Methods inherited from interface org.xith3d.ui.hud.listeners.ScrollbarListener
onScrollbarValueChanged
 

Method Detail

getSGGroup

GroupNode getSGGroup()
Returns:
the scenegraph Group to add children to

getResolution

org.openmali.vecmath2.Tuple2f getResolution()
Returns:
this WidgetContainer's resolution. By default this is equal to width and height.

getResX

float getResX()
Returns:
the x-resolution of the WidgetContainer.

getResY

float getResY()
Returns:
the y-resolution of the WidgetContainer.

getResAspect

float getResAspect()
Returns:
the aspect ratio of the resolution of the WidgetContainer.

getSGPixelWidth

float getSGPixelWidth()
Returns:
the width of one pixel in the scenegraph in resolution coordinates

getSGPixelHeight

float getSGPixelHeight()
Returns:
the height of one pixel in the scenegraph in resolution coordinates

getSGPixelSize

org.openmali.types.twodee.Sized2fRO getSGPixelSize()
Returns:
the size of one pixel in the scenegraph in resolution coordinates

getSizeOfPixels

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.

Parameters:
x - the x-count of pixels
y - the y-count of pixels
buffer - the buffer to write the values to
Returns:
the buffer back again

getSizeHUD2SG

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.

Parameters:
x - the HUD-x-value to transform
y - the HUD-y-value to transform
buffer - the buffer to write the values to
Returns:
the buffer back again

getLocationHUD2SG

org.openmali.vecmath2.Tuple2f getLocationHUD2SG(float x,
                                                float y,
                                                org.openmali.vecmath2.Tuple2f buffer)
Calculates scenegraph location from these HUD-values.

Parameters:
x - the HUD-x-value to transform
y - the HUD-y-value to transform
buffer - the buffer to write the values to
Returns:
the buffer back again

getSizeSG2HUD

org.openmali.types.twodee.Dim2f getSizeSG2HUD(float x,
                                              float y,
                                              org.openmali.types.twodee.Dim2f buffer)
Calculates HUD size from these scenegraph-values.

Parameters:
x - the scenegraph-x-value to transform
y - the scenegraph-y-value to transform
buffer - the buffer to write the values to
Returns:
the buffer back again

getLocationSG2HUD

org.openmali.vecmath2.Tuple2f getLocationSG2HUD(float x,
                                                float y,
                                                org.openmali.vecmath2.Tuple2f buffer)
Calculates HUD location from these scenegraph-values.

Parameters:
x - the scenegraph-x-value to transform
y - the scenegraph-y-value to transform
buffer - the buffer to write the values to
Returns:
the buffer back again

getSizeCanvas2HUD

org.openmali.types.twodee.Dim2f getSizeCanvas2HUD(int x,
                                                  int y,
                                                  org.openmali.types.twodee.Dim2f buffer)
Calculates HUD size from these Canvas3D-values.

Parameters:
x - the canvas-x-value to transform
y - the canvas-y-value to transform
buffer - the buffer to write the values to
Returns:
the buffer back again

getSizeHUD2Canvas

org.openmali.types.twodee.Dim2i getSizeHUD2Canvas(float x,
                                                  float y,
                                                  org.openmali.types.twodee.Dim2i buffer)
Calculates Canvas3D size from these HUD-values.

Parameters:
x - the HUD-x-value to transform
y - the HUD-y-value to transform
buffer - the buffer to write the values to
Returns:
the buffer back again

getLocationCanvas2HUD

org.openmali.vecmath2.Tuple2f getLocationCanvas2HUD(int x,
                                                    int y,
                                                    org.openmali.vecmath2.Tuple2f buffer)
Calculates HUD location from these Canvas3D-values.

Parameters:
x - the canvas-x-value to transform
y - the canvas-y-value to transform
buffer - the buffer to write the values to
Returns:
the buffer back again

getLocationHUD2Canvas

org.openmali.vecmath2.Tuple2i getLocationHUD2Canvas(float x,
                                                    float y,
                                                    org.openmali.vecmath2.Tuple2i buffer)
Calculates Canvas3D location from these HUD-values.

Parameters:
x - the HUD-x-value to transform
y - the HUD-y-value to transform
buffer - the buffer to write the values to
Returns:
the buffer back again

getSizeOnHUD

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.

Parameters:
x - the x-value to transform
y - the y-value to transform
measure - the source measurement
buffer - the buffer to write the values to
Returns:
the buffer back again

getEqualHeight

float getEqualHeight(float width)
Calculates a height that's visually equal to the given width.

Parameters:
width - the width to calculate a visually equal height
Returns:
the buffer back again

getEqualWidth

float getEqualWidth(float height)
Parameters:
height - the height to calculate a visually equal width
Returns:
a width that's visually equal to the given width

setForeground

void setForeground(Texture texture)
Sets the foreground texture of the WidgetContainer. It MUST always have an alpha channel!

Parameters:
texture - the texture resource to use

setForeground

void setForeground(java.lang.String texture)
Sets the foreground texture of the WidgetContainer. It MUST always have an alpha channel!

Parameters:
texture - the texture resource to use

getForeground

Texture getForeground()
Returns:
the foreground Texture of the WidgetContainer.

setLayout

void setLayout(LayoutManager layout)
Sets which LayoutManager to use for the child Widgets of this Container.

Parameters:
layout - the new LayoutManager to use

getLayout

LayoutManager getLayout()
Returns:
the currently used LayoutManager

setTransparency

void setTransparency(float transparency,
                     boolean childrenToo)
Sets the whole Widget's Transparency.

Parameters:
transparency -
childrenToo -

addWidget

Widget addWidget(Widget widget,
                 org.openmali.vecmath2.Tuple2f location,
                 java.lang.Object constraints)
Adds a Widget to this container at the given location.

Parameters:
widget - the Widget to add
location - the location to add the Widget at
constraints - the contraints to use for this Widget in the LayoutManager

addWidget

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.

Parameters:
widget - the Widget to add
location - the location to add the Widget at
zIndex - the new Widget's z-index
constraints - the contraints to use for this Widget in the LayoutManager

addWidget

Widget addWidget(Widget widget,
                 org.openmali.vecmath2.Tuple2f location)
Adds a Widget to this container at the given location.

Parameters:
widget - the Widget to add
location - the location to add the Widget at

addWidget

Widget addWidget(Widget widget,
                 org.openmali.vecmath2.Tuple2f location,
                 int zIndex)
Adds a Widget to this container at the given location.

Parameters:
widget - the Widget to add
location - the location to add the Widget at
zIndex - the new Widget's z-index

addWidget

Widget addWidget(Widget widget,
                 float locX,
                 float locY,
                 java.lang.Object constraints)
Adds a Widget to this container at the given location.

Parameters:
widget - the Widget to add
locX - the x-location to add the Widget at
locY - the y-location to add the Widget at
constraints - the contraints to use for this Widget in the LayoutManager

addWidget

Widget addWidget(Widget widget,
                 float locX,
                 float locY,
                 int zIndex,
                 java.lang.Object constraints)
Adds a Widget to this container at the given location.

Parameters:
widget - the Widget to add
locX - the x-location to add the Widget at
locY - the y-location to add the Widget at
zIndex - the new Widget's z-index
constraints - the contraints to use for this Widget in the LayoutManager

addWidget

Widget addWidget(Widget widget,
                 float locX,
                 float locY)
Adds a Widget to this container at the given location.

Parameters:
widget - the Widget to add
locX - the x-location to add the widget at
locY - the y-location to add the widget at

addWidget

Widget addWidget(Widget widget,
                 float locX,
                 float locY,
                 int zIndex)
Adds a Widget to this container at the given location.

Parameters:
widget - the Widget to add
locX - the x-location to add the widget at
locY - the y-location to add the widget at
zIndex - the new Widget's z-index

addWidget

Widget addWidget(Widget widget,
                 java.lang.Object constraints)
Adds a Widget to this container at the Widget's location.

Parameters:
widget - the widget to add
constraints - the contraints to use for this Widget in the LayoutManager

addWidget

Widget addWidget(Widget widget)
Adds a Widget to this container at the Widget's location.

Parameters:
widget - the widget to add

addWidgetCentered

Widget addWidgetCentered(Widget widget)
Adds a Widget to this container at the center.

Parameters:
widget - the widget to add (centered)

addWidgetCentered

Widget addWidgetCentered(Widget widget,
                         int zIndex)
Adds a Widget to this container at the center.

Parameters:
widget - the widget to add (centered)
zIndex - the new Widget's z-index

removeWidget

void removeWidget(Widget widget)
Removes a Widget from this container.

Parameters:
widget - the widget to remove

clear

void clear()
Removes all Widgets from this WidgetContainer.


getWidgets

java.util.List<Widget> getWidgets()
Returns:
a List of all Widgets contained by this WidgetContainer. The returned Set is unmodifiable.

setScrollScale

void setScrollScale(org.openmali.vecmath2.Tuple2f scrollScale)
Sets how much the children will be moved, when the Scrollbar(s) are moved.

Parameters:
scrollScale - the new scroll scale

getScrollScale

org.openmali.vecmath2.Tuple2f getScrollScale()
Returns:
how much the children will be moved, when the Scrollbar(s) are moved.

setScrollScale

void setScrollScale(float scrollScaleX,
                    float scrollScaleY)
Sets how much the children will be moved, when the Scrollbar(s) are moved.

Parameters:
scrollScaleX - the new scroll scale on the x axis
scrollScaleY - the new scroll scale on the y axis

getScrollScaleX

float getScrollScaleX()
Returns:
how much the children will be moved on the x axis, when the Scrollbar is moved.

getScrollScaleY

float getScrollScaleY()
Returns:
how much the children will be moved on the y axis, when the Scrollbar is moved.

setChildrenOffset

void setChildrenOffset(org.openmali.vecmath2.Tuple2f offset)
Sets the display offset for the child-Widgets.

Parameters:
offset - the new offset

getChildrenOffsetX

float getChildrenOffsetX()
Returns:
the display x-offset for the child-Widgets

getChildrenOffsetY

float getChildrenOffsetY()
Returns:
the display y-offset for the child-Widgets

getChildrenOffset

org.openmali.vecmath2.Tuple2f getChildrenOffset()
Returns:
the display offset for the child-Widgets

getInnerSize

org.openmali.vecmath2.Tuple2f getInnerSize()
Returns:
the size without the Border (if any) and padding

getInnerWidth

float getInnerWidth()
Returns:
the width without the Border (if any) and padding

getInnerHeight

float getInnerHeight()
Returns:
the height without the Border (if any) and padding

getInnerAspect

float getInnerAspect()
Returns:
the aspect ratio of the inner size
See Also:
getInnerSize()

setClippingEnabled

void setClippingEnabled(boolean clippingEnabled)
Enables or disables clipping for this WidgetContainer.

Parameters:
clippingEnabled -

isClippingEnbaled

boolean isClippingEnbaled()
Returns:
whether clipping is enabled or disabled for this WidgetContainer.

focus

Widget focus(Widget widget)
Focusses the given Widget (non thread-safe).

Parameters:
widget -
Returns:
the previously focussed Widget

getCurrentFocusedWidget

Widget getCurrentFocusedWidget(boolean getLeaf)
Parameters:
getLeaf - recursively searches for the focused leaf (Widget), if true
Returns:
the current focused Widget

getCurrentFocusedWidget

Widget getCurrentFocusedWidget()
Returns:
the current focused Widget

moveFocus

Widget moveFocus(WidgetContainer.FocusMoveDirection direction)
Moves the focus to the closest widget in the container in the given direction.

Parameters:
direction -
Returns:
the newly focussed Widget.