NASA World Wind

gov.nasa.worldwind
Class WorldWindowImpl

java.lang.Object
  extended by gov.nasa.worldwind.avlist.AVListImpl
      extended by gov.nasa.worldwind.WWObjectImpl
          extended by gov.nasa.worldwind.WorldWindowImpl
All Implemented Interfaces:
AVList, WorldWindow, WWObject, java.beans.PropertyChangeListener, java.util.EventListener
Direct Known Subclasses:
WorldWindowGLAutoDrawable

public class WorldWindowImpl
extends WWObjectImpl
implements WorldWindow

An implementation class for the WorldWindow interface. Classes implementing WorldWindow can subclass or aggreate this object to provide default WorldWindow functionality.


Field Summary
 
Fields inherited from class gov.nasa.worldwind.avlist.AVListImpl
changeSupport
 
Constructor Summary
WorldWindowImpl()
           
 
Method Summary
 void addPositionListener(PositionListener listener)
          Adds a position listener to this world window.
 void addRenderingListener(RenderingListener listener)
          Adds a rendering listener to this world window.
 void addSelectListener(SelectListener listener)
          Adds a select listener to this world window.
protected  void callPositionListeners(PositionEvent event)
           
protected  void callRenderingListeners(RenderingEvent event)
           
protected  void callSelectListeners(SelectEvent event)
           
 Position getCurrentPosition()
          Returns the current latitude, longitude and altitude of the current cursor position, or null if the cursor is not on the globe.
protected  PickedObject getCurrentSelection()
           
 InputHandler getInputHandler()
          Returns the input handler associated with this instance.
 Model getModel()
          Returns the window's current model.
 PickedObjectList getObjectsAtCurrentPosition()
          Returns the World Wind ojbects at the current cursor position.
 java.util.Collection<PerformanceStatistic> getPerFrameStatistics()
          Returns the active per-frame performance statistics such as number of tiles drawn in the most recent frame.
 SceneController getSceneController()
          Returns the scene controller assocciated with this instance.
 TextureCache getTextureCache()
          Returns the texture cache used by this World Window.?
 View getView()
          Returns this window's current view.
 void redraw()
          Causes a repaint event to be enqued with the window system for this world window.
 void redrawNow()
          Immediately repaints the world window without waiting for a window system repaint event.
 void removePositionListener(PositionListener listener)
          Removes the specified position listener associated with this world window.
 void removeRenderingListener(RenderingListener listener)
          Removes a specified rendering listener associated with this world window.
 void removeSelectListener(SelectListener listener)
          Removes the specified select listener associated with this world window.
 void setInputHandler(InputHandler inputHandler)
          Sets the input handler to use for this instance.
 void setModel(Model model)
          Sets the model to display in this window.
 void setModelAndView(Model model, View view)
          Sets the model to display in this window and the view used to display it.
 void setPerFrameStatisticsKeys(java.util.Set<java.lang.String> keys)
          Activates the per-frame performance statistic specified.
protected  void setTextureCache(TextureCache textureCache)
           
 void setView(View view)
          Sets the view to use when displaying this window's model.
 void shutdown()
          Causes resources used by the World Window to be freed.
 
Methods inherited from class gov.nasa.worldwind.WWObjectImpl
propertyChange
 
Methods inherited from class gov.nasa.worldwind.avlist.AVListImpl
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getDoubleValue, getDoubleValue, getEntries, getIntegerValue, getIntegerValue, getLongValue, getLongValue, 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

WorldWindowImpl

public WorldWindowImpl()
Method Detail

addPositionListener

public void addPositionListener(PositionListener listener)
Description copied from interface: WorldWindow
Adds a position listener to this world window. Position listeners are called when the cursor's position changes. They identify the position of the cursor on the globe, or that the cursor is not on the globe.

Specified by:
addPositionListener in interface WorldWindow
Parameters:
listener - The position listener to add.

addRenderingListener

public void addRenderingListener(RenderingListener listener)
Description copied from interface: WorldWindow
Adds a rendering listener to this world window. Rendering listeners are called at key point during World Wind drawing and provide applications the ability to participate or monitor rendering.

Specified by:
addRenderingListener in interface WorldWindow
Parameters:
listener - The rendering listener to add to those notified of rendering events by this world window.

addSelectListener

public void addSelectListener(SelectListener listener)
Description copied from interface: WorldWindow
Adds a select listener to this world window. Select listeners are called when a selection is made by the user in the world window. A selection is any operation that idetifies a visible item.

Specified by:
addSelectListener in interface WorldWindow
Parameters:
listener - The select listener to add.

callPositionListeners

protected void callPositionListeners(PositionEvent event)

callRenderingListeners

protected void callRenderingListeners(RenderingEvent event)

callSelectListeners

protected void callSelectListeners(SelectEvent event)

getCurrentPosition

public Position getCurrentPosition()
Description copied from interface: WorldWindow
Returns the current latitude, longitude and altitude of the current cursor position, or null if the cursor is not on the globe.

Specified by:
getCurrentPosition in interface WorldWindow
Returns:
The current position of the cursor, or null if the cursor is not positioned on the globe.

getCurrentSelection

protected PickedObject getCurrentSelection()

getInputHandler

