NASA World Wind

gov.nasa.worldwind.awt
Class WorldWindowGLCanvas

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Canvas
          extended by javax.media.opengl.GLCanvas
              extended by gov.nasa.worldwind.awt.WorldWindowGLCanvas
All Implemented Interfaces:
AVList, WorldWindow, ImageObserver, MenuContainer, PropertyChangeListener, Serializable, EventListener, Accessible, ComponentEvents, GLAutoDrawable, GLDrawable
Direct Known Subclasses:
GliderWorldWindow

public class WorldWindowGLCanvas
extends GLCanvas
implements WorldWindow, PropertyChangeListener

WorldWindowGLCanvas is a heavyweight AWT component for displaying World Wind Models (globe and layers). It's a self-contained component intended to serve as an application's WorldWindow. Construction options exist to specify a specific graphics device and to share graphics resources with another graphics device.

Heavyweight AWT components such as instances of this class can be used in conjunction with lightweight Swing components. A discussion of doing so is in the Heavyweight and Lightweight Issues section of the "JOGL User's Guide". All that's typically necessary is to invoke the following methods of the indicated Swing classes: ToolTipManager.setLightWeightPopupEnabled(boolean), JPopupMenu.setLightWeightPopupEnabled(boolean) and JPopupMenu.setLightWeightPopupEnabled(boolean). These methods should be invoked within a static block within an application's main class.

This class is capable of supporting stereo devices. To cause a stereo device to be selected and used, specify the Java VM property "gov.nasa.worldwind.stereo.mode=device" prior to creating an instance of this class. A stereo capable SceneController such as StereoSceneController must also be specified in the World Wind Configuration. The default configuration specifies a stereo-capable controller. To prevent stereo from being used by subsequently opened WorldWindowGLCanvases, set the property to a an empty string, "".

Under certain conditions, JOGL replaces the GLContext associated with instances of this class. This then necessitates that all resources such as textures that have been stored on the graphic devices must be regenerated for the new context. World Wind does this automatically by clearing the associated GpuResourceCache. Objects subsequently rendered automatically re-create those resources. If an application creates its own graphics resources, including textures, vertex buffer objects and display lists, it must store them in the GpuResourceCache associated with the current DrawContext so that they are automatically cleared, and be prepared to re-create them if they do not exist in the DrawContext's current GpuResourceCache when needed. Examples of doing this can be found by searching for usages of the method GpuResourceCache.get(Object) and GpuResourceCache.getTexture(Object).

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.awt.Canvas
Canvas.AccessibleAWTCanvas
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
protected  WorldWindowGLDrawable wwd
          The drawable to which WorldWindow methods are delegated.
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
WorldWindowGLCanvas()
          Constructs a new WorldWindowGLCanvas on the default graphics device.
WorldWindowGLCanvas(WorldWindow shareWith)
          Constructs a new WorldWindowGLCanvas on the default graphics device and shares graphics resources with another WorldWindow.
WorldWindowGLCanvas(WorldWindow shareWith, GraphicsDevice device)
          Constructs a new WorldWindowGLCanvas on a specified graphics device and shares graphics resources with another WorldWindow.
WorldWindowGLCanvas(WorldWindow shareWith, GraphicsDevice device, GLCapabilities capabilities, GLCapabilitiesChooser chooser)
          Constructs a new WorldWindowGLCanvas on a specified device with the specified capabilities and shares graphics resources with another WorldWindow.
 
Method Summary
 void addPositionListener(PositionListener listener)
          Adds a position listener to this world window.
 void addPropertyChangeListener(PropertyChangeListener listener)
          Adds the specified all-property property change listener that will be called for all list changes.
 void addPropertyChangeListener(String propertyName, PropertyChangeListener listener)
          Adds a property change listener for the specified key.
 void addRenderingExceptionListener(RenderingExceptionListener listener)
          Adds an exception 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.
 AVList clearList()
           
 AVList copy()
          Returns a shallow copy of this AVList instance: the keys and values themselves are not cloned.
protected  void createDefaultInputHandler()
          Constructs and attaches the InputHandler for this WorldWindow.
