|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.jmex.bui.Label
public class Label
Handles the underlying layout and rendering for BLabel and BButton.
| Nested Class Summary | |
|---|---|
protected static class |
Label.Config
|
protected static class |
Label.Text
|
| Field Summary | |
|---|---|
protected float |
_alpha
|
protected Label.Config |
_config
|
protected BTextComponent |
_container
|
protected BLabel.Fit |
_fit
|
protected int |
_gap
|
protected BIcon |
_icon
|
protected int |
_ix
|
protected int |
_iy
|
protected Orientation |
_orient
|
protected Label.Config |
_prefconfig
|
protected Dimension |
_prefsize
|
protected Rectangle |
_srect
|
protected int |
_tx
|
protected int |
_ty
|
protected java.lang.String |
_value
|
| Fields inherited from interface com.jmex.bui.BConstants |
|---|
DEFAULT_SIZE, DEFAULT_SPACING |
| Constructor Summary | |
|---|---|
Label(BTextComponent container)
|
|
| Method Summary | |
|---|---|
Dimension |
computePreferredSize(int whint,
int hhint)
Computes the preferred size of the label. |
protected Dimension |
computeSize(Label.Config config)
|
BIcon |
getIcon()
Returns the icon being displayed by this label. |
int |
getIconTextGap()
Returns the gap between the icon and the text. |
java.lang.String |
getText()
Returns the text currently being displayed by this label. |
protected int |
getXOffset(Insets insets,
int contWidth,
int width)
|
protected int |
getYOffset(Insets insets,
int contHeight,
int height)
|
void |
layout(Insets insets,
int contWidth,
int contHeight)
Lays out the label text and icon. |
protected Label.Config |
layoutConfig(Label.Config oconfig,
int twidth)
Creates glyphs for the current text at the specified target width. |
void |
releaseText()
Releases any underlying texture resources created by this label. |
void |
render(com.jme.renderer.Renderer renderer,
int x,
int y,
int contWidth,
int contHeight,
float alpha)
Renders the label text and icon. |
protected void |
renderText(com.jme.renderer.Renderer renderer,
int contWidth,
int contHeight,
float alpha)
|
void |
setFit(BLabel.Fit mode)
Configures whether this label will wrap, truncate or scale if it cannot fit text into its allotted width. |
void |
setIcon(BIcon icon)
Configures the label to display the specified icon. |
void |
setIconTextGap(int gap)
Configures the gap between the icon and the text. |
void |
setOrientation(Orientation orient)
Sets the orientation of this label with respect to its icon. |
void |
setText(java.lang.String text)
Updates the text displayed by this label. |
protected void |
useConfig(Label.Config config)
|
void |
wasAdded()
Called by our containing component when it was added to the interface hierarchy. |
void |
wasRemoved()
Called by our containing component when it was removed from the interface hierarchy. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected BTextComponent _container
protected java.lang.String _value
protected Orientation _orient
protected int _gap
protected BLabel.Fit _fit
protected BIcon _icon
protected int _ix
protected int _iy
protected Label.Config _config
protected int _tx
protected int _ty
protected float _alpha
protected Label.Config _prefconfig
protected Dimension _prefsize
protected Rectangle _srect
| Constructor Detail |
|---|
public Label(BTextComponent container)
| Method Detail |
|---|
public void setText(java.lang.String text)
text - Stringpublic java.lang.String getText()
public void setIcon(BIcon icon)
icon - BIconpublic BIcon getIcon()
public void setIconTextGap(int gap)
gap - intpublic int getIconTextGap()
public void setOrientation(Orientation orient)
orient - Orientationpublic void setFit(BLabel.Fit mode)
mode - BLabel.Fitpublic void wasAdded()
public void wasRemoved()
public Dimension computePreferredSize(int whint,
int hhint)
whint - inthhint - int
public void layout(Insets insets,
int contWidth,
int contHeight)
insets - InsetscontWidth - intcontHeight - intpublic void releaseText()
public void render(com.jme.renderer.Renderer renderer,
int x,
int y,
int contWidth,
int contHeight,
float alpha)
renderer - Rendererx - inty - intcontWidth - intcontHeight - intalpha - float
protected void renderText(com.jme.renderer.Renderer renderer,
int contWidth,
int contHeight,
float alpha)
renderer - RenderercontWidth - intcontHeight - intalpha - floatprotected Dimension computeSize(Label.Config config)
config - Config
protected int getXOffset(Insets insets,
int contWidth,
int width)
insets - InsetscontWidth - intwidth - int
protected int getYOffset(Insets insets,
int contHeight,
int height)
insets - InsetscontHeight - intheight - int
protected Label.Config layoutConfig(Label.Config oconfig,
int twidth)
oconfig - Configtwidth - int
protected void useConfig(Label.Config config)
config - Config
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||