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.
|
double |
getRotation()
Indicates the rotation applied to this label.
|
int |
getRotationMode()
Indicates the orientation mode used to interpret this label's rotation.
|
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 |
setRotation(double degrees)
Sets the amount of rotation applied to this label.
|
Label |
setRotationMode(int orientationMode)
Sets the orientation mode this label uses to interpret its rotation.
|
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 double getRotation()
getRotationMode()
public Label setRotation(double degrees)
degrees
- this label's new rotation amount in degrees, or zero to apply no rotation relative to this label's
orientation referencesetRotationMode(int)
public int getRotationMode()
WorldWind.RELATIVE_TO_SCREEN
- The label's orientation is fixed relative to the screen. Rotation indicates
clockwise degrees relative to the screen's vertical axis. This is the default mode.WorldWind.RELATIVE_TO_GLOBE
- The label's orientation is fixed relative to the globe. Rotation indicates
clockwise degrees relative to North.public Label setRotationMode(int orientationMode)
WorldWind.RELATIVE_TO_SCREEN
- The label's orientation is fixed relative to the screen. Rotation indicates
clockwise degrees relative to the screen's vertical axis. This is the default mode.WorldWind.RELATIVE_TO_GLOBE
- The label's orientation is fixed relative to the globe. Rotation indicates
clockwise degrees relative to North.orientationMode
- the orientation mode used to interpret this label's rotationpublic 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)
.