NASA World Wind

gov.nasa.worldwind.symbology
Class TacticalGraphicLabel

java.lang.Object
  extended by gov.nasa.worldwind.symbology.TacticalGraphicLabel
All Implemented Interfaces:
OrderedRenderable, Renderable

public class TacticalGraphicLabel
extends Object
implements OrderedRenderable

A label drawn as part of a tactical graphic. The label is drawn at constant screen size. The label can include multiple lines of text, and can optionally be kept aligned with features on the globe. To align a label with the globe specify an orientationPosition for the label. The label will be drawn along a line connecting the label's position to the orientation position.


Field Summary
protected  OGLStackHandler BEogsh
          Stack handler used for beginDrawing/endDrawing state.
protected  Rectangle2D bounds
          Size of the label.
static Font DEFAULT_FONT
          Default font.
static Insets DEFAULT_INSETS
          Default insets around the label.
static double DEFAULT_INTERIOR_OPACITY
          Default interior opacity.
static Offset DEFAULT_OFFSET
          Default offset.
static String DEFAULT_TEXT_EFFECT
          Default text effect (shadow).
protected  Object delegateOwner
          Indicates an object that represents the label during picking.
protected  boolean drawInterior
          Indicates whether or not to draw the label interior.
protected  String effect
          Effect applied to the text.
protected  boolean enableBatchPicking
          Indicates whether or not batch picking is enabled.
protected  boolean enableBatchRendering
          Indicates whether or not batch rendering is enabled.
protected  double eyeDistance
          Distance from the eye point to the label's geographic location.
protected  Font font
          Font used to draw the label.
protected  long frameTimeStamp
           
protected  Insets insets
          Insets that separate the text from its frame.
protected  double interiorOpacity
           
protected  Rectangle2D[] lineBounds
          Cached bounds for each line of text.
protected  int lineHeight
          Height of a line of text, computed in computeBoundsIfNeeded(gov.nasa.worldwind.render.DrawContext).
protected  String[] lines
          Text split into separate lines.
protected  int lineSpacing
          Space (in pixels) between lines in a multi-line label.
protected  Material material
          Material used to draw the label.
protected  Offset offset
          Offset from the geographic position at which to draw the label.
protected  double opacity
          Opacity of the text, as a value between 0 and 1.
protected  Position orientationPosition
          The label is drawn along a line from the label position to the orientation position.
protected  Layer pickLayer
          Active layer.
protected  PickSupport pickSupport
          Support object used during picking.
protected  Vec4 placePoint
          Geographic position in cartesian coordinates.
protected  Position position
          The label's geographic position.
protected  Angle rotation
          Rotation applied to the label.
protected  Rectangle screenExtent
          Extent of the label on the screen.
protected  Vec4 screenPlacePoint
          Location of the place point projected onto the screen.
protected  Point screenPoint
          Location of the upper left corner of the text measured from the lower left corner of the viewport.
protected  String textAlign
          Text alignment for multi-line labels.
 
Constructor Summary
TacticalGraphicLabel()
          Create a new empty label.
TacticalGraphicLabel(String text)
          Create a new label.
 
Method Summary
protected  void beginDrawing(DrawContext dc)
          Establish the OpenGL state needed to draw text.
protected  Color computeBackgroundColor(Color color)
          Compute a contrasting background color to draw the label's outline.
protected  void computeBoundsIfNeeded(DrawContext dc)
          Compute the bounds of the text, if necessary.
protected  void computeGeometry(DrawContext dc)
          Compute the label's screen position from its geographic position.
protected  void computeGeometryIfNeeded(DrawContext dc)
          Compute label geometry, if it has not already been computed this frame, or if the label position has changed since the extent was last computed.
protected  Rectangle computeRotatedScreenExtent(Rectangle rect, int x, int y, Angle rotation)
          Compute the bounding screen extent of a rotated rectangle.
protected  Angle computeRotation(Vec4 screenPoint, Vec4 orientationScreenPoint)
          Compute the amount of rotation to apply to a label in order to keep it oriented toward its orientation position.
protected  Rectangle computeTextExtent(int x, int y, Angle rotation)
          Determine the screen rectangle covered by a label.
protected  void doDrawOrderedRenderable(DrawContext dc, PickSupport pickSupport)
          Draw this label during ordered rendering.
protected  void doDrawText(TextRenderer textRenderer)
          Draw the label's text.
protected  void doPick(DrawContext dc, PickSupport pickSupport)
          Draw labels for picking.