protected  void createView()
          Constructs and attaches the View for this WorldWindow.
 void firePropertyChange(PropertyChangeEvent propertyChangeEvent)
          Calls all registered property change listeners with the specified property change event.
 void firePropertyChange(String propertyName, Object oldValue, Object newValue)
          Calls all property change listeners associated with the specified key.
protected static GLCapabilities getCaps()
          Returns a GLCapabilities identifying default graphics features to request.
 Position getCurrentPosition()
          Returns the current latitude, longitude and altitude of the current cursor position, or null if the cursor is not on the globe.
 Set<Map.Entry<String,Object>> getEntries()
           
 GpuResourceCache getGpuResourceCache()
          Returns the GPU Resource used by this World Window.
 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.
 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 associated with this instance.
 String getStringValue(String key)
          Returns the value for a specified key.
 Object getValue(String key)
          Returns the value for a specified key.
 Collection<Object> getValues()
           
 View getView()
          Returns this window's current view.
 boolean hasKey(String key)
          Indicates whether a key is in the collection.
 void propertyChange(PropertyChangeEvent evt)
           
 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.
 Object removeKey(String key)
          Removes a specified key from the collection if the key exists, otherwise returns without affecting the collection.
 void removePositionListener(PositionListener listener)
          Removes the specified position listener associated with this world window.
 void removePropertyChangeListener(PropertyChangeListener listener)
          Removes the specified all-property property change listener.
 void removePropertyChangeListener(String propertyName, PropertyChangeListener listener)
          Removes a property change listener associated with the specified key.
 void removeRenderingExceptionListener(RenderingExceptionListener listener)
          Removes the specified rendering exception 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(Set<String> keys)
          Activates the per-frame performance statistic specified.
 void setSceneController(SceneController sceneController)
          Specifies a new scene controller for the window.
 Object setValue(String key, Object value)
          Adds a key/value pair to the list.
 AVList setValues(AVList avList)
          Adds the contents of another attribute-value list to the list.
 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 javax.media.opengl.GLCanvas
addGLEventListener, addNotify, createContext, display, getAutoSwapBufferMode, getChosenGLCapabilities, getContext, getGL, getGraphicsConfiguration, paint, removeGLEventListener, removeNotify, reshape, setAutoSwapBufferMode, setGL, setRealized, swapBuffers, update
 
Methods inherited from class java.awt.Canvas
createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface gov.nasa.worldwind.WorldWindow
getContext
 
Methods inherited from interface javax.media.opengl.GLAutoDrawable
repaint
 
Methods inherited from interface javax.media.opengl.GLDrawable
getHeight, getWidth, setSize
 
Methods inherited from interface javax.media.opengl.ComponentEvents
addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener
 

Field Detail

wwd

protected final WorldWindowGLDrawable wwd
The drawable to which WorldWindow methods are delegated.

Constructor Detail

WorldWindowGLCanvas

public WorldWindowGLCanvas()
Constructs a new WorldWindowGLCanvas on the default graphics device.


WorldWindowGLCanvas

public WorldWindowGLCanvas(WorldWindow shareWith)
Constructs a new WorldWindowGLCanvas on the default graphics device and shares graphics resources with another WorldWindow.

Parameters:
shareWith - a WorldWindow with which to share graphics resources. May be null, in which case resources are not shared.
See Also:
GLCanvas.GLCanvas(GLCapabilities, GLCapabilitiesChooser, GLContext, GraphicsDevice)

WorldWindowGLCanvas

public WorldWindowGLCanvas(WorldWindow shareWith,
                           GraphicsDevice device)
Constructs a new WorldWindowGLCanvas on a specified graphics device and shares graphics resources with another WorldWindow.

Parameters:
shareWith - a WorldWindow with which to share graphics resources. May be null, in which case resources are not shared.
device - the GraphicsDevice on which to create the window. May be null, in which case the default screen device of the local GraphicsEnvironment is used.
See Also:
GLCanvas.GLCanvas(GLCapabilities, GLCapabilitiesChooser, GLContext, GraphicsDevice)

WorldWindowGLCanvas

