public class Label extends AbstractRenderable implements Highlightable, Movable
TextAttributes
.Constructor and Description |
---|
Label(Position position,
java.lang.String text)
Constructs a label that displays text at a geographic position.
|
Label(Position position,
java.lang.String text,
TextAttributes attributes)
Constructs a label with specified attributes that displays text at a geographic position.
|
Label(Position position,
TextAttributes attributes)
Constructs a label with specified attributes that displays at a geographic position once its text is set to a
non-null value.
|
Modifier and Type | Method and Description |
---|---|
int |
getAltitudeMode()
Indicates the altitude mode associated with this label's position.
|
TextAttributes |
getAttributes()
Indicates this label's "normal" attributes, that is the attributes used when the label's highlighted flag is
false.
|
TextAttributes |
getHighlightAttributes()
Gets the attributes used when this label's highlighted flag is true.
|
Position |
getPosition()
Indicates the geographic position where this label is displayed.
|
Position |
getReferencePosition()
A position associated with the object that indicates its aggregate geographic position.
|
java.lang.String |
getText()
Indicates the text displayed by this label.
|
boolean |
isHighlighted()
Indicates whether this label uses its highlight attributes rather than its normal attributes.
|
void |
moveTo(Globe globe,
Position position)
Moves the shape over the globe's surface.
|
Label |
setAltitudeMode(int altitudeMode)
Sets the altitude mode associated with this label's position.
|
Label |
setAttributes(TextAttributes attributes)
Sets this label's attributes to the supplied attributes bundle.
|
Label |
setHighlightAttributes(TextAttributes highlightAttributes)
Sets the attributes used when this label's highlighted flag is true.
|
void |
setHighlighted(boolean highlighted)
Sets the highlighted state of this label, which indicates whether this label uses its highlight attributes rather
than its normal attributes.
|
Label |
setPosition(Position position)
Sets this label's geographic position to the values in the supplied position.
|
Label |
setText(java.lang.String text)
Sets the text displayed by this label.
|
getDisplayName, getPickDelegate, getUserProperty, hasUserProperty, isEnabled, putUserProperty, removeUserProperty, render, setDisplayName, setEnabled, setPickDelegate
public Label(Position position, java.lang.String text)
position
- the position where the label is displayedtext
- the text to display, or null to display nothingjava.lang.IllegalArgumentException
- If the position is nullpublic Label(Position position, TextAttributes attributes)
position
- the position where the label is displayedattributes
- a reference to an attributes bundle used by this label when not highlightedjava.lang.IllegalArgumentException
- If the position is nullpublic Label(Position position, java.lang.String text, TextAttributes attributes)
position
- the position where the label is displayedtext
- the text to display, or null to display nothingattributes
- a reference to an attributes bundle used by this label when not highlightedjava.lang.IllegalArgumentException
- If the position is nullpublic Position getPosition()
public Label setPosition(Position position)
position
- the new position where this label is displayedjava.lang.IllegalArgumentException
- If the position is nullpublic int getAltitudeMode()
WorldWind.AltitudeMode
for possiblepublic Label setAltitudeMode(int altitudeMode)
altitudeMode
- the new altitude mode, see WorldWind.AltitudeMode
for acceptable
valuespublic java.lang.String getText()
public Label setText(java.lang.String text)
text
- the text to display, or null to display nothingpublic TextAttributes getAttributes()
public Label setAttributes(TextAttributes attributes)
attributes
- a reference to an attributes bundle used by this label when not highlightedpublic TextAttributes getHighlightAttributes()
public Label setHighlightAttributes(TextAttributes highlightAttributes)
highlightAttributes
- a reference to the attributes bundle used by this label when highlightedpublic boolean isHighlighted()
isHighlighted
in interface Highlightable
public void setHighlighted(boolean highlighted)
setHighlighted
in interface Highlightable
highlighted
- true to highlight this label, and false otherwisepublic Position getReferencePosition()
getReferencePosition
in interface Movable
getPosition()
public void moveTo(Globe globe, Position position)
setPosition(Position)
.