org.xith3d.ui.hud.base
Class WidgetContainerBase

java.lang.Object
  extended by org.xith3d.ui.hud.base.WidgetBase
      extended by org.xith3d.ui.hud.base.RectangularWidget
          extended by org.xith3d.ui.hud.base.WidgetContainerBase
All Implemented Interfaces:
org.jagatoo.datatypes.NamableObject, org.jagatoo.datatypes.NamedObject, org.openmali.types.twodee.Positioned2f, org.openmali.types.twodee.Positioned2fRO, org.openmali.types.twodee.Sized2f, org.openmali.types.twodee.Sized2fRO, BackgroundSettable, BackgroundSettableWidget, BorderSettable, PaddingSettable, Widget, WidgetContainer, ScrollbarListener
Direct Known Subclasses:
Panel

public abstract class WidgetContainerBase
extends RectangularWidget
implements WidgetContainer, ScrollbarListener

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 org.xith3d.ui.hud.base.WidgetBase
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, getUserObject, getWidgetAssembler, getWidth, getZIndex, hasFocus, hasFocus, hasToolTip, init, isClickable, isDraggable, isFocussable, isInitialized, isInitializing, isPickable, isVisible, onAddedToContainer, onAddedToHUD, onMouseButtonPressed, onMouseButtonReleased, onMouseEntered, onMouseLeft, onMouseMoved, onMouseStopped, onMouseWheelMoved, onRemovedFromContainer, pickWidgetAssembler, removeContainerListener, removeFocusListener, removeInputListener, removeLocationListener, removeSizeListener, removeVisibilityListener, requestFocus, setAssembly, setCachedToolTipWidget, setClickable, setContextMenu, setCursor, setDraggable, setFocussable, setHeight, setLocation, setLocation, setLocation, setName, setPickable, setSize, setSize, setSize, setToolTip, setTransparency, setUserObject, setWidth, setZIndex, toString
 
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.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, onMouseButtonPressed, onMouseButtonReleased, onMouseEntered, onMouseLeft, onMouseMoved, onMouseStopped, onMouseWheelMoved, removeContainerListener, removeFocusListener, removeInputListener, removeLocationListener, removeSizeListener, removeVisibilityListener, requestFocus, setAssembly, setCachedToolTipWidget, setClickable, setContextMenu, setCursor, setDraggable, setFocussable, setLocation, setLocation, setName, setPickable, setSize, setSize, setSize, setToolTip, setTransparency, setUserObject, setZIndex
 
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

childrenTG

public final TransformGroup childrenTG
Constructor Detail

WidgetContainerBase

public 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. The WidgetContainer will have a differen coordinate system then it's parent WidgetContainer.

Parameters:
width - the new width of this Widget
height - the new height of this Widget
resX - the x-resolution of the WidgetContainer
resY - the y-resolution of the WidgetContainer
zIndex - the z-index of this Widget
backgroundTex - the background texture

WidgetContainerBase

public 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. The WidgetContainer will have a differen coordinate system then it's parent WidgetContainer.

Parameters:
width - the new width of this Widget
height - the new height of this Widget
resX - the x-resolution of the WidgetContainer
resY - the y-resolution of the WidgetContainer
zIndex - the z-index of this Widget
backgroundTex - the background texture

WidgetContainerBase

public 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. The WidgetContainer will have a differen coordinate system then it's parent WidgetContainer.

Parameters:
width - the new width of this Widget
height - the new height of this Widget
resX - the x-resolution of the WidgetContainer
resY - the y-resolution of the WidgetContainer
zIndex - the z-index of this Widget
backgroundColor - the background color

WidgetContainerBase

public WidgetContainerBase(float width,
                           float height,
                           float resX,
                           float resY,
                           int zIndex)
Creates a new WidgetContainer with the given width, height and z-index. The WidgetContainer will have a differen coordinate system then it's parent WidgetContainer.

Parameters:
width - the new width of this Widget
height - the new height of this Widget
resX - the x-resolution of the WidgetContainer
resY - the y-resolution of the WidgetContainer
zIndex - the z-index of this Widget
Method Detail

getSGGroup

public final GroupNode getSGGroup()

Specified by:
getSGGroup in interface WidgetContainer
Returns:
the scenegraph Group to add children to

getSGPixelWidth

public final float getSGPixelWidth()

Specified by:
getSGPixelWidth in interface WidgetContainer
Returns:
the width of one pixel in the scenegraph in resolution coordinates

getSGPixelHeight

public final float getSGPixelHeight()

Specified by:
getSGPixelHeight in interface WidgetContainer
Returns:
the height of one pixel in the scenegraph in resolution coordinates

getSGPixelSize

public final org.openmali.types.twodee.Dim2f getSGPixelSize()

Specified by:
getSGPixelSize in interface WidgetContainer
Returns:
the size of one pixel in the scenegraph in resolution coordinates

getSizeOfPixels

public final 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.

Specified by:
getSizeOfPixels in interface 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

public final 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.

Specified by:
getSizeHUD2SG in interface WidgetContainer
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

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

Specified by:
getLocationHUD2SG in interface WidgetContainer
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

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

Specified by:
getSizeSG2HUD in interface WidgetContainer
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

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

Specified by:
getLocationSG2HUD in interface WidgetContainer
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

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

Specified by:
getSizeCanvas2HUD in interface WidgetContainer
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

getLocationCanvas2HUD

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

Specified by:
getLocationCanvas2HUD in interface WidgetContainer
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

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

Specified by:
getSizeHUD2Canvas in interface WidgetContainer
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

getLocationHUD2Canvas

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

