NASA World Wind

gov.nasa.worldwind.layers
Class IconLayer

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

public class IconLayer
extends AbstractLayer

The IconLayer class manages a collection of WWIcon objects for rendering and picking. IconLayer delegates to its internal IconRenderer for rendering and picking operations.

See Also:
WWIcon, IconRenderer

Field Summary
 
Fields inherited from class gov.nasa.worldwind.avlist.AVListImpl
changeSupport
 
Constructor Summary
IconLayer()
          Creates a new IconLayer with an empty collection of Icons.
 
Method Summary
 void addIcon(WWIcon icon)
          Adds the specified icon to this layer's internal collection.
 void addIcons(Iterable<WWIcon> icons)
          Adds the contents of the specified icons to this layer's internal collection.
protected  void doPick(DrawContext dc, Point pickPoint)
           
protected  void doRender(DrawContext dc)
           
 Iterable<WWIcon> getIcons()
          Returns the Iterable of Icons currently in use by this layer.
 Pedestal getPedestal()
          Returns the Pedestal used by this layers internal IconRenderer.
 void removeAllIcons()
          Clears the contents of this layer's internal Icon collection.
 void removeIcon(WWIcon icon)
          Removes the specified icon from this layer's internal collection, if it exists.
 void setIcons(Iterable<WWIcon> iconIterable)
          Overrides the collection of currently active Icons with the specified iconIterable.
 void setPedestal(Pedestal pedestal)
          Sets the Pedestal used by this layers internal IconRenderer.
 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

IconLayer

public IconLayer()
Creates a new IconLayer with an empty collection of Icons.

Method Detail

addIcon

public void addIcon(WWIcon icon)
Adds the specified icon to this layer's internal collection. If this layer's internal collection has been overriden with a call to setIcons(java.lang.Iterable), this will throw an exception.

Parameters:
icon - Icon to add.
Throws:
IllegalArgumentException - If icon is null.
IllegalStateException - If a custom Iterable has been specified by a call to setIcons.

addIcons

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

Parameters:
icons - Icons to add.
Throws:
IllegalArgumentException - If icons is null.
IllegalStateException - If a custom Iterable has been specified by a call to setIcons.

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

getIcons

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

Returns:
Iterable of currently active Icons.

getPedestal

public Pedestal getPedestal()
Returns the Pedestal used by this layers internal IconRenderer.

Returns:
Pedestal used by this layers internal IconRenderer.

removeAllIcons

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

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

removeIcon

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

Parameters:
icon - Icon to remove.
Throws:
IllegalArgumentException - If icon is null.
IllegalStateException - If a custom Iterable has been specified by a call to setIcons.

setIcons

public void setIcons(Iterable<WWIcon> iconIterable)
Overrides the collection of currently active Icons with the specified iconIterable. This layer will maintain a reference to iconIterable strictly for picking and rendering. This layer will not modify the Iterable reference. However, this will clear the internal collection of Icons, and will prevent any modification to its contents via addIcon, addIcons, or removeIcons. If the specified iconIterable is null, this layer will revert to maintaining its internal collection.

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

setPedestal

public void setPedestal(Pedestal pedestal)
Sets the Pedestal used by this layers internal IconRenderer.

Parameters:
pedestal - Pedestal to be used by this layers internal IconRenderer.

toString

public String toString()
Overrides:
toString in class AbstractLayer

NASA World Wind