org.xith3d.ui.hud.widgets
Class NumberLabel

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.NumberLabel
All Implemented Interfaces:
org.jagatoo.datatypes.Enableable, 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, PaddingSettable, Widget

public class NumberLabel
extends RectangularWidget
implements BackgroundSettableWidget, PaddingSettable, org.jagatoo.datatypes.Enableable

A NumberLabel displays floating-point-numbers, that may change very dynamically.

See Also:
Label, DynamicLabel

Nested Class Summary
static class NumberLabel.Description
          This class is used to describe a (set of) Label Widget(s).
 
Nested classes/interfaces inherited from interface org.xith3d.ui.hud.base.Widget
Widget.DescriptionBase
 
Field Summary
protected  boolean autoSize
           
 
Fields inherited from class org.xith3d.ui.hud.base.WidgetBase
containerListeners, transformGroup, translation, Z_INDEX_UNIT, Z_INDEX_UNIT_ASSEMBLER
 
Constructor Summary
NumberLabel(float width, float height, float value, char decimalChar, int maxLength)
          Creates a new Label with the given width and height and no text initially.
NumberLabel(float width, float height, float value, char decimalChar, int maxLength, org.openmali.vecmath2.Colorf color)
          Creates a new Label with the given width and height and a z-index of 0.
NumberLabel(float width, float height, float value, char decimalChar, int maxLength, org.openmali.vecmath2.Colorf color, TextAlignment alignment)
          Creates a new Label with the given width and height and a z-index of 0.
NumberLabel(float width, float height, float value, char decimalChar, int maxLength, java.awt.Font font)
          Creates a new Label with the given width and height and a z-index of 0.
NumberLabel(float width, float height, float value, char decimalChar, int maxLength, java.awt.Font font, org.openmali.vecmath2.Colorf color)
          Creates a new Label with the given width and height and a z-index of 0.
NumberLabel(float width, float height, float value, char decimalChar, int maxLength, java.awt.Font font, org.openmali.vecmath2.Colorf color, TextAlignment alignment)
          Creates a new Label with the given width and height and a z-index of 0.
NumberLabel(float width, float height, float value, char decimalChar, int maxLength, java.awt.Font font, TextAlignment alignment)
          Creates a new Label with the given width and height and a z-index of 0.
NumberLabel(float width, float height, float value, char decimalChar, int maxLength, NumberLabel.Description labelDesc)
          Creates a new Label with the given width, height and z-index.
NumberLabel(float width, float height, float value, char decimalChar, int maxLength, TextAlignment alignment)
          Creates a new Label with the given width and height and a z-index of 0.
NumberLabel(float width, float height, int zIndex, float value, char decimalChar, int maxLength)
          Creates a new Label with the given width and height and no text initially.
NumberLabel(float width, float height, int zIndex, float value, char decimalChar, int maxLength, org.openmali.vecmath2.Colorf color)
          Creates a new Label with the given width, height and z-index.
NumberLabel(float width, float height, int zIndex, float value, char decimalChar, int maxLength, org.openmali.vecmath2.Colorf color, TextAlignment alignment)
          Creates a new Label with the given width and height and a z-index of 0.
NumberLabel(float width, float height, int zIndex, float value, char decimalChar, int maxLength, java.awt.Font font, org.openmali.vecmath2.Colorf color)
          Creates a new Label with the given width, height and z-index.
NumberLabel(float width, float height, int zIndex, float value, char decimalChar, int maxLength, java.awt.Font font, org.openmali.vecmath2.Colorf color, TextAlignment alignment)
          Creates a new Label with the given width, height and z-index.
NumberLabel(float width, float height, int zIndex, float value, char decimalChar, int maxLength, NumberLabel.Description labelDesc)
          Creates a new Label with the given width, height and z-index.
NumberLabel(float width, float height, int zIndex, float value, char decimalChar, int maxLength, TextAlignment alignment)
          Creates a new Label with the given width and height and a z-index of 0.
NumberLabel(org.openmali.types.twodee.Sized2fRO size, float value, char decimalChar, int maxLength)
          Creates a new Label with the given width and height and no text initially.
