public class WorldWindowGLJPanel extends GLJPanel implements WorldWindow, PropertyChangeListener
WorldWindowGLCanvas is a lightweight Swing 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.
 
 Note: The Java SDK for OpenGL (JOGL) support for the underlying GLJPanel that 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 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,
 "". If a stereo device cannot be selected and used, this falls back to a non-stereo device that supports World Wind'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. 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).JPanel.AccessibleJPanelJComponent.AccessibleJComponentContainer.AccessibleAWTContainerComponent.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategyWindowClosingProtocol.WindowClosingModeAWTPrintLifecycle.Context| Modifier and Type | Field and Description | 
|---|---|
| protected WorldWindowGLDrawable | wwdThe drawable to which  WorldWindowmethods are delegated. | 
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWaccessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTDEFAULT_PRINT_TILE_SIZESCREEN_CHANGE_ACTION_ENABLEDABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH| Constructor and Description | 
|---|
| WorldWindowGLJPanel()Constructs a new  WorldWindowGLCanvaswindow on the default graphics device. | 
| WorldWindowGLJPanel(WorldWindow shareWith)Constructs a new  WorldWindowGLJPanelon the default graphics device and shares graphics resources
 with anotherWorldWindow. | 
| WorldWindowGLJPanel(WorldWindow shareWith,
                   GLCapabilities capabilities,
                   GLCapabilitiesChooser chooser)Constructs a new  WorldWindowGLJPanelthat shares graphics resources with anotherWorldWindowand whose capabilities are chosen via a specifiedGLCapabilitiesobject and aGLCapabilitiesChooser. | 
