NASA World Wind

gov.nasa.worldwind.render
Class GlobeBrowserBalloon

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.AbstractBrowserBalloon
                  extended by gov.nasa.worldwind.render.GlobeBrowserBalloon
All Implemented Interfaces:
AVList, Disposable, MessageListener, SelectListener, Balloon, GlobeBalloon, Highlightable, OrderedRenderable, Renderable, HotSpot, WWObject, KeyListener, MouseListener, MouseMotionListener, MouseWheelListener, PropertyChangeListener, EventListener

public class GlobeBrowserBalloon
extends AbstractBrowserBalloon
implements GlobeBalloon

A GlobeBalloon that displays HTML, JavaScript, and Flash content using the system's native browser, and who's origin is located at a position on the Globe.

See Also:
AbstractBrowserBalloon

Nested Class Summary
 
Nested classes/interfaces inherited from class gov.nasa.worldwind.render.AbstractBrowserBalloon
AbstractBrowserBalloon.BrowserControl, AbstractBrowserBalloon.FrameGeometryInfo
 
Field Summary
protected  int altitudeMode
          Indicates how this balloon's altitude is interpreted.
protected  Vec4 placePoint
          The model-coordinate point corresponding to this balloon's position.
protected  Position position
          Indicates this balloon's geographic position.
protected  Vec4 screenPlacePoint
          The projection of this balloon's placePoint in the viewport (on the screen).
 
Fields inherited from class gov.nasa.worldwind.render.AbstractBrowserBalloon
browserControls, DEFAULT_NATIVE_SIZE, DEFAULT_OUTLINE_PICK_WIDTH, DEFAULT_WEB_VIEW_FACTORY, drawBrowserControls, drawResizeControl, drawTitleBar, eyeDistance, FRAME_GEOMETRY_ELLIPSE_SLICES, FRAME_GEOMETRY_RECTANGLE_CORNER_SLICES, frameInfo, frameTimeStamp, geomTimeStamp, lastPickPoint, osh, outlinePickWidth, pickLayer, pickSupport, resourceResolver, screenExtent, screenOffset, screenPickExtent, screenRect, textUpdateTime, visibilityAction, webView, webViewContentSize, webViewCreationFailed, webViewRect, webViewTimeStamp
 
Fields inherited from class gov.nasa.worldwind.render.AbstractBalloon
activeAttributes, alwaysOnTop, attributes, defaultAttributes, delegateOwner, highlightAttributes, highlighted, maxActiveAltitude, minActiveAltitude, pickEnabled, text, textDecoder, visible
 
Constructor Summary
GlobeBrowserBalloon(String text, Position position)
          Constructs a new GlobeBrowserBalloon with the specified text content and position.
 
Method Summary
protected  void computeBalloonPoints(DrawContext dc)
          Computes and stores this balloon's model and screen coordinates.
protected  PickedObject createPickedObject(DrawContext dc, Color pickColor)
          

Overridden to use this balloon's position as the picked object's position.

 int getAltitudeMode()
          Returns the balloon's altitude mode.
 Position getPosition()
          Get the position of the balloon.
protected  boolean intersectsFrustum(DrawContext dc)
          Determines whether the balloon intersects the view frustum.
 void setAltitudeMode(int altitudeMode)
          Specifies the balloon's altitude mode.
 void setPosition(Position position)
          Set the balloon to a position on the globe.
