NASA World Wind

gov.nasa.worldwind.layers
Class RenderableLayer

java.lang.Object
  extended by gov.nasa.worldwind.avlist.AVListImpl
      extended by gov.nasa.worldwind.WWObjectImpl
          extended by gov.nasa.worldwind.layers.AbstractLayer
              extended by gov.nasa.worldwind.layers.RenderableLayer
All Implemented Interfaces:
AVList, Disposable, Layer, Restorable, WWObject, java.beans.PropertyChangeListener, java.util.EventListener
Direct Known Subclasses:
BMNGOneImage, Clementine40BaseLayer, FogLayer, MOCColorizedBaseLayer, ScalebarLayer, SkyColorLayer, StarsLayer, SurfaceImageLayer, WorldMapLayer

public class RenderableLayer
extends AbstractLayer

The RenderableLayer class manages a collection of Renderable objects for rendering, picking, and disposal.

See Also:
Renderable

Field Summary
 
Fields inherited from class gov.nasa.worldwind.avlist.AVListImpl
changeSupport
 
Constructor Summary
RenderableLayer()
          Creates a new RenderableLayer with a null delegateOwner
RenderableLayer(Layer delegateOwner)
          Creates a new RenderableLayer with the specified delegateOwner.
 
Method Summary
 void addRenderable(Renderable renderable)
          Adds the specified renderable to this layer's internal collection.
 void addRenderables(java.lang.Iterable<Renderable> renderables)
          Adds the contents of the specified renderables to this layer's internal collection.
 void dispose()
          Disposes the contents of this layer's internal Renderable collection, but does not remove any elements from that collection.
protected  void doPick(DrawContext dc, java.awt.Point pickPoint)
           
protected  void doRender(DrawContext dc)
           
 Layer getDelegateOwner()
          Returns this layer's delegate owner, or null if none has been specified.
 java.lang.Iterable<Renderable> getRenderables()
          Returns the Iterable of Renderables currently in use by this layer.
 void removeAllRenderables()
          Clears the contents of this layer's internal Renderable collection.
 void removeRenderable(Renderable renderable)
          Removes the specified renderable from this layer's internal collection, if it exists.
 void setRenderables(java.lang.Iterable<Renderable> renderableIterable)
          Overrides the collection of currently active Renderables with the specified renderableIterable.
 java.lang.String toString()
           
 
Methods inherited from class gov.nasa.worldwind.layers.AbstractLayer
getMaxActiveAltitude, getMinActiveAltitude, getName, getOpacity, getRestorableState, getScale, isAtMaxResolution, isEnabled, isLayerActive, isLayerInView, isMultiResolution, isPickEnabled, pick, render, restoreState, setEnabled, setMaxActiveAltitude, setMinActiveAltitude, setName, setOpacity, setPickEnabled
 
Methods inherited from class gov.nasa.worldwind.WWObjectImpl
propertyChange
 
Methods inherited from class gov.nasa.worldwind.avlist.AVListImpl
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getDoubleValue, getDoubleValue, getEntries, getIntegerValue, getIntegerValue, getLongValue, getLongValue, getStringValue, getStringValue, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
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
 
Methods inherited from interface java.beans.PropertyChangeListener
propertyChange
 

Constructor Detail

RenderableLayer

public RenderableLayer()
Creates a new RenderableLayer with a null delegateOwner


RenderableLayer

public RenderableLayer(Layer delegateOwner)
Creates a new RenderableLayer with the specified delegateOwner.

Parameters:
delegateOwner - Layer that is this layer's delegate owner.
Method Detail

addRenderable

public void addRenderable(Renderable renderable)
Adds the specified renderable to this layer's internal collection. If this layer's internal collection has been overriden with a call to setRenderables(java.lang.Iterable), this will throw an exception.

Parameters:
renderable - Renderable to add.
Throws:
java.lang.IllegalArgumentException - If renderable is null.
java.lang.IllegalStateException - If a custom Iterable has been specified by a call to setRenderables.

addRenderables

public void addRenderables(java.lang.Iterable<Renderable> renderables)
Adds the contents of the specified renderables to this layer's internal collection. If this layer's internal collection has been overriden with a call to setRenderables(java.lang.Iterable), this will throw an exception.

Parameters:
renderables - Renderables to add.
Throws:
java.lang.IllegalArgumentException - If renderables is null.
java.lang.IllegalStateException - If a custom Iterable has been specified by a call to setRenderables.

dispose

public void dispose()
Disposes the contents of this layer's internal Renderable collection, but does not remove any elements from that collection.

Specified by:
dispose in interface Disposable
Overrides:
dispose in class AbstractLayer
Throws:
java.lang.IllegalStateException - If a custom Iterable has been specified by a call to setRenderables.

doPick

protected void doPick(DrawContext dc,
                      java.awt.Point pickPoint)
Overrides:
doPick in class AbstractLayer

doRender

protected void doRender(DrawContext dc)
Specified by:
doRender in class AbstractLayer

getDelegateOwner

public Layer getDelegateOwner()
Returns this layer's delegate owner, or null if none has been specified.

Returns:
Layer that is this layer's delegate owner.

getRenderables

public java.lang.Iterable<Renderable> getRenderables()
Returns the Iterable of Renderables currently in use by this layer. If the caller has specified a custom Iterable via setRenderables(java.lang.Iterable), this will returns a reference to that Iterable. If the caller passed setRenderables a null parameter, or if setRenderables has not been called, this returns a view of this layer's internal collection of Renderables.

Returns:
Iterable of currently active Renderables.

removeAllRenderables

public void removeAllRenderables()
Clears the contents of this layer's internal Renderable collection. If this layer's internal collection has been overriden with a call to setRenderables(java.lang.Iterable), this will throw an exception.

Throws:
java.lang.IllegalStateException - If a custom Iterable has been specified by a call to setRenderables.

removeRenderable

public void removeRenderable(Renderable renderable)
Removes the specified renderable from this layer's internal collection, if it exists. If this layer's internal collection has been overriden with a call to setRenderables(java.lang.Iterable), this will throw an exception.

Parameters:
renderable - Renderable to remove.
Throws:
java.lang.IllegalArgumentException - If renderable is null.
java.lang.IllegalStateException - If a custom Iterable has been specified by a call to setRenderables.

setRenderables

public void setRenderables(java.lang.Iterable<Renderable> renderableIterable)
Overrides the collection of currently active Renderables with the specified renderableIterable. This layer will maintain a reference to renderableIterable strictly for picking and rendering. This layer will not modify the reference, or dispose of its contents. This will also clear and dispose of the internal collection of Renderables, and will prevent any modification to its contents via addRenderable, addRenderables, removeRenderables, or dispose. If the specified renderableIterable is null, this layer will revert to maintaining its internal collection.

Parameters:
renderableIterable - Iterable to use instead of this layer's internal collection, or null to use this layer's internal collection.

toString

public java.lang.String toString()
Overrides:
toString in class AbstractLayer

NASA World Wind