public abstract class WorldWindowImpl extends WWObjectImpl implements WorldWindow
WorldWindow
interface. Classes implementing WorldWindow
can
subclass or aggregate this object to provide default WorldWindow
functionality.Modifier and Type | Field and Description |
---|---|
protected GpuResourceCache |
gpuResourceCache |
Constructor and Description |
---|
WorldWindowImpl() |
Modifier and Type | Method and Description |
---|---|
void |
addPositionListener(PositionListener listener)
Adds a position listener to this WorldWindow.
|
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.
|
protected void |
callPositionListeners(PositionEvent event) |
protected void |
callRenderingExceptionListeners(java.lang.Throwable exception) |
protected void |
callRenderingListeners(RenderingEvent event) |
protected void |
callSelectListeners(SelectEvent event) |
static GpuResourceCache |
createGpuResourceCache() |
protected PickedObjectList |
getCurrentBoxSelection() |
Position |
getCurrentPosition()
Returns the current latitude, longitude and altitude of the current cursor position, or
null if the
cursor is not on the globe. |
protected PickedObject |
getCurrentSelection() |
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.
|
View |
getView()
Returns this window's current view.
|
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.
|
void |
removePositionListener(PositionListener listener)
Removes the specified position listener associated with this WorldWindow.
|
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 |
setGpuResourceCache(GpuResourceCache gpuResourceCache) |
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 sc)
Specifies a new scene controller for the window.
|
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.
|
onMessage, propertyChange
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getBooleanValue, getBooleanValue, getChangeSupport, getDoubleValue, getDoubleValue, getEntries, getIntegerValue, getIntegerValue, getLongValue, getLongValue, getRestorableStateForAVPair, getStringValue, getStringValue, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getContext, isEnableGpuCacheReinitialization, setEnableGpuCacheReinitialization
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getEntries, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues
protected GpuResourceCache gpuResourceCache
public void addPositionListener(PositionListener listener)
WorldWindow
addPositionListener
in interface WorldWindow
listener
- The position listener to add.public void addRenderingExceptionListener(RenderingExceptionListener listener)
WorldWindow
addRenderingExceptionListener
in interface WorldWindow
listener
- the The exception listener to add.public void addRenderingListener(RenderingListener listener)
WorldWindow
addRenderingListener
in interface WorldWindow
listener
- The rendering listener to add to those notified of rendering events by this WorldWindow.public void addSelectListener(SelectListener listener)
WorldWindow
addSelectListener
in interface WorldWindow
listener
- The select listener to add.protected void callPositionListeners(PositionEvent event)
protected void callRenderingExceptionListeners(java.lang.Throwable exception)
protected void callRenderingListeners(RenderingEvent event)
protected void callSelectListeners(SelectEvent event)
public static GpuResourceCache createGpuResourceCache()
protected PickedObjectList getCurrentBoxSelection()
public Position getCurrentPosition()
WorldWindow
null
if the
cursor is not on the globe.getCurrentPosition
in interface WorldWindow
null
if the cursor is not positioned on the globe.protected PickedObject getCurrentSelection()
public GpuResourceCache getGpuResourceCache()
WorldWindow
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.
getGpuResourceCache
in interface WorldWindow
public InputHandler getInputHandler()
WorldWindow
getInputHandler
in interface WorldWindow
null
if no input handler is associated.public Model getModel()
WorldWindow
getModel
in interface WorldWindow
public PickedObjectList getObjectsAtCurrentPosition()
WorldWindow
getObjectsAtCurrentPosition
in interface WorldWindow
null
if no objects are under the cursor.public PickedObjectList getObjectsInSelectionBox()
WorldWindow
getObjectsInSelectionBox
in interface WorldWindow
null
if no objects are in the box.public java.util.Collection<PerformanceStatistic> getPerFrameStatistics()
WorldWindow
getPerFrameStatistics
in interface WorldWindow
public SceneController getSceneController()
WorldWindow
getSceneController
in interface WorldWindow
null
if no scene controller is
associated.public View getView()
WorldWindow
getView
in interface WorldWindow
public void redraw()
WorldWindow
redraw
in interface WorldWindow
public void redrawNow()
WorldWindow
redrawNow
in interface WorldWindow
public void removePositionListener(PositionListener listener)
WorldWindow
removePositionListener
in interface WorldWindow
listener
- The listener to remove.public void removeRenderingExceptionListener(RenderingExceptionListener listener)
WorldWindow
removeRenderingExceptionListener
in interface WorldWindow
listener
- The listener to remove.public void removeRenderingListener(RenderingListener listener)
WorldWindow
removeRenderingListener
in interface WorldWindow
listener
- The rendering listener to remove.public void removeSelectListener(SelectListener listener)
WorldWindow
removeSelectListener
in interface WorldWindow
listener
- The select listener to remove.public void setGpuResourceCache(GpuResourceCache gpuResourceCache)
public void setInputHandler(InputHandler inputHandler)
WorldWindow
setInputHandler
in interface WorldWindow
inputHandler
- The input handler to use for this WorldWindow. May by null
if null
is specified, the current input handler, if any, is disassociated with the WorldWindow.public void setModel(Model model)
WorldWindow
null
is specified for the model, the current model, if
any, is disassociated with the window.setModel
in interface WorldWindow
model
- the model to display. May be null
.public void setModelAndView(Model model, View view)
WorldWindow
null
is specified for
the model, the current model, if any, is disassociated with the window. If null
is specified for the
view, the current view, if any, is disassociated with the window.setModelAndView
in interface WorldWindow
model
- the model to display. May benull
.view
- the view to use to display this window's model. May benull
.public void setPerFrameStatisticsKeys(java.util.Set<java.lang.String> keys)
WorldWindow
setPerFrameStatisticsKeys
in interface WorldWindow
keys
- The statistics to activate.public void setSceneController(SceneController sc)
WorldWindow
View
, Model
and any desired per-frame statistics keys.setSceneController
in interface WorldWindow
sc
- the new scene controller.SceneController.setView(View)
,
SceneController.setModel(Model)
,
SceneController.setPerFrameStatisticsKeys(java.util.Set)
public void setView(View view)
WorldWindow
null
is specified for the view, the
current view, if any, is disassociated with the window.setView
in interface WorldWindow
view
- the view to use to display this window's model. May be null.public void shutdown()
shutdown
in interface WorldWindow