public WorldWindowGLCanvas(WorldWindow shareWith,
                           GraphicsDevice device,
                           GLCapabilities capabilities,
                           GLCapabilitiesChooser chooser)
Constructs a new WorldWindowGLCanvas on a specified device with the specified capabilities and shares graphics resources with another WorldWindow.

Parameters:
shareWith - a WorldWindow with which to share graphics resources. May be null, in which case resources are not shared.
device - the GraphicsDevice on which to create the window. May be null, in which case the default screen device of the local GraphicsEnvironment is used.
capabilities - a capabilities object indicating the OpenGL rendering context's capabilities. May be null, in which case a default set of capabilities is used.
chooser - a chooser object that customizes the specified capabilities. May be null, in which case a default chooser is used.
See Also:
GLCanvas.GLCanvas(GLCapabilities, GLCapabilitiesChooser, GLContext, GraphicsDevice)
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.

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener listener)
Description copied from interface: AVList
Adds the specified all-property property change listener that will be called for all list changes.

Specified by:
addPropertyChangeListener in interface AVList
Specified by:
addPropertyChangeListener in interface ComponentEvents
Overrides:
addPropertyChangeListener in class Component
Parameters:
listener - the listener to call.
See Also:
PropertyChangeSupport

addPropertyChangeListener

public void addPropertyChangeListener(String propertyName,
                                      PropertyChangeListener listener)
Description copied from interface: AVList
Adds a property change listener for the specified key.

Specified by:
addPropertyChangeListener in interface AVList
Specified by:
addPropertyChangeListener in interface ComponentEvents
Overrides:
addPropertyChangeListener in class Component
Parameters:
propertyName - the key to associate the listener with.
listener - the listener to associate with the key.
See Also:
PropertyChangeSupport

addRenderingExceptionListener

public void addRenderingExceptionListener(RenderingExceptionListener listener)
Description copied from interface: WorldWindow
Adds an exception listener to this world window. Exception listeners are called when an exception or other critical event occurs during drawable initialization or during rendering.

Specified by:
addRenderingExceptionListener in interface WorldWindow
Parameters:
listener - the The exception 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 identifies a visible item.

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

clearList

public AVList clearList()
Specified by:
clearList in interface AVList

copy

public AVList copy()
Description copied from interface: AVList
Returns a shallow copy of this AVList instance: the keys and values themselves are not cloned.

Specified by:
copy in interface AVList
Returns:
a shallow copy of this AVList.

createDefaultInputHandler

protected void createDefaultInputHandler()
Constructs and attaches the InputHandler for this WorldWindow.


createView

protected void createView()
Constructs and attaches the View for this WorldWindow.


firePropertyChange

public void firePropertyChange(PropertyChangeEvent propertyChangeEvent)
Description copied from interface: AVList
Calls all registered property change listeners with the specified property change event.

Specified by:
firePropertyChange in interface AVList
Parameters:
propertyChangeEvent - the event
See Also:
PropertyChangeSupport

firePropertyChange

public void firePropertyChange(String propertyName,
                               Object oldValue,
                               Object newValue)
Description copied from interface: AVList
Calls all property change listeners associated with the specified key. No listeners are called if odValue and newValue are equal and non-null.

Specified by:
firePropertyChange in interface AVList
Overrides:
firePropertyChange in class Component
Parameters:
propertyName - the key
oldValue - the value associated with the key before the even causing the firing.
newValue - the new value associated with the key.
See Also:
PropertyChangeSupport

getCaps

protected static GLCapabilities getCaps()
Returns a GLCapabilities identifying default graphics features to request. The capabilities instance returned requests a frame buffer with 8 bits each of red, green, blue and alpha, a 24-bit depth buffer, double buffering, and if the Java property "gov.nasa.worldwind.stereo.mode" is set to "device", device-supported stereo.

Returns:
a new capabilities instance identifying desired graphics features.

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.

getEntries

public Set<Map.Entry<String,Object>> getEntries()
Specified by:
getEntries in interface AVList

getGpuResourceCache

public GpuResourceCache getGpuResourceCache()
Description copied from interface: WorldWindow
Returns the GPU Resource used by this World Window.

