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 TypeMethodDescriptionvoidaddLayeredListener(ILcdLayeredListener aLayeredListener) Registers the givenILcdLayeredListenerto be notified when layers are added, removed or moved.default voidaddLayeredListener(ILcdLayeredListener aListener, boolean aFireForeExistingLayers) Registers the givenILcdLayeredListenerto be notified when layers are added, removed or moved, with the additional option to be notified for all current layers.booleancontainsLayer(ILcdLayer aLayer) Returns whether thisILcdLayeredcontains the given layer.getLayer(int aIndex) Returns theILcdLayerin thisILcdLayeredwith indexaIndex.Returns aListof the layers.intReturns the index if the given layer is in the list.intReturns the number ofILcdLayerobjects in thisILcdLayered.Returns theILcdLayerof thisILcdLayeredthat contains the givenILcdModel.layers()Deprecated.Deprecated.useCollections.reverse(getLayers())insteadvoidmoveLayerAt(int aIndex, ILcdLayer aLayer) Moves the given layer (which is already inILcdLayered) to the existing index aIndex.voidRemoves all theILcdLayerobjects from thisILcdLayered.voidremoveLayer(ILcdLayer aLayer) Removes aLayer from thisILcdLayered.voidremoveLayeredListener(ILcdLayeredListener aLayeredListener) Unregisters the givenILcdLayeredListenerfrom receiving layered events for theILcdLayered.default voidremoveLayeredListener(ILcdLayeredListener aListener, boolean aFireForeExistingLayers) Unregisters the givenILcdLayeredListenerfrom receiving layered events, with the additional option to be notified for all current layers.
-
Method Details
-
addLayeredListener
Registers the given
ILcdLayeredListenerto 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
ALcdWeakLayeredListenerinstance 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
ILcdLayeredListenerto 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
ILcdLayeredaLAYER_ADDEDevent will be fired toaListenerwhenaFireForExistingLayersistrue. 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 givenILcdLayeredListenerfrom 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
ILcdLayeredListenerfrom receiving layered events, with the additional option to be notified for all current layers.For every existing layer in this
ILcdLayeredaLAYER_REMOVEDevent will be fired toaListenerwhenaFireForExistingLayersistrue. 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 ofILcdLayerobjects in thisILcdLayered.- Returns:
- the number of
ILcdLayerobjects in thisILcdLayered.
-
getLayers
Returns aListof the layers.- Returns:
- an unmodifiable
Listof the layers in thisILcdLayered - Since:
- 2017.1
-
layers
Deprecated.usegetLayers()insteadReturns anEnumerationof allILcdLayerobjects currently in thisILcdLayered, starting from the bottom layer to the top layer.- Returns:
- an
Enumerationof allILcdLayerobjects currently in thisILcdLayered, starting from the bottom layer to the top layer.
-
layersBackwards
Deprecated.useCollections.reverse(getLayers())insteadReturns anEnumerationof allILcdLayerobjects currently in thisILcdLayered, starting from the top layer to the bottom layer.- Returns:
- an
Enumerationof allILcdLayerobjects currently in thisILcdLayered, starting from the top layer to the bottom layer.
-
getLayer
Returns theILcdLayerin thisILcdLayeredwith indexaIndex.- Parameters:
aIndex- the position of the layer to retrieve in theILcdLayered.- Returns:
- the
ILcdLayerin thisILcdLayeredwith indexaIndex. - Throws:
ArrayIndexOutOfBoundsException- if the given index is invalid
-
layerOf
Returns theILcdLayerof thisILcdLayeredthat contains the givenILcdModel.- Parameters:
aModel- the model to check for in thisILcdLayered.- Returns:
- the
ILcdLayerof thisILcdLayeredthat 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- ifaLayeris 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
aLayerbefore the move. If previousIndex < aIndex, then the index of allILcdLayerobjects in from previousIndex + 1 to aIndex is decremented with 1. If previousIndex > aIndex, then the index of allILcdLayerobjects 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- ifaLayeris not in thisILcdLayered.ArrayIndexOutOfBoundsException- ifaIndexis 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 theILcdLayerobjects from thisILcdLayered. -
containsLayer
Returns whether thisILcdLayeredcontains the given layer. More formally, returnstrueif and only if theILcdLayeredcontains at least one layerlsuch that (aLayer==null ? l==null : aLayer.equals(l)).- Parameters:
aLayer- the layer to check whether it is in this layered.- Returns:
- true if
aLayeris in thisILcdLayered, false otherwise.
-
getLayers()instead