public class GlobeAnnotation extends AbstractAnnotation implements Locatable, Movable, Draggable
AbstractAnnotation
,
AnnotationAttributes
AbstractAnnotation.TextCacheKey
Modifier and Type | Field and Description |
---|---|
protected java.lang.Integer |
altitudeMode |
protected boolean |
dragEnabled |
protected DraggableSupport |
draggableSupport |
protected double |
heightInMeter |
protected Position |
position |
alwaysOnTop, attributes, childList, delegateOwner, layoutManager, maxActiveAltitude, minActiveAltitude, pickEnabled, pickSupport, text, textBoundsMap, vertexBuffer, wrappedTextMap
ANTIALIAS_DONT_CARE, ANTIALIAS_FASTEST, ANTIALIAS_NICEST
Constructor and Description |
---|
GlobeAnnotation(java.lang.String text,
Position position)
Creates a
GlobeAnnotation with the given text, at the given globe Position . |
GlobeAnnotation(java.lang.String text,
Position position,
AnnotationAttributes defaults)
Creates a
GlobeAnnotation with the given text, at the given globe Position . |
GlobeAnnotation(java.lang.String text,
Position position,
java.awt.Font font)
Creates a
GlobeAnnotation with the given text, at the given globe Position . |
GlobeAnnotation(java.lang.String text,
Position position,
java.awt.Font font,
java.awt.Color textColor)
Creates a
GlobeAnnotation with the given text, at the given globe Position . |
Modifier and Type | Method and Description |
---|---|
protected java.awt.Rectangle |
computeBounds(DrawContext dc) |
protected double[] |
computeDistanceScaleAndOpacity(DrawContext dc,
Vec4 point,
java.awt.Dimension size) |
protected java.lang.Double |
computeLookAtDistance(DrawContext dc) |
protected void |
doDrag(DragContext dragContext) |
protected void |
doRenderNow(DrawContext dc) |
void |
drag(DragContext dragContext)
Drag the object given the provided
DragContext . |
java.lang.Integer |
getAltitudeMode()
Get the annotation's altitude mode.
|
Vec4 |
getAnnotationDrawPoint(DrawContext dc)
Get the final Vec4 point at which an annotation will be drawn.
|
protected Vec4 |
getAnnotationDrawPointLegacy(DrawContext dc)
Compute the draw point using the legacy altitude mode.
|
double |
getHeightInMeter()
Returns the real world height of the annotation frame in meter.
|
Position |
getPosition() |
Position |
getReferencePosition()
A position associated with the object that indicates its aggregate geographic position.
|
java.lang.String |
getRestorableState()
Returns an XML state document String describing the public attributes of this GlobeAnnotation.
|
boolean |
isDragEnabled()
Indicates whether the object is enabled for dragging.
|
void |
move(Position position)
Shift the shape over the globe's surface while maintaining its original azimuth, its orientation relative to
North.
|
void |
moveTo(Position position)
Move the shape over the globe's surface while maintaining its original azimuth, its orientation relative to
North.
|
void |
restoreState(java.lang.String stateInXml)
Restores publicly settable attribute values found in the specified XML state document String.
|
void |
setAltitudeMode(java.lang.Integer altitudeMode)
Set the annotation's altitude mode.
|
protected void |
setDepthFunc(DrawContext dc,
Vec4 screenPoint) |
void |
setDragEnabled(boolean enabled)
Controls whether the object is enabled for dragging.
|
void |
setHeightInMeter(double meters)
Set the real world height of the annotation frame in meter.
|
void |
setPosition(Position position) |
addChild, adjustSizeToChildren, adjustSizeToText, applyBackgroundTextureState, applyColor, applyScreenTransform, beginDraw, beginDrawChildren, bindPickableObject, computeBoundingRectangle, computeFreeBounds, computeInsetBounds, computeOpacity, computeScale, computeTextBounds, dispose, doDraw, doDrawBackgroundTexture, doDrawChildren, draw, drawBackground, drawBackgroundImage, drawBorder, drawCallout, drawChildren, drawContent, drawHTML, drawPlainText, drawText, drawText, drawTopLevelAnnotation, endDraw, endDrawChildren, getAttributes, getBounds, getChildren, getDelegateOwner, getLayout, getMaxActiveAltitude, getMinActiveAltitude, getMultiLineTextRenderer, getPickSupport, getPreferredSize, getText, getTextBounds, getTextRenderer, getWrappedText, glPointFromAWTPoint, isAlwaysOnTop, isPickEnabled, modulateColorOpacity, pick, removeAllChildren, removeChild, render, renderNow, setAlwaysOnTop, setAttributes, setDelegateOwner, setLayout, setMaxActiveAltitude, setMinActiveAltitude, setPickEnabled, setPickSupport, setText, transformBackgroundImageCoordsToAnnotationCoords, transformByModelview, transformImageCoordsToBackgroundImageCoords, wrapText
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getBooleanValue, getBooleanValue, getChangeSupport, getDoubleValue, getDoubleValue, getEntries, getIntegerValue, getIntegerValue, getLongValue, getLongValue, getRestorableStateForAVPair, getStringValue, getStringValue, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues
protected java.lang.Integer altitudeMode
protected boolean dragEnabled
protected DraggableSupport draggableSupport
protected double heightInMeter
protected Position position
public GlobeAnnotation(java.lang.String text, Position position)
GlobeAnnotation
with the given text, at the given globe Position
.text
- the annotation text.position
- the annotation Position
.public GlobeAnnotation(java.lang.String text, Position position, AnnotationAttributes defaults)
GlobeAnnotation
with the given text, at the given globe Position
. Specify the
default AnnotationAttributes
set.text
- the annotation text.position
- the annotation Position
.defaults
- the default AnnotationAttributes
set.public GlobeAnnotation(java.lang.String text, Position position, java.awt.Font font)
GlobeAnnotation
with the given text, at the given globe Position
. Specify
the Font
to be used.text
- the annotation text.position
- the annotation Position
.font
- the Font
to use.public GlobeAnnotation(java.lang.String text, Position position, java.awt.Font font, java.awt.Color textColor)
GlobeAnnotation
with the given text, at the given globe Position
. Specify
the Font
and text Color
to be used.text
- the annotation text.position
- the annotation Position
.font
- the Font
to use.textColor
- the text Color
.protected java.awt.Rectangle computeBounds(DrawContext dc)
computeBounds
in class AbstractAnnotation
protected double[] computeDistanceScaleAndOpacity(DrawContext dc, Vec4 point, java.awt.Dimension size)
protected java.lang.Double computeLookAtDistance(DrawContext dc)
protected void doDrag(DragContext dragContext)
protected void doRenderNow(DrawContext dc)
doRenderNow
in class AbstractAnnotation
public void drag(DragContext dragContext)
Draggable
DragContext
.drag
in interface Draggable
dragContext
- the DragContext
of this dragging event.public java.lang.Integer getAltitudeMode()
Legacy altitude mode
If the annotation Position elevation is lower then the highest elevation on the
globe, the annotation will be drawn above the ground using its elevation as an offset, scaled by the current
vertical exaggeration. Otherwise, the original elevation will be used. This functionality is supported for
backward compatibility. New code that uses Globe Annotation should specify an altitude mode.
WorldWind.CLAMP_TO_GROUND
, WorldWind.RELATIVE_TO_GROUND
, WorldWind.ABSOLUTE
, or null
.setAltitudeMode(Integer)
public Vec4 getAnnotationDrawPoint(DrawContext dc)
getAltitudeMode()
will be used to determine the point.dc
- the current DrawContext.getAltitudeMode()
protected Vec4 getAnnotationDrawPointLegacy(DrawContext dc)
getAltitudeMode()
for details on the legacy
mode.dc
- the current DrawContext.getAltitudeMode()
public double getHeightInMeter()
If this dimension is zero, the annotation always maintains the same apparent size with possible scaling relative to the viewport center point if min and max distance scale factors are not one.
public Position getPosition()
getPosition
in interface Locatable
public Position getReferencePosition()
Movable
getReferencePosition
in interface Movable
public java.lang.String getRestorableState()
getRestorableState
in interface Restorable
getRestorableState
in class AbstractAnnotation
public boolean isDragEnabled()
Draggable
isDragEnabled
in interface Draggable
public void move(Position position)
Movable
public void moveTo(Position position)
Movable
public void restoreState(java.lang.String stateInXml)
stateInXml
must be a well formed XML document String, or this will throw an
IllegalArgumentException. Unknown structures in stateInXml
are benign, because they will simply be
ignored.restoreState
in interface Restorable
restoreState
in class AbstractAnnotation
stateInXml
- an XML document String describing a GlobeAnnotation.java.lang.IllegalArgumentException
- If stateInXml
is null, or if stateInXml
is not a well
formed XML document String.public void setAltitudeMode(java.lang.Integer altitudeMode)
altitudeMode
- The altitude mode, one of WorldWind.CLAMP_TO_GROUND
, WorldWind.RELATIVE_TO_GROUND
, or WorldWind.ABSOLUTE
. null
indicates that the
legacy altitude mode should be used. See getAltitudeMode()
for details on this
mode.getAltitudeMode()
protected void setDepthFunc(DrawContext dc, Vec4 screenPoint)
public void setDragEnabled(boolean enabled)
Draggable
setDragEnabled
in interface Draggable
enabled
- true
if the object is enabled, else false
.public void setHeightInMeter(double meters)
If this dimension is zero, the annotation always maintains the same apparent size with possible scaling relative to the viewport center point if min and max distance scale factors are not one.
meters
- the real world height of the annotation frame in meter.public void setPosition(Position position)