NASA World Wind

gov.nasa.worldwind.render
Class ScreenAnnotationBalloon

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
                  extended by gov.nasa.worldwind.render.ScreenAnnotationBalloon
All Implemented Interfaces:
AVList, MessageListener, Balloon, Highlightable, Renderable, ScreenBalloon, WWObject, PropertyChangeListener, EventListener

public class ScreenAnnotationBalloon
extends AbstractAnnotationBalloon
implements ScreenBalloon

An AnnotationBalloon that is attached to a point on the screen.


Field Summary
protected  ScreenAnnotation annotation
          Annotation used to render the balloon.
protected  Point screenPoint
           
 
Fields inherited from class gov.nasa.worldwind.render.AbstractBalloon
activeAttributes, alwaysOnTop, attributes, defaultAttributes, delegateOwner, highlightAttributes, highlighted, maxActiveAltitude, minActiveAltitude, pickEnabled, text, textDecoder, visible
 
Constructor Summary
ScreenAnnotationBalloon(String text, Point point)
          Create the balloon.
 
Method Summary
protected  void computePosition(DrawContext dc)
          Compute the annotation position, and set it in the annotation.
protected  ScreenAnnotation createAnnotation()
          Create an annotation to render the balloon.
protected  ScreenAnnotation getAnnotation()
          Get the annotation used to render the balloon.
 Point getScreenLocation()
          Get the position of the balloon on the screen.
 void setScreenLocation(Point point)
          Set the screen position of the balloon.
 
Methods inherited from class gov.nasa.worldwind.render.AbstractAnnotationBalloon
applyAttributesToAnnotation, computeOffsets, getBounds, render
 
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.render.Balloon
getAttributes, getBounds, getDelegateOwner, getHighlightAttributes, getMaxActiveAltitude, getMinActiveAltitude, getText, getTextDecoder, isAlwaysOnTop, isPickEnabled, isVisible, setAlwaysOnTop, setAttributes, setDelegateOwner, setHighlightAttributes, setMaxActiveAltitude, setMinActiveAltitude, setPickEnabled, setText, setTextDecoder, setVisible
 
Methods inherited from interface gov.nasa.worldwind.render.Renderable
render
 
Methods inherited from interface gov.nasa.worldwind.render.Highlightable
isHighlighted, setHighlighted
 
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
 

Field Detail

annotation

protected ScreenAnnotation annotation
Annotation used to render the balloon.


screenPoint

protected Point screenPoint
Constructor Detail

ScreenAnnotationBalloon

public ScreenAnnotationBalloon(String text,
                               Point point)
Create the balloon.

Parameters:
text - Text to display in the balloon. May not be null.
point - The balloon's screen point. This point is interpreted in a coordinate system with the origin at the upper left corner of the screen.
Method Detail

computePosition

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

Specified by:
computePosition in class AbstractAnnotationBalloon
Parameters:
dc - Draw context.

createAnnotation

protected ScreenAnnotation createAnnotation()
Create an annotation to render the balloon.

Specified by:
createAnnotation in class AbstractAnnotationBalloon
Returns:
The new annotation.

getAnnotation

protected ScreenAnnotation getAnnotation()
Get the annotation used to render the balloon.

Specified by:
getAnnotation in class AbstractAnnotationBalloon
Returns:
The annotation that renders this balloon.

getScreenLocation

public Point getScreenLocation()
Get the position of the balloon on the screen.

Specified by:
getScreenLocation in interface ScreenBalloon
Returns:
The screen location of the balloon.

setScreenLocation

public void setScreenLocation(Point point)
Set the screen position of the balloon. This point is interpreted in a coordinate system with the origin at the upper left corner of the screen.

Specified by:
setScreenLocation in interface ScreenBalloon
Parameters:
point - Point in screen coordinates, with origin at upper left corner.

NASA World Wind