Specified by:
getLocationHUD2Canvas in interface WidgetContainer
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

public final 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.

Specified by:
getSizeOnHUD in interface WidgetContainer
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

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

Specified by:
getEqualHeight in interface WidgetContainer
Parameters:
width - the width to calculate a visually equal height
Returns:
the buffer back again

getEqualWidth

public final float getEqualWidth(float height)

Specified by:
getEqualWidth in interface WidgetContainer
Parameters:
height - the height to calculate a visually equal width
Returns:
a width that's visually equal to the given width

getResX

public final float getResX()

Specified by:
getResX in interface WidgetContainer
Returns:
the x-resolution of the WidgetContainer.

getResY

public final float getResY()

Specified by:
getResY in interface WidgetContainer
Returns:
the y-resolution of the WidgetContainer.

getResolution

public final org.openmali.vecmath2.Tuple2f getResolution()

Specified by:
getResolution in interface WidgetContainer
Returns:
this WidgetContainer's resolution. By default this is equal to width and height.

getResAspect

public final float getResAspect()

Specified by:
getResAspect in interface WidgetContainer
Returns:
the aspect ratio of the resolution of the WidgetContainer.

setSize

protected boolean setSize(float width,
                          float height,
                          boolean forced)

Overrides:
setSize in class WidgetBase

setLayout

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

Specified by:
setLayout in interface WidgetContainer
Parameters:
layout - the new LayoutManager to use

getLayout

public final LayoutManager getLayout()

Specified by:
getLayout in interface WidgetContainer
Returns:
the currently used LayoutManager

setPadding

public boolean setPadding(float paddingBottom,
                          float paddingRight,
                          float paddingTop,
                          float paddingLeft)
Sets padding for this PaddingSettable Widget.
Padding translates local coordinates and shrinks the clipping area.

Specified by:
setPadding in interface PaddingSettable
Returns:
true, if the padding actually has changed

setPadding

public final boolean setPadding(float padding)
Sets padding for this PaddingSettable Widget.
Padding translates local coordinates and shrinks the clipping area.

Specified by:
setPadding in interface PaddingSettable
Parameters:
padding - padding for bottom, right, top and left
Returns:
true, if the padding actually has changed

getPaddingBottom

public final float getPaddingBottom()

Specified by:
getPaddingBottom in interface PaddingSettable
Returns:
bottom-padding for this PaddingSettable Widget.
Padding translates local coordinates and shrinks the clipping area.

getPaddingRight

public final float getPaddingRight()

Specified by:
getPaddingRight in interface PaddingSettable
Returns:
right-padding for this PaddingSettable Widget.
Padding translates local coordinates and shrinks the clipping area.

getPaddingTop

public final float getPaddingTop()

Specified by:
getPaddingTop in interface PaddingSettable
Returns:
top-padding for this PaddingSettable Widget.
Padding translates local coordinates and shrinks the clipping area.

getPaddingLeft

public final float getPaddingLeft()

Specified by:
getPaddingLeft in interface PaddingSettable
Returns:
left-padding for this PaddingSettable Widget.
Padding translates local coordinates and shrinks the clipping area.

getWidgets

public final java.util.List<Widget> getWidgets()

Specified by:
getWidgets in interface WidgetContainer
Returns:
a List of all Widgets contained by this WidgetContainer. The returned Set is unmodifiable.

addWidget

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

Specified by:
addWidget in interface WidgetContainer
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

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

Specified by:
addWidget in interface WidgetContainer
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

public final 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.

Specified by:
addWidget in interface WidgetContainer
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

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

Specified by:
addWidget in interface WidgetContainer
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

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

Specified by:
addWidget in interface WidgetContainer
Parameters:
widget - the Widget to add
location - the location to add the Widget at
zIndex - the new Widget's z-index

addWidget

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

Specified by:
addWidget in interface WidgetContainer
Parameters:
widget - the Widget to add
location - the location to add the Widget at

addWidget

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

Specified by:
addWidget in interface WidgetContainer
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

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

Specified by:
addWidget in interface WidgetContainer
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

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

Specified by:
addWidget in interface WidgetContainer
Parameters:
widget - the widget to add
constraints - the contraints to use for this Widget in the LayoutManager

addWidget

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

Specified by:
addWidget in interface WidgetContainer
Parameters:
widget - the widget to add

addWidgetCentered

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

Specified by:
addWidgetCentered in interface WidgetContainer
Parameters:
widget - the widget to add (centered)
zIndex - the new Widget's z-index

addWidgetCentered

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

Specified by:
addWidgetCentered in interface WidgetContainer
Parameters:
widget - the widget to add (centered)

removeWidget

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

Specified by:
removeWidget in interface WidgetContainer
Parameters:
widget - the widget to remove

clear

public void clear()
Removes all Widgets from this WidgetContainer.

Specified by:
clear in interface WidgetContainer

onDetached

public void onDetached()
This method is called right before the Widget has been detached from its WidgetContainer.

Specified by:
onDetached in interface Widget
Overrides:
onDetached in class WidgetBase

setVisible

public void setVisible(boolean visible)
Sets wheather this Widget is visible or not

Specified by:
setVisible in interface Widget
Overrides:
setVisible in class WidgetBase
Parameters:
visible - visible?

setTransparency

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

Specified by:
setTransparency in interface WidgetContainer

addContainerScrollListener

public final void addContainerScrollListener(ContainerScrollListener l)
Adds a ContainerScrollListener to the list of notified objects when the children-offset has changed.

Parameters:
l -

removeContainerScrollListener

public final void removeContainerScrollListener(ContainerScrollListener l)
Removes a ContainerScrollListener