|
NASA World Wind | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectgov.nasa.worldwind.avlist.AVListImpl
gov.nasa.worldwind.WWObjectImpl
gov.nasa.worldwind.layers.AbstractLayer
public abstract class AbstractLayer
| Constructor Summary | |
|---|---|
AbstractLayer()
|
|
| Method Summary | |
|---|---|
static Element |
createLayerConfigElements(AVList params,
Element context)
Appends layer configuration parameters as elements to the specified context. |
void |
dispose()
Disposes of any internal resources allocated by the object. |
protected void |
doPick(DrawContext dc,
Point point)
|
protected void |
doPreRender(DrawContext dc)
|
protected abstract void |
doRender(DrawContext dc)
|
FileStore |
getDataFileStore()
|
long |
getExpiryTime()
Returns the current expiry time. |
static AVList |
getLayerConfigParams(Element domElement,
AVList params)
Parses layer configuration parameters from the specified DOM document. |
double |
getMaxActiveAltitude()
Returns the maximum altitude at which to display the layer. |
Double |
getMaxEffectiveAltitude(Double radius)
Indicates the altitude above which this layer likely has low value or is not expected to be active. |
double |
getMinActiveAltitude()
Returns the minimum altitude at which the layer is displayed. |
Double |
getMinEffectiveAltitude(Double radius)
Indicates the altitude below which this layer likely has low value or is not expected to be active. |
String |
getName()
Returns the layer's name, as specified in the most recent call to Layer.setName(java.lang.String). |
double |
getOpacity()
Returns the layer's opacity, the degree to which it is blended with underlying layers. |
String |
getRestorableState()
Returns an XML document string describing the object's state. |
double |
getScale()
Returns the map scale, in terms of the ratio of 1 to the value returned, e.g., 1:24000. |
protected ScreenCredit |
getScreenCredit()
|
boolean |
isAtMaxResolution()
Indicates whether the most recent rendering of the layer rendered the highest resolution imagery or other data available. |
boolean |
isEnabled()
Indicates whether the layer is enabled for rendering and selection. |
boolean |
isLayerActive(DrawContext dc)
Indicates whether the layer is active based on arbitrary criteria. |
static boolean |
isLayerConfigDocument(Element domElement)
Returns true if a specified DOM document is a Layer configuration document, and false otherwise. |
boolean |
isLayerInView(DrawContext dc)
Indicates whether the layer is in the view. |
boolean |
isMultiResolution()
Indicates whether the layer provides multiple resolutions of imagery or other data. |
boolean |
isNetworkRetrievalEnabled()
Indicates whether the layer is allowed to retrieve data from the network. |
boolean |
isPickEnabled()
Indicates whether the layer performs selection during picking. |
void |
pick(DrawContext dc,
Point point)
Cause the layer to perform picking, which determines whether the object or its components intersect a given point on the screen. |
void |
preRender(DrawContext dc)
Causes the layer to perform any actions necessary to subsequently render the layer. |
void |
render(DrawContext dc)
Cause the layer to draw its representation. |
void |
restoreState(String stateInXml)
Restores the object's state to what is described in the specified XML document string. |
void |
setDataFileStore(FileStore fileStore)
|
void |
setEnabled(boolean enabled)
Controls whether the layer is enabled for rendering and selection. |
void |
setExpiryTime(long expiryTime)
Specifies the time of the layer's most recent dataset update. |
void |
setMaxActiveAltitude(double maxActiveAltitude)
Specifies the maximum altitude at which to display the layer. |
void |
setMinActiveAltitude(double minActiveAltitude)
Specifies the minimum altitude at which to display the layer. |
void |
setName(String name)
Set the layer's name. |
void |
setNetworkRetrievalEnabled(boolean networkDownloadEnabled)
Controls whether the layer is allowed to retrieve data from the network. |
void |
setOpacity(double opacity)
Sets the layer's opacity, the degree to which it is blended with underlying layers. |
void |
setPickEnabled(boolean pickable)
Controls whether the layer should perform picking. |
protected void |
setScreenCredit(ScreenCredit screenCredit)
|
String |
toString()
|
| 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 |
|---|
public AbstractLayer()
| Method Detail |
|---|
public static Element createLayerConfigElements(AVList params,
Element context)
| Parameter | Element Path | Type |
|---|---|---|
AVKey.DISPLAY_NAME | DisplayName | String |
AVKey.OPACITY | Opacity | Double |
AVKey.MAX_ACTIVE_ALTITUDE | ActiveAltitudes/@max | Double |
AVKey.MIN_ACTIVE_ALTITUDE | ActiveAltitudes/@min | Double |
AVKey.NETWORK_RETRIEVAL_ENABLED | NetworkRetrievalEnabled | Boolean |
AVKey.MAP_SCALE | MapScale | Double |
AVKey.SCREEN_CREDIT | ScreenCredit | ScreenCredit |
params - the key-value pairs which define the layer configuration parameters.context - the XML document root on which to append layer configuration elements.
IllegalArgumentException - if either the parameters or the context are null.public void dispose()
Disposable
dispose in interface Disposable
protected void doPick(DrawContext dc,
Point point)
protected void doPreRender(DrawContext dc)
protected abstract void doRender(DrawContext dc)
public FileStore getDataFileStore()
public long getExpiryTime()
Layer
getExpiryTime in interface Layer
public static AVList getLayerConfigParams(Element domElement,
AVList params)
| Parameter | Element Path | Type |
|---|---|---|
AVKey.DISPLAY_NAME | DisplayName | String |
AVKey.OPACITY | Opacity | Double |
AVKey.MAX_ACTIVE_ALTITUDE | ActiveAltitudes/@max | Double |
AVKey.MIN_ACTIVE_ALTITUDE | ActiveAltitudes/@min | Double |
AVKey.NETWORK_RETRIEVAL_ENABLED | NetworkRetrievalEnabled | Boolean |
AVKey.MAP_SCALE | MapScale | Double |
AVKey.SCREEN_CREDIT | ScreenCredit | ScreenCredit |
domElement - the XML document root to parse for layer configuration elements.params - the output key-value pairs which recieve the layer configuration parameters. A null reference
is permitted.
IllegalArgumentException - if the document is null.public double getMaxActiveAltitude()
Layer
getMaxActiveAltitude in interface Layerpublic Double getMaxEffectiveAltitude(Double radius)
LayerLayer.setMaxActiveAltitude(double) and does not reflect it.
The returned altitude is valid when the field of view indicated by View.getFieldOfView()
is set to its default value. Changing the field of view to any value other than the default may change this
layer's maximum effective altitude, but the returned altitude will not reflect that change.
getMaxEffectiveAltitude in interface Layerradius - the radius of the Globe the layer is associated with. May be
null, in which case the Earth's equatorial radius is used, Earth.WGS84_EQUATORIAL_RADIUS.
public double getMinActiveAltitude()
Layer
getMinActiveAltitude in interface Layerpublic Double getMinEffectiveAltitude(Double radius)
LayerLayer.setMinActiveAltitude(double) and does not reflect it.
The returned altitude is valid when the field of view indicated by View.getFieldOfView()
is set to its default value. Changing the field of view to any value other than the default may change this
layer's minimum effective altitude, but the returned altitude will not reflect that change.
getMinEffectiveAltitude in interface Layerradius - the radius of the Globe the layer is associated with. May be
null, in which case the Earth's equatorial radius is used, Earth.WGS84_EQUATORIAL_RADIUS.
public String getName()
LayerLayer.setName(java.lang.String).
getName in interface Layerpublic double getOpacity()
Layer
getOpacity in interface Layerpublic String getRestorableState()
RestorablerestoreState and passing the XML document.
getRestorableState in interface Restorablepublic double getScale()
Layer
getScale in interface Layerprotected ScreenCredit getScreenCredit()
public boolean isAtMaxResolution()
Layertrue.
Typically such layers also return false from Layer.isMultiResolution().
isAtMaxResolution in interface Layertrue if the layer is at maximum resolution, otherwise false.public boolean isEnabled()
Layer
isEnabled in interface Layerpublic boolean isLayerActive(DrawContext dc)
Layer
isLayerActive in interface Layerdc - the current draw context
true if the layer is active, false otherwise.public static boolean isLayerConfigDocument(Element domElement)
domElement - the DOM document in question.
IllegalArgumentException - if document is null.public boolean isLayerInView(DrawContext dc)
Layer
isLayerInView in interface Layerdc - the current draw context
true if the layer is in the view, false otherwise.public boolean isMultiResolution()
Layer
isMultiResolution in interface Layertrue if the layer provides multiple resolutions, else false.public boolean isNetworkRetrievalEnabled()
Layer
isNetworkRetrievalEnabled in interface Layertrue if the layer is enabled to retrieve network data, else false.public boolean isPickEnabled()
LayerSurfaceImage and SurfaceImageLayer} when the image
covers a large area because the view input handlers detect the surface image rather than the terrain as the top
picked object, and will not respond to the user's attempts at navigation. The solution is to disable picking for
the layer.
isPickEnabled in interface Layertrue if picking is enabled, else false.
public void pick(DrawContext dc,
Point point)
LayerWorldWindow.getObjectsAtCurrentPosition().
pick in interface Layerdc - the current draw context for rendering.point - the screen coordinate pointSelectEventpublic void preRender(DrawContext dc)
Layer
preRender in interface Layerdc - the current draw context.public void render(DrawContext dc)
Layer
render in interface Layerdc - the current draw context
IllegalArgumentException - if dc is null, or dc's Globe or
View is nullpublic void restoreState(String stateInXml)
Restorable
restoreState in interface RestorablestateInXml - an XML document string describing an object's state.public void setDataFileStore(FileStore fileStore)
public void setEnabled(boolean enabled)
Layer
setEnabled in interface Layerenabled - true if the layer is enabled, else false.public void setExpiryTime(long expiryTime)
Layer
setExpiryTime in interface LayerexpiryTime - the expiry time of any cached data, expressed as a number of milliseconds beyond the epoch.for a description of milliseconds beyond the epoch.public void setMaxActiveAltitude(double maxActiveAltitude)
Layer
setMaxActiveAltitude in interface LayermaxActiveAltitude - the maximum altitude at which to display the layer.public void setMinActiveAltitude(double minActiveAltitude)
Layer
setMinActiveAltitude in interface LayerminActiveAltitude - the minimum altitude at which to display the layer.public void setName(String name)
Layer
setName in interface Layername - the name to assign to the layer.public void setNetworkRetrievalEnabled(boolean networkDownloadEnabled)
Layer
setNetworkRetrievalEnabled in interface LayernetworkDownloadEnabled - true if network retrieval is allowed, else false.public void setOpacity(double opacity)
Layer
setOpacity in interface Layeropacity - The layer opacity, a value between 0 and 1. 0 indicates non-opaque (fully transparent), 1
indicates fully opaque. Values between 0 and 1 indicate partial opacity.public void setPickEnabled(boolean pickable)
Layer
setPickEnabled in interface Layerpickable - true if the layer should perform picking, else false.protected void setScreenCredit(ScreenCredit screenCredit)
public String toString()
toString in class Object
|
NASA World Wind | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||