public class CachedRenderableLayer extends AbstractLayer
NOTE: This class is experimental and not fully implemented. You should not use it now.
Modifier and Type | Field and Description |
---|---|
protected static int |
DEFAULT_DEPTH |
protected BasicQuadTree<Renderable> |
extentTree |
protected PickSupport |
pickSupport |
Constructor and Description |
---|
CachedRenderableLayer(Sector coverage)
Constructs a layer instance.
|
CachedRenderableLayer(Sector coverage,
int numLevels)
Constructs a layer instance.
|
Modifier and Type | Method and Description |
---|---|
void |
add(Renderable item)
Add a Renderable to the layer.
|
void |
add(Renderable item,
java.lang.String name)
Adds a named Renderable to the layer.
|
void |
dispose()
Disposes any Renderables implementing @{link Dispose} and removes all Renderables from the layer.
|
protected void |
disposeRenderables() |
protected void |
doPick(DrawContext dc,
java.lang.Iterable<? extends Renderable> renderables,
java.awt.Point pickPoint) |
protected void |
doPick(DrawContext dc,
java.awt.Point pickPoint) |
protected void |
doPreRender(DrawContext dc) |
protected void |
doPreRender(DrawContext dc,
java.lang.Iterable<? extends Renderable> renderables) |
protected void |
doRender(DrawContext dc) |
protected void |
doRender(DrawContext dc,
java.lang.Iterable<? extends Renderable> renderables) |
java.lang.Iterable<? extends Renderable> |
getAllRenderables()
Returns all Renderables in the layer.
|
Renderable |
getByName(java.lang.String name)
Searches the layer for a named Renderable.
|
double |
getOpacity()
Returns the layer's opacity value, which is ignored by this layer because each of its renderables typiically has
its own opacity control.
|
java.util.Collection<? extends Renderable> |
getRenderables(LatLon location)
Returns all Renderables at a specfied location.
|
java.util.Collection<? extends Renderable> |
getRenderables(Sector extent)
Returns all Renderables within or intersecting a specified sector.
|
boolean |
hasItems()
Indictes whether the layer contains Renderables.
|
void |
remove(Renderable item)
Remove a Renderable from the layer if the Renderable is in the layer.
|
void |
removeByName(java.lang.String name)
Remove a named Renderable from the layer if it is in the layer.
|
void |
setOpacity(double opacity)
Opacity is not applied to layers of this type because each renderable typically has its own opacity control.
|
java.lang.String |
toString() |
createLayerConfigElements, getDataFileStore, getExpiryTime, getLayerConfigParams, getMaxActiveAltitude, getMaxEffectiveAltitude, getMinActiveAltitude, getMinEffectiveAltitude, getName, getRestorableState, getScale, getScreenCredit, isAtMaxResolution, isEnabled, isLayerActive, isLayerConfigDocument, isLayerInView, isMultiResolution, isNetworkRetrievalEnabled, isPickEnabled, pick, preRender, render, restoreState, setDataFileStore, setEnabled, setExpiryTime, setMaxActiveAltitude, setMinActiveAltitude, setName, setNetworkRetrievalEnabled, setPickEnabled, setScreenCredit
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, wait, wait, wait
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getEntries, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues
onMessage
protected static final int DEFAULT_DEPTH
protected BasicQuadTree<Renderable> extentTree
protected PickSupport pickSupport
public CachedRenderableLayer(Sector coverage)
coverage
- the geographic area covered by the layer's Renderables.java.lang.IllegalArgumentException
- if the coverage sector is null.public CachedRenderableLayer(Sector coverage, int numLevels)
coverage
- the geographic area covered by the layer's Renderables.numLevels
- the depth of the tree used to sort the Renderables.java.lang.IllegalArgumentException
- if the coverage sector is null or the number of levels is less than 1;public void add(Renderable item)
item
- the Renderable to add.java.lang.IllegalArgumentException
- if the item is null or does not implement GeographicExtent
.add(gov.nasa.worldwind.render.Renderable, String)
public void add(Renderable item, java.lang.String name)
item
- the Renderable to add.name
- a name for the Renderable. May be null, in which case the item has no name.java.lang.IllegalArgumentException
- if the item is null or does not implement GeographicExtent
.add(gov.nasa.worldwind.render.Renderable)
public void dispose()
dispose
in interface Disposable
dispose
in class AbstractLayer
protected void disposeRenderables()
protected void doPick(DrawContext dc, java.lang.Iterable<? extends Renderable> renderables, java.awt.Point pickPoint)
protected void doPick(DrawContext dc, java.awt.Point pickPoint)
doPick
in class AbstractLayer
protected void doPreRender(DrawContext dc)
doPreRender
in class AbstractLayer
protected void doPreRender(DrawContext dc, java.lang.Iterable<? extends Renderable> renderables)
protected void doRender(DrawContext dc)
doRender
in class AbstractLayer
protected void doRender(DrawContext dc, java.lang.Iterable<? extends Renderable> renderables)
public java.lang.Iterable<? extends Renderable> getAllRenderables()
public Renderable getByName(java.lang.String name)
name
- the name to search for. If null, no search is performed and null is returned.public double getOpacity()
getOpacity
in interface Layer
getOpacity
in class AbstractLayer
public java.util.Collection<? extends Renderable> getRenderables(LatLon location)
location
- the location of interest.getRenderables(gov.nasa.worldwind.geom.Sector)
,
getAllRenderables()
public java.util.Collection<? extends Renderable> getRenderables(Sector extent)
extent
- the location of interest.getRenderables(gov.nasa.worldwind.geom.LatLon)
,
getAllRenderables()
public boolean hasItems()
public void remove(Renderable item)
item
- the Renderable to removeremoveByName(String)
public void removeByName(java.lang.String name)
name
- the name of the Renderable to remove. If null, no Renderable is removed.remove(gov.nasa.worldwind.render.Renderable)
public void setOpacity(double opacity)
setOpacity
in interface Layer
setOpacity
in class AbstractLayer
opacity
- the current opacity value, which is ignored by this layer.public java.lang.String toString()
toString
in class AbstractLayer