|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.threerings.media.AbstractMedia
com.threerings.media.sprite.Sprite
com.threerings.media.sprite.LabelSprite
public class LabelSprite
A sprite that uses a label to render itself. If the label has not been
previously laid out (see Label.layout(java.awt.Component)) it will be done when the
sprite is added to a media panel. If the label is altered after the
sprite is created, updateBounds() should be called.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.threerings.media.sprite.Sprite |
|---|
Sprite.CancelledOp, Sprite.CompletedOp |
| Field Summary | |
|---|---|
protected boolean |
_antiAliased
Whether or not to use anti-aliased rendering. |
protected Label |
_label
The label associated with this sprite. |
| Fields inherited from class com.threerings.media.sprite.Sprite |
|---|
_orient, _ox, _oxoff, _oy, _oyoff, _path, _pathStamp |
| Fields inherited from class com.threerings.media.AbstractMedia |
|---|
_bounds, _firstTick, _mgr, _observers, _renderOrder, HUD_LAYER |
| Fields inherited from interface com.threerings.util.DirectionCodes |
|---|
CARDINAL_DIRECTIONS, CCW, CW, DIRECTION_COUNT, DOWN, EAST, EASTNORTHEAST, EASTSOUTHEAST, FINE_DIRECTION_COUNT, HORIZONTAL, LEFT, NONE, NORTH, NORTHEAST, NORTHNORTHEAST, NORTHNORTHWEST, NORTHWEST, RIGHT, SOUTH, SOUTHEAST, SOUTHSOUTHEAST, SOUTHSOUTHWEST, SOUTHWEST, UP, VERTICAL, WEST, WESTNORTHWEST, WESTSOUTHWEST |
| Constructor Summary | |
|---|---|
LabelSprite(Label label)
Constructs a label sprite that renders itself with the specified label. |
|
| Method Summary | |
|---|---|
Label |
getLabel()
Returns the label displayed by this sprite. |
protected void |
init()
Called when the media has had its manager set. |
protected void |
layoutLabel()
Lays out our underlying label which must be done if the text is changed. |
void |
paint(Graphics2D gfx)
Called by the appropriate manager to request that the media render itself with the given graphics context. |
void |
setAntiAliased(boolean antiAliased)
Indicates that our label should be rendered with antialiased text. |
void |
updateBounds()
Updates the bounds of the sprite after a change to the label. |
| Methods inherited from class com.threerings.media.sprite.Sprite |
|---|
addSpriteObserver, cancelMove, contains, fastForward, getHeight, getOrientation, getPath, getWidth, getX, getXOffset, getY, getYOffset, hitTest, inside, intersects, isMoving, move, paintPath, pathBeginning, pathCompleted, removeSpriteObserver, setLocation, setOrientation, shutdown, tick, tickPath, toString, updateRenderOrigin, viewLocationDidChange |
| Methods inherited from class com.threerings.media.AbstractMedia |
|---|
addObserver, contains, contains, contains, contains, getBounds, getBounds2D, getPathIterator, getPathIterator, getRenderOrder, init, intersects, intersects, invalidate, invalidateAfterChange, naturalCompareTo, queueNotification, removeObserver, renderCompareTo, setRenderOrder, toString, willStart |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.threerings.media.util.Pathable |
|---|
getBounds |
| Field Detail |
|---|
protected Label _label
protected boolean _antiAliased
| Constructor Detail |
|---|
public LabelSprite(Label label)
| Method Detail |
|---|
public Label getLabel()
public void setAntiAliased(boolean antiAliased)
public void updateBounds()
protected void init()
AbstractMediasuper.init().
init in class AbstractMediapublic void paint(Graphics2D gfx)
AbstractMedia
paint in class Spriteprotected void layoutLabel()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||