|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.threerings.opengl.gui.LabelRenderer
public class LabelRenderer
Handles the underlying layout and rendering for Label and Button.
| Nested Class Summary | |
|---|---|
protected static class |
LabelRenderer.Config
|
protected static class |
LabelRenderer.Glyphs
|
| Field Summary | |
|---|---|
protected float |
_alpha
|
protected LabelRenderer.Config |
_config
|
protected TextComponent |
_container
|
protected Label.Fit |
_fit
|
protected int |
_gap
|
protected Icon |
_icon
|
protected int |
_ix
|
protected int |
_iy
|
protected int |
_orient
|
protected LabelRenderer.Config |
_prefconfig
|
protected Dimension |
_prefsize
|
protected int |
_prefWidth
|
protected Rectangle |
_srect
|
protected int |
_textRotation
|
protected int |
_tx
|
protected int |
_ty
|
protected String |
_value
|
| Fields inherited from interface com.threerings.opengl.gui.UIConstants |
|---|
BOTTOM, CENTER, DEFAULT_SIZE, DEFAULT_SPACING, GLOW, HORIZONTAL, LEFT, NORMAL, OUTLINE, OVERLAPPING, PLAIN, RIGHT, SHADOW, TOP, VERTICAL |
| Constructor Summary | |
|---|---|
LabelRenderer(TextComponent container)
|
|
| Method Summary | |
|---|---|
Dimension |
computePreferredSize(int whint,
int hhint)
Computes the preferred size of the label. |
protected Dimension |
computeSize(LabelRenderer.Config config)
|
protected static int |
getHeight(int width,
int height,
int rotation)
Returns the height under the supplied rotation. |
Icon |
getIcon()
Returns the icon being displayed by this label. |
int |
getIconTextGap()
Returns the gap between the icon and the text. |
int |
getIconX()
Returns the x coordinate of the icon. |
int |
getIconY()
Returns the y coordinate of the icon. |
protected static int |
getOffsetX(int width,
int height,
int rotation)
Returns the x offset for rotating the supplied dimensions by the specified amount. |
protected static int |
getOffsetY(int width,
int height,
int rotation)
Returns the y offset for rotation the supplied dimensions by the specified amount. |
String |
getText()
Returns the text currently being displayed by this label. |
protected static int |
getWidth(int width,
int height,
int rotation)
Returns the width under the supplied rotation. |
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 LabelRenderer.Config |
layoutConfig(LabelRenderer.Config oconfig,
int twidth)
Creates glyphs for the current text at the specified target width. |
void |
render(Renderer renderer,
int x,
int y,
int contWidth,
int contHeight,
float alpha)
Renders the label text and icon. |
protected void |
renderText(Renderer renderer,
int contWidth,
int contHeight,
float alpha)
|
void |
setFit(Label.Fit mode)
Configures whether this label will wrap, truncate or scale if it cannot fit text into its allotted width. |
void |
setIcon(Icon icon)
Configures the label to display the specified icon. |
void |
setIconTextGap(int gap)
Configures the gap between the icon and the text. |
void |
setOrientation(int orient)
Sets the orientation of this label with respect to its icon. |
void |
setPreferredWidth(int width)
Configures the preferred width of this label (the preferred height will be calculated from the font). |
void |
setText(String text)
Updates the text displayed by this label. |
void |
setTextRotation(int rotation)
Sets the rotation for the text (in ninety degree increments). |
protected void |
useConfig(LabelRenderer.Config config)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected TextComponent _container
protected String _value
protected int _textRotation
protected int _orient
protected int _gap
protected Label.Fit _fit
protected Icon _icon
protected int _ix
protected int _iy
protected LabelRenderer.Config _config
protected int _tx
protected int _ty
protected float _alpha
protected LabelRenderer.Config _prefconfig
protected Dimension _prefsize
protected int _prefWidth
protected Rectangle _srect
| Constructor Detail |
|---|
public LabelRenderer(TextComponent container)
| Method Detail |
|---|
public void setText(String text)
public String getText()
public void setIcon(Icon icon)
public Icon getIcon()
public void setIconTextGap(int gap)
public int getIconTextGap()
public void setTextRotation(int rotation)
public void setOrientation(int orient)
public void setFit(Label.Fit mode)
public void setPreferredWidth(int width)
public Dimension computePreferredSize(int whint,
int hhint)
public void layout(Insets insets,
int contWidth,
int contHeight)
public int getIconX()
public int getIconY()
public void render(Renderer renderer,
int x,
int y,
int contWidth,
int contHeight,
float alpha)
protected void renderText(Renderer renderer,
int contWidth,
int contHeight,
float alpha)
protected Dimension computeSize(LabelRenderer.Config config)
protected int getXOffset(Insets insets,
int contWidth,
int width)
protected int getYOffset(Insets insets,
int contHeight,
int height)
protected LabelRenderer.Config layoutConfig(LabelRenderer.Config oconfig,
int twidth)
protected void useConfig(LabelRenderer.Config config)
protected static int getWidth(int width,
int height,
int rotation)
protected static int getHeight(int width,
int height,
int rotation)
protected static int getOffsetX(int width,
int height,
int rotation)
protected static int getOffsetY(int width,
int height,
int rotation)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||