NumberLabel(org.openmali.types.twodee.Sized2fRO size, float value, char decimalChar, int maxLength, org.openmali.vecmath2.Colorf color)
          Creates a new Label with the given width and height and a z-index of 0.
NumberLabel(org.openmali.types.twodee.Sized2fRO size, float value, char decimalChar, int maxLength, org.openmali.vecmath2.Colorf color, TextAlignment alignment)
          Creates a new Label with the given width and height and a z-index of 0.
NumberLabel(org.openmali.types.twodee.Sized2fRO size, float value, char decimalChar, int maxLength, java.awt.Font font)
          Creates a new Label with the given width and height and a z-index of 0.
NumberLabel(org.openmali.types.twodee.Sized2fRO size, float value, char decimalChar, int maxLength, java.awt.Font font, org.openmali.vecmath2.Colorf color)
          Creates a new Label with the given width and height and a z-index of 0.
NumberLabel(org.openmali.types.twodee.Sized2fRO size, float value, char decimalChar, int maxLength, java.awt.Font font, org.openmali.vecmath2.Colorf color, TextAlignment alignment)
          Creates a new Label with the given width and height and a z-index of 0.
NumberLabel(org.openmali.types.twodee.Sized2fRO size, float value, char decimalChar, int maxLength, java.awt.Font font, TextAlignment alignment)
          Creates a new Label with the given width and height and a z-index of 0.
NumberLabel(org.openmali.types.twodee.Sized2fRO size, float value, char decimalChar, int maxLength, NumberLabel.Description labelDesc)
          Creates a new Label with the given width, height and z-index.
NumberLabel(org.openmali.types.twodee.Sized2fRO size, float value, char decimalChar, int maxLength, TextAlignment alignment)
          Creates a new Label with the given width and height and a z-index of 0.
NumberLabel(org.openmali.types.twodee.Sized2fRO size, int zIndex, float value, char decimalChar, int maxLength, org.openmali.vecmath2.Colorf color)
          Creates a new Label with the given width, height and z-index.
NumberLabel(org.openmali.types.twodee.Sized2fRO size, int zIndex, float value, char decimalChar, int maxLength, org.openmali.vecmath2.Colorf color, TextAlignment alignment)
          Creates a new Label with the given width and height and a z-index of 0.
NumberLabel(org.openmali.types.twodee.Sized2fRO size, int zIndex, float value, char decimalChar, int maxLength, java.awt.Font font, org.openmali.vecmath2.Colorf color)
          Creates a new Label with the given width, height and z-index.
NumberLabel(org.openmali.types.twodee.Sized2fRO size, int zIndex, float value, char decimalChar, int maxLength, java.awt.Font font, org.openmali.vecmath2.Colorf color, TextAlignment alignment)
          Creates a new Label with the given width, height and z-index.
NumberLabel(org.openmali.types.twodee.Sized2fRO size, int zIndex, float value, char decimalChar, int maxLength, NumberLabel.Description labelDesc)
          Creates a new Label with the given width, height and z-index.
NumberLabel(org.openmali.types.twodee.Sized2fRO size, int zIndex, float value, char decimalChar, int maxLength, TextAlignment alignment)
          Creates a new Label with the given width and height and a z-index of 0.
 
Method Summary
protected  void fixTranslation(org.openmali.vecmath2.Tuple2f offset)
           
 TextAlignment getAlignment()
           
 Texture getBackground()
          
 org.openmali.vecmath2.Colorf getBackgroundColor()
          
 float getBackgroundTileHeight()
          
 org.openmali.types.twodee.Sized2fRO getBackgroundTileSize()
          
 float getBackgroundTileWidth()
          
 GroupNode getContentGroup()
           
 java.awt.Font getFont()
          
 org.openmali.vecmath2.Colorf getFontColor()
          
 org.openmali.vecmath2.Colorf getFontColorDisabled()
          
 java.awt.Font getFontDisabled()
          
 org.openmali.types.twodee.Dim2f getMinimalSize(org.openmali.types.twodee.Dim2f buffer)
          Calculates the minimum Size needed to contain the whole caption.
 NumberGeom getNumberGeom()
           
 int getNumFractions()
           
 float getPaddingBottom()
          
 float getPaddingLeft()
          
 float getPaddingRight()
          
 float getPaddingTop()
          
 float getTransparency()
          
 float getValue()
           
