Package com.luciad.view
Class TLcdLayeredSupport
java.lang.Object
com.luciad.view.TLcdLayeredSupport
- All Implemented Interfaces:
ILcdLayered
,Serializable
This is a utility class that can be used to make a class that implements
ILcdLayered
.- See Also:
-
Constructor Summary
ConstructorDescriptionCreate a newTLcdLayeredSupport
, without specifying theILcdLayered
which delegates his methods to this support.TLcdLayeredSupport
(ILcdLayered aLayeredToSupport) Creates a newTLcdLayeredSupport
that works for the givenILcdLayered
. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Adds anILcdLayer
(containing anILcdModel
) on the top of the list.boolean
Adds anILcdLayer
(containing anILcdModel
) at indexaIndex
to the list.void
addLayeredListener
(ILcdLayeredListener aLayeredListener) Adds anILcdLayeredListener
to this list.Returns the firstILcdLayer
of the list.boolean
containsLayer
(ILcdLayer aLayer) Tests if the givenILcdLayer
is in the list.findModelLayer
(ILcdModel aModel) void
fireLayeredEvent
(TLcdLayeredEvent aLayeredEvent) getLayer
(int aIndex) Returns theILcdLayer
in thisILcdLayered
with indexaIndex
.Returns theILcdLayered
which delegates his methods to this supportint
Returns the index if the given layer is in the list.static boolean
Returns true if some initial events are fired to aILcdLayeredListener
when it is added.int
Returns the number ofILcdLayer
objects in thisILcdLayered
.Returns theILcdLayer
of thisILcdLayered
that contains the givenILcdModel
.layers()
Returns anEnumeration
of allILcdLayer
objects currently in thisILcdLayered
, starting from the bottom layer to the top layer.Returns anEnumeration
of allILcdLayer
objects currently in thisILcdLayered
, starting from the top layer to the bottom layer.void
moveLayerAt
(int aIndex, ILcdLayer aLayer) Moves the given layer (which is already inILcdLayered
) to the existing index aIndex.void
Removes all theILcdLayer
from this list.void
Removes all the Objects in eachILcdModel
of eachILcdLayer
of the list.void
removeLayer
(ILcdLayer aLayer) Removes anILcdLayer
from the list.void
removeLayer
(String aLayerLabel) Removes from the list theILcdLayer
which label is aLayerLabel.void
removeLayeredListener
(ILcdLayeredListener aLayeredListener) Removes anILcdLayeredListener
from this list.static void
setFireInitialEvents
(boolean aFireInitialEvents) Sets if some initial events are fired to aILcdLayeredListener
when it is added.void
setLayeredToSupport
(ILcdLayered aLayeredToSupport) Sets theILcdLayered
which delegates his methods to this supporttopLayer()
Returns the lastILcdLayer
of the list.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.luciad.view.ILcdLayered
addLayeredListener, getLayers, removeLayeredListener
-
Constructor Details
-
TLcdLayeredSupport
Creates a newTLcdLayeredSupport
that works for the givenILcdLayered
.- Parameters:
aLayeredToSupport
- The layered to support.
-
TLcdLayeredSupport
public TLcdLayeredSupport()Create a newTLcdLayeredSupport
, without specifying theILcdLayered
which delegates his methods to this support. Make suresetLayeredToSupport(ILcdLayered)
is called before using an instance of this class.
-
-
Method Details
-
isFireInitialEvents
public static boolean isFireInitialEvents()Returns true if some initial events are fired to aILcdLayeredListener
when it is added. Default is false.- Returns:
- true if events should be fired to a
ILcdLayeredListener
that is added. - See Also:
-
setFireInitialEvents
public static void setFireInitialEvents(boolean aFireInitialEvents) Sets if some initial events are fired to aILcdLayeredListener
when it is added. Prior to version 6.0, the default behavior was true, meaning that aLAYER_REMOVED
andLAYER_ADDED
event were fired, for every layer, but only to the listener that was just added. As of version 6.0 the default is false, meaning no events are fired to aILcdLayeredListener
when it is added. This is consistent with the behavior of all other listeners. For backward compatibility reasons, the old behavior can still be enabled, by setting this value to true. This property can also be set by assigning 'true' or 'false' to the system property 'com.luciad.view.TLcdLayeredSupport.fireInitialEvents'. A system property can be set using the command line option -Dkey=value to java.- Parameters:
aFireInitialEvents
- True if initial events are fired to a listener, false otherwise.
-
getLayeredToSupport
Returns theILcdLayered
which delegates his methods to this support- Returns:
- the
ILcdLayered
which delegates his methods to this support
-
setLayeredToSupport
Sets theILcdLayered
which delegates his methods to this support- Parameters:
aLayeredToSupport
- theILcdLayered
which delegates his methods to this support
-
layerCount
public int layerCount()Description copied from interface:ILcdLayered
Returns the number ofILcdLayer
objects in thisILcdLayered
.- Specified by:
layerCount
in interfaceILcdLayered
- Returns:
- the number of
ILcdLayer
objects in thisILcdLayered
.
-
layers
Description copied from interface:ILcdLayered
Returns anEnumeration
of allILcdLayer
objects currently in thisILcdLayered
, starting from the bottom layer to the top layer.- Specified by:
layers
in interfaceILcdLayered
- Returns:
- an
Enumeration
of allILcdLayer
objects currently in thisILcdLayered
, starting from the bottom layer to the top layer.
-
layersBackwards
Description copied from interface:ILcdLayered
Returns anEnumeration
of allILcdLayer
objects currently in thisILcdLayered
, starting from the top layer to the bottom layer.- Specified by:
layersBackwards
in interfaceILcdLayered
- Returns:
- an
Enumeration
of allILcdLayer
objects currently in thisILcdLayered
, starting from the top layer to the bottom layer.
-
indexOf
Description copied from interface:ILcdLayered
Returns the index if the given layer is in the list.- Specified by:
indexOf
in interfaceILcdLayered
- Parameters:
aLayer
- the layer whose index to return- Returns:
- the index of
aLayer
- Throws:
NoSuchElementException
- ifaLayer
is not in the list
-
moveLayerAt
public void moveLayerAt(int aIndex, ILcdLayer aLayer) throws NoSuchElementException, ArrayIndexOutOfBoundsException Description copied from interface:ILcdLayered
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.- Specified by:
moveLayerAt
in interfaceILcdLayered
- 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
.
-
getLayer
Description copied from interface:ILcdLayered
Returns theILcdLayer
in thisILcdLayered
with indexaIndex
.- Specified by:
getLayer
in interfaceILcdLayered
- 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
Description copied from interface:ILcdLayered
Returns theILcdLayer
of thisILcdLayered
that contains the givenILcdModel
.- Specified by:
layerOf
in interfaceILcdLayered
- 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
-
addLayeredListener
Adds anILcdLayeredListener
to this list.- Specified by:
addLayeredListener
in interfaceILcdLayered
- Parameters:
aLayeredListener
- the listener that from now on will be notified of all changes to theILcdLayered
- See Also:
-
removeLayeredListener
Removes anILcdLayeredListener
from this list.- Specified by:
removeLayeredListener
in interfaceILcdLayered
- Parameters:
aLayeredListener
- the listener that will no longer be notified of changes to theILcdLayered
- See Also:
-
fireLayeredEvent
-
removeAllObjects
public void removeAllObjects()Removes all the Objects in eachILcdModel
of eachILcdLayer
of the list. -
containsLayer
Tests if the givenILcdLayer
is in the list.- Specified by:
containsLayer
in interfaceILcdLayered
- Parameters:
aLayer
- the layer to check whether it is in this layered.- Returns:
- true if
aLayer
is in thisILcdLayered
, false otherwise.
-
bottomLayer
Returns the firstILcdLayer
of the list.- Throws:
NoSuchElementException
-
topLayer
Returns the lastILcdLayer
of the list.- Throws:
NoSuchElementException
-
addLayer
Adds anILcdLayer
(containing anILcdModel
) on the top of the list. No action is performed if the givenILcdLayer
is already contained in the list.- Parameters:
aLayer
- the layer to be added- Returns:
true (false)
if the layer has been added (not been added).
-
addLayer
Adds anILcdLayer
(containing anILcdModel
) at indexaIndex
to the list. No action is performed if the givenILcdLayer
is already contained in the list.- Parameters:
aLayer
- the layer to be addedaIndex
- the target index foraLayer
in the list. The index must be a value greater than or equal to0
and less than or equal to the current number of layerslayerCount()
. (If the index is equal to the current number of layers, the new element is appended to the list.)- Returns:
true (false)
if the layer has been added (not been added).
-
removeLayer
Removes anILcdLayer
from the list. No action is performed if the givenILcdLayer
is not contained in the list.- Specified by:
removeLayer
in interfaceILcdLayered
- Parameters:
aLayer
- the layer to remove.
-
removeAllLayers
public void removeAllLayers()Removes all theILcdLayer
from this list. No action is performed if the givenILcdLayer
is not contained in the list.- Specified by:
removeAllLayers
in interfaceILcdLayered
-
removeLayer
Removes from the list theILcdLayer
which label is aLayerLabel. No action is performed if the givenILcdLayer
is not contained in the list. -
findModelLayer
-