Class WorldWindowGLCanvas
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Canvas
-
- com.jogamp.opengl.awt.GLCanvas
-
- gov.nasa.worldwind.awt.WorldWindowGLCanvas
-
- All Implemented Interfaces:
com.jogamp.nativewindow.awt.AWTPrintLifecycle
,com.jogamp.nativewindow.NativeSurfaceHolder
,com.jogamp.nativewindow.OffscreenLayerOption
,com.jogamp.nativewindow.ScalableSurface
,com.jogamp.nativewindow.WindowClosingProtocol
,com.jogamp.opengl.awt.AWTGLAutoDrawable
,com.jogamp.opengl.awt.ComponentEvents
,com.jogamp.opengl.GLAutoDrawable
,com.jogamp.opengl.GLDrawable
,com.jogamp.opengl.GLSharedContextSetter
,AVList
,WorldWindow
,java.awt.image.ImageObserver
,java.awt.MenuContainer
,java.beans.PropertyChangeListener
,java.io.Serializable
,java.util.EventListener
,javax.accessibility.Accessible
- Direct Known Subclasses:
GliderWorldWindow
public class WorldWindowGLCanvas extends com.jogamp.opengl.awt.GLCanvas implements WorldWindow, java.beans.PropertyChangeListener
WorldWindowGLCanvas
is a heavyweight AWT component for displaying WorldWindModel
s (globe and layers). It's a self-contained component intended to serve as an application'sWorldWindow
. 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)
andJPopupMenu.setLightWeightPopupEnabled(boolean)
. These methods should be invoked within astatic
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 asStereoSceneController
must also be specified in the WorldWindConfiguration
. The default configuration specifies a stereo-capable controller. To prevent stereo from being used by subsequently openedWorldWindowGLCanvas
es, set the property to a an empty string, "". If a stereo device cannot be selected and used, this falls back to a non-stereo device that supports WorldWind's minimum requirements.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. WorldWind does this automatically by clearing the associatedGpuResourceCache
. 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 theGpuResourceCache
associated with the currentDrawContext
so that they are automatically cleared, and be prepared to re-create them if they do not exist in theDrawContext
's currentGpuResourceCache
when needed. Examples of doing this can be found by searching for usages of the methodGpuResourceCache.get(Object)
andGpuResourceCache.getTexture(Object)
.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
-
-
Field Summary
Fields Modifier and Type Field Description protected WorldWindowGLDrawable
wwd
The drawable to whichWorldWindow
methods are delegated.-
Fields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
-
Fields inherited from interface com.jogamp.nativewindow.awt.AWTPrintLifecycle
DEFAULT_PRINT_TILE_SIZE
-
-
Constructor Summary
Constructors Constructor Description WorldWindowGLCanvas()
Constructs a newWorldWindowGLCanvas
on the default graphics device.WorldWindowGLCanvas(WorldWindow shareWith)
Constructs a newWorldWindowGLCanvas
on the default graphics device and shares graphics resources with anotherWorldWindow
.WorldWindowGLCanvas(WorldWindow shareWith, java.awt.GraphicsDevice device)
Constructs a newWorldWindowGLCanvas
on a specified graphics device and shares graphics resources with anotherWorldWindow
.WorldWindowGLCanvas(WorldWindow shareWith, java.awt.GraphicsDevice device, com.jogamp.opengl.GLCapabilities capabilities, com.jogamp.opengl.GLCapabilitiesChooser chooser)
Constructs a newWorldWindowGLCanvas
on a specified device with the specified capabilities and shares graphics resources with anotherWorldWindow
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addPositionListener(PositionListener listener)
Adds a position listener to this WorldWindow.void
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds the specified all-property property change listener that will be called for all list changes.void
addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
Adds a property change listener for the specified key.void
addRenderingExceptionListener(RenderingExceptionListener listener)
Adds an exception listener to this WorldWindow.void
addRenderingListener(RenderingListener listener)
Adds a rendering listener to this WorldWindow.void
addSelectListener(SelectListener listener)
Adds a select listener to this WorldWindow.AVList
clearList()
AVList
copy()
Returns a shallow copy of thisAVList
instance: the keys and values themselves are not cloned.protected void
createDefaultInputHandler()
Constructs and attaches theInputHandler
for thisWorldWindow
.protected void
createView()
Constructs and attaches theView
for thisWorldWindow
.void
firePropertyChange(java.beans.PropertyChangeEvent propertyChangeEvent)
Calls all registered property change listeners with the specified property change event.void
firePropertyChange(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue)
Calls all property change listeners associated with the specified key.Position
getCurrentPosition()
Returns the current latitude, longitude and altitude of the current cursor position, ornull
if the cursor is not on the globe.java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.Object>>
getEntries()
GpuResourceCache
getGpuResourceCache()
Returns the GPU Resource used by this WorldWindow.InputHandler
getInputHandler()
Returns the input handler associated with this instance.Model
getModel()
Returns the window's current model.PickedObjectList
getObjectsAtCurrentPosition()
Returns the WorldWind objects at the current cursor position.PickedObjectList
getObjectsInSelectionBox()
Returns the WorldWind objects intersecting the current selection box.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 associated with this instance.java.lang.String
getStringValue(java.lang.String key)
Returns the value for a specified key.java.lang.Object
getValue(java.lang.String key)
Returns the value for a specified key.java.util.Collection<java.lang.Object>
getValues()
View
getView()
Returns this window's current view.boolean
hasKey(java.lang.String key)
Indicates whether a key is in the collection.boolean
isEnableGpuCacheReinitialization()
Indicates whether the GPU resource cache is reinitialized when this window is reinitialized.void
propertyChange(java.beans.PropertyChangeEvent evt)
void
redraw()
Causes a repaint event to be enqueued with the window system for this WorldWindow.void
redrawNow()
Immediately repaints the WorldWindow without waiting for a window system repaint event.java.lang.Object
removeKey(java.lang.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 WorldWindow.void
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes the specified all-property property change listener.void
removePropertyChangeListener(java.lang.String propertyName, java.beans.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 WorldWindow.void
removeRenderingListener(RenderingListener listener)
Removes a specified rendering listener associated with this WorldWindow.void
removeSelectListener(SelectListener listener)
Removes the specified select listener associated with this WorldWindow.void
setEnableGpuCacheReinitialization(boolean enableGpuCacheReinitialization)
Specifies whether to reinitialize the GPU resource cache when this window is reinitialized.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.void
setSceneController(SceneController sceneController)
Specifies a new scene controller for the window.java.lang.Object
setValue(java.lang.String key, java.lang.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 WorldWindow to be freed.-
Methods inherited from class com.jogamp.opengl.awt.GLCanvas
addGLEventListener, addGLEventListener, addNotify, areAllGLEventListenerInitialized, createContext, destroy, destroyImpl, display, disposeGLEventListener, flushGLRunnables, getAnimator, getAutoSwapBufferMode, getChosenGLCapabilities, getContext, getContextCreationFlags, getCurrentSurfaceScale, getDefaultCloseOperation, getDelegatedDrawable, getExclusiveContextThread, getFactory, getGL, getGLEventListener, getGLEventListenerCount, getGLEventListenerInitState, getGLProfile, getGraphicsConfiguration, getHandle, getMaximumSurfaceScale, getMinimumSurfaceScale, getNativeSurface, getRequestedGLCapabilities, getRequestedSurfaceScale, getShallUseOffscreenLayer, getSurfaceHeight, getSurfaceWidth, getThreadName, getUpstreamLock, getUpstreamWidget, invoke, invoke, isGLOriented, isOffscreenLayerSurfaceEnabled, isRealized, isThreadGLCapable, main, paint, print, releasePrint, removeGLEventListener, removeNotify, reshape, setAnimator, setAutoSwapBufferMode, setContext, setContextCreationFlags, setDefaultCloseOperation, setExclusiveContextThread, setGL, setGLEventListenerInitState, setRealized, setShallUseOffscreenLayer, setSharedAutoDrawable, setSharedContext, setSurfaceScale, setupPrint, swapBuffers, toString, update
-
Methods inherited from class java.awt.Canvas
createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy
-
Methods inherited from class java.awt.Component
add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, applyComponentOrientation, areFocusTraversalKeysSet, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, doLayout, 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, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, hasFocus, imageUpdate, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, list, list, list, list, list, paintAll, paramString, prepareImage, prepareImage, 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, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, requestFocusInWindow, revalidate, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setMixingCutoutShape, setName, setPreferredSize, setSize, setSize, setVisible, transferFocus, transferFocusBackward, transferFocusUpCycle, validate
-
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.jogamp.opengl.awt.ComponentEvents
addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener
-
Methods inherited from interface gov.nasa.worldwind.WorldWindow
getContext
-
-
-
-
Field Detail
-
wwd
protected final WorldWindowGLDrawable wwd
The drawable to whichWorldWindow
methods are delegated.
-
-
Constructor Detail
-
WorldWindowGLCanvas
public WorldWindowGLCanvas()
Constructs a newWorldWindowGLCanvas
on the default graphics device.
-
WorldWindowGLCanvas
public WorldWindowGLCanvas(WorldWindow shareWith)
Constructs a newWorldWindowGLCanvas
on the default graphics device and shares graphics resources with anotherWorldWindow
.- Parameters:
shareWith
- aWorldWindow
with which to share graphics resources.- See Also:
GLCanvas(GLCapabilitiesImmutable, GLCapabilitiesChooser, GraphicsDevice)
-
WorldWindowGLCanvas
public WorldWindowGLCanvas(WorldWindow shareWith, java.awt.GraphicsDevice device)
Constructs a newWorldWindowGLCanvas
on a specified graphics device and shares graphics resources with anotherWorldWindow
.- Parameters:
shareWith
- aWorldWindow
with which to share graphics resources.device
- theGraphicsDevice
on which to create the window. May be null, in which case the default screen device of the localGraphicsEnvironment
is used.- See Also:
GLCanvas(GLCapabilitiesImmutable, GLCapabilitiesChooser, GraphicsDevice)
-
WorldWindowGLCanvas
public WorldWindowGLCanvas(WorldWindow shareWith, java.awt.GraphicsDevice device, com.jogamp.opengl.GLCapabilities capabilities, com.jogamp.opengl.GLCapabilitiesChooser chooser)
Constructs a newWorldWindowGLCanvas
on a specified device with the specified capabilities and shares graphics resources with anotherWorldWindow
.- Parameters:
shareWith
- aWorldWindow
with which to share graphics resources.device
- theGraphicsDevice
on which to create the window. May be null, in which case the default screen device of the localGraphicsEnvironment
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(GLCapabilitiesImmutable, GLCapabilitiesChooser, GraphicsDevice)
-
-
Method Detail
-
propertyChange
public void propertyChange(java.beans.PropertyChangeEvent evt)
- Specified by:
propertyChange
in interfacejava.beans.PropertyChangeListener
-
shutdown
public void shutdown()
Description copied from interface:WorldWindow
Causes resources used by the WorldWindow to be freed. The WorldWindow cannot be used once this method is called.- Specified by:
shutdown
in interfaceWorldWindow
-
isEnableGpuCacheReinitialization
public boolean isEnableGpuCacheReinitialization()
Description copied from interface:WorldWindow
Indicates whether the GPU resource cache is reinitialized when this window is reinitialized.- Specified by:
isEnableGpuCacheReinitialization
in interfaceWorldWindow
- Returns:
true
if reinitialization is enabled, otherwisefalse
.
-
setEnableGpuCacheReinitialization
public void setEnableGpuCacheReinitialization(boolean enableGpuCacheReinitialization)
Description copied from interface:WorldWindow
Specifies whether to reinitialize the GPU resource cache when this window is reinitialized. A value oftrue
indicates that the GPU resource cache this window is using should be cleared when its init() method is called, typically when re-parented. Set this tofalse
when this window is sharing context with other windows and is likely to be re-parented. It prevents the flashing caused by clearing and re-populating the GPU resource cache during re-parenting. The default value istrue
.- Specified by:
setEnableGpuCacheReinitialization
in interfaceWorldWindow
- Parameters:
enableGpuCacheReinitialization
-true
to enable reinitialization, otherwisefalse
.
-
createView
protected void createView()
Constructs and attaches theView
for thisWorldWindow
.
-
createDefaultInputHandler
protected void createDefaultInputHandler()
Constructs and attaches theInputHandler
for thisWorldWindow
.
-
getInputHandler
public InputHandler getInputHandler()
Description copied from interface:WorldWindow
Returns the input handler associated with this instance.- Specified by:
getInputHandler
in interfaceWorldWindow
- Returns:
- The input handler associated with this instance, or
null
if no input handler is associated.
-
setInputHandler
public void setInputHandler(InputHandler inputHandler)
Description copied from interface:WorldWindow
Sets the input handler to use for this instance.- Specified by:
setInputHandler
in interfaceWorldWindow
- Parameters:
inputHandler
- The input handler to use for this WorldWindow. May bynull
ifnull
is specified, the current input handler, if any, is disassociated with the WorldWindow.
-
getSceneController
public SceneController getSceneController()
Description copied from interface:WorldWindow
Returns the scene controller associated with this instance.- Specified by:
getSceneController
in interfaceWorldWindow
- Returns:
- The scene controller associated with the instance, or
null
if no scene controller is associated.
-
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 aView
,Model
and any desired per-frame statistics keys.- Specified by:
setSceneController
in interfaceWorldWindow
- Parameters:
sceneController
- the new scene controller.- See Also:
SceneController.setView(View)
,SceneController.setModel(Model)
,SceneController.setPerFrameStatisticsKeys(java.util.Set)
-
getGpuResourceCache
public GpuResourceCache getGpuResourceCache()
Description copied from interface:WorldWindow
Returns the GPU Resource used by this WorldWindow. This method is for internal use only.Note: Applications do not need to interact with the GPU resource cache. It is self managed. Modifying it in any way will cause significant problems such as excessive memory usage or application crashes. The only reason to use the GPU resource cache is to request management of GPU resources within implementations of shapes or layers. And then access should be only through the draw context only.
- Specified by:
getGpuResourceCache
in interfaceWorldWindow
- Returns:
- The GPU Resource cache used by this WorldWindow.
-
redraw
public void redraw()
Description copied from interface:WorldWindow
Causes a repaint event to be enqueued with the window system for this WorldWindow. 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 WorldWindow.- Specified by:
redraw
in interfaceWorldWindow
-
redrawNow
public void redrawNow()
Description copied from interface:WorldWindow
Immediately repaints the WorldWindow 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 interfaceWorldWindow
-
setModel
public void setModel(Model model)
Description copied from interface:WorldWindow
Sets the model to display in this window. Ifnull
is specified for the model, the current model, if any, is disassociated with the window.- Specified by:
setModel
in interfaceWorldWindow
- Parameters:
model
- the model to display. May benull
.
-
getModel
public Model getModel()
Description copied from interface:WorldWindow
Returns the window's current model.- Specified by:
getModel
in interfaceWorldWindow
- Returns:
- the window's current model.
-
setView
public void setView(View view)
Description copied from interface:WorldWindow
Sets the view to use when displaying this window's model. Ifnull
is specified for the view, the current view, if any, is disassociated with the window.- Specified by:
setView
in interfaceWorldWindow
- Parameters:
view
- the view to use to display this window's model. May be null.
-
getView
public View getView()
Description copied from interface:WorldWindow
Returns this window's current view.- Specified by:
getView
in interfaceWorldWindow
- Returns:
- the window's current view.
-
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. Ifnull
is specified for the model, the current model, if any, is disassociated with the window. Ifnull
is specified for the view, the current view, if any, is disassociated with the window.- Specified by:
setModelAndView
in interfaceWorldWindow
- Parameters:
model
- the model to display. May benull
.view
- the view to use to display this window's model. May benull
.
-
addRenderingListener
public void addRenderingListener(RenderingListener listener)
Description copied from interface:WorldWindow
Adds a rendering listener to this WorldWindow. Rendering listeners are called at key point during WorldWind drawing and provide applications the ability to participate or monitor rendering.- Specified by:
addRenderingListener
in interfaceWorldWindow
- Parameters:
listener
- The rendering listener to add to those notified of rendering events by this WorldWindow.
-
removeRenderingListener
public void removeRenderingListener(RenderingListener listener)
Description copied from interface:WorldWindow
Removes a specified rendering listener associated with this WorldWindow.- Specified by:
removeRenderingListener
in interfaceWorldWindow
- Parameters:
listener
- The rendering listener to remove.
-
addSelectListener
public void addSelectListener(SelectListener listener)
Description copied from interface:WorldWindow
Adds a select listener to this WorldWindow. Select listeners are called when a selection is made by the user in the WorldWindow. A selection is any operation that identifies a visible item.- Specified by:
addSelectListener
in interfaceWorldWindow
- Parameters:
listener
- The select listener to add.
-
removeSelectListener
public void removeSelectListener(SelectListener listener)
Description copied from interface:WorldWindow
Removes the specified select listener associated with this WorldWindow.- Specified by:
removeSelectListener
in interfaceWorldWindow
- Parameters:
listener
- The select listener to remove.
-
addPositionListener
public void addPositionListener(PositionListener listener)
Description copied from interface:WorldWindow
Adds a position listener to this WorldWindow. 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 interfaceWorldWindow
- Parameters:
listener
- The position listener to add.
-
removePositionListener
public void removePositionListener(PositionListener listener)
Description copied from interface:WorldWindow
Removes the specified position listener associated with this WorldWindow.- Specified by:
removePositionListener
in interfaceWorldWindow
- Parameters:
listener
- The listener to remove.
-
addRenderingExceptionListener
public void addRenderingExceptionListener(RenderingExceptionListener listener)
Description copied from interface:WorldWindow
Adds an exception listener to this WorldWindow. Exception listeners are called when an exception or other critical event occurs during drawable initialization or during rendering.- Specified by:
addRenderingExceptionListener
in interfaceWorldWindow
- Parameters:
listener
- the The exception listener to add.
-
removeRenderingExceptionListener
public void removeRenderingExceptionListener(RenderingExceptionListener listener)
Description copied from interface:WorldWindow
Removes the specified rendering exception listener associated with this WorldWindow.- Specified by:
removeRenderingExceptionListener
in interfaceWorldWindow
- Parameters:
listener
- The listener to remove.
-
getCurrentPosition
public Position getCurrentPosition()
Description copied from interface:WorldWindow
Returns the current latitude, longitude and altitude of the current cursor position, ornull
if the cursor is not on the globe.- Specified by:
getCurrentPosition
in interfaceWorldWindow
- Returns:
- The current position of the cursor, or
null
if the cursor is not positioned on the globe.
-
getObjectsAtCurrentPosition
public PickedObjectList getObjectsAtCurrentPosition()
Description copied from interface:WorldWindow
Returns the WorldWind objects at the current cursor position. The list of objects under the cursor is determined each time the WorldWindow is repainted. This method returns the list of objects determined when the most recent repaint was performed.- Specified by:
getObjectsAtCurrentPosition
in interfaceWorldWindow
- Returns:
- The list of objects at the cursor position, or
null
if no objects are under the cursor.
-
getObjectsInSelectionBox
public PickedObjectList getObjectsInSelectionBox()
Description copied from interface:WorldWindow
Returns the WorldWind objects intersecting the current selection box. The list of objects in the selection box is determined each time the WorldWindow is repainted. This method returns the list of objects determined when the most recent repaint was performed.- Specified by:
getObjectsInSelectionBox
in interfaceWorldWindow
- Returns:
- The list of objects intersecting the selection box, or
null
if no objects are in the box.
-
setValue
public java.lang.Object setValue(java.lang.String key, java.lang.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 interfaceAVList
- Parameters:
key
- the attribute name. May not benull
.value
- the attribute value. May benull
, 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.
-
getValue
public java.lang.Object getValue(java.lang.String key)
Description copied from interface:AVList
Returns the value for a specified key.
-
getValues
public java.util.Collection<java.lang.Object> getValues()
-
getEntries
public java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.Object>> getEntries()
- Specified by:
getEntries
in interfaceAVList
-
getStringValue
public java.lang.String getStringValue(java.lang.String key)
Description copied from interface:AVList
Returns the value for a specified key. The value must be aString
.- Specified by:
getStringValue
in interfaceAVList
- Parameters:
key
- the attribute name. May not benull
.- Returns:
- the attribute value if one exists in the collection, otherwise
null
.
-
hasKey
public boolean hasKey(java.lang.String key)
Description copied from interface:AVList
Indicates whether a key is in the collection.
-
removeKey
public java.lang.Object removeKey(java.lang.String key)
Description copied from interface:AVList
Removes a specified key from the collection if the key exists, otherwise returns without affecting the collection.
-
addPropertyChangeListener
public void addPropertyChangeListener(java.beans.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 interfaceAVList
- Specified by:
addPropertyChangeListener
in interfacecom.jogamp.opengl.awt.ComponentEvents
- Overrides:
addPropertyChangeListener
in classjava.awt.Component
- Parameters:
listener
- the listener to call.- See Also:
PropertyChangeSupport
-
addPropertyChangeListener
public void addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
Description copied from interface:AVList
Adds a property change listener for the specified key.- Specified by:
addPropertyChangeListener
in interfaceAVList
- Specified by:
addPropertyChangeListener
in interfacecom.jogamp.opengl.awt.ComponentEvents
- Overrides:
addPropertyChangeListener
in classjava.awt.Component
- Parameters:
propertyName
- the key to associate the listener with.listener
- the listener to associate with the key.- See Also:
PropertyChangeSupport
-
removePropertyChangeListener
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Description copied from interface:AVList
Removes the specified all-property property change listener.- Specified by:
removePropertyChangeListener
in interfaceAVList
- Specified by:
removePropertyChangeListener
in interfacecom.jogamp.opengl.awt.ComponentEvents
- Overrides:
removePropertyChangeListener
in classjava.awt.Component
- Parameters:
listener
- the listener to remove.- See Also:
PropertyChangeSupport
-
removePropertyChangeListener
public void removePropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
Description copied from interface:AVList
Removes a property change listener associated with the specified key.- Specified by:
removePropertyChangeListener
in interfaceAVList
- Specified by:
removePropertyChangeListener
in interfacecom.jogamp.opengl.awt.ComponentEvents
- Overrides:
removePropertyChangeListener
in classjava.awt.Component
- Parameters:
propertyName
- the key associated with the change listener.listener
- the listener to remove.- See Also:
PropertyChangeSupport
-
firePropertyChange
public void firePropertyChange(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue)
Description copied from interface:AVList
Calls all property change listeners associated with the specified key. No listeners are called ifodValue
andnewValue
are equal and non-null.- Specified by:
firePropertyChange
in interfaceAVList
- Overrides:
firePropertyChange
in classjava.awt.Component
- Parameters:
propertyName
- the keyoldValue
- the value associated with the key before the even causing the firing.newValue
- the new value associated with the key.- See Also:
PropertyChangeSupport
-
firePropertyChange
public void firePropertyChange(java.beans.PropertyChangeEvent propertyChangeEvent)
Description copied from interface:AVList
Calls all registered property change listeners with the specified property change event.- Specified by:
firePropertyChange
in interfaceAVList
- Parameters:
propertyChangeEvent
- the event- See Also:
PropertyChangeSupport
-
copy
public AVList copy()
Description copied from interface:AVList
Returns a shallow copy of thisAVList
instance: the keys and values themselves are not cloned.
-
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 interfaceWorldWindow
- Parameters:
keys
- The statistics to activate.
-
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 interfaceWorldWindow
- Returns:
- The keys and values of the active per-frame statistics.
-
-