Package gov.nasa.worldwind
Interface WorldWindow
-
- All Superinterfaces:
AVList
- All Known Subinterfaces:
WorldWindowGLDrawable
- All Known Implementing Classes:
ConfiguringGLRuntimeCapabilities.MyGLAutoDrawable,DebuggingGLErrors.MyGLAutoDrawable,GliderWorldWindow,WorldWindowGLAutoDrawable,WorldWindowGLCanvas,WorldWindowGLJPanel,WorldWindowImpl
public interface WorldWindow extends AVList
The top-level interface common to all toolkit-specific WorldWind windows.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddPositionListener(PositionListener listener)Adds a position listener to this WorldWindow.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.com.jogamp.opengl.GLContextgetContext()Returns theGLContextassociated with thisWorldWindow.PositiongetCurrentPosition()Returns the current latitude, longitude and altitude of the current cursor position, ornullif the cursor is not on the globe.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.ViewgetView()Returns this window's current view.booleanisEnableGpuCacheReinitialization()Indicates whether the GPU resource cache is reinitialized when this window is reinitialized.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.voidremovePositionListener(PositionListener listener)Removes the specified position listener associated with this WorldWindow.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.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 interface gov.nasa.worldwind.avlist.AVList
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getEntries, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues
-
-
-
-
Method Detail
-
setModel
void setModel(Model model)
Sets the model to display in this window. Ifnullis specified for the model, the current model, if any, is disassociated with the window.- Parameters:
model- the model to display. May benull.
-
getModel
Model getModel()
Returns the window's current model.- Returns:
- the window's current model.
-
setView
void setView(View view)
Sets 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.- Parameters:
view- the view to use to display this window's model. May be null.
-
getView
View getView()
Returns this window's current view.- Returns:
- the window's current view.
-
setModelAndView
void setModelAndView(Model model, View view)
Sets 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.- Parameters:
model- the model to display. May benull.view- the view to use to display this window's model. May benull.
-
getSceneController
SceneController getSceneController()
Returns the scene controller associated with this instance.- Returns:
- The scene controller associated with the instance, or
nullif no scene controller is associated.
-
setSceneController
void setSceneController(SceneController sceneController)
Specifies 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.- Parameters:
sceneController- the new scene controller.- See Also:
SceneController.setView(View),SceneController.setModel(Model),SceneController.setPerFrameStatisticsKeys(java.util.Set)
-
getInputHandler
InputHandler getInputHandler()
Returns the input handler associated with this instance.- Returns:
- The input handler associated with this instance, or
nullif no input handler is associated.
-
setInputHandler
void setInputHandler(InputHandler inputHandler)
Sets the input handler to use for this instance.- Parameters:
inputHandler- The input handler to use for this WorldWindow. May bynullifnullis specified, the current input handler, if any, is disassociated with the WorldWindow.
-
addRenderingListener
void addRenderingListener(RenderingListener listener)
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.- Parameters:
listener- The rendering listener to add to those notified of rendering events by this WorldWindow.
-
removeRenderingListener
void removeRenderingListener(RenderingListener listener)
Removes a specified rendering listener associated with this WorldWindow.- Parameters:
listener- The rendering listener to remove.
-
addSelectListener
void addSelectListener(SelectListener listener)
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.- Parameters:
listener- The select listener to add.
-
removeSelectListener
void removeSelectListener(SelectListener listener)
Removes the specified select listener associated with this WorldWindow.- Parameters:
listener- The select listener to remove.
-
addPositionListener
void addPositionListener(PositionListener listener)
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.- Parameters:
listener- The position listener to add.
-
removePositionListener
void removePositionListener(PositionListener listener)
Removes the specified position listener associated with this WorldWindow.- Parameters:
listener- The listener to remove.
-
redraw
void redraw()
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.
-
redrawNow
void redrawNow()
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.
-
getCurrentPosition
Position getCurrentPosition()
Returns the current latitude, longitude and altitude of the current cursor position, ornullif the cursor is not on the globe.- Returns:
- The current position of the cursor, or
nullif the cursor is not positioned on the globe.
-
getObjectsAtCurrentPosition
PickedObjectList getObjectsAtCurrentPosition()
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.- Returns:
- The list of objects at the cursor position, or
nullif no objects are under the cursor.
-
getObjectsInSelectionBox
PickedObjectList getObjectsInSelectionBox()
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.- Returns:
- The list of objects intersecting the selection box, or
nullif no objects are in the box.
-
getGpuResourceCache
GpuResourceCache getGpuResourceCache()
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.
- Returns:
- The GPU Resource cache used by this WorldWindow.
-
setPerFrameStatisticsKeys
void setPerFrameStatisticsKeys(java.util.Set<java.lang.String> keys)
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.- Parameters:
keys- The statistics to activate.
-
getPerFrameStatistics
java.util.Collection<PerformanceStatistic> getPerFrameStatistics()
Returns the active per-frame performance statistics such as number of tiles drawn in the most recent frame.- Returns:
- The keys and values of the active per-frame statistics.
-
shutdown
void shutdown()
Causes resources used by the WorldWindow to be freed. The WorldWindow cannot be used once this method is called.
-
addRenderingExceptionListener
void addRenderingExceptionListener(RenderingExceptionListener listener)
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.- Parameters:
listener- the The exception listener to add.
-
removeRenderingExceptionListener
void removeRenderingExceptionListener(RenderingExceptionListener listener)
Removes the specified rendering exception listener associated with this WorldWindow.- Parameters:
listener- The listener to remove.
-
getContext
com.jogamp.opengl.GLContext getContext()
Returns theGLContextassociated with thisWorldWindow.- Returns:
- the
GLContextassociated with this window. May be null.
-
isEnableGpuCacheReinitialization
boolean isEnableGpuCacheReinitialization()
Indicates whether the GPU resource cache is reinitialized when this window is reinitialized.- Returns:
trueif reinitialization is enabled, otherwisefalse.
-
setEnableGpuCacheReinitialization
void setEnableGpuCacheReinitialization(boolean enableGpuCacheReinitialization)
Specifies 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.- Parameters:
enableGpuCacheReinitialization-trueto enable reinitialization, otherwisefalse.
-
-