protected  void drawBatched(DrawContext dc)
          Draws this ordered renderable and all subsequent Label ordered renderables in the ordered renderable list.
protected  void drawBatchedText(DrawContext dc, TextRenderer textRenderer)
          Draws text for subsequent Label ordered renderables in the ordered renderable list.
protected  void drawInterior(DrawContext dc)
          Render the label interior as a filled rectangle.
protected  void drawMultiLineText(TextRenderer textRenderer, int x, int y)
           
protected  void drawOrderedRenderable(DrawContext dc)
          Draws the graphic as an ordered renderable.
protected  void drawText(DrawContext dc, TextRenderer textRenderer)
          Draw the label's text.
protected  void endDrawing(DrawContext dc)
          Pop the state set in beginDrawing.
 Rectangle getBounds(DrawContext dc)
          Get the label bounding Rectangle using OGL coordinates - bottom-left corner x and y relative to the WorldWindow bottom-left corner.
 Object getDelegateOwner()
          Returns the delegate owner of this label.
 double getDistanceFromEye()
          Returns the ordered renderable's distance from the current view's eye point.
 String getEffect()
          Indicates an effect used to decorate the text.
 Font getFont()
          Indicates the font used to draw the label.
 Insets getInsets()
          Indicates the amount of space between the label's content and its frame, in pixels.
 double getInteriorOpacity()
          Indicates the opacity of label's interior as a floating-point value in the range 0.0 to 1.0.
 int getLineSpacing()
          Indicates the line spacing applied to multi-line labels.
 Material getMaterial()
          Indicates the material used to draw the label.
 Offset getOffset()
          Indicates the offset from the geographic position at which to draw the label.
 double getOpacity()
          Indicates the opacity of the text as a floating-point value in the range 0.0 to 1.0.
 Position getOrientationPosition()
          Indicates the orientation position.
protected  Object getPickedObject()
          Indicates the object that represents this label during picking.
 Position getPosition()
          Indicates the label's position.
 String getText()
          Indicates the text of this label.
 String getTextAlign()
          Indicates the current text alignment.
protected  boolean intersectsFrustum(DrawContext dc)
          Determine if this label intersects the view or pick frustum.
 boolean isDrawInterior()
          Indicates whether or not to draw a colored frame behind the label.
 boolean isEnableBatchPicking()
          Indicates whether batch picking is enabled.
 boolean isEnableBatchRendering()
          Indicates whether batch rendering is enabled.
protected  void makeOrderedRenderable(DrawContext dc)
          Draws the graphic as an ordered renderable.
 void pick(DrawContext dc, Point pickPoint)
          Executes a pick of the ordered renderable.
 void render(DrawContext dc)
          Causes this Renderable to render itself using the provided draw context.
 void setDelegateOwner(Object owner)
          Specifies the delegate owner of this label.
 void setDrawInterior(boolean drawInterior)
          Specifies whether or not to draw a colored frame behind the label.
 void setEffect(String effect)
          Specifies an effect used to decorate the text.
 void setEnableBatchPicking(boolean enableBatchPicking)
          Specifies whether adjacent Labels in the ordered renderable list may be pick-tested together if they are contained in the same layer.
 void setEnableBatchRendering(boolean enableBatchRendering)
          Specifies whether adjacent Labels in the ordered renderable list may be rendered together if they are contained in the same layer.
 void setFont(Font font)
          Specifies the font used to draw the label.
 void setInsets(Insets insets)
          Specifies the amount of space (in pixels) between the label's content and the edges of the label's frame.
 void setInteriorOpacity(double interiorOpacity)
          Specifies the opacity of the label's interior as a floating-point value in the range 0.0 to 1.0.
 void setLineSpacing(int lineSpacing)
          Specifies the line spacing applied to multi-line labels.
 void setMaterial(Material material)
          Specifies the material used to draw the label.
 void setOffset(Offset offset)
          Specifies the offset from the geographic position at which to draw the label.
 void setOpacity(double opacity)
          Specifies the opacity of the text as a floating-point value in the range 0.0 to 1.0.
 void setOrientationPosition(Position orientationPosition)
          Specifies the orientation position.
 void setPosition(Position position)
          Indicates the label's geographic position.
 void setText(String text)
          Specifies the text of this label.
 void setTextAlign(String textAlign)
          Specifies the text alignment.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BEogsh

protected OGLStackHandler BEogsh
Stack handler used for beginDrawing/endDrawing state.


bounds

