org.xith3d.ui.hud.widgets
Class Image

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.widgets.Image
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, AbstractImage, Widget

public class Image
extends RectangularWidget
implements AbstractImage

A widget representing an image. Implemented with textures


Nested Class Summary
static class Image.Description
          This class is used to describe an Image Widget.
 
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
Image(float width, float height, org.openmali.vecmath2.Colorf color)
          Creates a new Image with the given width and height.
Image(float width, float height, Image.Description imgDesc)
          Creates a new Image with the given width and height.
Image(float width, float height, int zIndex, org.openmali.vecmath2.Colorf color)
          Creates a new Image with the given width and height.
Image(float width, float height, int zIndex, Image.Description imgDesc)
          Creates a new Image with the given width and height.
Image(float width, float height, int zIndex, java.lang.String texture)
          Creates a new Image with the given width and height.
Image(float width, float height, int zIndex, Texture texture)
          Creates a new Image with the given width and height.
Image(float width, float height, java.lang.String texture)
          Creates a new Image with the given width and height.
Image(float width, float height, Texture texture)
          Creates a new Image with the given width and height.
Image(org.openmali.types.twodee.Sized2fRO size, org.openmali.vecmath2.Colorf color)
          Creates a new Image with the given width and height.
Image(org.openmali.types.twodee.Sized2fRO size, Image.Description imgDesc)
          Creates a new Image with the given width and height.
Image(org.openmali.types.twodee.Sized2fRO size, int zIndex, org.openmali.vecmath2.Colorf color)
          Creates a new Image with the given width and height.
Image(org.openmali.types.twodee.Sized2fRO size, int zIndex, Image.Description imgDesc)
          Creates a new Image with the given width and height.
Image(org.openmali.types.twodee.Sized2fRO size, int zIndex, java.lang.String texture)
          Creates a new Image with the given width and height.
Image(org.openmali.types.twodee.Sized2fRO size, int zIndex, Texture texture)
          Creates a new Image with the given width and height.
Image(org.openmali.types.twodee.Sized2fRO size, java.lang.String texture)
          Creates a new Image with the given width and height.
Image(org.openmali.types.twodee.Sized2fRO size, Texture texture)
          Creates a new Image with the given width and height.
 
Method Summary
 org.openmali.vecmath2.Colorf getColor()
          
 Rectangle getRectangle()
          Directly returns the Quad (Shape3d).
 Texture getTexture()
          
 float getTileHeight()
          
 org.openmali.types.twodee.Sized2fRO getTileSize()
          
 float getTileWidth()
          
 float getTransparency()
          
protected  void init()
          This method is called when the WidgetContainer is set.
 void setColor(org.openmali.vecmath2.Colorf color)
          Sets this Image's color.
 boolean setSize(float width, float height, boolean forced)
          
 void setTexture(java.lang.String texture)
          Sets the Texture resource used as the Image's texture
 void setTexture(Texture texture)
          Sets the Texture resource used as the Image's texture
 void setTileSize(float tileWidth, float tileHeight)
          Sets the tile size.
 void setTileSize(org.openmali.types.twodee.Sized2fRO tileSize)
          Sets the tile size.
 void setTransparency(float transparency)
          Sets the whole Widget's Transparency.
 
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, 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, setContainer, setContextMenu, setCursor, setDraggable, setFocussable, setHeight, setLocation, setLocation, setLocation, setName, setPickable, setSize, setSize, setSize, setToolTip, 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, 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, setUserObject, setVisible, setZIndex, update
 
Methods inherited from interface org.openmali.types.twodee.Sized2f
setHeight, setWidth
 

Constructor Detail

Image

public Image(float width,
             float height,
             int zIndex,
             Image.Description imgDesc)
Creates a new Image with the given width and height.

Parameters:
width - the new width of this Widget
height - the new height of this Widget
zIndex - the new z-index of this Widget
imgDesc - the ImageDescription instance, which holds all texturing information for this Image

Image

public Image(float width,
             float height,
             Image.Description imgDesc)
Creates a new Image with the given width and height.

Parameters:
width - the new width of this Widget
height - the new height of this Widget
imgDesc - the ImageDescription instance, which holds all texturing information for this Image

Image

public Image(org.openmali.types.twodee.Sized2fRO size,
             int zIndex,
             Image.Description imgDesc)
Creates a new Image with the given width and height.

Parameters:
size - the new size of this Widget
zIndex - the new z-index of this Widget
imgDesc - the ImageDescription instance, which holds all texturing information for this Image

Image

public Image(org.openmali.types.twodee.Sized2fRO size,
             Image.Description imgDesc)
Creates a new Image with the given width and height.

Parameters:
size - the new size of this Widget
imgDesc - the ImageDescription instance, which holds all texturing information for this Image