public InputHandler getInputHandler()
Description copied from interface: WorldWindow
Returns the input handler associated with this instance.

Specified by:
getInputHandler in interface WorldWindow
Returns:
The input handler associated with this instance, or null if no input handler is associated.

getModel

public Model getModel()
Description copied from interface: WorldWindow
Returns the window's current model.

Specified by:
getModel in interface WorldWindow
Returns:
the window's current model.

getObjectsAtCurrentPosition

public PickedObjectList getObjectsAtCurrentPosition()
Description copied from interface: WorldWindow
Returns the World Wind ojbects at the current cursor position. The list of objects under the cursor is determined each time the world window is repainted. This method returns the list of objects determined when the most recent repaint was performed.

Specified by:
getObjectsAtCurrentPosition in interface WorldWindow
Returns:
The list of objects at the cursor position, or null if no objects are under the cursor.

getPerFrameStatistics

public java.util.Collection<PerformanceStatistic> getPerFrameStatistics()
Description copied from interface: WorldWindow
Returns the active per-frame performance statistics such as number of tiles drawn in the most recent frame.

Specified by:
getPerFrameStatistics in interface WorldWindow
Returns:
The keys and values of the active per-frame statistics.

getSceneController

public SceneController getSceneController()
Description copied from interface: WorldWindow
Returns the scene controller assocciated with this instance.

Specified by:
getSceneController in interface WorldWindow
Returns:
The scene controller associated with the instance, or null if no scene controller is associated.

getTextureCache

public TextureCache getTextureCache()
Description copied from interface: WorldWindow
Returns the texture cache used by this World Window.?

Specified by:
getTextureCache in interface WorldWindow
Returns:
The texture cache used by the World Window.

getView

public View getView()
Description copied from interface: WorldWindow
Returns this window's current view.

Specified by:
getView in interface WorldWindow
Returns:
the window's current view.

redraw

public void redraw()
Description copied from interface: WorldWindow
Causes a repaint event to be enqued with the window system for this world window. The repaint will occur at the window system's discretion, within the window system toolkit's event loop, and on the thread of that loop. This is the preferred method for requesting a repaint of the world window.

Specified by:
redraw in interface WorldWindow

redrawNow

public void redrawNow()
Description copied from interface: WorldWindow
Immediately repaints the world window without waiting for a window system repaint event. This is not the preferred way to cause a repaint, but is provided for the rare cases that require it.

Specified by:
redrawNow in interface WorldWindow

removePositionListener

public void removePositionListener(PositionListener listener)
Description copied from interface: WorldWindow
Removes the specified position listener associated with this world window.

Specified by:
removePositionListener in interface WorldWindow
Parameters:
listener - The listener to remove.

removeRenderingListener

public void removeRenderingListener(RenderingListener listener)
Description copied from interface: WorldWindow
Removes a specified rendering listener associated with this world window.

Specified by:
removeRenderingListener in interface WorldWindow
Parameters:
listener - The rendering listener to remove.

removeSelectListener

public void removeSelectListener(SelectListener listener)
Description copied from interface: WorldWindow
Removes the specified select listener associated with this world window.

Specified by:
removeSelectListener in interface WorldWindow
Parameters:
listener - The select listener to remove.

setInputHandler

public void setInputHandler(InputHandler inputHandler)
Description copied from interface: WorldWindow
Sets the input handler to use for this instance.

Specified by:
setInputHandler in interface WorldWindow
Parameters:
inputHandler - The input handler to use for this world window. May by null if null is specified, the current input handler, if any, is disassociated with the world window.

setModel

public void setModel(Model model)
Description copied from interface: WorldWindow
Sets the model to display in this window. If null is specified for the model, the current model, if any, is disassociated with the window.

Specified by:
setModel in interface WorldWindow
Parameters:
model - the model to display. May be null.

setModelAndView

public void setModelAndView(Model model,
                            View view)
Description copied from interface: WorldWindow
Sets the model to display in this window and the view used to display it. If null is specified for the model, the current model, if any, is disassociated with the window. If null is specified for the view, the current view, if any, is disassociated with the window.

Specified by:
setModelAndView in interface WorldWindow
Parameters:
model - the model to display. May benull.
view - the view to use to display this window's model. May benull.

setPerFrameStatisticsKeys

public void setPerFrameStatisticsKeys(java.util.Set<java.lang.String> keys)
Description copied from interface: WorldWindow
Activates the per-frame performance statistic specified. Per-frame statistics measure values within a single frame of rendering, such as number of tiles drawn to produce the frame.

Specified by:
setPerFrameStatisticsKeys in interface WorldWindow
Parameters:
keys - The statistics to activate.

setTextureCache

protected void setTextureCache(TextureCache textureCache)

setView

public void setView(View view)
Description copied from interface: WorldWindow
Sets the view to use when displaying this window's model. If null is specified for the view, the current view, if any, is disassociated with the window.

Specified by:
setView in interface WorldWindow
Parameters:
view - the view to use to display this window's model. May be null.

shutdown

public void shutdown()
Causes resources used by the World Window to be freed. The World Window cannot be used once this method is called. An OpenGL context for the window must be current.

Specified by:
shutdown in interface WorldWindow

NASA World Wind