protected  void init()
          This method is called when the WidgetContainer is set.
 boolean isAutoSizeEnabled()
           
 boolean isEnabled()
          
 void setAlignment(TextAlignment alignment)
          Sets the horizontal and vertical alignment of the text
 void setAutoSizeEnabled(boolean enabled)
          Enables or disables auto-sizing.
 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
 void setEnabled(boolean enabled)
          
 void setEnabledImpl(boolean enabled)
           
 void setFont(java.awt.Font font)
          
 void setFontColor(org.openmali.vecmath2.Colorf color)
          
 void setFontColorDisabled(org.openmali.vecmath2.Colorf color)
          
 void setFontDisabled(java.awt.Font font)
          
 void setMinimalSize()
          Resizes this Label to the minimum Size needed to contain the whole caption.
 void setNumFractions(int numFractions)
           
 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.
 boolean setSize(float width, float height, boolean forced)
          
 void setTransparency(float transparency)
          Sets the whole Widget's Transparency.
 void setValue(float value)
           
 java.lang.String toString()
          
protected  void updateNumber()
           
protected  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, 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, setContextMenu, setCursor, setDraggable, setFocussable, setHeight, setLocation, setLocation, setLocation, setName, setPickable, setSize, setSize, setSize, setToolTip, setUserObject, setVisible, setWidth, setZIndex, update
 
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, 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
 

Field Detail

autoSize

protected boolean autoSize
Constructor Detail

NumberLabel

public NumberLabel(float width,
                   float height,
                   int zIndex,
                   float value,
                   char decimalChar,
                   int maxLength,
                   NumberLabel.Description labelDesc)
Creates a new Label 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
value - the value to display in this NumberWidget
decimalChar - the character to use as decimal delimiter
maxLength - the maximum number of digits (inclusive sign, decimal-delim and fractions)
labelDesc - a LabelDescription instance holding information about font, color, alignment and background-texture

NumberLabel

public NumberLabel(float width,
                   float height,
                   float value,
                   char decimalChar,
                   int maxLength,
                   NumberLabel.Description labelDesc)
Creates a new Label with the given width, height and z-index.

Parameters:
width - the new width of this Widget
height - the new height of this Widget
value - the value to display in this NumberWidget
decimalChar - the character to use as decimal delimiter
maxLength - the maximum number of digits (inclusive sign, decimal-delim and fractions)
labelDesc - a LabelDescription instance holding information about font, color, alignment and background-texture

NumberLabel

public NumberLabel(org.openmali.types.twodee.Sized2fRO size,
                   float value,
                   char decimalChar,
                   int maxLength,
                   NumberLabel.Description labelDesc)
Creates a new Label with the given width, height and z-index.

Parameters:
size - the new size of this Widget
value - the value to display in this NumberWidget
decimalChar - the character to use as decimal delimiter
maxLength - the maximum number of digits (inclusive sign, decimal-delim and fractions)
labelDesc - a LabelDescription instance holding information about font, color, alignment and background-texture

NumberLabel

public NumberLabel(org.openmali.types.twodee.Sized2fRO size,
                   int zIndex,
                   float value,
                   char decimalChar,
                   int maxLength,
                   NumberLabel.Description labelDesc)
Creates a new Label with the given width, height and z-index.

Parameters:
size - the new size of this Widget
zIndex - the z-index of this Widget
value - the value to display in this NumberWidget
decimalChar - the character to use as decimal delimiter
maxLength - the maximum number of digits (inclusive sign, decimal-delim and fractions)
labelDesc - a LabelDescription instance holding information about font, color, alignment and background-texture

NumberLabel

public NumberLabel(float width,
                   float height,
                   int zIndex,
                   float value,
                   char decimalChar,
                   int maxLength,
                   java.awt.Font font,
                   org.openmali.vecmath2.Colorf color,
                   TextAlignment alignment)
Creates a new Label 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
value - the value to display in this NumberWidget
decimalChar - the character to use as decimal delimiter
maxLength - the maximum number of digits (inclusive sign, decimal-delim and fractions)
font - the Font to be used for the text
color - the color to be used
alignment - the horizontal and vertical alignment