Image

public Image(float width,
             float height,
             int zIndex,
             java.lang.String texture)
Creates a new Image with the given width and height.

Parameters:
width - the new width of this Widget
height - the new height of this Widget
zIndex - the new z-index of this Widget
texture - the Texture resource to use for this Image

Image

public Image(org.openmali.types.twodee.Sized2fRO size,
             int zIndex,
             java.lang.String texture)
Creates a new Image with the given width and height.

Parameters:
size - the new size of this Widget
zIndex - the new z-index of this Widget
texture - the Texture resource to use for this Image

Image

public Image(float width,
             float height,
             java.lang.String texture)
Creates a new Image with the given width and height.

Parameters:
width - the new width of this Widget
height - the new height of this Widget
texture - the Texture resource to use for this Image

Image

public Image(org.openmali.types.twodee.Sized2fRO size,
             java.lang.String texture)
Creates a new Image with the given width and height.

Parameters:
size - the new size of this Widget
texture - the texture resource to use as background image for this FPSCounter
Make suse this texture supports alpha channel (e.g. PNG).

Image

public Image(float width,
             float height,
             int zIndex,
             Texture texture)
Creates a new Image with the given width and height.

Parameters:
width - the new width of this Widget
height - the new height of this Widget
zIndex - the new z-index of this Widget
texture - the Texture to use for this Image

Image

public Image(org.openmali.types.twodee.Sized2fRO size,
             int zIndex,
             Texture texture)
Creates a new Image with the given width and height.

Parameters:
size - the new size of this Widget
zIndex - the new z-index of this Widget
texture - the Texture to use for this Image

Image

public Image(float width,
             float height,
             Texture texture)
Creates a new Image with the given width and height.

Parameters:
width - the new width of this Widget
height - the new height of this Widget
texture - the Texture to use for this Image

Image

public Image(org.openmali.types.twodee.Sized2fRO size,
             Texture texture)
Creates a new Image with the given width and height.

Parameters:
size - the new size of this Widget
texture - the Texture to use for this Image

Image

public Image(float width,
             float height,
             int zIndex,
             org.openmali.vecmath2.Colorf color)
Creates a new Image with the given width and height.

Parameters:
width - the new width of this Widget
height - the new height of this Widget
zIndex - the new z-index of this Widget
color - the color to use for the Image

Image

public Image(float width,
             float height,
             org.openmali.vecmath2.Colorf color)
Creates a new Image with the given width and height.

Parameters:
width - the new width of this Widget
height - the new height of this Widget
color - the color to use for the Image

Image

public Image(org.openmali.types.twodee.Sized2fRO size,
             int zIndex,
             org.openmali.vecmath2.Colorf color)
Creates a new Image with the given width and height.

Parameters:
size - the new size of this Widget
zIndex - the new z-index of this Widget
color - the color to use for the Image

Image

public Image(org.openmali.types.twodee.Sized2fRO size,
             org.openmali.vecmath2.Colorf color)
Creates a new Image with the given width and height.

Parameters:
size - the new size of this Widget
color - the color to use for the Image
Method Detail

setTransparency

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

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

getTransparency

public float getTransparency()

Specified by:
getTransparency in interface Widget
Returns:
the whole Widget's Transparency.

getRectangle

public Rectangle getRectangle()
Directly returns the Quad (Shape3d). Only modify it, when you know what you're doing!


setTileSize

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

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

setTileSize

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

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

getTileSize

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

Specified by:
getTileSize in interface AbstractImage
Returns:
the tile size (or null for no tiling)

getTileWidth

public float getTileWidth()

Specified by:
getTileWidth in interface AbstractImage
Returns:
the tile width (or negative for no tiling)

getTileHeight

public float getTileHeight()

Specified by:
getTileHeight in interface AbstractImage
Returns:
the tile width (or negative for no tiling)

getTexture

public Texture getTexture()

Specified by:
getTexture in interface AbstractImage
Returns:
the Texture resource used as the Image's texture

setTexture

public void setTexture(Texture texture)
Sets the Texture resource used as the Image's texture

Specified by:
setTexture in interface AbstractImage

setTexture

public void setTexture(java.lang.String texture)
Sets the Texture resource used as the Image's texture

Specified by:
setTexture in interface AbstractImage

setColor

public void setColor(org.openmali.vecmath2.Colorf color)
Sets this Image's color.

Specified by:
setColor in interface AbstractImage
Parameters:
color - the new color

getColor

public org.openmali.vecmath2.Colorf getColor()

Specified by:
getColor in interface AbstractImage
Returns:
this Image's color

setSize

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

Overrides:
setSize in class WidgetBase

init

protected void init()
This method is called when the WidgetContainer is set.

Specified by:
init in class WidgetBase