public interface ILspLayer extends ILcdLayer
ILspView
.
This interface introduces the concept of "paint representations": each layer can
define any number of ways to visually represent the contents of its model. These representations
are rendered into the view in separate passes, and each of them can be toggled on and off
individually. The two commonly used representations are the geometries of objects
(TLspPaintRepresentation.BODY
) and textual representations
(TLspPaintRepresentation.LABEL
). This layer does not specify any mechanism for
visualization of the layer's model; this is done in derived interfaces.
This interface extends the basic ILcdLayer
interface with:
TLspPaintRepresentation
slayer state changes
layer status changes
bounds
of the layerlayer type
layer style
ILspPaintableLayer
Modifier and Type | Interface and Description |
---|---|
static class |
ILspLayer.LayerType
Provides hints about the type of a given
ILspLayer . |
Modifier and Type | Method and Description |
---|---|
void |
addLayerStateListener(ILspLayerStateListener aListener)
Adds a state change listener to this layer.
|
void |
addStatusListener(ILcdStatusListener<ILspLayer> aListener)
Adds a status listener to this layer that is notified when the layer
starts work asynchronously, when it is in progress, and when
it is finished.
|
ILcdBounds |
getBounds(TLspContext aContext)
Returns the bounds of the layer in world coordinates.
|
Collection<ILspView> |
getCurrentViews()
Returns a collection of all the views in which this layer is currently present.
|
TLspLayerStyle |
getLayerStyle()
Gets the current layer style.
|
ILspLayer.LayerType |
getLayerType()
Returns the layer type of this layer.
|
default ILspMapScaleProvider |
getMapScaleProvider()
Returns the map scale provider that determines the relationship between the view's map scale and the map scale as
used by stylers and data loading for this layer.
|
ILcdModelXYZWorldTransformation |
getModelXYZWorldTransformation(ILspView aView)
Returns the transformation that will be used to transform coordinates of the objects
in the model to world coordinates of the given view.
|
Collection<TLspPaintRepresentation> |
getPaintRepresentations()
Returns all
PaintRepresentation s that are supported by this layer. |
void |
invalidate()
Marks the contents of this layer as invalid, indicating that a repaint is required.
|
boolean |
isEditable(TLspPaintRepresentation aPaintRepresentation)
Returns whether the specified
PaintRepresentation is editable or not. |
boolean |
isVisible(TLspPaintRepresentation aPaintRepresentation)
Returns whether one of the
TLspPaintRepresentationState s of the the specified
TLspPaintRepresentation is enabled. |
boolean |
isVisible(TLspPaintRepresentationState aPaintRepresentationState)
Returns whether the specified
PaintRepresentationState is enabled or not. |
void |
registerView(ILspView aView)
Registers a view with this layer.
|
void |
removeLayerStateListener(ILspLayerStateListener aListener)
Removes the specified state listener from this layer.
|
void |
removeStatusListener(ILcdStatusListener<ILspLayer> aListener)
Removes a previously added status listener from this layer.
|
void |
setEditable(boolean aEditable)
Sets whether the layer should allow editing the content that it visualizes.
|
void |
setEditable(TLspPaintRepresentation aPaintRepresentation,
boolean aEditable)
Enables or disables the editable property of a paint representation.
|
void |
setLayerStyle(TLspLayerStyle aLayerStyle)
Sets a layer style to this layer.
|
void |
setVisible(boolean aVisible)
Sets whether or not the layer's content is painted.
|
void |
setVisible(TLspPaintRepresentation aPaintRepresentation,
boolean aVisible)
Enables or disables all
TLspPaintRepresentationState s of the specified
TLspPaintRepresentation . |
void |
setVisible(TLspPaintRepresentationState aPaintRepresentationState,
boolean aVisible)
Enables or disables the a paint representation state.
|
void |
unregisterView(ILspView aView)
Unregisters a view from this layer.
|
clearSelection, fireCollectedSelectionChanges, getIcon, getLabel, getModel, isEditable, isEditableSupported, isSelectable, isSelectableSupported, isVisible, selectObject, setIcon, setLabel, setSelectable
addSelectionListener, getSelectedObjects, getSelectionCount, isSelected, removeSelectionListener, selectedObjects
addPropertyChangeListener, removePropertyChangeListener
ILspLayer.LayerType getLayerType()
ILspLayer.LayerType
Collection<TLspPaintRepresentation> getPaintRepresentations()
PaintRepresentation
s that are supported by this layer.PaintRepresentation
s, never null
void setVisible(boolean aVisible)
ILcdLayer
setVisible
in interface ILcdLayer
aVisible
- true
if the layer should be visible, false
otherwise.setVisible(TLspPaintRepresentationState, boolean)
void setVisible(TLspPaintRepresentation aPaintRepresentation, boolean aVisible)
TLspPaintRepresentationState
s of the specified
TLspPaintRepresentation
.
This can be used to quickly switch representations (e.g. labels) on and off
without having to remove its related properties (ex. a painter).aPaintRepresentation
- the representation to enable or disableaVisible
- true to enable the representations or false to disable itIllegalArgumentException
- if aPaintRepresentation
is not supportedsetVisible(TLspPaintRepresentationState, boolean)
boolean isVisible(TLspPaintRepresentation aPaintRepresentation)
TLspPaintRepresentationState
s of the the specified
TLspPaintRepresentation
is enabled.aPaintRepresentation
- the paint representation to checkPaintRepresentation
is enabled or notIllegalArgumentException
- if aPaintRepresentation
is not supportedsetVisible(TLspPaintRepresentation, boolean)
void setVisible(TLspPaintRepresentationState aPaintRepresentationState, boolean aVisible)
layer visibility
. So a paint
representation state will only be visible when this method and the ILcdLayer.isVisible()
method
return true
.aPaintRepresentationState
- the representations to enable or disableaVisible
- true to enable the representations or false to disable itIllegalArgumentException
- if aPaintRepresentationState
is not supportedsetVisible(boolean)
boolean isVisible(TLspPaintRepresentationState aPaintRepresentationState)
PaintRepresentationState
is enabled or not.aPaintRepresentationState
- the paint representation to checkPaintRepresentationState
is enabled or notIllegalArgumentException
- if aPaintRepresentationState
is not supportedsetVisible(TLspPaintRepresentationState, boolean)
void setEditable(boolean aEditable)
ILcdLayer
isEditableSupported
to see if the layer supports editing.setEditable
in interface ILcdLayer
aEditable
- true if the layer content can be editedsetEditable(TLspPaintRepresentation, boolean)
,
ILcdLayer.isEditableSupported()
void setEditable(TLspPaintRepresentation aPaintRepresentation, boolean aEditable)
layer editability
. So paint
representation will only be editable when both the layer and the paint representation are
editable and editing is supported
.aPaintRepresentation
- the representation to enable or disableaEditable
- true to enable the representations or false to disable itIllegalArgumentException
- if aPaintRepresentation
is not supportedsetEditable(boolean)
,
ILcdLayer.isEditableSupported()
boolean isEditable(TLspPaintRepresentation aPaintRepresentation)
PaintRepresentation
is editable or not.aPaintRepresentation
- the paint representation to checkPaintRepresentation
is editable or notIllegalArgumentException
- if aPaintRepresentation
is not supportedsetEditable(TLspPaintRepresentation, boolean)
void registerView(ILspView aView)
unregisterView(com.luciad.view.lightspeed.ILspView)
.
This allows the layer to know at all times in which views it is currently
present; this information may help it to manage any data that it caches.aView
- the view to which this layer has been addedvoid unregisterView(ILspView aView)
registerView(com.luciad.view.lightspeed.ILspView)
, this method
determines the result of getCurrentViews()
.aView
- the view from which this layer has been removedCollection<ILspView> getCurrentViews()
Returns a collection of all the views in which this layer is currently present.
This list is kept up-to-date via the view's invocations of
registerView(com.luciad.view.lightspeed.ILspView)
and
unregisterView(com.luciad.view.lightspeed.ILspView)
.
The returned collection should not be modified.
registerView(com.luciad.view.lightspeed.ILspView)
,
unregisterView(com.luciad.view.lightspeed.ILspView)
ILcdModelXYZWorldTransformation getModelXYZWorldTransformation(ILspView aView)
Returns the transformation that will be used to transform coordinates of the objects in the model to world coordinates of the given view.
In order for this method to be thread-safe, the model-world transformation should not
be modified after it is returned by this method. In practice this means that this method
and its callers should treat the model-world transformation as an immutable object. So
it shouldn't reuse the same ILcdModelXYZWorldTransformation
for different
ILcdModelReferences
or ILcdXYZWorldReference
.
aView
- the viewvoid addLayerStateListener(ILspLayerStateListener aListener)
TLspPaintRepresentation
or TLspPaintRepresentationState
is
changed. This state change is described respectively by a TLspLayerStateEvent
or a
TLspLayerPaintStateEvent
.aListener
- the state change listener to be registered on this layervoid removeLayerStateListener(ILspLayerStateListener aListener)
aListener
- the listener to be removed from the layeraddLayerStateListener(ILspLayerStateListener)
void addStatusListener(ILcdStatusListener<ILspLayer> aListener)
aListener
- a status listenervoid removeStatusListener(ILcdStatusListener<ILspLayer> aListener)
aListener
- a status listenervoid invalidate()
ILcdBounds getBounds(TLspContext aContext) throws TLcdNoBoundsException, TLcdOutOfBoundsException
TLspContext.getXYZWorldReference()
is used.aContext
- The context that defines the reference system for the bounds to be
returned.TLcdNoBoundsException
- If the layer has no bounds in the reference system. For instance,
if the layer paints directly in the view.TLcdOutOfBoundsException
- If the bounds can not be represented in the specified reference
system.TLspLayerStyle getLayerStyle()
layer.setLayerStyle(TLspLayerStyle.newBuilder().build());
null
.void setLayerStyle(TLspLayerStyle aLayerStyle)
layer.setLayerStyle(TLspLayerStyle.newBuilder().build());
aLayerStyle
- the layer style. must not be null
.default ILspMapScaleProvider getMapScaleProvider()
TLspScaleBasedStyler
.null
. The default map scale provider takes the map scale directly from
the view and can be created with ILspMapScaleProvider.fromView()
.