protected Rectangle2D bounds
Size of the label.


DEFAULT_FONT

public static final Font DEFAULT_FONT
Default font.


DEFAULT_INSETS

public static final Insets DEFAULT_INSETS
Default insets around the label.


DEFAULT_INTERIOR_OPACITY

public static final double DEFAULT_INTERIOR_OPACITY
Default interior opacity.

See Also:
Constant Field Values

DEFAULT_OFFSET

public static final Offset DEFAULT_OFFSET
Default offset. The default offset aligns the label horizontal with the text alignment position, and centers the label vertically. For example, if the text alignment is AVKey.LEFT, then the left edge of the text will be aligned with the geographic position, and the label will be centered vertically.


DEFAULT_TEXT_EFFECT

public static final String DEFAULT_TEXT_EFFECT
Default text effect (shadow).

See Also:
Constant Field Values

delegateOwner

protected Object delegateOwner
Indicates an object that represents the label during picking.


drawInterior

protected boolean drawInterior
Indicates whether or not to draw the label interior.


effect

protected String effect
Effect applied to the text. May be AVKey.TEXT_EFFECT_SHADOW or AVKey.TEXT_EFFECT_NONE.


enableBatchPicking

protected boolean enableBatchPicking
Indicates whether or not batch picking is enabled.


enableBatchRendering

protected boolean enableBatchRendering
Indicates whether or not batch rendering is enabled.


eyeDistance

protected double eyeDistance
Distance from the eye point to the label's geographic location.


font

protected Font font
Font used to draw the label.


frameTimeStamp

protected long frameTimeStamp

insets

protected Insets insets
Insets that separate the text from its frame. Only applies when the text interior is rendered.


interiorOpacity

protected double interiorOpacity

lineBounds

protected Rectangle2D[] lineBounds
Cached bounds for each line of text.


lineHeight

protected int lineHeight
Height of a line of text, computed in computeBoundsIfNeeded(gov.nasa.worldwind.render.DrawContext).


lines

protected String[] lines
Text split into separate lines.


lineSpacing

protected int lineSpacing
Space (in pixels) between lines in a multi-line label.


material

protected Material material
Material used to draw the label.


offset

protected Offset offset
Offset from the geographic position at which to draw the label.


opacity

protected double opacity
Opacity of the text, as a value between 0 and 1.


orientationPosition

protected Position orientationPosition
The label is drawn along a line from the label position to the orientation position.


pickLayer

protected Layer pickLayer
Active layer.


pickSupport

protected PickSupport pickSupport
Support object used during picking.


placePoint

protected Vec4 placePoint
Geographic position in cartesian coordinates.


position

protected Position position
The label's geographic position.


rotation

protected Angle rotation
Rotation applied to the label. This is computed each frame based on the orientation position.


screenExtent

protected Rectangle screenExtent
Extent of the label on the screen.


screenPlacePoint

protected Vec4 screenPlacePoint
Location of the place point projected onto the screen.


screenPoint

protected Point screenPoint
Location of the upper left corner of the text measured from the lower left corner of the viewport. This point in OGL coordinates.


textAlign

protected String textAlign
Text alignment for multi-line labels.

Constructor Detail

TacticalGraphicLabel

public TacticalGraphicLabel()
Create a new empty label.


TacticalGraphicLabel

public TacticalGraphicLabel(String text)
Create a new label.

Parameters:
text - Label text.
Method Detail

beginDrawing

protected void beginDrawing(DrawContext dc)
Establish the OpenGL state needed to draw text.

Parameters:
dc - the current draw context.

computeBackgroundColor

protected Color computeBackgroundColor(Color color)
Compute a contrasting background color to draw the label's outline.

Parameters:
color - Label color.
Returns:
A color that contrasts with color.

computeBoundsIfNeeded

protected void computeBoundsIfNeeded(DrawContext dc)
Compute the bounds of the text, if necessary.

Parameters:
dc - the current DrawContext.

computeGeometry

protected void computeGeometry(DrawContext dc)
Compute the label's screen position from its geographic position.

Parameters:
dc - Current draw context.

computeGeometryIfNeeded

protected void computeGeometryIfNeeded(DrawContext dc)
Compute label geometry, if it has not already been computed this frame, or if the label position has changed since the extent was last computed.

Parameters:
dc - Current geometry.

computeRotatedScreenExtent

protected Rectangle computeRotatedScreenExtent(Rectangle rect,
                                               int x,
                                               int y,
                                               Angle rotation)
