gov.nasa.worldwind.layers
Class AbstractLayer
java.lang.Object
gov.nasa.worldwind.avlist.AVListImpl
gov.nasa.worldwind.WWObjectImpl
gov.nasa.worldwind.layers.AbstractLayer
- All Implemented Interfaces:
- AVList, Disposable, Layer, Restorable, WWObject, java.beans.PropertyChangeListener, java.util.EventListener
- Direct Known Subclasses:
- AnnotationLayer, CompassLayer, CrosshairLayer, IconLayer, PlaceNameLayer, RenderableLayer, SkyGradientLayer, TerrainProfileLayer, TiledImageLayer, TrackLayer, UTMGraticuleLayer
public abstract class AbstractLayer
- extends WWObjectImpl
- implements Layer
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 |
AbstractLayer
public AbstractLayer()
dispose
public void dispose()
- Specified by:
dispose
in interface Disposable
doPick
protected void doPick(DrawContext dc,
java.awt.Point point)
doRender
protected abstract void doRender(DrawContext dc)
getMaxActiveAltitude
public double getMaxActiveAltitude()
getMinActiveAltitude
public double getMinActiveAltitude()
getName
public java.lang.String getName()
- Specified by:
getName
in interface Layer
getOpacity
public double getOpacity()
- Specified by:
getOpacity
in interface Layer
getRestorableState
public java.lang.String getRestorableState()
- Description copied from interface:
Restorable
- Returns an XML document string describing the object?s state. This state can be restored later by calling
restoreState
and passing the XML document.
- Specified by:
getRestorableState
in interface Restorable
- Returns:
- an XML document string describing the object's state.
getScale
public double getScale()
- Specified by:
getScale
in interface Layer
isAtMaxResolution
public boolean isAtMaxResolution()
- Specified by:
isAtMaxResolution
in interface Layer
isEnabled
public boolean isEnabled()
- Specified by:
isEnabled
in interface Layer
isLayerActive
public boolean isLayerActive(DrawContext dc)
- Indicates whether the layer is active based on arbitrary criteria. The method implemented here is a default
indicating the layer is active if the current altitude is within the layer's min and max active altitudes.
Subclasses able to consider more criteria should override this implementation.
- Parameters:
dc
- the current draw context
- Returns:
true
if the layer is active, false
otherwise.
isLayerInView
public boolean isLayerInView(DrawContext dc)
- Indicates whether the layer is in the view. The method implemented here is a default indicating the layer is in
view. Subclasses able to determine their presence in the view should override this implementation.
- Parameters:
dc
- the current draw context
- Returns:
true
if the layer is in the view, false
otherwise.
isMultiResolution
public boolean isMultiResolution()
- Specified by:
isMultiResolution
in interface Layer
isPickEnabled
public boolean isPickEnabled()
- Specified by:
isPickEnabled
in interface Layer
pick
public void pick(DrawContext dc,
java.awt.Point point)
- Specified by:
pick
in interface Layer
render
public void render(DrawContext dc)
- Specified by:
render
in interface Layer
- Parameters:
dc
- the current draw context
- Throws:
java.lang.IllegalArgumentException
- if dc
is null, or dc
's Globe
or
View
is null
restoreState
public void restoreState(java.lang.String stateInXml)
- Description copied from interface:
Restorable
- Restores the object?s state to what is described in the specified XML document string.
- Specified by:
restoreState
in interface Restorable
- Parameters:
stateInXml
- an XML document string describing an object's state.
setEnabled
public void setEnabled(boolean enabled)
- Specified by:
setEnabled
in interface Layer
setMaxActiveAltitude
public void setMaxActiveAltitude(double maxActiveAltitude)
setMinActiveAltitude
public void setMinActiveAltitude(double minActiveAltitude)
setName
public void setName(java.lang.String name)
- Specified by:
setName
in interface Layer
setOpacity
public void setOpacity(double opacity)
- Specified by:
setOpacity
in interface Layer
setPickEnabled
public void setPickEnabled(boolean pickable)
- Specified by:
setPickEnabled
in interface Layer
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object