Interface ILcdLayered
- All Superinterfaces:
Serializable
- All Known Subinterfaces:
ILcdGXYView
,ILcdLayerTreeNode
,ILcdRotationCapableGXYView
,ILcdTreeLayered
,ILcdTreeLayeredSupport
,ILspAWTView
,ILspView
- All Known Implementing Classes:
ALspAWTView
,TLcdEarthGXYViewTileSet
,TLcdGXYAsynchronousEditableLabelsLayerTreeNodeWrapper
,TLcdGXYAsynchronousLayerTreeNodeWrapper
,TLcdGXYLayerTreeNode
,TLcdGXYLspAsynchronousLayerTreeNodeWrapper
,TLcdGXYViewBufferedImage
,TLcdGXYViewCanvas
,TLcdGXYViewJPanel
,TLcdGXYViewJPanelLightWeight
,TLcdGXYViewPanel
,TLcdGXYViewPlanarImage
,TLcdIndependentOrderTreeLayeredSupport
,TLcdLayeredSupport
,TLcdLayerTreeNodeSupport
,TLcdMapBufferedImage
,TLcdMapCanvas
,TLcdMapJPanel
,TLcdMapJPanelLightWeight
,TLcdMapPanel
,TLcdTreeLayeredSupport
,TLspAWTView
,TLspExternalView
,TLspFXView
,TLspGXYLayerTreeNodeAdapter
,TLspLayerTreeNode
,TLspOffscreenView
,TLspSwingView
ILcdLayered
is a list of zero or more ILcdLayers
.
Each ILcdLayer
has
a unique index, ranging from 0 to the number of ILcdLayers
in this
ILcdLayered
minus one (#layers-1).
The layers are ordered by their index.
The bottom layer of this ILcdLayered
is the first ILcdLayer
.
The top layer of this ILcdLayered
is the last ILcdLayer
.
The meaning of top and bottom is that when all ILcdLayers
of
the ILcdLayered
are displayed, an ILcdLayer
closer to the top may
cover objects of an ILcdLayer
closer to the bottom, but not vice versa.
An ILcdLayered
has zero or more ILcdLayeredListeners
associated to it.
The ILcdLayered
sends a TLcdLayeredEvent
whenever the state of the
ILcdLayered
changes (listener pattern).
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addLayeredListener
(ILcdLayeredListener aLayeredListener) Registers the givenILcdLayeredListener
to be notified when layers are added, removed or moved.default void
addLayeredListener
(ILcdLayeredListener aListener, boolean aFireForeExistingLayers) Registers the givenILcdLayeredListener
to be notified when layers are added, removed or moved, with the additional option to be notified for all current layers.boolean
containsLayer
(ILcdLayer aLayer) Returns whether thisILcdLayered
contains the given layer.getLayer
(int aIndex) Returns theILcdLayer
in thisILcdLayered
with indexaIndex
.Returns aList
of the layers.int
Returns the index if the given layer is in the list.int
Returns the number ofILcdLayer
objects in thisILcdLayered
.Returns theILcdLayer
of thisILcdLayered
that contains the givenILcdModel
.layers()
Deprecated.Deprecated.useCollections.reverse(getLayers())
insteadvoid
moveLayerAt
(int aIndex, ILcdLayer aLayer) Moves the given layer (which is already inILcdLayered
) to the existing index aIndex.void
Removes all theILcdLayer
objects from thisILcdLayered
.void
removeLayer
(ILcdLayer aLayer) Removes aLayer from thisILcdLayered
.void
removeLayeredListener
(ILcdLayeredListener aLayeredListener) Unregisters the givenILcdLayeredListener
from receiving layered events for theILcdLayered
.default void
removeLayeredListener
(ILcdLayeredListener aListener, boolean aFireForeExistingLayers) Unregisters the givenILcdLayeredListener
from receiving layered events, with the additional option to be notified for all current layers.
-
Method Details
-
addLayeredListener
Registers the given
ILcdLayeredListener
to be notified when layers are added, removed or moved.In case you need to register a listener which keeps a reference to an object with a shorter life-time than this layered, you can use a
ALcdWeakLayeredListener
instance as layered listener.- Parameters:
aLayeredListener
- the listener that from now on will be notified of all changes to theILcdLayered
- See Also:
-
addLayeredListener
Registers the given
ILcdLayeredListener
to be notified when layers are added, removed or moved, with the additional option to be notified for all current layers.For every existing layer in this
ILcdLayered
aLAYER_ADDED
event will be fired toaListener
whenaFireForExistingLayers
istrue
. A use-case for this is when you want to use the listener to perform an action on any of the existing layers and on all future layers.- Parameters:
aListener
- The listener that from now on will be notified of all changes to theILcdLayered
.- Since:
- 2019.1
-
removeLayeredListener
Unregisters the givenILcdLayeredListener
from receiving layered events for theILcdLayered
.- Parameters:
aLayeredListener
- the listener that will no longer be notified of changes to theILcdLayered
- See Also:
-
removeLayeredListener
Unregisters the given
ILcdLayeredListener
from receiving layered events, with the additional option to be notified for all current layers.For every existing layer in this
ILcdLayered
aLAYER_REMOVED
event will be fired toaListener
whenaFireForExistingLayers
istrue
. A use-case for this is when you might want to unregister additional listeners for existing layers.- Parameters:
aListener
- The listener that will no longer be notified of changes to theILcdLayered
.- Since:
- 2020.1
-
layerCount
int layerCount()Returns the number ofILcdLayer
objects in thisILcdLayered
.- Returns:
- the number of
ILcdLayer
objects in thisILcdLayered
.
-
getLayers
Returns aList
of the layers.- Returns:
- an unmodifiable
List
of the layers in thisILcdLayered
- Since:
- 2017.1
-
layers
Deprecated.usegetLayers()
insteadReturns anEnumeration
of allILcdLayer
objects currently in thisILcdLayered
, starting from the bottom layer to the top layer.- Returns:
- an
Enumeration
of allILcdLayer
objects currently in thisILcdLayered
, starting from the bottom layer to the top layer.
-
layersBackwards
Deprecated.useCollections.reverse(getLayers())
insteadReturns anEnumeration
of allILcdLayer
objects currently in thisILcdLayered
, starting from the top layer to the bottom layer.- Returns:
- an
Enumeration
of allILcdLayer
objects currently in thisILcdLayered
, starting from the top layer to the bottom layer.
-
getLayer
Returns theILcdLayer
in thisILcdLayered
with indexaIndex
.- Parameters:
aIndex
- the position of the layer to retrieve in theILcdLayered
.- Returns:
- the
ILcdLayer
in thisILcdLayered
with indexaIndex
. - Throws:
ArrayIndexOutOfBoundsException
- if the given index is invalid
-
layerOf
Returns theILcdLayer
of thisILcdLayered
that contains the givenILcdModel
.- Parameters:
aModel
- the model to check for in thisILcdLayered
.- Returns:
- the
ILcdLayer
of thisILcdLayered
that contains the givenILcdModel
. - Throws:
NoSuchElementException
- if there is no layer containing the given model
-
indexOf
Returns the index if the given layer is in the list.- Parameters:
aLayer
- the layer whose index to return- Returns:
- the index of
aLayer
- Throws:
NoSuchElementException
- ifaLayer
is not in the list
-
moveLayerAt
void moveLayerAt(int aIndex, ILcdLayer aLayer) throws NoSuchElementException, ArrayIndexOutOfBoundsException Moves the given layer (which is already inILcdLayered
) to the existing index aIndex. When a layer is moved down, all layers in between the previous and future position of the given layer (including the layer at index aIndex) are moved one position up. When a layer is moved up, all layers in between the previous and future position of the given layer (including the layer at index aIndex) are moved one position down.More formally, let previousIndex be the index of
aLayer
before the move. If previousIndex < aIndex, then the index of allILcdLayer
objects in from previousIndex + 1 to aIndex is decremented with 1. If previousIndex > aIndex, then the index of allILcdLayer
objects in from aIndex to previousIndex -1 is incremented with 1.- Parameters:
aIndex
- the index of the position where to move the layer.aLayer
- the layer to move.- Throws:
NoSuchElementException
- ifaLayer
is not in thisILcdLayered
.ArrayIndexOutOfBoundsException
- ifaIndex
is not an index of one of the layers of thisILcdLayered
.
-
removeLayer
Removes aLayer from thisILcdLayered
.- Parameters:
aLayer
- the layer to remove.
-
removeAllLayers
void removeAllLayers()Removes all theILcdLayer
objects from thisILcdLayered
. -
containsLayer
Returns whether thisILcdLayered
contains the given layer. More formally, returnstrue
if and only if theILcdLayered
contains at least one layerl
such that (aLayer==null ? l==null : aLayer.equals(l)).- Parameters:
aLayer
- the layer to check whether it is in this layered.- Returns:
- true if
aLayer
is in thisILcdLayered
, false otherwise.
-
getLayers()
instead