NumberLabel

public NumberLabel(org.openmali.types.twodee.Sized2fRO size,
                   int zIndex,
                   float value,
                   char decimalChar,
                   int maxLength,
                   java.awt.Font font,
                   org.openmali.vecmath2.Colorf color,
                   TextAlignment alignment)
Creates a new Label with the given width, height and z-index.

Parameters:
size - the new size of this Widget
zIndex - the z-index of this Widget
value - the value to display in this NumberWidget
decimalChar - the character to use as decimal delimiter
maxLength - the maximum number of digits (inclusive sign, decimal-delim and fractions)
font - the Font to be used for the text
color - the color to be used
alignment - the horizontal and vertical alignment

NumberLabel

public NumberLabel(org.openmali.types.twodee.Sized2fRO size,
                   int zIndex,
                   float value,
                   char decimalChar,
                   int maxLength,
                   TextAlignment alignment)
Creates a new Label with the given width and height and a z-index of 0.

Parameters:
size - the new size of this Widget
zIndex - the z-index of this Widget
value - the value to display in this NumberWidget
decimalChar - the character to use as decimal delimiter
maxLength - the maximum number of digits (inclusive sign, decimal-delim and fractions)
alignment - the horizontal and vertical alignment

NumberLabel

public NumberLabel(float width,
                   float height,
                   int zIndex,
                   float value,
                   char decimalChar,
                   int maxLength,
                   TextAlignment alignment)
Creates a new Label with the given width and height and a z-index of 0.

Parameters:
width - the new width of this Widget
height - the new height of this Widget
zIndex - the z-index of this Widget
value - the value to display in this NumberWidget
decimalChar - the character to use as decimal delimiter
maxLength - the maximum number of digits (inclusive sign, decimal-delim and fractions)
alignment - the horizontal and vertical alignment

NumberLabel

public NumberLabel(org.openmali.types.twodee.Sized2fRO size,
                   float value,
                   char decimalChar,
                   int maxLength,
                   TextAlignment alignment)
Creates a new Label with the given width and height and a z-index of 0.

Parameters:
size - the new size of this Widget
value - the value to display in this NumberWidget
decimalChar - the character to use as decimal delimiter
maxLength - the maximum number of digits (inclusive sign, decimal-delim and fractions)
alignment - the horizontal and vertical alignment

NumberLabel

public NumberLabel(float width,
                   float height,
                   float value,
                   char decimalChar,
                   int maxLength,
                   TextAlignment alignment)
Creates a new Label with the given width and height and a z-index of 0.

Parameters:
width - the new width of this Widget
height - the new height of this Widget
value - the value to display in this NumberWidget
decimalChar - the character to use as decimal delimiter
maxLength - the maximum number of digits (inclusive sign, decimal-delim and fractions)
alignment - the horizontal and vertical alignment

NumberLabel

public NumberLabel(org.openmali.types.twodee.Sized2fRO size,
                   int zIndex,
                   float value,
                   char decimalChar,
                   int maxLength,
                   org.openmali.vecmath2.Colorf color,
                   TextAlignment alignment)
Creates a new Label with the given width and height and a z-index of 0.

Parameters:
size - the new size of this Widget
zIndex - the z-index of this Widget
value - the value to display in this NumberWidget
decimalChar - the character to use as decimal delimiter
maxLength - the maximum number of digits (inclusive sign, decimal-delim and fractions)
color - the color to be used
alignment - the horizontal and vertical alignment

NumberLabel

public NumberLabel(float width,
                   float height,
                   int zIndex,
                   float value,
                   char decimalChar,
                   int maxLength,
                   org.openmali.vecmath2.Colorf color,
                   TextAlignment alignment)
Creates a new Label with the given width and height and a z-index of 0.

Parameters:
width - the new width of this Widget
height - the new height of this Widget
zIndex - the z-index of this Widget
value - the value to display in this NumberWidget
decimalChar - the character to use as decimal delimiter
maxLength - the maximum number of digits (inclusive sign, decimal-delim and fractions)
color - the color to be used
alignment - the horizontal and vertical alignment

NumberLabel