protected  void setupDepthTest(DrawContext dc)
          
 
Methods inherited from class gov.nasa.worldwind.render.AbstractBrowserBalloon
addAllBrowserControls, addBrowserControl, addBrowserControl, addBrowserControl, beginDrawing, bindWebViewTexture, computeFramePickRect, computeFrameRectForWebViewRect, computeGeometry, computeOffset, computeOutlinePickWidth, computeSize, computeWebViewRectForFrameRect, convertToWebView, createDefaultBrowserControls, createFrameVertices, createLinkPickedObject, determineWebViewContentSize, dispose, disposeWebView, doDrawOrderedRenderable, drawBrowserControl, drawBrowserControls, drawFrame, drawFrameInterior, drawFrameOutline, drawLinks, drawOrderedRenderable, drawResizeControl, drawTitleBar, drawWebViewLinks, endDrawing, getBounds, getBrowserControls, getCursor, getDistanceFromEye, getOutlinePickWidth, getResourceResolver, getVisibilityAction, goBack, goForward, handleKeyEvent, handleMouseEvent, handleSelectEvent, isActive, isDrawBrowserControls, isDrawBrowserControls, isDrawInterior, isDrawLinks, isDrawOutline, isDrawResizeControl, isDrawResizeControl, isDrawTitleBar, isDrawTitleBar, keyPressed, keyReleased, keyTyped, makeDefaultFrameVertices, makeEllipseFrameVertices, makeOrderedRenderable, makeRectangleFrameVertices, makeWebView, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, mouseWheelMoved, mustRegenerateGeometry, pick, prepareToDrawInterior, prepareToDrawOutline, propertyChange, removeAllBrowserControls, removeBrowserControl, render, selected, setActive, setDrawBrowserControls, setDrawResizeControl, setDrawTitleBar, setOutlinePickWidth, setResourceResolver, setVisibilityAction, setVisible, setWebViewContent, updateRenderState, updateRenderStateIfNeeded, updateWebView
 
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
 
Methods inherited from class gov.nasa.worldwind.WWObjectImpl
onMessage
 
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

altitudeMode

protected int altitudeMode
Indicates how this balloon's altitude is interpreted. One of WorldWind.ABSOLUTE, WorldWind.RELATIVE_TO_GROUND, or WorldWind.CLAMP_TO_GROUND. If the altitude mode is 0 or an unrecognized code, this balloon assumes an altitude mode of WorldWind.ABSOLUTE. Initially 0.


placePoint

protected Vec4 placePoint
The model-coordinate point corresponding to this balloon's position. May be null.


position

protected Position position
Indicates this balloon's geographic position. The position's altitude is interpreted relative to this balloon's altitudeMode. Initialized to a non-null value at construction.


screenPlacePoint

protected Vec4 screenPlacePoint
The projection of this balloon's placePoint in the viewport (on the screen). May be null.

Constructor Detail

GlobeBrowserBalloon

public GlobeBrowserBalloon(String text,
                           Position position)
Constructs a new GlobeBrowserBalloon with the specified text content and position.

Parameters:
text - the balloon's initial text content.
position - the balloon's initial position.
Throws:
IllegalArgumentException - if either text or position are null.
Method Detail

computeBalloonPoints

protected void computeBalloonPoints(DrawContext dc)
Computes and stores this balloon's model and screen coordinates. This assigns balloon coordinate properties as follows:


createPickedObject

protected PickedObject createPickedObject(DrawContext dc,
                                          Color pickColor)

Overridden to use this balloon's position as the picked object's position.

Overrides:
createPickedObject in class AbstractBrowserBalloon

getAltitudeMode

public int getAltitudeMode()
Returns the balloon's altitude mode. See GlobeBalloon.setAltitudeMode(int) for a description of the modes.

Specified by:
getAltitudeMode in interface GlobeBalloon
Returns:
the balloon's altitude mode.

getPosition

public Position getPosition()
Get the position of the balloon.

Specified by:
getPosition in interface GlobeBalloon
Returns:
The position of the balloon.

intersectsFrustum

protected boolean intersectsFrustum(DrawContext dc)
Determines whether the balloon intersects the view frustum.

Overridden to return false if the balloon's position is either behind the View's near clipping plane or in front of the View's far clipping plane. Otherwise this delegates to the super class' behavior.

Overrides:
intersectsFrustum in class AbstractBrowserBalloon
Parameters:
dc - the current draw context.
Returns:
true If the balloon intersects the frustum, otherwise false.

setAltitudeMode

public void setAltitudeMode(int altitudeMode)
Specifies the balloon's altitude mode. Recognized modes are:

Specified by:
setAltitudeMode in interface GlobeBalloon
Parameters:
altitudeMode - the altitude mode

setPosition

public void setPosition(Position position)
Set the balloon to a position on the globe.

Specified by:
setPosition in interface GlobeBalloon
Parameters:
position - New position for the balloon.

setupDepthTest

protected void setupDepthTest(DrawContext dc)

Specified by:
setupDepthTest in class AbstractBrowserBalloon

NASA World Wind