Class WorldWindowGLJPanel
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JPanel
-
- com.jogamp.opengl.awt.GLJPanel
-
- gov.nasa.worldwind.awt.WorldWindowGLJPanel
-
- All Implemented Interfaces:
com.jogamp.nativewindow.awt.AWTPrintLifecycle,com.jogamp.nativewindow.NativeSurfaceHolder,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
public class WorldWindowGLJPanel extends com.jogamp.opengl.awt.GLJPanel implements WorldWindow, java.beans.PropertyChangeListener
WorldWindowGLCanvasis a lightweight Swing component for displaying WorldWindModels (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.Note: The Java SDK for OpenGL (JOGL) support for the underlying
GLJPanelthat this class uses has historically been problematic. It works well on some devices but not on others, and its performance varies much more among devices than that of its heavyweight counterpart,WorldWindowGLCanvas. It's therefore best to use the heavyweight component if possible. You can find detailed information on this issue in the Heavyweight and Lightweight Issues section of the "JOGL User's Guide"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
SceneControllersuch asStereoSceneControllermust also be specified in the WorldWindConfiguration. The default configuration specifies a stereo-capable controller. To prevent stereo from being used by subsequently openedWorldWindowGLCanvases, 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
GLContextassociated 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 theGpuResourceCacheassociated with the currentDrawContextso that they are automatically cleared, and be prepared to re-create them if they do not exist in theDrawContext's currentGpuResourceCachewhen 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 javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
-
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
-
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
-
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 WorldWindowGLDrawablewwdThe drawable to whichWorldWindowmethods are delegated.-
Fields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
-
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 WorldWindowGLJPanel()Constructs a newWorldWindowGLCanvaswindow on the default graphics device.WorldWindowGLJPanel(WorldWindow shareWith)Constructs a newWorldWindowGLJPanelon the default graphics device and shares graphics resources with anotherWorldWindow.WorldWindowGLJPanel(WorldWindow shareWith, com.jogamp.opengl.GLCapabilities capabilities, com.jogamp.opengl.GLCapabilitiesChooser chooser)Constructs a newWorldWindowGLJPanelthat shares graphics resources with anotherWorldWindowand whose capabilities are chosen via a specifiedGLCapabilitiesobject and aGLCapabilitiesChooser.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddPositionListener(PositionListener listener)Adds a position listener to this WorldWindow.voidaddPropertyChangeListener(java.beans.PropertyChangeListener listener)Adds the specified all-property property change listener that will be called for all list changes.voidaddPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)Adds a property change listener for the specified key.voidaddRenderingExceptionListener(RenderingExceptionListener listener)Adds an exception listener to this WorldWindow.voidaddRenderingListener(RenderingListener listener)Adds a rendering listener to this WorldWindow.voidaddSelectListener(SelectListener listener)Adds a select listener to this WorldWindow.AVListclearList()AVListcopy()Returns a shallow copy of thisAVListinstance: the keys and values themselves are not cloned.protected voidcreateDefaultInputHandler()Constructs and attaches theInputHandlerfor thisWorldWindow.protected voidcreateView()Constructs and attaches theViewfor thisWorldWindow.voidfirePropertyChange(java.beans.PropertyChangeEvent propertyChangeEvent)Calls all registered property change listeners with the specified property change event.voidfirePropertyChange(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue)Calls all property change listeners associated with the specified key.PositiongetCurrentPosition()Returns the current latitude, longitude and altitude of the current cursor position, ornullif the cursor is not on the globe.java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.Object>>getEntries()GpuResourceCachegetGpuResourceCache()Returns the GPU Resource used by this WorldWindow.InputHandlergetInputHandler()Returns the input handler associated with this instance.ModelgetModel()Returns the window's current model.PickedObjectListgetObjectsAtCurrentPosition()Returns the WorldWind objects at the current cursor position.PickedObjectListgetObjectsInSelectionBox()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.SceneControllergetSceneController()Returns the scene controller associated with this instance.java.lang.StringgetStringValue(java.lang.String key)Returns the value for a specified key.java.lang.ObjectgetValue(java.lang.String key)Returns the value for a specified key.java.util.Collection<java.lang.Object>getValues()ViewgetView()Returns this window's current view.booleanhasKey(java.lang.String key)Indicates whether a key is in the collection.booleanisEnableGpuCacheReinitialization()Indicates whether the GPU resource cache is reinitialized when this window is reinitialized.voidpropertyChange(java.beans.PropertyChangeEvent evt)voidredraw()Causes a repaint event to be enqueued with the window system for this WorldWindow.voidredrawNow()Immediately repaints the WorldWindow without waiting for a window system repaint event.java.lang.ObjectremoveKey(java.lang.String key)Removes a specified key from the collection if the key exists, otherwise returns without affecting the collection.voidremovePositionListener(PositionListener listener)Removes the specified position listener associated with this WorldWindow.voidremovePropertyChangeListener(java.beans.PropertyChangeListener listener)Removes the specified all-property property change listener.voidremovePropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)Removes a property change listener associated with the specified key.voidremoveRenderingExceptionListener(RenderingExceptionListener listener)Removes the specified rendering exception listener associated with this WorldWindow.voidremoveRenderingListener(RenderingListener listener)Removes a specified rendering listener associated with this WorldWindow.voidremoveSelectListener(SelectListener listener)Removes the specified select listener associated with this WorldWindow.voidsetEnableGpuCacheReinitialization(boolean enableGpuCacheReinitialization)Specifies whether to reinitialize the GPU resource cache when this window is reinitialized.voidsetInputHandler(InputHandler inputHandler)Sets the input handler to use for this instance.voidsetModel(Model model)Sets the model to display in this window.voidsetModelAndView(Model model, View view)Sets the model to display in this window and the view used to display it.voidsetPerFrameStatisticsKeys(java.util.Set<java.lang.String> keys)Activates the per-frame performance statistic specified.voidsetSceneController(SceneController sceneController)Specifies a new scene controller for the window.java.lang.ObjectsetValue(java.lang.String key, java.lang.Object value)Adds a key/value pair to the list.AVListsetValues(AVList avList)Adds the contents of another attribute-value list to the list.voidsetView(View view)Sets the view to use when displaying this window's model.voidshutdown()Causes resources used by the WorldWindow to be freed.-
Methods inherited from class com.jogamp.opengl.awt.GLJPanel
addGLEventListener, addGLEventListener, addNotify, areAllGLEventListenerInitialized, createContext, destroy, display, dispose, disposeGLEventListener, flushGLRunnables, getAnimator, getAutoSwapBufferMode, getChosenGLCapabilities, getContext, getContextCreationFlags, getCurrentSurfaceScale, getCustomPixelBufferProvider, getDefaultCloseOperation, getDelegatedDrawable, getExclusiveContextThread, getFactory, getGL, getGLEventListener, getGLEventListenerCount, getGLEventListenerInitState, getGLProfile, getHandle, getMaximumSurfaceScale, getMinimumSurfaceScale, getNativeSurface, getRequestedGLCapabilities, getRequestedSurfaceScale, getSkipGLOrientationVerticalFlip, getSurfaceHeight, getSurfaceWidth, getTextureUnit, getThreadName, getUpstreamLock, getUpstreamWidget, initializeBackend, invoke, invoke, isGLOriented, isRealized, isThreadGLCapable, paintComponent, print, printComponent, releasePrint, removeGLEventListener, removeNotify, reshape, setAnimator, setAutoSwapBufferMode, setContext, setContextCreationFlags, setDefaultCloseOperation, setExclusiveContextThread, setGL, setGLEventListenerInitState, setOpaque, setPixelBufferProvider, setRealized, setRequestedGLCapabilities, setSharedAutoDrawable, setSharedContext, setSkipGLOrientationVerticalFlip, setSurfaceScale, setTextureUnit, setupPrint, shouldPreserveColorBufferIfTranslucent, swapBuffers, toString
-
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
-
Methods inherited from class javax.swing.JComponent
addAncestorListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, printAll, printBorder, printChildren, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
-
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, list, list, paintComponents, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
-
Methods inherited from class java.awt.Component
add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, hasFocus, imageUpdate, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, list, list, list, paintAll, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, transferFocus, transferFocusBackward, transferFocusUpCycle
-
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 whichWorldWindowmethods are delegated.
-
-
Constructor Detail
-
WorldWindowGLJPanel
public WorldWindowGLJPanel()
Constructs a newWorldWindowGLCanvaswindow on the default graphics device.
-
WorldWindowGLJPanel
public WorldWindowGLJPanel(WorldWindow shareWith)
Constructs a newWorldWindowGLJPanelon the default graphics device and shares graphics resources with anotherWorldWindow.- Parameters:
shareWith- aWorldWindowwith which to share graphics resources.- See Also:
GLJPanel(GLCapabilitiesImmutable, GLCapabilitiesChooser)
-
WorldWindowGLJPanel
public WorldWindowGLJPanel(WorldWindow shareWith, com.jogamp.opengl.GLCapabilities capabilities, com.jogamp.opengl.GLCapabilitiesChooser chooser)
Constructs a newWorldWindowGLJPanelthat shares graphics resources with anotherWorldWindowand whose capabilities are chosen via a specifiedGLCapabilitiesobject and aGLCapabilitiesChooser.- Parameters:
shareWith- aWorldWindowwith which to share graphics resources.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:
GLJPanel(GLCapabilitiesImmutable, GLCapabilitiesChooser)
-
-
Method Detail
-
propertyChange
public void propertyChange(java.beans.PropertyChangeEvent evt)
- Specified by:
propertyChangein interfacejava.beans.PropertyChangeListener
-
shutdown
public void shutdown()
Description copied from interface:WorldWindowCauses resources used by the WorldWindow to be freed. The WorldWindow cannot be used once this method is called.- Specified by:
shutdownin interfaceWorldWindow
-
isEnableGpuCacheReinitialization
public boolean isEnableGpuCacheReinitialization()
Description copied from interface:WorldWindowIndicates whether the GPU resource cache is reinitialized when this window is reinitialized.- Specified by:
isEnableGpuCacheReinitializationin interfaceWorldWindow- Returns:
trueif reinitialization is enabled, otherwisefalse.
-
setEnableGpuCacheReinitialization
public void setEnableGpuCacheReinitialization(boolean enableGpuCacheReinitialization)
Description copied from interface:WorldWindowSpecifies whether to reinitialize the GPU resource cache when this window is reinitialized. A value oftrueindicates that the GPU resource cache this window is using should be cleared when its init() method is called, typically when re-parented. Set this tofalsewhen 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:
setEnableGpuCacheReinitializationin interfaceWorldWindow- Parameters:
enableGpuCacheReinitialization-trueto enable reinitialization, otherwisefalse.
-
createView
protected void createView()
Constructs and attaches theViewfor thisWorldWindow.
-
createDefaultInputHandler
protected void createDefaultInputHandler()
Constructs and attaches theInputHandlerfor thisWorldWindow.
-
getInputHandler
public InputHandler getInputHandler()
Description copied from interface:WorldWindowReturns the input handler associated with this instance.- Specified by:
getInputHandlerin interfaceWorldWindow- Returns:
- The input handler associated with this instance, or
nullif no input handler is associated.
-
setInputHandler
public void setInputHandler(InputHandler inputHandler)
Description copied from interface:WorldWindowSets the input handler to use for this instance.- Specified by:
setInputHandlerin interfaceWorldWindow- Parameters:
inputHandler- The input handler to use for this WorldWindow. May bynullifnullis specified, the current input handler, if any, is disassociated with the WorldWindow.
-
getSceneController
public SceneController getSceneController()
Description copied from interface:WorldWindowReturns the scene controller associated with this instance.- Specified by:
getSceneControllerin interfaceWorldWindow- Returns:
- The scene controller associated with the instance, or
nullif no scene controller is associated.
-
setSceneController
public void setSceneController(SceneController sceneController)
Description copied from interface:WorldWindowSpecifies a new scene controller for the window. The caller is responsible for populating the new scene controller with aView,Modeland any desired per-frame statistics keys.- Specified by:
setSceneControllerin 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:WorldWindowReturns 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:
getGpuResourceCachein interfaceWorldWindow- Returns:
- The GPU Resource cache used by this WorldWindow.
-
redraw
public void redraw()
Description copied from interface:WorldWindowCauses 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:
redrawin interfaceWorldWindow
-
redrawNow
public void redrawNow()
Description copied from interface:WorldWindowImmediately 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:
redrawNowin interfaceWorldWindow
-
setModel
public void setModel(Model model)
Description copied from interface:WorldWindowSets the model to display in this window. Ifnullis specified for the model, the current model, if any, is disassociated with the window.- Specified by:
setModelin interfaceWorldWindow- Parameters:
model- the model to display. May benull.
-
getModel
public Model getModel()
Description copied from interface:WorldWindowReturns the window's current model.- Specified by:
getModelin interfaceWorldWindow- Returns:
- the window's current model.
-
setView
public void setView(View view)
Description copied from interface:WorldWindowSets the view to use when displaying this window's model. Ifnullis specified for the view, the current view, if any, is disassociated with the window.- Specified by:
setViewin interfaceWorldWindow- Parameters:
view- the view to use to display this window's model. May be null.
-
getView
public View getView()
Description copied from interface:WorldWindowReturns this window's current view.- Specified by:
getViewin interfaceWorldWindow- Returns:
- the window's current view.
-
setModelAndView
public void setModelAndView(Model model, View view)
Description copied from interface:WorldWindowSets the model to display in this window and the view used to display it. Ifnullis specified for the model, the current model, if any, is disassociated with the window. Ifnullis specified for the view, the current view, if any, is disassociated with the window.- Specified by:
setModelAndViewin 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:WorldWindowAdds 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:
addRenderingListenerin 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:WorldWindowRemoves a specified rendering listener associated with this WorldWindow.- Specified by:
removeRenderingListenerin interfaceWorldWindow- Parameters:
listener- The rendering listener to remove.
-
addSelectListener
public void addSelectListener(SelectListener listener)
Description copied from interface:WorldWindowAdds 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:
addSelectListenerin interfaceWorldWindow- Parameters:
listener- The select listener to add.
-
removeSelectListener
public void removeSelectListener(SelectListener listener)
Description copied from interface:WorldWindowRemoves the specified select listener associated with this WorldWindow.- Specified by:
removeSelectListenerin interfaceWorldWindow- Parameters:
listener- The select listener to remove.
-
addPositionListener
public void addPositionListener(PositionListener listener)
Description copied from interface:WorldWindowAdds 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:
addPositionListenerin interfaceWorldWindow- Parameters:
listener- The position listener to add.
-
removePositionListener
public void removePositionListener(PositionListener listener)
Description copied from interface:WorldWindowRemoves the specified position listener associated with this WorldWindow.- Specified by:
removePositionListenerin interfaceWorldWindow- Parameters:
listener- The listener to remove.
-
addRenderingExceptionListener
public void addRenderingExceptionListener(RenderingExceptionListener listener)
Description copied from interface:WorldWindowAdds 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:
addRenderingExceptionListenerin interfaceWorldWindow- Parameters:
listener- the The exception listener to add.
-
removeRenderingExceptionListener
public void removeRenderingExceptionListener(RenderingExceptionListener listener)
Description copied from interface:WorldWindowRemoves the specified rendering exception listener associated with this WorldWindow.- Specified by:
removeRenderingExceptionListenerin interfaceWorldWindow- Parameters:
listener- The listener to remove.
-
getCurrentPosition
public Position getCurrentPosition()
Description copied from interface:WorldWindowReturns the current latitude, longitude and altitude of the current cursor position, ornullif the cursor is not on the globe.- Specified by:
getCurrentPositionin interfaceWorldWindow- Returns:
- The current position of the cursor, or
nullif the cursor is not positioned on the globe.
-
getObjectsAtCurrentPosition
public PickedObjectList getObjectsAtCurrentPosition()
Description copied from interface:WorldWindowReturns 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:
getObjectsAtCurrentPositionin interfaceWorldWindow- Returns:
- The list of objects at the cursor position, or
nullif no objects are under the cursor.
-
getObjectsInSelectionBox
public PickedObjectList getObjectsInSelectionBox()
Description copied from interface:WorldWindowReturns 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:
getObjectsInSelectionBoxin interfaceWorldWindow- Returns:
- The list of objects intersecting the selection box, or
nullif no objects are in the box.
-
setValue
public java.lang.Object setValue(java.lang.String key, java.lang.Object value)Description copied from interface:AVListAdds a key/value pair to the list. Replaces an existing key/value pair if the list already contains the key.- Specified by:
setValuein 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:AVListAdds 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:AVListReturns 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:
getEntriesin interfaceAVList
-
getStringValue
public java.lang.String getStringValue(java.lang.String key)
Description copied from interface:AVListReturns the value for a specified key. The value must be aString.- Specified by:
getStringValuein 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:AVListIndicates whether a key is in the collection.
-
removeKey
public java.lang.Object removeKey(java.lang.String key)
Description copied from interface:AVListRemoves 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:AVListAdds the specified all-property property change listener that will be called for all list changes.- Specified by:
addPropertyChangeListenerin interfaceAVList- Specified by:
addPropertyChangeListenerin interfacecom.jogamp.opengl.awt.ComponentEvents- Overrides:
addPropertyChangeListenerin classjava.awt.Container- 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:AVListAdds a property change listener for the specified key.- Specified by:
addPropertyChangeListenerin interfaceAVList- Specified by:
addPropertyChangeListenerin interfacecom.jogamp.opengl.awt.ComponentEvents- Overrides:
addPropertyChangeListenerin classjava.awt.Container- 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:AVListRemoves the specified all-property property change listener.- Specified by:
removePropertyChangeListenerin interfaceAVList- Specified by:
removePropertyChangeListenerin interfacecom.jogamp.opengl.awt.ComponentEvents- Overrides:
removePropertyChangeListenerin 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:AVListRemoves a property change listener associated with the specified key.- Specified by:
removePropertyChangeListenerin interfaceAVList- Specified by:
removePropertyChangeListenerin interfacecom.jogamp.opengl.awt.ComponentEvents- Overrides:
removePropertyChangeListenerin 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:AVListCalls all property change listeners associated with the specified key. No listeners are called ifodValueandnewValueare equal and non-null.- Specified by:
firePropertyChangein interfaceAVList- Overrides:
firePropertyChangein 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:AVListCalls all registered property change listeners with the specified property change event.- Specified by:
firePropertyChangein interfaceAVList- Parameters:
propertyChangeEvent- the event- See Also:
PropertyChangeSupport
-
copy
public AVList copy()
Description copied from interface:AVListReturns a shallow copy of thisAVListinstance: the keys and values themselves are not cloned.
-
setPerFrameStatisticsKeys
public void setPerFrameStatisticsKeys(java.util.Set<java.lang.String> keys)
Description copied from interface:WorldWindowActivates 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:
setPerFrameStatisticsKeysin interfaceWorldWindow- Parameters:
keys- The statistics to activate.
-
getPerFrameStatistics
public java.util.Collection<PerformanceStatistic> getPerFrameStatistics()
Description copied from interface:WorldWindowReturns the active per-frame performance statistics such as number of tiles drawn in the most recent frame.- Specified by:
getPerFrameStatisticsin interfaceWorldWindow- Returns:
- The keys and values of the active per-frame statistics.
-
-