Compute the bounding screen extent of a rotated rectangle.

Parameters:
rect - Rectangle to rotate.
x - X coordinate of the rotation point.
y - Y coordinate of the rotation point.
rotation - Rotation angle.
Returns:
The smallest rectangle that completely contains rect when rotated by the specified angle.

computeRotation

protected Angle computeRotation(Vec4 screenPoint,
                                Vec4 orientationScreenPoint)
Compute the amount of rotation to apply to a label in order to keep it oriented toward its orientation position.

Parameters:
screenPoint - Geographic position of the text, projected onto the screen.
orientationScreenPoint - Orientation position, projected onto the screen.
Returns:
The rotation angle to apply when drawing the label.

computeTextExtent

protected Rectangle computeTextExtent(int x,
                                      int y,
                                      Angle rotation)
Determine the screen rectangle covered by a label. The input coordinate identifies either the top left, top center, or top right corner of the label, depending on the text alignment. If the label is rotated to align with features on the surface then the extent will be the smallest screen rectangle that completely encloses the rotated label.

Parameters:
x - X coordinate at which to draw the label.
y - Y coordinate at which to draw the label.
rotation - Label rotation.
Returns:
The rectangle, in OGL screen coordinates (origin at bottom left corner), that is covered by the label.

doDrawOrderedRenderable

protected void doDrawOrderedRenderable(DrawContext dc,
                                       PickSupport pickSupport)
Draw this label during ordered rendering.

Parameters:
dc - Current draw context.
pickSupport - Support object used during picking.

doDrawText

protected void doDrawText(TextRenderer textRenderer)
Draw the label's text. This method assumes that the text renderer context has already been set up.

Parameters:
textRenderer - renderer to use.

doPick

protected void doPick(DrawContext dc,
                      PickSupport pickSupport)
Draw labels for picking.

Parameters:
dc - Current draw context.
pickSupport - the PickSupport instance to be used.

drawBatched

protected void drawBatched(DrawContext dc)
Draws this ordered renderable and all subsequent Label ordered renderables in the ordered renderable list. This method differs from drawBatchedText in that this method re-initializes the text renderer to draw the next label, while drawBatchedText re-uses the active text renderer context. That is, drawBatchedText attempts to draw as many labels as possible that share same text renderer configuration as this label, and this method attempts to draw as many labels as possible regardless of the text renderer configuration of the subsequent labels.

Parameters:
dc - the current draw context.

drawBatchedText

protected void drawBatchedText(DrawContext dc,
                               TextRenderer textRenderer)
Draws text for subsequent Label ordered renderables in the ordered renderable list. This method is called after the text renderer has been set up (after beginRendering has been called), so this method can only draw text for subsequent labels that use the same font and rotation as this label. This method differs from drawBatched in that this method reuses the active text renderer context to draw as many labels as possible without switching text renderer state.

Parameters:
dc - the current draw context.
textRenderer - Text renderer used to draw the label.

drawInterior

protected void drawInterior(DrawContext dc)
Render the label interior as a filled rectangle.

Parameters:
dc - Current draw context.

drawMultiLineText

protected void drawMultiLineText(TextRenderer textRenderer,
                                 int x,
                                 int y)

drawOrderedRenderable

protected void drawOrderedRenderable(DrawContext dc)
Draws the graphic as an ordered renderable.

Parameters:
dc - the current draw context.

drawText

protected void drawText(DrawContext dc,
                        TextRenderer textRenderer)
Draw the label's text. This method sets up the text renderer, and then calls doDrawText to actually draw the text.

Parameters:
dc - Current draw context.
textRenderer - Text renderer.

endDrawing

protected void endDrawing(DrawContext dc)
Pop the state set in beginDrawing.

Parameters:
dc - the current draw context.

getBounds

public Rectangle getBounds(DrawContext dc)
Get the label bounding Rectangle using OGL coordinates - bottom-left corner x and y relative to the WorldWindow bottom-left corner. If the label is rotated then the returned rectangle is the bounding rectangle of the rotated label.

Parameters:
dc - the current DrawContext.
Returns:
the label bounding Rectangle using OGL viewport coordinates.
Throws:
IllegalArgumentException - if dc is null.

getDelegateOwner

public Object getDelegateOwner()
Returns the delegate owner of this label. If non-null, the returned object replaces the label as the pickable object returned during picking. If null, the label itself is the pickable object returned during picking.

Returns:
the object used as the pickable object returned during picking, or null to indicate the the label is returned during picking.