public NumberLabel(org.openmali.types.twodee.Sized2fRO size,
                   float value,
                   char decimalChar,
                   int maxLength,
                   org.openmali.vecmath2.Colorf color,
                   TextAlignment alignment)
Creates a new Label with the given width and height and a z-index of 0.

Parameters:
size - the new size of this Widget
value - the value to display in this NumberWidget
decimalChar - the character to use as decimal delimiter
maxLength - the maximum number of digits (inclusive sign, decimal-delim and fractions)
color - the color to be used
alignment - the horizontal and vertical alignment

NumberLabel

public NumberLabel(float width,
                   float height,
                   float value,
                   char decimalChar,
                   int maxLength,
                   org.openmali.vecmath2.Colorf color,
                   TextAlignment alignment)
Creates a new Label with the given width and height and a z-index of 0.

Parameters:
width - the new width of this Widget
height - the new height of this Widget
value - the value to display in this NumberWidget
decimalChar - the character to use as decimal delimiter
maxLength - the maximum number of digits (inclusive sign, decimal-delim and fractions)
color - the color to be used
alignment - the horizontal and vertical alignment

NumberLabel

public NumberLabel(org.openmali.types.twodee.Sized2fRO size,
                   float value,
                   char decimalChar,
                   int maxLength,
                   java.awt.Font font,
                   org.openmali.vecmath2.Colorf color,
                   TextAlignment alignment)
Creates a new Label with the given width and height and a z-index of 0.

Parameters:
size - the new size of this Widget
value - the value to display in this NumberWidget
decimalChar - the character to use as decimal delimiter
maxLength - the maximum number of digits (inclusive sign, decimal-delim and fractions)
font - the Font to be used for the text
color - the color to be used
alignment - the horizontal and vertical alignment

NumberLabel

public NumberLabel(float width,
                   float height,
                   float value,
                   char decimalChar,
                   int maxLength,
                   java.awt.Font font,
                   org.openmali.vecmath2.Colorf color,
                   TextAlignment alignment)
Creates a new Label with the given width and height and a z-index of 0.

Parameters:
width - the new width of this Widget
height - the new height of this Widget
value - the value to display in this NumberWidget
decimalChar - the character to use as decimal delimiter
maxLength - the maximum number of digits (inclusive sign, decimal-delim and fractions)
font - the Font to be used for the text
color - the color to be used
alignment - the horizontal and vertical alignment

NumberLabel

public NumberLabel(org.openmali.types.twodee.Sized2fRO size,
                   int zIndex,
                   float value,
                   char decimalChar,
                   int maxLength,
                   java.awt.Font font,
                   org.openmali.vecmath2.Colorf color)
Creates a new Label with the given width, height and z-index.

Parameters:
size - the new size of this Widget
zIndex - the z-index of this Widget
value - the value to display in this NumberWidget
decimalChar - the character to use as decimal delimiter
maxLength - the maximum number of digits (inclusive sign, decimal-delim and fractions)
font - the Font to be used for the text
color - the color to be used

NumberLabel

public NumberLabel(float width,
                   float height,
                   int zIndex,
                   float value,
                   char decimalChar,
                   int maxLength,
                   java.awt.Font font,
                   org.openmali.vecmath2.Colorf color)
Creates a new Label 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
value - the value to display in this NumberWidget
decimalChar - the character to use as decimal delimiter
maxLength - the maximum number of digits (inclusive sign, decimal-delim and fractions)
font - the Font to be used for the text
color - the color to be used

NumberLabel

public NumberLabel(org.openmali.types.twodee.Sized2fRO size,
                   float value,
                   char decimalChar,
                   int maxLength,
                   java.awt.Font font,
                   org.openmali.vecmath2.Colorf color)
Creates a new Label with the given width and height and a z-index of 0.

Parameters:
size - the new size of this Widget
value - the value to display in this NumberWidget
decimalChar - the character to use as decimal delimiter
maxLength - the maximum number of digits (inclusive sign, decimal-delim and fractions)
font - the Font to be used for the text
color - the color to be used

NumberLabel

public NumberLabel(float width,
                   float height,
                   float value,
                   char decimalChar,
                   int maxLength,
                   java.awt.Font font,
                   org.openmali.vecmath2.Colorf color)
Creates a new Label with the given width and height and a z-index of 0.

