NASA World Wind

gov.nasa.worldwind.render
Interface Balloon

All Superinterfaces:
AVList, Highlightable, Renderable
All Known Subinterfaces:
GlobeBalloon, ScreenBalloon
All Known Implementing Classes:
AbstractAnnotationBalloon, AbstractBalloon, AbstractBrowserBalloon, GlobeAnnotationBalloon, GlobeBrowserBalloon, KMLAbstractBalloon, KMLGlobeBalloonImpl, KMLScreenBalloonImpl, ScreenAnnotationBalloon, ScreenBrowserBalloon

public interface Balloon
extends Renderable, Highlightable, AVList

A text label that can be attached to a point on the screen, or a point on the globe.

See Also:
BalloonAttributes

Method Summary
 BalloonAttributes getAttributes()
          Get the "normal" balloon attributes.
 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.
 Object getDelegateOwner()
          Returns the delegate owner of the balloon.
 BalloonAttributes getHighlightAttributes()
          Get the highlight attributes.
 double getMaxActiveAltitude()
          Returns the maximum eye altitude, in meters, for which the balloon is displayed.
 double getMinActiveAltitude()
          Returns the minimum eye altitude, in meters, for which the balloon is displayed.
 String getText()
          Get the balloon text.
 TextDecoder getTextDecoder()
          Get the text decoder that will process the balloon text.
 boolean isAlwaysOnTop()
          Is the balloon always on top?
 boolean isPickEnabled()
          Is the balloon enabled for picking?
 boolean isVisible()
          Get whether the annotation is visible and should be rendered.
 void setAlwaysOnTop(boolean alwaysOnTop)
          Set the balloon to always on top or not.
 void setAttributes(BalloonAttributes attrs)
          Set the "normal" balloon attributes.
 void setDelegateOwner(Object owner)
          Specifies the delegate owner of the balloon.
 void setHighlightAttributes(BalloonAttributes attrs)
          Set the highlight attributes.
 void setMaxActiveAltitude(double maxActiveAltitude)
          Specifies the maximum eye altitude, in meters, for which the balloon is displayed.
 void setMinActiveAltitude(double minActiveAltitude)
          Specifies the minimum eye altitude, in meters, for which the balloon is displayed.
 void setPickEnabled(boolean enable)
          Set the balloon to be pick enabled or not.
 void setText(String text)
          Set the balloon text.
 void setTextDecoder(TextDecoder decoder)
          Set a text decoder to process the balloon text.
 void setVisible(boolean visible)
          Set whether the balloon is visible and should be rendered.
 
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
 

Method Detail

getAttributes

BalloonAttributes getAttributes()
Get the "normal" balloon attributes.

Returns:
Balloon attributes.

getBounds

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.
Throws:
IllegalArgumentException - if dc is null.

getDelegateOwner

Object getDelegateOwner()
Returns the delegate owner of the balloon. If non-null, the returned object replaces the balloon as the pickable object returned during picking. If null, the balloon itself is the pickable object returned during picking.

Returns:
the object used as the pickable object returned during picking, or null to indicate the the balloon is returned during picking.

getHighlightAttributes

BalloonAttributes getHighlightAttributes()
Get the highlight attributes.

Returns:
Balloon's highlight attributes.

getMaxActiveAltitude

double getMaxActiveAltitude()
Returns the maximum eye altitude, in meters, for which the balloon is displayed.

Returns:
the maximum altitude, in meters, for which the balloon is displayed.
See Also:
setMaxActiveAltitude(double), getMinActiveAltitude()

getMinActiveAltitude

double getMinActiveAltitude()
Returns the minimum eye altitude, in meters, for which the balloon is displayed.

Returns:
the minimum altitude, in meters, for which the balloon is displayed.
See Also:
setMinActiveAltitude(double), getMaxActiveAltitude()

getText

String getText()
Get the balloon text. The method returns the raw text, before decoding.

Returns:
The balloon text.
See Also:
getTextDecoder(), setTextDecoder(gov.nasa.worldwind.util.TextDecoder)

getTextDecoder

TextDecoder getTextDecoder()
Get the text decoder that will process the balloon text.

Returns:
Active text decoder.

isAlwaysOnTop

boolean isAlwaysOnTop()
Is the balloon always on top?

Returns:
True if the balloon will always render above other items.

isPickEnabled

boolean isPickEnabled()
Is the balloon enabled for picking?

Returns:
True if the balloon can be picked, false if not.

isVisible

boolean isVisible()
Get whether the annotation is visible and should be rendered.

Returns:
true if the annotation is visible and should be rendered.

setAlwaysOnTop

void setAlwaysOnTop(boolean alwaysOnTop)
Set the balloon to always on top or not.

Parameters:
alwaysOnTop - True if the balloon should always render above other objects.

setAttributes

void setAttributes(BalloonAttributes attrs)
Set the "normal" balloon attributes.

Parameters:
attrs - New attributes

setDelegateOwner

void setDelegateOwner(Object owner)
Specifies the delegate owner of the balloon. If non-null, the delegate owner replaces the balloon as the pickable object returned during picking. If null, the balloon itself is the pickable object returned during picking.

Parameters:
owner - the object to use as the pickable object returned during picking, or null to return the balloon.

setHighlightAttributes

void setHighlightAttributes(BalloonAttributes attrs)
Set the highlight attributes.

Parameters:
attrs - Attributes to use when the balloon is highlighted.

setMaxActiveAltitude

void setMaxActiveAltitude(double maxActiveAltitude)
Specifies the maximum eye altitude, in meters, for which the balloon is displayed.

Parameters:
maxActiveAltitude - the maximum altitude, in meters, for which the balloon is displayed.
See Also:
getMaxActiveAltitude(), setMinActiveAltitude(double)

setMinActiveAltitude

void setMinActiveAltitude(double minActiveAltitude)
Specifies the minimum eye altitude, in meters, for which the balloon is displayed.

Parameters:
minActiveAltitude - the minimum altitude, in meters, for which the balloon is displayed.
See Also:
getMinActiveAltitude(), setMaxActiveAltitude(double)

setPickEnabled

void setPickEnabled(boolean enable)
Set the balloon to be pick enabled or not.

Parameters:
enable - True if the balloon can be picked, false if not.

setText

void setText(String text)
Set the balloon text.

Parameters:
text - New balloon text.

setTextDecoder

void setTextDecoder(TextDecoder decoder)
Set a text decoder to process the balloon text.

Parameters:
decoder - New decoder.

setVisible

void setVisible(boolean visible)
Set whether the balloon is visible and should be rendered.

Parameters:
visible - true if the balloon is visible and should be rendered.

NASA World Wind