getDistanceFromEye

public double getDistanceFromEye()
Returns the ordered renderable's distance from the current view's eye point. Intended to be used only to sort a list of ordered renderables according to eye distance, and only during frame generation when a view is active.

Specified by:
getDistanceFromEye in interface OrderedRenderable
Returns:
the distance of the ordered renderable from the current view's eye point.

getEffect

public String getEffect()
Indicates an effect used to decorate the text. Can be one of AVKey.TEXT_EFFECT_SHADOW (default), or AVKey.TEXT_EFFECT_NONE.

Returns:
the effect used for text rendering

getFont

public Font getFont()
Indicates the font used to draw the label.

Returns:
The label's font.

getInsets

public Insets getInsets()
Indicates the amount of space between the label's content and its frame, in pixels.

Returns:
the padding between the label's content and its frame, in pixels.
See Also:
setInsets(java.awt.Insets)

getInteriorOpacity

public double getInteriorOpacity()
Indicates the opacity of label's interior as a floating-point value in the range 0.0 to 1.0. A value of 1.0 specifies a completely opaque interior, and 0.0 specifies a completely transparent interior. Values in between specify a partially transparent interior.

Returns:
the opacity of the interior as a floating-point value from 0.0 to 1.0.

getLineSpacing

public int getLineSpacing()
Indicates the line spacing applied to multi-line labels.

Returns:
The space (in pixels) between lines of a multi-line label.

getMaterial

public Material getMaterial()
Indicates the material used to draw the label.

Returns:
The label's material.

getOffset

public Offset getOffset()
Indicates the offset from the geographic position at which to draw the label. See setOffset for more information on how the offset is interpreted.

Returns:
The offset at which to draw the label.

getOpacity

public double getOpacity()
Indicates the opacity of the text as a floating-point value in the range 0.0 to 1.0. A value of 1.0 specifies a completely opaque text, and 0.0 specifies a completely transparent text. Values in between specify a partially transparent text.

Returns:
the opacity of the text as a floating-point value from 0.0 to 1.0.

getOrientationPosition

public Position getOrientationPosition()
Indicates the orientation position. The label oriented on a line drawn from the label's position to the orientation position.

Returns:
Position used to orient the label. May be null.

getPickedObject

protected Object getPickedObject()
Indicates the object that represents this label during picking.

Returns:
If a delegate owner is set, returns the delegate owner. Otherwise returns this label.

getPosition

public Position getPosition()
Indicates the label's position. The label is drawn at an offset from this position.

Returns:
The label's geographic position.
See Also:
getOffset()

getText

public String getText()
Indicates the text of this label.

Returns:
The label's text.

getTextAlign

public String getTextAlign()
Indicates the current text alignment. Can be one of AVKey.LEFT (default), AVKey.CENTER or AVKey.RIGHT.

Returns:
the current text alignment.

intersectsFrustum

protected boolean intersectsFrustum(DrawContext dc)
Determine if this label intersects the view or pick frustum.

Parameters:
dc - Current draw context.
Returns:
True if this label intersects the active frustum (view or pick). Otherwise false.

isDrawInterior

public boolean isDrawInterior()
Indicates whether or not to draw a colored frame behind the label.

Returns:
true if the label's interior is drawn, otherwise false.
See Also:
setDrawInterior(boolean)

isEnableBatchPicking

public boolean isEnableBatchPicking()
Indicates whether batch picking is enabled.

Returns:
true if batch rendering is enabled, otherwise false.
See Also:
setEnableBatchPicking(boolean).

isEnableBatchRendering

public boolean isEnableBatchRendering()
Indicates whether batch rendering is enabled.

Returns:
true if batch rendering is enabled, otherwise false.
See Also:
setEnableBatchRendering(boolean).

makeOrderedRenderable

protected void makeOrderedRenderable(DrawContext dc)
Draws the graphic as an ordered renderable.

Parameters:
dc - the current draw context.

pick

public void pick(DrawContext dc,
                 Point pickPoint)
Executes a pick of the ordered renderable.

Specified by:
pick in interface OrderedRenderable
Parameters:
dc - the current draw context.
pickPoint - the pick point.

render

public void render(DrawContext dc)
Causes this Renderable to render itself using the provided draw context.

Specified by:
render in interface Renderable
Parameters:
dc - the DrawContext to be used
See Also:
DrawContext

setDelegateOwner

