org.xith3d.ui.hud.base
Class LabeledStateButton

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.StateButton
              extended by org.xith3d.ui.hud.base.LabeledStateButton
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, TextWidget, Widget
Direct Known Subclasses:
Checkbox, RadioButton

public abstract class LabeledStateButton
extends StateButton
implements TextWidget

This class serves as a base for all StateButtons with an Image and a Label.


Nested Class Summary
static class LabeledStateButton.Description
          This class is used to describe a LabeledStateButton Widget.
 
Nested classes/interfaces inherited from class org.xith3d.ui.hud.base.StateButton
StateButton.State
 
Nested classes/interfaces inherited from interface org.xith3d.ui.hud.base.Widget
Widget.DescriptionBase
 
Field Summary
protected  Image buttonImage
           
protected  Label label
           
 
Fields inherited from class org.xith3d.ui.hud.base.WidgetBase
containerListeners, transformGroup, translation, Z_INDEX_UNIT, Z_INDEX_UNIT_ASSEMBLER
 
Constructor Summary
LabeledStateButton(float width, float height, int zIndex, LabeledStateButton.Description desc)
          Creates a new LabeledStateButton
LabeledStateButton(float width, float height, int zIndex, LabeledStateButton.Description desc, java.lang.String text)
          Creates a new LabeledStateButton
LabeledStateButton(float width, float height, LabeledStateButton.Description desc)
          Creates a new LabeledStateButton
LabeledStateButton(float width, float height, LabeledStateButton.Description desc, java.lang.String text)
          Creates a new LabeledStateButton
 
Method Summary
 TextAlignment getAlignment()
          
 java.awt.Font getFont()
          
 org.openmali.vecmath2.Colorf getFontColor()
          
 org.openmali.vecmath2.Colorf getFontColorDisabled()
          
 java.awt.Font getFontDisabled()
          
 java.lang.String getText()
          
 float getTransparency()
          
protected  void init()
          This method is called when the WidgetContainer is set.
protected  void onStateChanged(StateButton.State state)
           
 void setAlignment(TextAlignment alignment)
          Sets the horizontal and vertical alignment of the text
protected  void setEnabledImpl(boolean enabled)
          
 void setFont(java.awt.Font font)
          Sets the new Font to be used
 void setFontColor(org.openmali.vecmath2.Colorf color)
          Sets the new color to be used
 void setFontColorDisabled(org.openmali.vecmath2.Colorf color)
          
 void setFontDisabled(java.awt.Font font)
          
protected  boolean setSize(float width, float height, boolean forced)
          
 void setText(java.lang.String text)
          Sets the new text to be displayed
 
Methods inherited from class org.xith3d.ui.hud.base.StateButton
addStateListener, cycleState, getBooleanState, getState, getStateGroup, isEnabled, notifyListeners, onMouseButtonPressed, onMouseEntered, onMouseLeft, removeStateListener, setEnabled, setState, setState, setStateGroup
 
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, onMouseButtonReleased, 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, 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, getUserObject, getWidth, getZIndex, hasFocus, hasFocus, hasToolTip, isClickable, isDraggable, isFocussable, isPickable, isVisible, onControllerAxisChanged, onControllerButtonPressed, onControllerButtonReleased, onDetached, onFocusGained, onFocusLost, onInputStateChanged, onKeyPressed, onKeyReleased, onKeyTyped, onMouseButtonPressed, onMouseButtonReleased, onMouseEntered, onMouseLeft, onMouseMoved, onMouseStopped, onMouseUnbound, onMouseWheelMoved, pick, removeContainerListener, removeFocusListener, removeInputListener, removeLocationListener, removeSizeListener, removeVisibilityListener, requestFocus, setAssembly, setCachedToolTipWidget, setClickable, setContainer, setContextMenu, setCursor, setDraggable, setFocussable, setLocation, setLocation, setName, setPickable, setSize, setSize, setSize, setToolTip, setTransparency, setUserObject, setVisible, setZIndex, update
 
Methods inherited from interface org.openmali.types.twodee.Sized2f
setHeight, setWidth
 

Field Detail

buttonImage

protected Image buttonImage

label

protected Label label
Constructor Detail

LabeledStateButton

public LabeledStateButton(float width,
                          float height,
                          int zIndex,
                          LabeledStateButton.Description desc,
                          java.lang.String text)
Creates a new LabeledStateButton

Parameters:
width - the desired width
height - the desired height
zIndex - the desired z-index
desc - the Description object for this Widget
text - the text to be displayed

LabeledStateButton

public LabeledStateButton(float width,
                          float height,
                          LabeledStateButton.Description desc,
                          java.lang.String text)
Creates a new LabeledStateButton

Parameters:
width - the desired width
height - the desired height
desc - the Description object for this Widget
text - the text to be displayed

LabeledStateButton

public LabeledStateButton(float width,
                          float height,
                          int zIndex,
                          LabeledStateButton.Description desc)
Creates a new LabeledStateButton

Parameters:
width - the desired width
height - the desired height
zIndex - the desired z-index
desc - the Description object for this Widget

LabeledStateButton

public LabeledStateButton(float width,
                          float height,
                          LabeledStateButton.Description desc)
Creates a new LabeledStateButton

Parameters:
width - the desired width
height - the desired height
desc - the Description object for this Widget
Method Detail

getTransparency

public float getTransparency()

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

setText

public void setText(java.lang.String text)
Sets the new text to be displayed

Specified by:
setText in interface TextWidget
Parameters:
text - the new Text

getText

public java.lang.String getText()

Specified by:
getText in interface TextWidget
Returns:
the text that is displayed

setAlignment

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

Specified by:
setAlignment in interface TextWidget

getAlignment

public TextAlignment getAlignment()

Specified by:
getAlignment in interface TextWidget
Returns:
the horizontal and vertical alignment of the text

setFont

public void setFont(java.awt.Font font)
Sets the new Font to be used

Specified by:
setFont in interface TextWidget
Parameters:
font - the new Font

getFont

public java.awt.Font getFont()

Specified by:
getFont in interface TextWidget
Returns:
the used Font

setFontDisabled

public void setFontDisabled(java.awt.Font font)


getFontDisabled

public java.awt.Font getFontDisabled()


setFontColor

public void setFontColor(org.openmali.vecmath2.Colorf color)
Sets the new color to be used

Specified by:
setFontColor in interface TextWidget
Parameters:
color - the new color

getFontColor

public org.openmali.vecmath2.Colorf getFontColor()

Specified by:
getFontColor in interface TextWidget
Returns:
the used color

setFontColorDisabled

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


getFontColorDisabled

public org.openmali.vecmath2.Colorf getFontColorDisabled()


setEnabledImpl

protected void setEnabledImpl(boolean enabled)

Specified by:
setEnabledImpl in class StateButton

onStateChanged

protected void onStateChanged(StateButton.State state)
Specified by:
onStateChanged in class StateButton

setSize

protected 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