org.xith3d.ui.hud.base
Class BackgroundSettableRectangularWidget

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.BackgroundSettableRectangularWidget
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, Widget
Direct Known Subclasses:
FPSCounter, HUDConsole

public abstract class BackgroundSettableRectangularWidget
extends RectangularWidget
implements BackgroundSettableWidget

This class implements a base for rectangular Widgets, which are BackgroundSettable


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.xith3d.ui.hud.base.Widget
Widget.DescriptionBase
 
Field Summary
 
Fields inherited from class org.xith3d.ui.hud.base.WidgetBase
containerListeners, transformGroup, translation, Z_INDEX_UNIT, Z_INDEX_UNIT_ASSEMBLER
 
Constructor Summary
BackgroundSettableRectangularWidget(float width, float height)
          Creates a new Widget with the given width and height.
BackgroundSettableRectangularWidget(float width, float height, int zIndex)
          Creates a new Widget with the given width, height and z-index.
 
Method Summary
protected abstract  AbstractImage createBackgroundImage(float width, float height, org.openmali.vecmath2.Colorf color)
           
protected abstract  AbstractImage createBackgroundImage(float width, float height, Texture texture)
           
 Texture getBackground()
          
 org.openmali.vecmath2.Colorf getBackgroundColor()
          
 float getBackgroundTileHeight()
          
 org.openmali.types.twodee.Sized2fRO getBackgroundTileSize()
          
 float getBackgroundTileWidth()
          
 void setBackground(org.openmali.vecmath2.Colorf color)
          Sets the background color of the Widget.
 void setBackground(java.lang.String texture)
          Sets the background Texture of the Widget.
 void setBackground(Texture texture)
          Sets the background texture of the Widget.
 void setBackgroundTileSize(float tileWidth, float tileHeight)
          Sets the background tile size.
 void setBackgroundTileSize(org.openmali.types.twodee.Sized2fRO tileSize)
          Sets the background tile size.
 void setContainer(WidgetContainer container)
          Sets this Widget's container
 
Methods inherited from class org.xith3d.ui.hud.base.RectangularWidget
getPickHeight, getPickSGZPosition, getPickWidth, pick
 
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, onControllerAxisChanged, onControllerButtonPressed, onControllerButtonReleased, onDetached, onFocusGained, onFocusLost, onInputStateChanged, onKeyPressed, onKeyReleased, onKeyTyped, onMouseButtonPressed, onMouseButtonReleased, onMouseEntered, onMouseLeft, onMouseMoved, onMouseStopped, onMouseUnbound, 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, setSize, setToolTip, setTransparency, setUserObject, setVisible, setWidth, setZIndex, toString, update, updateTranslation
 
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.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, 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
 

Constructor Detail

BackgroundSettableRectangularWidget

public BackgroundSettableRectangularWidget(float width,
                                           float height,
                                           int zIndex)
Creates a new Widget with the given width, height and z-index.

Parameters:
width - the new width of this Widget
height - the new height of this Widget
zIndex - the z-index of this Widget

BackgroundSettableRectangularWidget

public BackgroundSettableRectangularWidget(float width,
                                           float height)
Creates a new Widget with the given width and height.

Parameters:
width - the new width of this Widget
height - the new height of this Widget
Method Detail

createBackgroundImage

protected abstract AbstractImage createBackgroundImage(float width,
                                                       float height,
                                                       org.openmali.vecmath2.Colorf color)
Returns:
a new instance of AbstractImage to be used as the background image.

createBackgroundImage

protected abstract AbstractImage createBackgroundImage(float width,
                                                       float height,
                                                       Texture texture)
Returns:
a new instance of AbstractImage to be used as the background image.

setBackground

public void setBackground(org.openmali.vecmath2.Colorf color)
Sets the background color of the Widget.

Specified by:
setBackground in interface BackgroundSettable
Parameters:
color - the color to use

setBackground

public void setBackground(Texture texture)
Sets the background texture of the Widget.

Specified by:
setBackground in interface BackgroundSettable
Parameters:
texture - the texture resource to use

setBackground

public void setBackground(java.lang.String texture)
Sets the background Texture of the Widget.

Specified by:
setBackground in interface BackgroundSettable
Parameters:
texture - the texture resource to use

getBackground

public Texture getBackground()

Specified by:
getBackground in interface BackgroundSettable
Returns:
the background Texture of the WidgetContainer.

getBackgroundColor

public org.openmali.vecmath2.Colorf getBackgroundColor()

Specified by:
getBackgroundColor in interface BackgroundSettable
Returns:
the background color of the Widget.

setBackgroundTileSize

public void setBackgroundTileSize(float tileWidth,
                                  float tileHeight)
Sets the background tile size.
Use any negative value for no tiling.

Specified by:
setBackgroundTileSize in interface BackgroundSettable
Parameters:
tileWidth - the tile width (or negative for no tiling of width)
tileHeight - the tile height (or negative for no tiling of height)

setBackgroundTileSize

public void setBackgroundTileSize(org.openmali.types.twodee.Sized2fRO tileSize)
Sets the background tile size.
Use any negative value for no tiling.

Specified by:
setBackgroundTileSize in interface BackgroundSettable
Parameters:
tileSize - the tile size (or null for no tiling)

getBackgroundTileSize

public org.openmali.types.twodee.Sized2fRO getBackgroundTileSize()

Specified by:
getBackgroundTileSize in interface BackgroundSettable
Returns:
the background tile size (or null for no tiling)

getBackgroundTileWidth

public float getBackgroundTileWidth()

Specified by:
getBackgroundTileWidth in interface BackgroundSettable
Returns:
the background tile width (or negative for no tiling)

getBackgroundTileHeight

public float getBackgroundTileHeight()

Specified by:
getBackgroundTileHeight in interface BackgroundSettable
Returns:
the background tile width (or negative for no tiling)

setContainer

public void setContainer(WidgetContainer container)
Sets this Widget's container

Specified by:
setContainer in interface Widget
Overrides:
setContainer in class WidgetBase
Parameters:
container - the new Container