public class CachedRenderableLayer extends AbstractLayer
| 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,
   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,
      Iterable<? extends Renderable> renderables,
      Point pickPoint)  | 
protected void | 
doPick(DrawContext dc,
      Point pickPoint)  | 
protected void | 
doPreRender(DrawContext dc)  | 
protected void | 
doPreRender(DrawContext dc,
           Iterable<? extends Renderable> renderables)  | 
protected void | 
doRender(DrawContext dc)  | 
protected void | 
doRender(DrawContext dc,
        Iterable<? extends Renderable> renderables)  | 
Iterable<? extends Renderable> | 
getAllRenderables()
Returns all Renderables in the layer. 
 | 
Renderable | 
getByName(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. 
 | 
Collection<? extends Renderable> | 
getRenderables(LatLon location)
Returns all Renderables at a specfied location. 
 | 
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(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. 
 | 
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, setScreenCreditonMessage, propertyChangeaddPropertyChangeListener, 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, setValuesclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getEntries, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValuespropertyChangeonMessageprotected 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.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.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.IllegalArgumentException - if the item is null or does not implement GeographicExtent.add(gov.nasa.worldwind.render.Renderable, String)public void add(Renderable item, String name)
item - the Renderable to add.name - a name for the Renderable. May be null, in which case the item has no name.IllegalArgumentException - if the item is null or does not implement GeographicExtent.add(gov.nasa.worldwind.render.Renderable)public void dispose()
dispose in interface Disposabledispose in class AbstractLayerprotected void disposeRenderables()
protected void doPick(DrawContext dc, Iterable<? extends Renderable> renderables, Point pickPoint)
protected void doPick(DrawContext dc, Point pickPoint)
doPick in class AbstractLayerprotected void doPreRender(DrawContext dc)
doPreRender in class AbstractLayerprotected void doPreRender(DrawContext dc, Iterable<? extends Renderable> renderables)
protected void doRender(DrawContext dc)
doRender in class AbstractLayerprotected void doRender(DrawContext dc, Iterable<? extends Renderable> renderables)
public Iterable<? extends Renderable> getAllRenderables()
public Renderable getByName(String name)
name - the name to search for. If null, no search is performed and null is returned.public double getOpacity()
getOpacity in interface LayergetOpacity in class AbstractLayerpublic Collection<? extends Renderable> getRenderables(LatLon location)
location - the location of interest.getRenderables(gov.nasa.worldwind.geom.Sector), 
getAllRenderables()public 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(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 LayersetOpacity in class AbstractLayeropacity - the current opacity value, which is ignored by this layer.public String toString()
toString in class AbstractLayer