public class ScreenAnnotation extends AbstractAnnotation
AbstractAnnotation
,
AnnotationAttributes
AbstractAnnotation.TextCacheKey
Modifier and Type | Field and Description |
---|---|
protected Position |
position |
protected java.awt.Point |
screenPoint |
alwaysOnTop, attributes, childList, delegateOwner, layoutManager, maxActiveAltitude, minActiveAltitude, pickEnabled, pickSupport, text, textBoundsMap, vertexBuffer, wrappedTextMap
ANTIALIAS_DONT_CARE, ANTIALIAS_FASTEST, ANTIALIAS_NICEST
Constructor and Description |
---|
ScreenAnnotation(java.lang.String text,
java.awt.Point position)
Creates a
ScreenAnnotation with the given text, at the given viewport position. |
ScreenAnnotation(java.lang.String text,
java.awt.Point position,
AnnotationAttributes defaults)
Creates a
ScreenAnnotation with the given text, at the given viewport position. |
ScreenAnnotation(java.lang.String text,
java.awt.Point position,
java.awt.Font font)
Creates a
ScreenAnnotation with the given text, at the given viewport position. |
ScreenAnnotation(java.lang.String text,
java.awt.Point position,
java.awt.Font font,
java.awt.Color textColor)
Creates a
ScreenAnnotation with the given text, at the given viewport position. |
Modifier and Type | Method and Description |
---|---|
protected java.awt.Point |
computeAnnotationPosition(DrawContext dc,
Position pos) |
protected java.awt.Rectangle |
computeBounds(DrawContext dc) |
protected double[] |
computeOffset(DrawContext dc) |
protected java.awt.Point |
computeSize(DrawContext dc) |
protected void |
doRenderNow(DrawContext dc) |
Position |
getPosition()
Returns the position set via
setPosition(gov.nasa.worldwind.geom.Position) . |
java.lang.String |
getRestorableState()
Returns an XML state document String describing the public attributes of this ScreenAnnotation.
|
java.awt.Point |
getScreenPoint()
Get the
Point where the annotation is drawn in the viewport. |
protected java.awt.Point |
getScreenPoint(DrawContext dc)
Get the
Point where the annotation is drawn in the viewport. |
void |
restoreState(java.lang.String stateInXml)
Restores publicly settable attribute values found in the specified XML state document String.
|
void |
setPosition(Position position)
Specifies an optional geographic position that is mapped to a screen position during rendering.
|
void |
setScreenPoint(java.awt.Point position)
Set the
Point where the annotation will be drawn in the viewport. |
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 Position position
protected java.awt.Point screenPoint
public ScreenAnnotation(java.lang.String text, java.awt.Point position)
ScreenAnnotation
with the given text, at the given viewport position.text
- the annotation text.position
- the annotation viewport position.public ScreenAnnotation(java.lang.String text, java.awt.Point position, AnnotationAttributes defaults)
ScreenAnnotation
with the given text, at the given viewport position. Specify the default
AnnotationAttributes
set.text
- the annotation text.position
- the annotation viewport position.defaults
- the default AnnotationAttributes
set.public ScreenAnnotation(java.lang.String text, java.awt.Point position, java.awt.Font font)
ScreenAnnotation
with the given text, at the given viewport position. Specifiy the
Font
to be used.text
- the annotation text.position
- the annotation viewport position.font
- the Font
to use.public ScreenAnnotation(java.lang.String text, java.awt.Point position, java.awt.Font font, java.awt.Color textColor)
ScreenAnnotation
with the given text, at the given viewport position. Specifiy the
Font
and text Color
to be used.text
- the annotation text.position
- the annotation viewport position.font
- the Font
to use.textColor
- the text Color
.protected java.awt.Point computeAnnotationPosition(DrawContext dc, Position pos)
protected java.awt.Rectangle computeBounds(DrawContext dc)
computeBounds
in class AbstractAnnotation
protected double[] computeOffset(DrawContext dc)
protected java.awt.Point computeSize(DrawContext dc)
protected void doRenderNow(DrawContext dc)
doRenderNow
in class AbstractAnnotation
public Position getPosition()
setPosition(gov.nasa.worldwind.geom.Position)
.public java.lang.String getRestorableState()
getRestorableState
in interface Restorable
getRestorableState
in class AbstractAnnotation
public java.awt.Point getScreenPoint()
Point
where the annotation is drawn in the viewport.Point
where the annotation is drawn in the viewport.protected java.awt.Point getScreenPoint(DrawContext dc)
Point
where the annotation is drawn in the viewport.dc
- the current draw context.Point
where the annotation is drawn in the viewport.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 ScreenAnnotation.java.lang.IllegalArgumentException
- If stateInXml
is null, or if stateInXml
is not a well
formed XML document String.public void setPosition(Position position)
position
- This annotation's geographic position. May be null, in which case this annotation's screen point
is used directly.setScreenPoint(java.awt.Point)
public void setScreenPoint(java.awt.Point position)
Point
where the annotation will be drawn in the viewport.position
- the Point
where the annotation will be drawn in the viewport.