Specified by:
getGpuResourceCache in interface WorldWindow
Returns:
The GPU Resource cache used by this World Window.

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 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 associated 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.

getStringValue

public String getStringValue(String key)
Description copied from interface: AVList
Returns the value for a specified key. The value must be a String.

Specified by:
getStringValue in interface AVList
Parameters:
key - the attribute name. May not be null.
Returns:
the attribute value if one exists in the collection, otherwise null.

getValue

public Object getValue(String key)
Description copied from interface: AVList
Returns the value for a specified key.

Specified by:
getValue in interface AVList
Parameters:
key - the attribute name. May not be null.
Returns:
the attribute value if one exists in the collection, otherwise null.

getValues

public Collection<Object> getValues()
Specified by:
getValues in interface AVList

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.

hasKey

public boolean hasKey(String key)
Description copied from interface: AVList
Indicates whether a key is in the collection.

Specified by:
hasKey in interface AVList
Parameters:
key - the attribute name. May not be null.
Returns:
true if the key exists in the collection, otherwise false.

propertyChange

public void propertyChange(PropertyChangeEvent evt)
Specified by:
propertyChange in interface PropertyChangeListener

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

removeKey

public Object removeKey(String key)
Description copied from interface: AVList
Removes a specified key from the collection if the key exists, otherwise returns without affecting the collection.

Specified by:
removeKey in interface AVList
Parameters:
key - the attribute name. May not be null.
Returns:
previous value associated with specified key, or null if there was no mapping for key.

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.

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener listener)
Description copied from interface: AVList
Removes the specified all-property property change listener.

Specified by:
removePropertyChangeListener in interface AVList
Specified by:
removePropertyChangeListener in interface ComponentEvents
Overrides:
removePropertyChangeListener in class Component
Parameters:
listener - the listener to remove.
See Also:
PropertyChangeSupport

removePropertyChangeListener

public void removePropertyChangeListener(String propertyName,
                                         PropertyChangeListener listener)
Description copied from interface: AVList
Removes a property change listener associated with the specified key.

Specified by:
removePropertyChangeListener in interface AVList
Specified by:
removePropertyChangeListener in interface ComponentEvents
Overrides:
removePropertyChangeListener in class Component
Parameters:
propertyName - the key associated with the change listener.
listener - the listener to remove.
See Also:
PropertyChangeSupport

removeRenderingExceptionListener

public void removeRenderingExceptionListener(RenderingExceptionListener listener)
Description copied from interface: WorldWindow
Removes the specified rendering exception listener associated with this world window.

Specified by:
removeRenderingExceptionListener 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(Set<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.

setSceneController

public void setSceneController(SceneController sceneController)
Description copied from interface: WorldWindow
Specifies a new scene controller for the window. The caller is responsible for populating the new scene controller with a View, Model and any desired per-frame statistics keys.

Specified by:
setSceneController in interface WorldWindow
Parameters:
sceneController - the new scene controller.
See Also:
SceneController.setView(View), SceneController.setModel(Model), SceneController.setPerFrameStatisticsKeys(java.util.Set)

setValue

public Object setValue(String key,
                       Object value)
Description copied from interface: AVList
Adds a key/value pair to the list. Replaces an existing key/value pair if the list already contains the key.

Specified by:
setValue in interface AVList
Parameters:
key - the attribute name. May not be null.
value - the attribute value. May be null, in which case any existing value for the key is removed from the collection.
Returns:
previous value associated with specified key, or null if there was no mapping for key. A null return can also indicate that the map previously associated null with the specified key, if the implementation supports null values.

setValues

public AVList setValues(AVList avList)
Description copied from interface: AVList
Adds the contents of another attribute-value list to the list. Replaces an existing key/value pair if the list already contains the key.

Specified by:
setValues in interface AVList
Parameters:
avList - the list to copy. May not be null.
Returns:
this, a self reference.

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()
Description copied from interface: WorldWindow
Causes resources used by the World Window to be freed. The World Window cannot be used once this method is called.

Specified by:
shutdown in interface WorldWindow

NASA World Wind