public abstract class AbstractLayer extends WWObjectImpl implements Layer
Constructor and Description |
---|
AbstractLayer() |
Modifier and Type | Method and Description |
---|---|
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() |
onMessage, propertyChange
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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getEntries, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues
propertyChange
onMessage
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 Layer
public Double getMaxEffectiveAltitude(Double radius)
Layer
Layer.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 Layer
radius
- 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 Layer
public Double getMinEffectiveAltitude(Double radius)
Layer
Layer.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 Layer
radius
- 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()
Layer
Layer.setName(java.lang.String)
.public double getOpacity()
Layer
getOpacity
in interface Layer
public String getRestorableState()
Restorable
restoreState
and passing the XML document.getRestorableState
in interface Restorable
public double getScale()
Layer
protected ScreenCredit getScreenCredit()
public boolean isAtMaxResolution()
Layer
true
.
Typically such layers also return false
from Layer.isMultiResolution()
.isAtMaxResolution
in interface Layer
true
if the layer is at maximum resolution, otherwise false
.public boolean isEnabled()
Layer
public boolean isLayerActive(DrawContext dc)
Layer
isLayerActive
in interface Layer
dc
- the current draw contexttrue
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 Layer
dc
- the current draw contexttrue
if the layer is in the view, false
otherwise.public boolean isMultiResolution()
Layer
isMultiResolution
in interface Layer
true
if the layer provides multiple resolutions, else false
.public boolean isNetworkRetrievalEnabled()
Layer
isNetworkRetrievalEnabled
in interface Layer
true
if the layer is enabled to retrieve network data, else false
.public boolean isPickEnabled()
Layer
SurfaceImage
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 Layer
true
if picking is enabled, else false
.public void pick(DrawContext dc, Point point)
Layer
WorldWindow.getObjectsAtCurrentPosition()
.pick
in interface Layer
dc
- the current draw context for rendering.point
- the screen coordinate pointSelectEvent
public void preRender(DrawContext dc)
Layer
public void render(DrawContext dc)
Layer
render
in interface Layer
dc
- the current draw contextIllegalArgumentException
- if dc
is null, or dc
's Globe
or
View
is nullpublic void restoreState(String stateInXml)
Restorable
restoreState
in interface Restorable
stateInXml
- an XML document string describing an object's state.public void setDataFileStore(FileStore fileStore)
public void setEnabled(boolean enabled)
Layer
setEnabled
in interface Layer
enabled
- true
if the layer is enabled, else false
.public void setExpiryTime(long expiryTime)
Layer
setExpiryTime
in interface Layer
expiryTime
- 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 Layer
maxActiveAltitude
- the maximum altitude at which to display the layer.public void setMinActiveAltitude(double minActiveAltitude)
Layer
setMinActiveAltitude
in interface Layer
minActiveAltitude
- the minimum altitude at which to display the layer.public void setName(String name)
Layer
public void setNetworkRetrievalEnabled(boolean networkDownloadEnabled)
Layer
setNetworkRetrievalEnabled
in interface Layer
networkDownloadEnabled
- true
if network retrieval is allowed, else false
.public void setOpacity(double opacity)
Layer
setOpacity
in interface Layer
opacity
- 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 Layer
pickable
- true
if the layer should perform picking, else false
.protected void setScreenCredit(ScreenCredit screenCredit)