Interface Layer
-
- All Superinterfaces:
AVList
,Disposable
,java.util.EventListener
,MessageListener
,java.beans.PropertyChangeListener
,Restorable
,WWObject
- All Known Subinterfaces:
AirspaceEditor
- All Known Implementing Classes:
AbstractAirspaceEditor
,AbstractGraticuleLayer
,AbstractLayer
,AbstractShapeEditor
,AnnotationLayer
,BasicMercatorTiledImageLayer
,BasicTiledImageLayer
,BMNGOneImage
,BMNGWMSLayer
,BoxEditor
,CachedRenderableLayer
,CompassLayer
,ConeEditor
,CountryBoundariesLayer
,CrosshairLayer
,CylinderEditor
,ExtrudedPolygonEditor
,GARSGraticuleLayer
,GliderImageLayer
,IconLayer
,LandsatI3WMSLayer
,LatLonGraticuleLayer
,LayerManagerLayer
,LocalRasterServerLayer
,MarkerLayer
,MarkersOrder.AppFrame.TimedMarkerLayer
,MeasureTool.CustomRenderableLayer
,MercatorTiledImageLayer
,MGRSGraticuleLayer
,MSVirtualEarthLayer
,NASAWFSPlaceNameLayer
,OpenStreetMapShapefileLoader.TextAndShapesLayer
,OSMCycleMapLayer
,OSMMapnikLayer
,PickFrustum.PickFrustumLayer
,PlaceNameLayer
,PolygonEditor
,PyramidEditor
,RenderableLayer
,RigidShapeEditor
,RPFTiledImageLayer
,ScalebarLayer
,SegmentPlaneEditor
,SkyColorLayer
,SkyGradientLayer
,SphereAirspaceEditor
,StarsLayer
,StatusLayer
,StatusLayer.StatusMGRSLayer
,StatusLayer.StatusUTMLayer
,SurfaceImageLayer
,TerrainProfileLayer
,TiledImageLayer
,USDANAIPWMSImageLayer
,USGSDigitalOrtho
,USGSTopoHighRes
,USGSTopoLowRes
,USGSTopoMedRes
,USGSUrbanAreaOrtho
,UTMBaseGraticuleLayer
,UTMGraticuleLayer
,ViewControlsLayer
,ViewVolumeViewer.SectorGeometryLayer
,ViewVolumeViewer.ViewVolumeLayer
,WedgeEditor
,WMSTiledImageLayer
,WorldMapLayer
public interface Layer extends WWObject, Disposable, Restorable
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description long
getExpiryTime()
Returns the current expiry time.double
getMaxActiveAltitude()
Returns the maximum altitude at which to display the layer.java.lang.Double
getMaxEffectiveAltitude(java.lang.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.java.lang.Double
getMinEffectiveAltitude(java.lang.Double radius)
Indicates the altitude below which this layer likely has low value or is not expected to be active.java.lang.String
getName()
Returns the layer's name, as specified in the most recent call tosetName(java.lang.String)
.double
getOpacity()
Returns the layer's opacity, the degree to which it is blended with underlying layers.double
getScale()
Returns the map scale, in terms of the ratio of 1 to the value returned, e.g., 1:24000.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.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, java.awt.Point pickPoint)
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
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(java.lang.String name)
Set the layer's name.void
setNetworkRetrievalEnabled(boolean networkRetrievalEnabled)
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 isPickable)
Controls whether the layer should perform picking.-
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 gov.nasa.worldwind.Disposable
dispose
-
Methods inherited from interface gov.nasa.worldwind.event.MessageListener
onMessage
-
Methods inherited from interface gov.nasa.worldwind.Restorable
getRestorableState, restoreState
-
-
-
-
Method Detail
-
isEnabled
boolean isEnabled()
Indicates whether the layer is enabled for rendering and selection.- Returns:
- true if the layer is enabled, else false.
-
setEnabled
void setEnabled(boolean enabled)
Controls whether the layer is enabled for rendering and selection.- Parameters:
enabled
-true
if the layer is enabled, elsefalse
.
-
getName
java.lang.String getName()
Returns the layer's name, as specified in the most recent call tosetName(java.lang.String)
.- Returns:
- the layer's name.
-
setName
void setName(java.lang.String name)
Set the layer's name. The name is a convenience attribute typically used to identify the layer in user interfaces. By default, a layer has no name.- Parameters:
name
- the name to assign to the layer.
-
getOpacity
double getOpacity()
Returns the layer's opacity, the degree to which it is blended with underlying layers.Many layers apply special usage of opacity, and some ignore it in favor of the opacity settings of their internal renderables. See the description of this method in specific layers to determine usage there.
- Returns:
- The layer's opacity, a value between 0 and 1.
-
setOpacity
void setOpacity(double opacity)
Sets the layer's opacity, the degree to which it is blended with underlying layers.Many layers apply special usage of opacity, and some ignore it in favor of the opacity settings of their internal renderables. See the description of this method in specific layers to determine usage there.
- Parameters:
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.
-
isPickEnabled
boolean isPickEnabled()
Indicates whether the layer performs selection during picking.Most layers enable picking by default. However, this becomes inconvenient for
SurfaceImage
andSurfaceImageLayer
} 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.- Returns:
true
if picking is enabled, elsefalse
.
-
setPickEnabled
void setPickEnabled(boolean isPickable)
Controls whether the layer should perform picking.- Parameters:
isPickable
-true
if the layer should perform picking, elsefalse
.
-
preRender
void preRender(DrawContext dc)
Causes the layer to perform any actions necessary to subsequently render the layer. The layer has exclusive access to the frame buffer during the call, and may use it to generate images or other information that is subsequently used to render the layer's contents. Upon return, the OpenGL state must be restored to its original.- Parameters:
dc
- the current draw context.
-
render
void render(DrawContext dc)
Cause the layer to draw its representation.- Parameters:
dc
- the current draw context for rendering.
-
pick
void pick(DrawContext dc, java.awt.Point pickPoint)
Cause the layer to perform picking, which determines whether the object or its components intersect a given point on the screen. Objects that intersect that point are added to the draw context's pick list and are conveyed to the application via selection events or by a direct query ofWorldWindow.getObjectsAtCurrentPosition()
.- Parameters:
dc
- the current draw context for rendering.pickPoint
- the screen coordinate point- See Also:
SelectEvent
-
isAtMaxResolution
boolean isAtMaxResolution()
Indicates whether the most recent rendering of the layer rendered the highest resolution imagery or other data available. Some layers do not track resolution. For those layers this value will always betrue
. Typically such layers also returnfalse
fromisMultiResolution()
.- Returns:
true
if the layer is at maximum resolution, otherwisefalse
.
-
isMultiResolution
boolean isMultiResolution()
Indicates whether the layer provides multiple resolutions of imagery or other data.- Returns:
true
if the layer provides multiple resolutions, elsefalse
.
-
getScale
double getScale()
Returns the map scale, in terms of the ratio of 1 to the value returned, e.g., 1:24000.- Returns:
- the map scale.
-
isNetworkRetrievalEnabled
boolean isNetworkRetrievalEnabled()
Indicates whether the layer is allowed to retrieve data from the network. Many layers have no need to retrieve data from the network. This state is meaningless for such layers.- Returns:
true
if the layer is enabled to retrieve network data, elsefalse
.
-
setNetworkRetrievalEnabled
void setNetworkRetrievalEnabled(boolean networkRetrievalEnabled)
Controls whether the layer is allowed to retrieve data from the network. Many layers have no need for data from the network. This state may be set but is meaningless for such layers.- Parameters:
networkRetrievalEnabled
-true
if network retrieval is allowed, elsefalse
.
-
setExpiryTime
void setExpiryTime(long expiryTime)
Specifies the time of the layer's most recent dataset update. If greater than zero, the layer ignores and eliminates any previously cached data older than the time specified, and requests new information from the data source. If zero, the layer uses any expiry times intrinsic to the layer, typically initialized at layer construction. The default expiry time is 0, thereby enabling a layer's intrinsic expiration criteria.- Parameters:
expiryTime
- the expiry time of any cached data, expressed as a number of milliseconds beyond the epoch.- See Also:
for a description of milliseconds beyond the epoch.
-
getExpiryTime
long getExpiryTime()
Returns the current expiry time.- Returns:
- the current expiry time.
-
getMinActiveAltitude
double getMinActiveAltitude()
Returns the minimum altitude at which the layer is displayed.- Returns:
- the minimum altitude at which the layer is displayed.
-
setMinActiveAltitude
void setMinActiveAltitude(double minActiveAltitude)
Specifies the minimum altitude at which to display the layer.- Parameters:
minActiveAltitude
- the minimum altitude at which to display the layer.
-
getMaxActiveAltitude
double getMaxActiveAltitude()
Returns the maximum altitude at which to display the layer.- Returns:
- the maximum altitude at which to display the layer.
-
setMaxActiveAltitude
void setMaxActiveAltitude(double maxActiveAltitude)
Specifies the maximum altitude at which to display the layer.- Parameters:
maxActiveAltitude
- the maximum altitude at which to display the layer.
-
isLayerInView
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.
-
isLayerActive
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.
-
getMaxEffectiveAltitude
java.lang.Double getMaxEffectiveAltitude(java.lang.Double radius)
Indicates the altitude above which this layer likely has low value or is not expected to be active. This value is independent of the maximum active altitude,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.- Parameters:
radius
- the radius of theGlobe
the layer is associated with. May be null, in which case the Earth's equatorial radius is used,Earth.WGS84_EQUATORIAL_RADIUS
.- Returns:
- the layer's maximum effective altitude.
-
getMinEffectiveAltitude
java.lang.Double getMinEffectiveAltitude(java.lang.Double radius)
Indicates the altitude below which this layer likely has low value or is not expected to be active. This value is independent of the minimum active altitude,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.- Parameters:
radius
- the radius of theGlobe
the layer is associated with. May be null, in which case the Earth's equatorial radius is used,Earth.WGS84_EQUATORIAL_RADIUS
.- Returns:
- the layer's minimum effective altitude.
-
-