NASA World Wind

gov.nasa.worldwind.layers
Class TrackLayer

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.TrackLayer
All Implemented Interfaces:
AVList, Disposable, Layer, Restorable, WWObject, java.beans.PropertyChangeListener, java.util.EventListener
Direct Known Subclasses:
TrackMarkerLayer, TrackPipesLayer

public abstract class TrackLayer
extends AbstractLayer

The TrackLayer class manages a collection of Track objects for rendering and picking.

See Also:
Track

Field Summary
 
Fields inherited from class gov.nasa.worldwind.avlist.AVListImpl
changeSupport
 
Constructor Summary
TrackLayer(java.util.Collection<Track> tracks)
          Creates a new TrackLayer with the specified tracks in its internal collection.
 
Method Summary
protected abstract  void doDraw(DrawContext dc, TrackPointIterator trackPoints, java.awt.Point pickPoint)
           
protected  void doPick(DrawContext dc, java.awt.Point pickPoint)
           
protected  void doRender(DrawContext dc)
           
 Sector getBoundingSector()
           
 double getElevation()
           
 int getLowerLimit()
           
 int getNumPoints()
           
 java.lang.Iterable<Track> getTracks()
          Returns the Iterable of Tracks currently in use by this layer.
 int getUpperLimit()
           
 boolean isOverrideElevation()
           
 TrackPointIterator iterator()
           
 void setBoundingSector(Sector boundingSector)
           
 void setElevation(double markerElevation)
           
 void setLowerLimit(int lowerLimit)
           
 void setOverrideElevation(boolean overrideElevation)
           
 void setTrackIterable(java.lang.Iterable<Track> trackIterable)
          Overrides the collection of currently active Tracks with the specified trackIterable.
 void setTracks(java.util.Collection<Track> tracks)
          Sets the specified tracks as this layer's internal collection.
 void setUpperLimit(int upperLimit)
           
 java.lang.String toString()
           
 
Methods inherited from class gov.nasa.worldwind.layers.AbstractLayer
dispose, 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

TrackLayer

public TrackLayer(java.util.Collection<Track> tracks)
Creates a new TrackLayer with the specified tracks in its internal collection.

Parameters:
tracks - Collection of Tracks to add to this layer's internal collection.
Method Detail

doDraw

protected abstract void doDraw(DrawContext dc,
                               TrackPointIterator trackPoints,
                               java.awt.Point pickPoint)

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

getBoundingSector

public Sector getBoundingSector()

getElevation

public double getElevation()

getLowerLimit

public int getLowerLimit()

getNumPoints

public int getNumPoints()

getTracks

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

Returns:
Iterable of currently active Tracks.

getUpperLimit

public int getUpperLimit()

isOverrideElevation

public boolean isOverrideElevation()

iterator

public TrackPointIterator iterator()

setBoundingSector

public void setBoundingSector(Sector boundingSector)

setElevation

public void setElevation(double markerElevation)

setLowerLimit

public void setLowerLimit(int lowerLimit)

setOverrideElevation

public void setOverrideElevation(boolean overrideElevation)

setTrackIterable

public void setTrackIterable(java.lang.Iterable<Track> trackIterable)
Overrides the collection of currently active Tracks with the specified trackIterable. This layer will maintain a reference to trackIterable strictly for picking and rendering. This layer will not modify the Iterable reference. However, this will clear the internal collection of Tracks, and will prevent any modification to its contents via setTracks. If the specified trackIterable is null, this layer will revert to maintaining its internal collection.

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

setTracks

public void setTracks(java.util.Collection<Track> tracks)
Sets the specified tracks as this layer's internal collection. If this layer's internal collection has been overriden with a call to setTrackIterable(java.lang.Iterable), this will throw an exception.

Parameters:
tracks - List of Tracks to use.
Throws:
java.lang.IllegalArgumentException - If tracks is null.
java.lang.IllegalStateException - If a custom Iterable has been specified by a call to setTrackIterable.

setUpperLimit

public void setUpperLimit(int upperLimit)

toString

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

NASA World Wind