Package gov.nasa.worldwind.render
Class AbstractBalloon
- java.lang.Object
-
- gov.nasa.worldwind.avlist.AVListImpl
-
- gov.nasa.worldwind.WWObjectImpl
-
- gov.nasa.worldwind.render.AbstractBalloon
-
- All Implemented Interfaces:
AVList,MessageListener,Balloon,Highlightable,Renderable,WWObject,java.beans.PropertyChangeListener,java.util.EventListener
- Direct Known Subclasses:
AbstractAnnotationBalloon
public abstract class AbstractBalloon extends WWObjectImpl implements Balloon
Abstract implementation ofBalloon.
-
-
Field Summary
Fields Modifier and Type Field Description protected BalloonAttributesactiveAttributesprotected booleanalwaysOnTopprotected BalloonAttributesattributesprotected static BalloonAttributesdefaultAttributesThe attributes used if attributes are not specified.protected java.lang.ObjectdelegateOwnerprotected BalloonAttributeshighlightAttributesprotected booleanhighlightedprotected doublemaxActiveAltitudeprotected doubleminActiveAltitudeprotected booleanpickEnabledprotected java.lang.Stringtextprotected TextDecodertextDecoderprotected booleanvisible
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractBalloon()Create a balloon.protectedAbstractBalloon(java.lang.String text)Create a balloon with text.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddetermineActiveAttributes()Determines which attributes -- normal, highlight or default -- to use each frame.protected BalloonAttributesgetActiveAttributes()Get the active attributes, based on the highlight state.BalloonAttributesgetAttributes()Get the "normal" balloon attributes.protected java.lang.StringgetDecodedText()Get text after it has been processed by the text decoder.java.lang.ObjectgetDelegateOwner()Returns the delegate owner of the balloon.BalloonAttributesgetHighlightAttributes()Get the highlight attributes.doublegetMaxActiveAltitude()Returns the maximum eye altitude, in meters, for which the balloon is displayed.doublegetMinActiveAltitude()Returns the minimum eye altitude, in meters, for which the balloon is displayed.java.lang.StringgetText()Get the balloon text.TextDecodergetTextDecoder()Get the text decoder that will process the balloon text.booleanisAlwaysOnTop()Is the balloon always on top?booleanisHighlighted()Indicates whether to highlight the shape.booleanisPickEnabled()Is the balloon enabled for picking?booleanisVisible()Get whether the annotation is visible and should be rendered.voidsetAlwaysOnTop(boolean alwaysOnTop)Set the balloon to always on top or not.voidsetAttributes(BalloonAttributes attributes)Set the "normal" balloon attributes.voidsetDelegateOwner(java.lang.Object delegateOwner)Specifies the delegate owner of the balloon.voidsetHighlightAttributes(BalloonAttributes highlightAttributes)Set the highlight attributes.voidsetHighlighted(boolean highlighted)Specifies whether to highlight the shape.voidsetMaxActiveAltitude(double maxActiveAltitude)Specifies the maximum eye altitude, in meters, for which the balloon is displayed.voidsetMinActiveAltitude(double minActiveAltitude)Specifies the minimum eye altitude, in meters, for which the balloon is displayed.voidsetPickEnabled(boolean enable)Set the balloon to be pick enabled or not.voidsetText(java.lang.String text)Set the balloon text.voidsetTextDecoder(TextDecoder decoder)Set a text decoder to process the balloon text.voidsetVisible(boolean visible)Set whether the balloon is visible and should be rendered.-
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
-
Methods inherited from interface gov.nasa.worldwind.render.Renderable
render
-
-
-
-
Field Detail
-
alwaysOnTop
protected boolean alwaysOnTop
-
pickEnabled
protected boolean pickEnabled
-
delegateOwner
protected java.lang.Object delegateOwner
-
attributes
protected BalloonAttributes attributes
-
highlightAttributes
protected BalloonAttributes highlightAttributes
-
activeAttributes
protected BalloonAttributes activeAttributes
-
text
protected java.lang.String text
-
textDecoder
protected TextDecoder textDecoder
-
visible
protected boolean visible
-
highlighted
protected boolean highlighted
-
minActiveAltitude
protected double minActiveAltitude
-
maxActiveAltitude
protected double maxActiveAltitude
-
defaultAttributes
protected static final BalloonAttributes defaultAttributes
The attributes used if attributes are not specified.
-
-
Method Detail
-
isAlwaysOnTop
public boolean isAlwaysOnTop()
Is the balloon always on top?- Specified by:
isAlwaysOnTopin interfaceBalloon- Returns:
- True if the balloon will always render above other items.
-
setAlwaysOnTop
public void setAlwaysOnTop(boolean alwaysOnTop)
Set the balloon to always on top or not.- Specified by:
setAlwaysOnTopin interfaceBalloon- Parameters:
alwaysOnTop- True if the balloon should always render above other objects.
-
isPickEnabled
public boolean isPickEnabled()
Is the balloon enabled for picking?- Specified by:
isPickEnabledin interfaceBalloon- Returns:
- True if the balloon can be picked, false if not.
-
setPickEnabled
public void setPickEnabled(boolean enable)
Set the balloon to be pick enabled or not.- Specified by:
setPickEnabledin interfaceBalloon- Parameters:
enable- True if the balloon can be picked, false if not.
-
getText
public java.lang.String getText()
Get the balloon text. The method returns the raw text, before decoding.- Specified by:
getTextin interfaceBalloon- Returns:
- The balloon text.
- See Also:
Balloon.getTextDecoder(),Balloon.setTextDecoder(gov.nasa.worldwind.util.TextDecoder)
-
getDecodedText
protected java.lang.String getDecodedText()
Get text after it has been processed by the text decoder. Returns the original text if there is noTextDecoder.- Returns:
- Decoded text.
- See Also:
TextDecoder,setTextDecoder(gov.nasa.worldwind.util.TextDecoder),getTextDecoder()
-
setText
public void setText(java.lang.String text)
Set the balloon text.
-
getDelegateOwner
public java.lang.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.- Specified by:
getDelegateOwnerin interfaceBalloon- Returns:
- the object used as the pickable object returned during picking, or null to indicate the the balloon is returned during picking.
-
setDelegateOwner
public void setDelegateOwner(java.lang.Object delegateOwner)
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.- Specified by:
setDelegateOwnerin interfaceBalloon- Parameters:
delegateOwner- the object to use as the pickable object returned during picking, or null to return the balloon.
-
getAttributes
public BalloonAttributes getAttributes()
Get the "normal" balloon attributes.- Specified by:
getAttributesin interfaceBalloon- Returns:
- Balloon attributes.
-
setAttributes
public void setAttributes(BalloonAttributes attributes)
Set the "normal" balloon attributes.- Specified by:
setAttributesin interfaceBalloon- Parameters:
attributes- New attributes
-
getHighlightAttributes
public BalloonAttributes getHighlightAttributes()
Get the highlight attributes.- Specified by:
getHighlightAttributesin interfaceBalloon- Returns:
- Balloon's highlight attributes.
-
setHighlightAttributes
public void setHighlightAttributes(BalloonAttributes highlightAttributes)
Set the highlight attributes.- Specified by:
setHighlightAttributesin interfaceBalloon- Parameters:
highlightAttributes- Attributes to use when the balloon is highlighted.
-
determineActiveAttributes
protected void determineActiveAttributes()
Determines which attributes -- normal, highlight or default -- to use each frame.
-
getActiveAttributes
protected BalloonAttributes getActiveAttributes()
Get the active attributes, based on the highlight state.- Returns:
- Highlight attributes if the balloon is highlighted, or normal attributes otherwise.
-
getTextDecoder
public TextDecoder getTextDecoder()
Get the text decoder that will process the balloon text.- Specified by:
getTextDecoderin interfaceBalloon- Returns:
- Active text decoder.
-
setTextDecoder
public void setTextDecoder(TextDecoder decoder)
Set a text decoder to process the balloon text.- Specified by:
setTextDecoderin interfaceBalloon- Parameters:
decoder- New decoder.
-
isHighlighted
public boolean isHighlighted()
Indicates whether to highlight the shape.- Specified by:
isHighlightedin interfaceHighlightable- Returns:
- true to highlight the shape, otherwise false.
-
setHighlighted
public void setHighlighted(boolean highlighted)
Specifies whether to highlight the shape.- Specified by:
setHighlightedin interfaceHighlightable- Parameters:
highlighted- true to highlight the shape, otherwise false.
-
isVisible
public boolean isVisible()
Get whether the annotation is visible and should be rendered.
-
setVisible
public void setVisible(boolean visible)
Set whether the balloon is visible and should be rendered.- Specified by:
setVisiblein interfaceBalloon- Parameters:
visible- true if the balloon is visible and should be rendered.
-
getMinActiveAltitude
public double getMinActiveAltitude()
Returns the minimum eye altitude, in meters, for which the balloon is displayed.- Specified by:
getMinActiveAltitudein interfaceBalloon- Returns:
- the minimum altitude, in meters, for which the balloon is displayed.
- See Also:
Balloon.setMinActiveAltitude(double),Balloon.getMaxActiveAltitude()
-
setMinActiveAltitude
public void setMinActiveAltitude(double minActiveAltitude)
Specifies the minimum eye altitude, in meters, for which the balloon is displayed.- Specified by:
setMinActiveAltitudein interfaceBalloon- Parameters:
minActiveAltitude- the minimum altitude, in meters, for which the balloon is displayed.- See Also:
Balloon.getMinActiveAltitude(),Balloon.setMaxActiveAltitude(double)
-
getMaxActiveAltitude
public double getMaxActiveAltitude()
Returns the maximum eye altitude, in meters, for which the balloon is displayed.- Specified by:
getMaxActiveAltitudein interfaceBalloon- Returns:
- the maximum altitude, in meters, for which the balloon is displayed.
- See Also:
Balloon.setMaxActiveAltitude(double),Balloon.getMinActiveAltitude()
-
setMaxActiveAltitude
public void setMaxActiveAltitude(double maxActiveAltitude)
Specifies the maximum eye altitude, in meters, for which the balloon is displayed.- Specified by:
setMaxActiveAltitudein interfaceBalloon- Parameters:
maxActiveAltitude- the maximum altitude, in meters, for which the balloon is displayed.- See Also:
Balloon.getMaxActiveAltitude(),Balloon.setMinActiveAltitude(double)
-
-