NASA World Wind

gov.nasa.worldwind.render
Class AbstractAnnotationBalloon

java.lang.Object
  extended by gov.nasa.worldwind.avlist.AVListImpl
      extended by gov.nasa.worldwind.WWObjectImpl
          extended by gov.nasa.worldwind.render.AbstractBalloon
              extended by gov.nasa.worldwind.render.AbstractAnnotationBalloon
All Implemented Interfaces:
AVList, MessageListener, Balloon, Highlightable, Renderable, WWObject, PropertyChangeListener, EventListener
Direct Known Subclasses:
GlobeAnnotationBalloon, ScreenAnnotationBalloon

public abstract class AbstractAnnotationBalloon
extends AbstractBalloon

Implementation of balloon using Annotation.


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
AbstractAnnotationBalloon(String text)
          Create a new annotation balloon.
 
Method Summary
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.
 Rectangle getBounds(DrawContext dc)
          Get the balloon bounding Rectangle using OGL coordinates - bottom-left corner x and y relative to the WorldWindow bottom-left corner, and the balloon callout width and height.
 void render(DrawContext dc)
          Causes this Renderable 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, finalize, 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
 

Constructor Detail

AbstractAnnotationBalloon

public AbstractAnnotationBalloon(String text)
Create a new annotation balloon.

Parameters:
text - Balloon text. May not be null.
Method Detail

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.

computePosition

protected abstract void computePosition(DrawContext dc)
Compute the annotation position, and set it in the annotation.

Parameters:
dc - Draw context.

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.

getBounds

public Rectangle getBounds(DrawContext dc)
Get the balloon bounding Rectangle using OGL coordinates - bottom-left corner x and y relative to the WorldWindow 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.

render

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

Parameters:
dc - the DrawContext to be used
See Also:
DrawContext

NASA World Wind