public void setDelegateOwner(Object owner)
Specifies the delegate owner of this label. If non-null, the delegate owner replaces the label as the pickable object returned during picking. If null, the label itself is the pickable object returned during picking.

Parameters:
owner - the object to use as the pickable object returned during picking, or null to return the label.

setDrawInterior

public void setDrawInterior(boolean drawInterior)
Specifies whether or not to draw a colored frame behind the label.

Parameters:
drawInterior - true if the label's interior is drawn, otherwise false.
See Also:
isDrawInterior()

setEffect

public void setEffect(String effect)
Specifies an effect used to decorate the text. Can be one of AVKey.TEXT_EFFECT_SHADOW (default), or AVKey.TEXT_EFFECT_NONE.

Parameters:
effect - the effect to use for text rendering

setEnableBatchPicking

public void setEnableBatchPicking(boolean enableBatchPicking)
Specifies whether adjacent Labels in the ordered renderable list may be pick-tested together if they are contained in the same layer. This increases performance but allows only the top-most of the label to be reported in a SelectEvent even if several of the labels are at the pick position.

Batch rendering (setEnableBatchRendering(boolean)) must be enabled in order for batch picking to occur.

Parameters:
enableBatchPicking - true to enable batch rendering, otherwise false.

setEnableBatchRendering

public void setEnableBatchRendering(boolean enableBatchRendering)
Specifies whether adjacent Labels in the ordered renderable list may be rendered together if they are contained in the same layer. This increases performance and there is seldom a reason to disable it.

Parameters:
enableBatchRendering - true to enable batch rendering, otherwise false.

setFont

public void setFont(Font font)
Specifies the font used to draw the label.

Parameters:
font - New font.

setInsets

public void setInsets(Insets insets)
Specifies the amount of space (in pixels) between the label's content and the edges of the label's frame.

Parameters:
insets - the desired padding between the label's content and its frame, in pixels.
Throws:
IllegalArgumentException - if insets is null.
See Also:
getInsets()

setInteriorOpacity

public void setInteriorOpacity(double interiorOpacity)
Specifies the opacity of the label's interior as a floating-point value in the range 0.0 to 1.0. A value of 1.0 specifies a completely opaque interior, and 0.0 specifies a completely transparent interior. Values in between specify a partially transparent interior.

Parameters:
interiorOpacity - the opacity of label's interior as a floating-point value from 0.0 to 1.0.
Throws:
IllegalArgumentException - if opacity is less than 0.0 or greater than 1.0.

setLineSpacing

public void setLineSpacing(int lineSpacing)
Specifies the line spacing applied to multi-line labels.

Parameters:
lineSpacing - New line spacing.

setMaterial

public void setMaterial(Material material)
Specifies the material used to draw the label.

Parameters:
material - New material.

setOffset

public void setOffset(Offset offset)
Specifies the offset from the geographic position at which to draw the label. The default offset aligns the label horizontal with the text alignment position, and centers the label vertically. For example, if the text alignment is AVKey.LEFT., then the left edge of the text will be aligned with the geographic position, and the label will be centered vertically.

When the text is rotated a horizontal offset moves the text along the orientation line, and a vertical offset moves the text perpendicular to the orientation line.

Parameters:
offset - The offset at which to draw the label.

setOpacity

public void setOpacity(double opacity)
Specifies the opacity of the text as a floating-point value in the range 0.0 to 1.0. A value of 1.0 specifies a completely opaque text, and 0.0 specifies a completely transparent text. Values in between specify a partially transparent text.

Parameters:
opacity - the opacity of text as a floating-point value from 0.0 to 1.0.
Throws:
IllegalArgumentException - if opacity is less than 0.0 or greater than 1.0.

setOrientationPosition

public void setOrientationPosition(Position orientationPosition)
Specifies the orientation position. The label is oriented on a line drawn from the label's position to the orientation position. If the orientation position is null then the label is drawn with no rotation.

Parameters:
orientationPosition - Draw label oriented toward this position.

setPosition

public void setPosition(Position position)
Indicates the label's geographic position. The label is drawn at an offset from this position.

Parameters:
position - New position.
See Also:
getOffset()

setText

public void setText(String text)
Specifies the text of this label. The text may include multiple lines, separated by newline characters.

Parameters:
text - New text.

setTextAlign

public void setTextAlign(String textAlign)
Specifies the text alignment. Can be one of AVKey.LEFT (default), AVKey.CENTER, or AVKey.RIGHT.

Parameters:
textAlign - New text alignment.

NASA World Wind