| Modifier and Type | Method and Description | 
|---|---|
| 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  AVListinstance: the keys and values themselves are not cloned. | 
| protected void | createDefaultInputHandler()Constructs and attaches the  InputHandlerfor thisWorldWindow. | 
| protected void | createView()Constructs and attaches the  Viewfor thisWorldWindow. | 
| 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. | 
| Position | getCurrentPosition()Returns the current latitude, longitude and altitude of the current cursor position, or  nullif 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 objects at the current cursor position. | 
| PickedObjectList | getObjectsInSelectionBox()Returns the World Wind objects intersecting the current selection box. | 
| 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. | 
| boolean | isEnableGpuCacheReinitialization()Indicates whether the GPU resource cache is reinitialized when this window is reinitialized. | 
| void | propertyChange(PropertyChangeEvent evt) | 
| void | redraw()Causes a repaint event to be enqueued 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 | 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(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. | 
addGLEventListener, addGLEventListener, addNotify, areAllGLEventListenerInitialized, createContext, destroy, display, dispose, disposeGLEventListener, getAnimator, getAutoSwapBufferMode, getChosenGLCapabilities, getContext, getContextCreationFlags, getCustomPixelBufferProvider, getDefaultCloseOperation, getDelegatedDrawable, getExclusiveContextThread, getFactory, getGL, getGLEventListener, getGLEventListenerCount, getGLEventListenerInitState, getGLProfile, getHandle, getNativeSurface, getSkipGLOrientationVerticalFlip, getTextureUnit, getThreadName, getUpstreamWidget, initializeBackend, invoke, invoke, isGLOriented, isRealized, paintComponent, print, printComponent, releasePrint, removeGLEventListener, removeNotify, reshape, setAnimator, setAutoSwapBufferMode, setContext, setContextCreationFlags, setDefaultCloseOperation, setExclusiveContextThread, setGL, setGLEventListenerInitState, setOpaque, setPixelBufferProvider, setRealized, setSharedAutoDrawable, setSharedContext, setSkipGLOrientationVerticalFlip, setTextureUnit, setupPrint, shouldPreserveColorBufferIfTranslucent, swapBuffers, toStringgetAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIaddAncestorListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, 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, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, 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, requestDefaultFocus, 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, setNextFocusableComponent, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, updateadd, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTreeaction, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, 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, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, transferFocus, transferFocusBackward, transferFocusUpCycleclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetContextrepaint, setSizeaddComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListenergetHeight, getWidthprotected final WorldWindowGLDrawable wwd
WorldWindow methods are delegated.public WorldWindowGLJPanel()
WorldWindowGLCanvas window on the default graphics device.public WorldWindowGLJPanel(WorldWindow shareWith)
WorldWindowGLJPanel on the default graphics device and shares graphics resources
 with another WorldWindow.shareWith - a WorldWindow with which to share graphics resources.GLJPanel.GLJPanel(javax.media.opengl.GLCapabilitiesImmutable, javax.media.opengl.GLCapabilitiesChooser,
      javax.media.opengl.GLContext)public WorldWindowGLJPanel(WorldWindow shareWith, GLCapabilities capabilities, GLCapabilitiesChooser chooser)
WorldWindowGLJPanel that shares graphics resources with another
 WorldWindow and whose capabilities are chosen via a specified GLCapabilities object and a
 GLCapabilitiesChooser.shareWith - a WorldWindow with 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.GLJPanel.GLJPanel(javax.media.opengl.GLCapabilitiesImmutable, javax.media.opengl.GLCapabilitiesChooser,
      javax.media.opengl.GLContext)public void addPositionListener(PositionListener listener)
WorldWindowaddPositionListener in interface WorldWindowlistener - The position listener to add.public void addPropertyChangeListener(PropertyChangeListener listener)
AVListaddPropertyChangeListener in interface AVListaddPropertyChangeListener in interface ComponentEventsaddPropertyChangeListener in class Containerlistener - the listener to call.PropertyChangeSupportpublic void addPropertyChangeListener(String propertyName, PropertyChangeListener listener)
AVListaddPropertyChangeListener in interface AVListaddPropertyChangeListener in interface ComponentEventsaddPropertyChangeListener in class ContainerpropertyName - the key to associate the listener with.listener - the listener to associate with the key.PropertyChangeSupportpublic void addRenderingExceptionListener(RenderingExceptionListener listener)
WorldWindowaddRenderingExceptionListener in interface WorldWindowlistener - the The exception listener to add.public void addRenderingListener(RenderingListener listener)
WorldWindowaddRenderingListener in interface WorldWindowlistener - The rendering listener to add to those notified of rendering events by this world window.public void addSelectListener(SelectListener listener)
WorldWindowaddSelectListener in interface WorldWindowlistener - The select listener to add.public AVList copy()
AVListAVList instance: the keys and values themselves are not cloned.protected void createDefaultInputHandler()
InputHandler for this WorldWindow.protected void createView()
View for this WorldWindow.public void firePropertyChange(PropertyChangeEvent propertyChangeEvent)
AVListfirePropertyChange in interface AVListpropertyChangeEvent - the eventPropertyChangeSupportpublic void firePropertyChange(String propertyName, Object oldValue, Object newValue)
AVListodValue and newValue are equal and non-null.firePropertyChange in interface AVListfirePropertyChange in class ComponentpropertyName - the keyoldValue - the value associated with the key before the even causing the firing.newValue - the new value associated with the key.PropertyChangeSupportpublic Position getCurrentPosition()
WorldWindownull if the
 cursor is not on the globe.getCurrentPosition in interface WorldWindownull if the cursor is not positioned on the globe.public Set<Map.Entry<String,Object>> getEntries()
getEntries in interface AVListpublic GpuResourceCache getGpuResourceCache()
WorldWindowgetGpuResourceCache in interface WorldWindowpublic InputHandler getInputHandler()
WorldWindowgetInputHandler in interface WorldWindownull if no input handler is associated.public Model getModel()
WorldWindowgetModel in interface WorldWindowpublic PickedObjectList getObjectsAtCurrentPosition()
WorldWindowgetObjectsAtCurrentPosition in interface WorldWindownull if no objects are under the cursor.public PickedObjectList getObjectsInSelectionBox()
WorldWindowgetObjectsInSelectionBox in interface WorldWindownull if no objects are in the box.public Collection<PerformanceStatistic> getPerFrameStatistics()
WorldWindowgetPerFrameStatistics in interface WorldWindowpublic SceneController getSceneController()
WorldWindowgetSceneController in interface WorldWindownull if no scene controller is
         associated.public String getStringValue(String key)
AVListString.getStringValue in interface AVListkey - the attribute name. May not be null.null.public Object getValue(String key)
AVListpublic Collection<Object> getValues()
public View getView()
WorldWindowgetView in interface WorldWindowpublic boolean hasKey(String key)
AVListpublic boolean isEnableGpuCacheReinitialization()
WorldWindowisEnableGpuCacheReinitialization in interface WorldWindowtrue if reinitialization is enabled, otherwise false.public void propertyChange(PropertyChangeEvent evt)
propertyChange in interface PropertyChangeListenerpublic void redraw()
WorldWindowredraw in interface WorldWindowpublic void redrawNow()
WorldWindowredrawNow in interface WorldWindowpublic Object removeKey(String key)
AVListpublic void removePositionListener(PositionListener listener)
WorldWindowremovePositionListener in interface WorldWindowlistener - The listener to remove.public void removePropertyChangeListener(PropertyChangeListener listener)
AVListremovePropertyChangeListener in interface AVListremovePropertyChangeListener in interface ComponentEventsremovePropertyChangeListener in class Componentlistener - the listener to remove.PropertyChangeSupportpublic void removePropertyChangeListener(String propertyName, PropertyChangeListener listener)
AVListremovePropertyChangeListener in interface AVListremovePropertyChangeListener in interface ComponentEventsremovePropertyChangeListener in class ComponentpropertyName - the key associated with the change listener.listener - the listener to remove.PropertyChangeSupportpublic void removeRenderingExceptionListener(RenderingExceptionListener listener)
WorldWindowremoveRenderingExceptionListener in interface WorldWindowlistener - The listener to remove.public void removeRenderingListener(RenderingListener listener)
WorldWindowremoveRenderingListener in interface WorldWindowlistener - The rendering listener to remove.public void removeSelectListener(SelectListener listener)
WorldWindowremoveSelectListener in interface WorldWindowlistener - The select listener to remove.public void setEnableGpuCacheReinitialization(boolean enableGpuCacheReinitialization)
WorldWindowtrue 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 to false 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 is true.setEnableGpuCacheReinitialization in interface WorldWindowenableGpuCacheReinitialization - true to enable reinitialization, otherwise false.public void setInputHandler(InputHandler inputHandler)
WorldWindowsetInputHandler in interface WorldWindowinputHandler - 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.public void setModel(Model model)
WorldWindownull is specified for the model, the current model, if
 any, is disassociated with the window.setModel in interface WorldWindowmodel - the model to display. May be null.public void setModelAndView(Model model, View view)
WorldWindownull 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.setModelAndView in interface WorldWindowmodel - the model to display. May benull.view - the view to use to display this window's model. May benull.public void setPerFrameStatisticsKeys(Set<String> keys)
WorldWindowsetPerFrameStatisticsKeys in interface WorldWindowkeys - The statistics to activate.public void setSceneController(SceneController sceneController)
WorldWindowView, Model and any desired per-frame statistics keys.setSceneController in interface WorldWindowsceneController - the new scene controller.SceneController.setView(View), 
SceneController.setModel(Model), 
SceneController.setPerFrameStatisticsKeys(java.util.Set)public Object setValue(String key, Object value)
AVListsetValue in interface AVListkey - 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.public AVList setValues(AVList avList)
AVListpublic void setView(View view)
WorldWindownull is specified for the view, the
 current view, if any, is disassociated with the window.setView in interface WorldWindowview - the view to use to display this window's model. May be null.public void shutdown()
WorldWindowshutdown in interface WorldWindow