Package gov.nasa.worldwind.render
Class AbstractAnnotationBalloon
- java.lang.Object
-
- gov.nasa.worldwind.avlist.AVListImpl
-
- gov.nasa.worldwind.WWObjectImpl
-
- gov.nasa.worldwind.render.AbstractBalloon
-
- gov.nasa.worldwind.render.AbstractAnnotationBalloon
-
- All Implemented Interfaces:
AVList
,MessageListener
,Balloon
,Highlightable
,Renderable
,WWObject
,java.beans.PropertyChangeListener
,java.util.EventListener
- Direct Known Subclasses:
GlobeAnnotationBalloon
,ScreenAnnotationBalloon
public abstract class AbstractAnnotationBalloon extends AbstractBalloon
Implementation of balloon usingAnnotation
.
-
-
Field Summary
-
Fields inherited from class gov.nasa.worldwind.render.AbstractBalloon
activeAttributes, alwaysOnTop, attributes, defaultAttributes, delegateOwner, highlightAttributes, highlighted, maxActiveAltitude, minActiveAltitude, pickEnabled, text, textDecoder, visible
-
-
Constructor Summary
Constructors Constructor Description AbstractAnnotationBalloon(java.lang.String text)
Create a new annotation balloon.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
applyAttributesToAnnotation()
Apply the balloon attributes to the annotation.protected void
computeOffsets(DrawContext dc)
Compute the position and offsets, and set in them in the annotation.protected abstract void
computePosition(DrawContext dc)
Compute the annotation position, and set it in the annotation.protected abstract Annotation
createAnnotation()
Create an annotation to render the balloon.protected abstract Annotation
getAnnotation()
Get the annotation used to render the balloon.java.awt.Rectangle
getBounds(DrawContext dc)
Get the balloon boundingRectangle
using OGL coordinates - bottom-left corner x and y relative to theWorldWindow
bottom-left corner, and the balloon callout width and height.void
render(DrawContext dc)
Causes thisRenderable
to render itself using the provided draw context.-
Methods inherited from class gov.nasa.worldwind.render.AbstractBalloon
determineActiveAttributes, getActiveAttributes, getAttributes, getDecodedText, getDelegateOwner, getHighlightAttributes, getMaxActiveAltitude, getMinActiveAltitude, getText, getTextDecoder, isAlwaysOnTop, isHighlighted, isPickEnabled, isVisible, setAlwaysOnTop, setAttributes, setDelegateOwner, setHighlightAttributes, setHighlighted, setMaxActiveAltitude, setMinActiveAltitude, setPickEnabled, setText, setTextDecoder, setVisible
-
Methods inherited from class gov.nasa.worldwind.WWObjectImpl
onMessage, propertyChange
-
Methods inherited from class gov.nasa.worldwind.avlist.AVListImpl
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
-
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface gov.nasa.worldwind.avlist.AVList
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getEntries, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues
-
-
-
-
Method Detail
-
getBounds
public java.awt.Rectangle getBounds(DrawContext dc)
Get the balloon boundingRectangle
using OGL coordinates - bottom-left corner x and y relative to theWorldWindow
bottom-left corner, and the balloon callout width and height.The balloon offset from it's reference point is factored in such that the callout leader shape and reference point are included in the bounding rectangle.
- Parameters:
dc
- the current DrawContext.- Returns:
- the balloon bounding
Rectangle
using OGL viewport coordinates.
-
createAnnotation
protected abstract Annotation createAnnotation()
Create an annotation to render the balloon.- Returns:
- The new annotation.
-
getAnnotation
protected abstract Annotation getAnnotation()
Get the annotation used to render the balloon.- Returns:
- The annotation that renders this balloon.
-
computePosition
protected abstract void computePosition(DrawContext dc)
Compute the annotation position, and set it in the annotation.- Parameters:
dc
- Draw context.
-
render
public void render(DrawContext dc)
Causes thisRenderable
to render itself using the provided draw context.- Parameters:
dc
- theDrawContext
to be used- See Also:
DrawContext
-
applyAttributesToAnnotation
protected void applyAttributesToAnnotation()
Apply the balloon attributes to the annotation.
-
computeOffsets
protected void computeOffsets(DrawContext dc)
Compute the position and offsets, and set in them in the annotation.- Parameters:
dc
- DrawContext in which the balloon is being rendered.
-
-