NASA World Wind

gov.nasa.worldwind.layers
Class AirspaceLayer

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.AirspaceLayer
All Implemented Interfaces:
AVList, Disposable, MessageListener, Layer, Restorable, WWObject, PropertyChangeListener, EventListener

public class AirspaceLayer
extends AbstractLayer

The Airspace class manages a collection of Airspace objects for rendering and picking. AirspaceLayer delegates to its internal AirspaceRenderer for rendering and picking operations.

See Also:
Airspace, AirspaceRenderer

Constructor Summary
AirspaceLayer()
          Creates a new Airspace with an empty collection of Airspaces.
 
Method Summary
 void addAirspace(Airspace airspace)
          Adds the specified airspace to this layer's internal collection.
 void addAirspaces(Iterable<Airspace> airspaces)
          Adds the contents of the specified airspaces to this layer's internal collection.
protected  void doPick(DrawContext dc, Point pickPoint)
           
protected  void doRender(DrawContext dc)
           
 Iterable<Airspace> getAirspaces()
          Returns the Iterable of Airspaces currently in use by this layer.
 Double getDepthOffsetFactor()
           
 Double getDepthOffsetUnits()
           
protected  AirspaceRenderer getRenderer()
           
 boolean isDrawExtents()
           
 boolean isDrawWireframe()
           
 boolean isEnableAntialiasing()
           
 boolean isEnableBatchPicking()
           
 boolean isEnableBatchRendering()
           
 boolean isEnableBlending()
           
 boolean isEnableDepthOffset()
           
 boolean isEnableLighting()
           
 void removeAirspace(Airspace airspace)
          Removes the specified airspace from this layer's internal collection, if it exists.
 void removeAllAirspaces()
          Clears the contents of this layer's internal Airspace collection.
 void setAirspaces(Iterable<Airspace> airspaceIterable)
          Overrides the collection of currently active Airspaces with the specified airspaceIterable.
 void setDepthOffsetFactor(Double factor)
           
 void setDepthOffsetUnits(Double units)
           
 void setDrawExtents(boolean draw)
           
 void setDrawWireframe(boolean draw)
           
 void setEnableAntialiasing(boolean enable)
           
 void setEnableBatchPicking(boolean enableBatchPicking)
           
 void setEnableBatchRendering(boolean enableBatchRendering)
           
 void setEnableBlending(boolean enable)
           
 void setEnableDepthOffset(boolean enable)
           
 void setEnableLighting(boolean enable)
           
 String toString()
           
 
Methods inherited from class gov.nasa.worldwind.layers.AbstractLayer
createLayerConfigElements, dispose, doPreRender, getDataFileStore, getExpiryTime, getLayerConfigParams, getMaxActiveAltitude, getMaxEffectiveAltitude, getMinActiveAltitude, getMinEffectiveAltitude, getName, getOpacity, getRestorableState, getScale, getScreenCredit, isAtMaxResolution, isEnabled, isLayerActive, isLayerConfigDocument, isLayerInView, isMultiResolution, isNetworkRetrievalEnabled, isPickEnabled, pick, preRender, render, restoreState, setDataFileStore, setEnabled, setExpiryTime, setMaxActiveAltitude, setMinActiveAltitude, setName, setNetworkRetrievalEnabled, setOpacity, setPickEnabled, setScreenCredit
 
Methods inherited from class gov.nasa.worldwind.WWObjectImpl
onMessage, propertyChange
 
Methods inherited from class gov.nasa.worldwind.avlist.AVListImpl
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
 
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
 
Methods inherited from interface gov.nasa.worldwind.event.MessageListener
onMessage
 

Constructor Detail

AirspaceLayer

public AirspaceLayer()
Creates a new Airspace with an empty collection of Airspaces.

Method Detail

addAirspace

public void addAirspace(Airspace airspace)
Adds the specified airspace to this layer's internal collection. If this layer's internal collection has been overridden with a call to setAirspaces(Iterable), this will throw an exception.

Parameters:
airspace - Airspace to add.
Throws:
IllegalArgumentException - If airspace is null.
IllegalStateException - If a custom Iterable has been specified by a call to setAirspaces.

addAirspaces

public void addAirspaces(Iterable<Airspace> airspaces)
Adds the contents of the specified airspaces to this layer's internal collection. If this layer's internal collection has been overridden with a call to setAirspaces(Iterable), this will throw an exception.

Parameters:
airspaces - Airspaces to add.
Throws:
IllegalArgumentException - If airspaces is null.
IllegalStateException - If a custom Iterable has been specified by a call to setAirspaces.

doPick

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

doRender

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

getAirspaces

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

Returns:
Iterable of currently active Airspaces.

getDepthOffsetFactor

public Double getDepthOffsetFactor()

getDepthOffsetUnits

public Double getDepthOffsetUnits()

getRenderer

protected AirspaceRenderer getRenderer()

isDrawExtents

public boolean isDrawExtents()

isDrawWireframe

public boolean isDrawWireframe()

isEnableAntialiasing

public boolean isEnableAntialiasing()

isEnableBatchPicking

public boolean isEnableBatchPicking()

isEnableBatchRendering

public boolean isEnableBatchRendering()

isEnableBlending

public boolean isEnableBlending()

isEnableDepthOffset

public boolean isEnableDepthOffset()

isEnableLighting

public boolean isEnableLighting()

removeAirspace

public void removeAirspace(Airspace airspace)
Removes the specified airspace from this layer's internal collection, if it exists. If this layer's internal collection has been overridden with a call to setAirspaces(Iterable), this will throw an exception.

Parameters:
airspace - Airspace to remove.
Throws:
IllegalArgumentException - If airspace is null.
IllegalStateException - If a custom Iterable has been specified by a call to setAirspaces.

removeAllAirspaces

public void removeAllAirspaces()
Clears the contents of this layer's internal Airspace collection. If this layer's internal collection has been overridden with a call to setAirspaces(Iterable), this will throw an exception.

Throws:
IllegalStateException - If a custom Iterable has been specified by a call to setAirspaces.

setAirspaces

public void setAirspaces(Iterable<Airspace> airspaceIterable)
Overrides the collection of currently active Airspaces with the specified airspaceIterable. This layer will maintain a reference to airspaceIterable strictly for picking and rendering. This layer will not modify the Iterable reference. However, this will clear the internal collection of Airspaces, and will prevent any modification to its contents via addAirspace, addAirspaces, or removeAirspaces.

If the specified airspaceIterable is null, this layer will revert to maintaining its internal collection.

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

setDepthOffsetFactor

public void setDepthOffsetFactor(Double factor)

setDepthOffsetUnits

public void setDepthOffsetUnits(Double units)

setDrawExtents

public void setDrawExtents(boolean draw)

setDrawWireframe

public void setDrawWireframe(boolean draw)

setEnableAntialiasing

public void setEnableAntialiasing(boolean enable)

setEnableBatchPicking

public void setEnableBatchPicking(boolean enableBatchPicking)

setEnableBatchRendering

public void setEnableBatchRendering(boolean enableBatchRendering)

setEnableBlending

public void setEnableBlending(boolean enable)

setEnableDepthOffset

public void setEnableDepthOffset(boolean enable)

setEnableLighting

public void setEnableLighting(boolean enable)

toString

public String toString()
Overrides:
toString in class AbstractLayer

NASA World Wind