|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xith3d.ui.hud.base.WidgetBase
org.xith3d.ui.hud.base.RectangularWidget
org.xith3d.ui.hud.widgets.Label
public class Label
A Label displays text content, that won't change too often. Use it in any case, when you don't plan to change the Label's text each few frames. For highly dynmaic text content you should consider to use DynamicLabel.
DynamicLabel,
NumberLabel| Nested Class Summary | |
|---|---|
static class |
Label.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 | |
|---|---|
Label(float width,
float height)
Creates a new Label with the given width and height and no text initially. |
|
Label(float width,
float height,
int zIndex)
Creates a new Label with the given width, height and z-index and no text initially. |
|
Label(float width,
float height,
int zIndex,
java.lang.String text)
Creates a new Label with the given width and height and no text initially. |
|
Label(float width,
float height,
int zIndex,
java.lang.String text,
org.openmali.vecmath2.Colorf color)
Creates a new Label with the given width, height and z-index. |
|
Label(float width,
float height,
int zIndex,
java.lang.String text,
org.openmali.vecmath2.Colorf color,
TextAlignment alignment)
Creates a new Label with the given width and height and a z-index of 0. |
|
Label(float width,
float height,
int zIndex,
java.lang.String text,
java.awt.Font font,
org.openmali.vecmath2.Colorf color)
Creates a new Label with the given width, height and z-index. |
|
Label(float width,
float height,
int zIndex,
java.lang.String text,
java.awt.Font font,
org.openmali.vecmath2.Colorf color,
TextAlignment alignment)
Creates a new Label with the given width, height and z-index. |
|
Label(float width,
float height,
int zIndex,
java.lang.String text,
Label.Description labelDesc)
Creates a new Label with the given width, height and z-index. |
|
Label(float width,
float height,
int zIndex,
java.lang.String text,
TextAlignment alignment)
Creates a new Label with the given width and height and a z-index of 0. |
|
Label(float width,
float height,
java.lang.String text)
Creates a new Label with the given width and height and no text initially. |
|
Label(float width,
float height,
java.lang.String text,
org.openmali.vecmath2.Colorf color)
Creates a new Label with the given width and height and a z-index of 0. |
|
Label(float width,
float height,
java.lang.String text,
org.openmali.vecmath2.Colorf color,
TextAlignment alignment)
Creates a new Label with the given width and height and a z-index of 0. |
|
Label(float width,
float height,
java.lang.String text,
java.awt.Font font)
Creates a new Label with the given width and height and a z-index of 0. |
|
Label(float width,
float height,
java.lang.String text,
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. |
|
Label(float width,
float height,
java.lang.String text,
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. |
|
Label(float width,
float height,
java.lang.String text,
java.awt.Font font,
TextAlignment alignment)
Creates a new Label with the given width and height and a z-index of 0. |
|
Label(float width,
float height,
java.lang.String text,
Label.Description labelDesc)
Creates a new Label with the given width, height and z-index. |
|
Label(float width,
float height,
java.lang.String text,
TextAlignment alignment)
Creates a new Label with the given width and height and a z-index of 0. |
|
Label(org.openmali.types.twodee.Sized2fRO size)
Creates a new Label with the given width and height and no text initially. |
|
Label(org.openmali.types.twodee.Sized2fRO size,
int zIndex)
Creates a new Label with the given width, height and z-index and no text initially. |
|
Label(org.openmali.types.twodee.Sized2fRO size,
int zIndex,
java.lang.String text,
org.openmali.vecmath2.Colorf color)
Creates a new Label with the given width, height and z-index. |
|
Label(org.openmali.types.twodee.Sized2fRO size,
int zIndex,
java.lang.String text,
org.openmali.vecmath2.Colorf color,
TextAlignment alignment)
Creates a new Label with the given width and height and a z-index of 0. |
|
Label(org.openmali.types.twodee.Sized2fRO size,
int zIndex,
java.lang.String text,
java.awt.Font font,
org.openmali.vecmath2.Colorf color)
Creates a new Label with the given width, height and z-index. |
|
Label(org.openmali.types.twodee.Sized2fRO size,
int zIndex,
java.lang.String text,
java.awt.Font font,
org.openmali.vecmath2.Colorf color,
TextAlignment alignment)
Creates a new Label with the given width, height and z-index. |
|
Label(org.openmali.types.twodee.Sized2fRO size,
int zIndex,
java.lang.String text,
Label.Description labelDesc)
Creates a new Label with the given width, height and z-index. |
|
Label(org.openmali.types.twodee.Sized2fRO size,
int zIndex,
java.lang.String text,
TextAlignment alignment)
Creates a new Label with the given width and height and a z-index of 0. |
|
Label(org.openmali.types.twodee.Sized2fRO size,
java.lang.String text)
Creates a new Label with the given width and height and no text initially. |
|
Label(org.openmali.types.twodee.Sized2fRO size,
java.lang.String text,
org.openmali.vecmath2.Colorf color)
Creates a new Label with the given width and height and a z-index of 0. |
|
Label(org.openmali.types.twodee.Sized2fRO size,
java.lang.String text,
org.openmali.vecmath2.Colorf color,
TextAlignment alignment)
Creates a new Label with the given width and height and a z-index of 0. |
|
Label(org.openmali.types.twodee.Sized2fRO size,
java.lang.String text,
java.awt.Font font)
Creates a new Label with the given width and height and a z-index of 0. |
|
Label(org.openmali.types.twodee.Sized2fRO size,
java.lang.String text,
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. |
|
Label(org.openmali.types.twodee.Sized2fRO size,
java.lang.String text,
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. |
|
Label(org.openmali.types.twodee.Sized2fRO size,
java.lang.String text,
java.awt.Font font,
TextAlignment alignment)
Creates a new Label with the given width and height and a z-index of 0. |
|
Label(org.openmali.types.twodee.Sized2fRO size,
java.lang.String text,
Label.Description labelDesc)
Creates a new Label with the given width, height and z-index. |
|
Label(org.openmali.types.twodee.Sized2fRO size,
java.lang.String text,
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()
|
protected java.lang.String |
getDisplayedText()
|
java.awt.Font |
getFont()
|
protected java.awt.Font |
getFont(boolean disabled)
|
org.openmali.vecmath2.Colorf |
getFontColor()
|
protected org.openmali.vecmath2.Colorf |
getFontColor(boolean disabled)
|
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. |
float |
getPaddingBottom()
|
float |
getPaddingLeft()
|
float |
getPaddingRight()
|
float |
getPaddingTop()
|
java.lang.String |
getText()
|
Rectangle |
getTextRectangle()
|
float |
getTransparency()
|
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)
|
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)
|
void |
setMinimalSize()
Resizes this Label to the minimum Size needed to contain the whole caption. |
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 |
setText(java.lang.String text)
Sets the new text to be displayed |
void |
setTransparency(float transparency)
Sets the whole Widget's Transparency. |
java.lang.String |
toString()
|
protected void |
updateText()
|
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 java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.openmali.types.twodee.Sized2f |
|---|
setHeight, setWidth |
| Field Detail |
|---|
protected boolean autoSize
| Constructor Detail |
|---|
public Label(float width,
float height,
int zIndex,
java.lang.String text,
Label.Description labelDesc)
width - the new width of this Widgetheight - the new height of this WidgetzIndex - the z-index of this Widgettext - the text to display in this TextWidgetlabelDesc - a LabelDescription instance holding information about font, color, alignment and background-texture
public Label(float width,
float height,
java.lang.String text,
Label.Description labelDesc)
width - the new width of this Widgetheight - the new height of this Widgettext - the text to display in this TextWidgetlabelDesc - a LabelDescription instance holding information about font, color, alignment and background-texture
public Label(org.openmali.types.twodee.Sized2fRO size,
java.lang.String text,
Label.Description labelDesc)
size - the new size of this Widgettext - the text to display in this TextWidgetlabelDesc - a LabelDescription instance holding information about font, color, alignment and background-texture
public Label(org.openmali.types.twodee.Sized2fRO size,
int zIndex,
java.lang.String text,
Label.Description labelDesc)
size - the new size of this WidgetzIndex - the z-index of this Widgettext - the text to display in this TextWidgetlabelDesc - a LabelDescription instance holding information about font, color, alignment and background-texture
public Label(float width,
float height,
int zIndex,
java.lang.String text,
java.awt.Font font,
org.openmali.vecmath2.Colorf color,
TextAlignment alignment)
width - the new width of this Widgetheight - the new height of this WidgetzIndex - the z-index of this Widgettext - the text to display in this TextWidgetfont - the Font to be used for the textcolor - the color to be usedalignment - the horizontal and vertical alignment
public Label(org.openmali.types.twodee.Sized2fRO size,
int zIndex,
java.lang.String text,
java.awt.Font font,
org.openmali.vecmath2.Colorf color,
TextAlignment alignment)
size - the new size of this WidgetzIndex - the z-index of this Widgettext - the text to display in this TextWidgetfont - the Font to be used for the textcolor - the color to be usedalignment - the horizontal and vertical alignment
public Label(org.openmali.types.twodee.Sized2fRO size,
int zIndex,
java.lang.String text,
TextAlignment alignment)
size - the new size of this WidgetzIndex - the z-index of this Widgettext - the text to display in this TextWidgetalignment - the horizontal and vertical alignment
public Label(float width,
float height,
int zIndex,
java.lang.String text,
TextAlignment alignment)
width - the new width of this Widgetheight - the new height of this WidgetzIndex - the z-index of this Widgettext - the text to display in this TextWidgetalignment - the horizontal and vertical alignment
public Label(org.openmali.types.twodee.Sized2fRO size,
java.lang.String text,
TextAlignment alignment)
size - the new size of this Widgettext - the text to display in this TextWidgetalignment - the horizontal and vertical alignment
public Label(float width,
float height,
java.lang.String text,
TextAlignment alignment)
width - the new width of this Widgetheight - the new height of this Widgettext - the text to display in this TextWidgetalignment - the horizontal and vertical alignment
public Label(org.openmali.types.twodee.Sized2fRO size,
int zIndex,
java.lang.String text,
org.openmali.vecmath2.Colorf color,
TextAlignment alignment)
size - the new size of this WidgetzIndex - the z-index of this Widgettext - the text to display in this TextWidgetcolor - the color to be usedalignment - the horizontal and vertical alignment
public Label(float width,
float height,
int zIndex,
java.lang.String text,
org.openmali.vecmath2.Colorf color,
TextAlignment alignment)
width - the new width of this Widgetheight - the new height of this WidgetzIndex - the z-index of this Widgettext - the text to display in this TextWidgetcolor - the color to be usedalignment - the horizontal and vertical alignment
public Label(org.openmali.types.twodee.Sized2fRO size,
java.lang.String text,
org.openmali.vecmath2.Colorf color,
TextAlignment alignment)
size - the new size of this Widgettext - the text to display in this TextWidgetcolor - the color to be usedalignment - the horizontal and vertical alignment
public Label(float width,
float height,
java.lang.String text,
org.openmali.vecmath2.Colorf color,
TextAlignment alignment)
width - the new width of this Widgetheight - the new height of this Widgettext - the text to display in this TextWidgetcolor - the color to be usedalignment - the horizontal and vertical alignment
public Label(org.openmali.types.twodee.Sized2fRO size,
java.lang.String text,
java.awt.Font font,
org.openmali.vecmath2.Colorf color,
TextAlignment alignment)
size - the new size of this Widgettext - the text to display in this TextWidgetfont - the Font to be used for the textcolor - the color to be usedalignment - the horizontal and vertical alignment
public Label(float width,
float height,
java.lang.String text,
java.awt.Font font,
org.openmali.vecmath2.Colorf color,
TextAlignment alignment)
width - the new width of this Widgetheight - the new height of this Widgettext - the text to display in this TextWidgetfont - the Font to be used for the textcolor - the color to be usedalignment - the horizontal and vertical alignment
public Label(org.openmali.types.twodee.Sized2fRO size,
int zIndex,
java.lang.String text,
java.awt.Font font,
org.openmali.vecmath2.Colorf color)
size - the new size of this WidgetzIndex - the z-index of this Widgettext - the text to display in this TextWidgetfont - the Font to be used for the textcolor - the color to be used
public Label(float width,
float height,
int zIndex,
java.lang.String text,
java.awt.Font font,
org.openmali.vecmath2.Colorf color)
width - the new width of this Widgetheight - the new height of this WidgetzIndex - the z-index of this Widgettext - the text to display in this TextWidgetfont - the Font to be used for the textcolor - the color to be used
public Label(org.openmali.types.twodee.Sized2fRO size,
java.lang.String text,
java.awt.Font font,
org.openmali.vecmath2.Colorf color)
size - the new size of this Widgettext - the text to display in this TextWidgetfont - the Font to be used for the textcolor - the color to be used
public Label(float width,
float height,
java.lang.String text,
java.awt.Font font,
org.openmali.vecmath2.Colorf color)
width - the new width of this Widgetheight - the new height of this Widgettext - the text to display in this TextWidgetfont - the Font to be used for the textcolor - the color to be used
public Label(org.openmali.types.twodee.Sized2fRO size,
int zIndex,
java.lang.String text,
org.openmali.vecmath2.Colorf color)
size - the new size of this WidgetzIndex - the z-index of this Widgettext - the text to display in this TextWidgetcolor - the color to be used
public Label(float width,
float height,
int zIndex,
java.lang.String text,
org.openmali.vecmath2.Colorf color)
width - the new width of this Widgetheight - the new height of this WidgetzIndex - the z-index of this Widgettext - the text to display in this TextWidgetcolor - the color to be used
public Label(org.openmali.types.twodee.Sized2fRO size,
java.lang.String text,
org.openmali.vecmath2.Colorf color)
size - the new size of this Widgettext - the text to display in this TextWidgetcolor - the color to be used
public Label(float width,
float height,
java.lang.String text,
org.openmali.vecmath2.Colorf color)
width - the new width of this Widgetheight - the new height of this Widgettext - the text to display in this TextWidgetcolor - the color to be used
public Label(org.openmali.types.twodee.Sized2fRO size,
java.lang.String text,
java.awt.Font font)
size - the new size of this Widgettext - the text to display in this TextWidgetfont - the Font to be used for the text
public Label(float width,
float height,
java.lang.String text,
java.awt.Font font)
width - the new width of this Widgetheight - the new height of this Widgettext - the text to display in this TextWidgetfont - the Font to be used for the text
public Label(org.openmali.types.twodee.Sized2fRO size,
java.lang.String text,
java.awt.Font font,
TextAlignment alignment)
size - the new size of this Widgettext - the text to display in this TextWidgetfont - the Font to be used for the textalignment - the horizontal and vertical alignment
public Label(float width,
float height,
java.lang.String text,
java.awt.Font font,
TextAlignment alignment)
width - the new width of this Widgetheight - the new height of this Widgettext - the text to display in this TextWidgetfont - the Font to be used for the textalignment - the horizontal and vertical alignment
public Label(org.openmali.types.twodee.Sized2fRO size,
int zIndex)
size - the new size of this WidgetzIndex - the z-index of this Widget
public Label(float width,
float height,
int zIndex)
width - the new width of this Widgetheight - the new height of this WidgetzIndex - the z-index of this Widgetpublic Label(org.openmali.types.twodee.Sized2fRO size)
size - the new size of this Widget
public Label(float width,
float height)
width - the new width of this Widgetheight - the new height of this Widget
public Label(org.openmali.types.twodee.Sized2fRO size,
java.lang.String text)
size - the new size of this Widgettext - the text to display in this TextWidget
public Label(float width,
float height,
int zIndex,
java.lang.String text)
width - the new width of this Widgetheight - the new height of this WidgetzIndex - the z-index of this Widgettext - the text to display in this TextWidget
public Label(float width,
float height,
java.lang.String text)
width - the new width of this Widgetheight - the new height of this Widgettext - the text to display in this TextWidget| Method Detail |
|---|
public GroupNode getContentGroup()
public void setTransparency(float transparency)
setTransparency in interface WidgetsetTransparency in class WidgetBasepublic float getTransparency()
getTransparency in interface Widgetpublic void setBackground(org.openmali.vecmath2.Colorf color)
setBackground in interface BackgroundSettablecolor - the color to usepublic void setBackground(java.lang.String texture)
setBackground in interface BackgroundSettabletexture - the texture resource to usepublic void setBackground(Texture texture)
setBackground in interface BackgroundSettabletexture - the texture resource to usepublic Texture getBackground()
getBackground in interface BackgroundSettablepublic org.openmali.vecmath2.Colorf getBackgroundColor()
getBackgroundColor in interface BackgroundSettable
public void setBackgroundTileSize(float tileWidth,
float tileHeight)
setBackgroundTileSize in interface BackgroundSettabletileWidth - the tile width (or negative for no tiling of width)tileHeight - the tile height (or negative for no tiling of height)public void setBackgroundTileSize(org.openmali.types.twodee.Sized2fRO tileSize)
setBackgroundTileSize in interface BackgroundSettabletileSize - the tile size (or null for no tiling)public org.openmali.types.twodee.Sized2fRO getBackgroundTileSize()
getBackgroundTileSize in interface BackgroundSettablepublic float getBackgroundTileWidth()
getBackgroundTileWidth in interface BackgroundSettablepublic float getBackgroundTileHeight()
getBackgroundTileHeight in interface BackgroundSettable
public boolean setPadding(float paddingBottom,
float paddingRight,
float paddingTop,
float paddingLeft)
setPadding in interface PaddingSettablepublic final boolean setPadding(float padding)
setPadding in interface PaddingSettablepadding - padding for bottom, right, top and left
public float getPaddingBottom()
getPaddingBottom in interface PaddingSettablepublic float getPaddingRight()
getPaddingRight in interface PaddingSettablepublic float getPaddingTop()
getPaddingTop in interface PaddingSettablepublic float getPaddingLeft()
getPaddingLeft in interface PaddingSettablepublic void setAutoSizeEnabled(boolean enabled)
enabled - public boolean isAutoSizeEnabled()
public Rectangle getTextRectangle()
protected java.lang.String getDisplayedText()
protected void updateText()
public void setText(java.lang.String text)
setText in interface TextWidgettext - the new Textpublic java.lang.String getText()
getText in interface TextWidgetpublic void setAlignment(TextAlignment alignment)
setAlignment in interface TextWidgetpublic TextAlignment getAlignment()
getAlignment in interface TextWidgetpublic void setFont(java.awt.Font font)
setFont in interface TextWidgetfont - the new Fontpublic final java.awt.Font getFont()
getFont in interface TextWidgetpublic void setFontDisabled(java.awt.Font font)
public final java.awt.Font getFontDisabled()
protected java.awt.Font getFont(boolean disabled)
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 org.openmali.vecmath2.Colorf getFontColor(boolean disabled)
protected void setEnabledImpl(boolean enabled)
public final void setEnabled(boolean enabled)
setEnabled in interface org.jagatoo.datatypes.Enableablepublic final boolean isEnabled()
isEnabled in interface org.jagatoo.datatypes.Enableable
public boolean setSize(float width,
float height,
boolean forced)
setSize in class WidgetBasepublic org.openmali.types.twodee.Dim2f getMinimalSize(org.openmali.types.twodee.Dim2f buffer)
public void setMinimalSize()
protected void fixTranslation(org.openmali.vecmath2.Tuple2f offset)
protected void updateTranslation()
updateTranslation in class WidgetBaseprotected void init()
init in class WidgetBasepublic void setContainer(WidgetContainer container)
setContainer in interface WidgetsetContainer in class WidgetBasecontainer - the new Containerpublic java.lang.String toString()
toString in class WidgetBase
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||