|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xith3d.ui.hud.base.Widget
org.xith3d.ui.hud.base.StateButton
org.xith3d.ui.hud.base.LabeledStateButton
public abstract class LabeledStateButton
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.Widget |
|---|
Widget.DescriptionBase |
| Field Summary | |
|---|---|
protected static boolean |
DEFAULT_HEAVYWEIGHT
|
| Fields inherited from class org.xith3d.ui.hud.base.Widget |
|---|
transformHeight_Pixels2HUD, transformWidth_Pixels2HUD |
| Constructor Summary | |
|---|---|
LabeledStateButton(boolean isHeavyWeight,
float width,
float height,
java.lang.String text,
LabeledStateButton.Description desc)
Creates a new LabeledStateButton |
|
| Method Summary | ||
|---|---|---|
protected void |
drawWidget(Texture2DCanvas texCanvas,
int offsetX,
int offsetY,
int width,
int height,
boolean drawsSelf)
|
|
protected void |
drawWidgetAfterWidgetAssembler(Texture2DCanvas texCanvas,
int offsetX,
int offsetY,
int width,
int height,
boolean drawsSelf)
Draws the part of the Widget, that needs to be drawn after the WidgetAssembler. |
|
TextAlignment |
getAlignment()
|
|
org.openmali.vecmath2.Colorf |
getBackgroundColor()
|
|
Texture2D |
getBackgroundTexture()
|
|
TileMode |
getBackgroundTileMode()
|
|
HUDFont |
getFont()
|
|
org.openmali.vecmath2.Colorf |
getFontColor()
|
|
org.openmali.vecmath2.Colorf |
getFontColorDisabled()
|
|
HUDFont |
getFontDisabled()
|
|
float |
getMinimalHeight()
Gets the state-button's minimum height. |
|
|
getMinimalSize(Dim2f_ buffer)
Gets the state-button's minimum size. |
|
float |
getMinimalWidth()
Gets the state-button's minimum width. |
|
java.lang.String |
getText()
|
|
protected void |
init()
This method is called when the WidgetContainer is set. |
|
protected void |
initSize()
|
|
boolean |
isAutoSizeEnabled()
|
|
protected boolean |
isMouseOverStateImage(float mouseX,
float mouseY)
|
|
protected void |
onExtendedStateChanged(boolean state,
boolean hovered)
|
|
protected void |
onSizeChanged(float oldWidth,
float oldHeight,
float newWidth,
float newHeight)
|
|
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,
java.lang.String texture)
Sets background color and texture at once. |
|
void |
setBackground(org.openmali.vecmath2.Colorf color,
Texture2D texture,
TileMode tileMode)
Sets background color and texture at once. |
|
void |
setBackgroundColor(org.openmali.vecmath2.Colorf color)
Sets the background color of the Widget. |
|
void |
setBackgroundTexture(java.lang.String texture)
Sets the background Texture of the Widget. |
|
void |
setBackgroundTexture(Texture2D texture)
Sets the background texture of the Widget. |
|
void |
setBackgroundTileMode(TileMode mode)
Sets the background tile mode (null for no tiling) |
|
protected void |
setEnabledImpl(boolean enabled)
|
|
void |
setFont(HUDFont 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(HUDFont font)
|
|
void |
setMinimalSize()
Resizes this LabeledStateButton to the minimum Size needed to contain the whole caption. |
|
void |
setNoBackground()
Sets background color and texture to nothing at once. |
|
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, getState, getStateGroup, isEnabled, notifyListeners, onMouseButtonPressed, onMouseEntered, onMouseExited, removeStateListener, setEnabled, setState, setStateGroup |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static final boolean DEFAULT_HEAVYWEIGHT
| Constructor Detail |
|---|
public LabeledStateButton(boolean isHeavyWeight,
float width,
float height,
java.lang.String text,
LabeledStateButton.Description desc)
isHeavyWeight - width - the desired widthheight - the desired heightdesc - the Description object for this Widgettext - the text to be displayed| Method Detail |
|---|
public void setBackgroundColor(org.openmali.vecmath2.Colorf color)
color - the color to usepublic final org.openmali.vecmath2.Colorf getBackgroundColor()
public void setBackgroundTexture(Texture2D texture)
texture - the texture resource to usepublic void setBackgroundTexture(java.lang.String texture)
texture - the texture resource to use
public final void setBackground(org.openmali.vecmath2.Colorf color,
Texture2D texture,
TileMode tileMode)
color - texture - tileMode -
public final void setBackground(org.openmali.vecmath2.Colorf color,
java.lang.String texture)
color - texture - public final void setNoBackground()
public final Texture2D getBackgroundTexture()
public void setBackgroundTileMode(TileMode mode)
mode - public final TileMode getBackgroundTileMode()
public void setText(java.lang.String text)
setText in interface TextWidgettext - the new Textpublic final java.lang.String getText()
getText in interface TextWidgetpublic void setAlignment(TextAlignment alignment)
setAlignment in interface TextWidgetpublic final TextAlignment getAlignment()
getAlignment in interface TextWidgetpublic void setFont(HUDFont font)
setFont in interface TextWidgetfont - the new Fontpublic final HUDFont getFont()
getFont in interface TextWidgetpublic void setFontDisabled(HUDFont font)
public final HUDFont getFontDisabled()
public void setFontColor(org.openmali.vecmath2.Colorf color)
setFontColor in interface TextWidgetcolor - the new colorpublic final org.openmali.vecmath2.Colorf getFontColor()
getFontColor in interface TextWidgetpublic void setFontColorDisabled(org.openmali.vecmath2.Colorf color)
public final org.openmali.vecmath2.Colorf getFontColorDisabled()
protected void setEnabledImpl(boolean enabled)
setEnabledImpl in class StateButton
protected void onExtendedStateChanged(boolean state,
boolean hovered)
onExtendedStateChanged in class StateButton
protected void onSizeChanged(float oldWidth,
float oldHeight,
float newWidth,
float newHeight)
onSizeChanged in class Widgetpublic void setAutoSizeEnabled(boolean enabled)
setAutoSizeEnabled in interface AutoSizableenabled - public final boolean isAutoSizeEnabled()
isAutoSizeEnabled in interface AutoSizablepublic final <Dim2f_ extends org.openmali.types.twodee.Dim2f> Dim2f_ getMinimalSize(Dim2f_ buffer)
getMinimalSize in interface AutoSizablepublic final void setMinimalSize()
setMinimalSize in interface AutoSizablepublic final float getMinimalWidth()
getMinimalWidth in interface AutoSizablepublic final float getMinimalHeight()
getMinimalHeight in interface AutoSizable
protected boolean isMouseOverStateImage(float mouseX,
float mouseY)
protected void drawWidget(Texture2DCanvas texCanvas,
int offsetX,
int offsetY,
int width,
int height,
boolean drawsSelf)
drawWidget in class Widget
protected void drawWidgetAfterWidgetAssembler(Texture2DCanvas texCanvas,
int offsetX,
int offsetY,
int width,
int height,
boolean drawsSelf)
drawWidgetAfterWidgetAssembler in class Widgetprotected void initSize()
initSize in class Widgetprotected void init()
init in class Widget
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||