Parameters:
width - the new width of this Widget
height - the new height of this Widget
value - the value to display in this NumberWidget
decimalChar - the character to use as decimal delimiter
maxLength - the maximum number of digits (inclusive sign, decimal-delim and fractions)
font - the Font to be used for the text
color - the color to be used

NumberLabel

public NumberLabel(org.openmali.types.twodee.Sized2fRO size,
                   int zIndex,
                   float value,
                   char decimalChar,
                   int maxLength,
                   org.openmali.vecmath2.Colorf color)
Creates a new Label with the given width, height and z-index.

Parameters:
size - the new size of this Widget
zIndex - the z-index of this Widget
value - the value to display in this NumberWidget
decimalChar - the character to use as decimal delimiter
maxLength - the maximum number of digits (inclusive sign, decimal-delim and fractions)
color - the color to be used

NumberLabel

public NumberLabel(float width,
                   float height,
                   int zIndex,
                   float value,
                   char decimalChar,
                   int maxLength,
                   org.openmali.vecmath2.Colorf color)
Creates a new Label 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
value - the value to display in this NumberWidget
decimalChar - the character to use as decimal delimiter
maxLength - the maximum number of digits (inclusive sign, decimal-delim and fractions)
color - the color to be used

NumberLabel

public NumberLabel(org.openmali.types.twodee.Sized2fRO size,
                   float value,
                   char decimalChar,
                   int maxLength,
                   org.openmali.vecmath2.Colorf color)
Creates a new Label with the given width and height and a z-index of 0.

Parameters:
size - the new size of this Widget
value - the value to display in this NumberWidget
decimalChar - the character to use as decimal delimiter
maxLength - the maximum number of digits (inclusive sign, decimal-delim and fractions)
color - the color to be used

NumberLabel

public NumberLabel(float width,
                   float height,
                   float value,
                   char decimalChar,
                   int maxLength,
                   org.openmali.vecmath2.Colorf color)
Creates a new Label with the given width and height and a z-index of 0.

Parameters:
width - the new width of this Widget
height - the new height of this Widget
value - the value to display in this NumberWidget
decimalChar - the character to use as decimal delimiter
maxLength - the maximum number of digits (inclusive sign, decimal-delim and fractions)
color - the color to be used

NumberLabel

public NumberLabel(org.openmali.types.twodee.Sized2fRO size,
                   float value,
                   char decimalChar,
                   int maxLength,
                   java.awt.Font font)
Creates a new Label with the given width and height and a z-index of 0.

Parameters:
size - the new size of this Widget
value - the value to display in this NumberWidget
decimalChar - the character to use as decimal delimiter
maxLength - the maximum number of digits (inclusive sign, decimal-delim and fractions)
font - the Font to be used for the text

NumberLabel

public NumberLabel(float width,
                   float height,
                   float value,
                   char decimalChar,
                   int maxLength,
                   java.awt.Font font)
Creates a new Label with the given width and height and a z-index of 0.

Parameters:
width - the new width of this Widget
height - the new height of this Widget
value - the value to display in this NumberWidget
decimalChar - the character to use as decimal delimiter
maxLength - the maximum number of digits (inclusive sign, decimal-delim and fractions)
font - the Font to be used for the text

NumberLabel

public NumberLabel(org.openmali.types.twodee.Sized2fRO size,
                   float value,
                   char decimalChar,
                   int maxLength,
                   java.awt.Font font,
                   TextAlignment alignment)
Creates a new Label with the given width and height and a z-index of 0.

Parameters:
size - the new size of this Widget
value - the value to display in this NumberWidget
decimalChar - the character to use as decimal delimiter
maxLength - the maximum number of digits (inclusive sign, decimal-delim and fractions)
font - the Font to be used for the text
alignment - the horizontal and vertical alignment

NumberLabel

public NumberLabel(float width,
                   float height,
                   float value,
                   char decimalChar,
                   int maxLength,
                   java.awt.Font font,
                   TextAlignment alignment)
Creates a new Label with the given width and height and a z-index of 0.

Parameters:
width - the new width of this Widget
height - the new height of this Widget
value - the value to display in this NumberWidget
decimalChar - the character to use as decimal delimiter
maxLength - the maximum number of digits (inclusive sign, decimal-delim and fractions)
font - the Font to be used for the text
alignment - the horizontal and vertical alignment

NumberLabel

public NumberLabel(org.openmali.types.twodee.Sized2fRO size,
                   float value,
                   char decimalChar,
                   int maxLength)
Creates a new Label with the given width and height and no text initially.

Parameters:
size - the new size of this Widget
value - the value to display in this NumberWidget
decimalChar - the character to use as decimal delimiter
maxLength - the maximum number of digits (inclusive sign, decimal-delim and fractions)

NumberLabel

public NumberLabel(float width,
                   float height,
                   int zIndex,
                   float value,
                   char decimalChar,
                   int maxLength)
Creates a new Label with the given width and height and no text initially.

Parameters:
width - the new width of this Widget
height - the new height of this Widget
zIndex - the z-index of this Widget
value - the value to display in this NumberWidget
decimalChar - the character to use as decimal delimiter
maxLength - the maximum number of digits (inclusive sign, decimal-delim and fractions)

NumberLabel

public NumberLabel(float width,
                   float height,
                   float value,
                   char decimalChar,
                   int maxLength)
Creates a new Label with the given width and height and no text initially.

Parameters:
width - the new width of this Widget
height - the new height of this Widget
value - the value to display in this NumberWidget
decimalChar - the character to use as decimal delimiter
maxLength - the maximum number of digits (inclusive sign, decimal-delim and fractions)
Method Detail

getContentGroup

public GroupNode getContentGroup()
Returns:
the TransformGroup to put the Text2DNode or whatever in

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.

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(java.lang.String 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(Texture 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)

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 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 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 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 float getPaddingLeft()

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

setAutoSizeEnabled

public void setAutoSizeEnabled(boolean enabled)
Enables or disables auto-sizing.
If enabled, the Label's size will always be the minimal size to wrap the whole text content.

Parameters:
enabled -

isAutoSizeEnabled

public boolean isAutoSizeEnabled()
Returns:
if auto-sizing is enabled.
If enabled, the Label's size will always be the minimal size to wrap the whole text content.

getNumberGeom

public NumberGeom getNumberGeom()
Returns:
the untilized NumberGeom to render the number

updateNumber

protected void updateNumber()

setValue

public void setValue(float value)

getValue

public float getValue()

setNumFractions

public void setNumFractions(int numFractions)

getNumFractions

public final int getNumFractions()

setAlignment

public void setAlignment(TextAlignment alignment)
Sets the horizontal and vertical alignment of the text


getAlignment

public TextAlignment getAlignment()
Returns:
the horizontal and vertical alignment of the text

setFont

public void setFont(java.awt.Font font)


getFont

public java.awt.Font getFont()


setFontDisabled

public void setFontDisabled(java.awt.Font font)


getFontDisabled

public java.awt.Font getFontDisabled()


setFontColor

public void setFontColor(org.openmali.vecmath2.Colorf color)


getFontColor

public org.openmali.vecmath2.Colorf getFontColor()


setFontColorDisabled

public void setFontColorDisabled(org.openmali.vecmath2.Colorf color)


getFontColorDisabled

public org.openmali.vecmath2.Colorf getFontColorDisabled()


setEnabledImpl

public void setEnabledImpl(boolean enabled)

setEnabled

public final void setEnabled(boolean enabled)

Specified by:
setEnabled in interface org.jagatoo.datatypes.Enableable

isEnabled

public final boolean isEnabled()

Specified by:
isEnabled in interface org.jagatoo.datatypes.Enableable

setSize

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

Overrides:
setSize in class WidgetBase

getMinimalSize

public org.openmali.types.twodee.Dim2f getMinimalSize(org.openmali.types.twodee.Dim2f buffer)
Calculates the minimum Size needed to contain the whole caption.


setMinimalSize

public void setMinimalSize()
Resizes this Label to the minimum Size needed to contain the whole caption.


fixTranslation

protected void fixTranslation(org.openmali.vecmath2.Tuple2f offset)

updateTranslation

protected void updateTranslation()
Effectively changes the translation of this Widget (location and z-index)

Overrides:
updateTranslation in class WidgetBase

init