public class TLcdLayeredSupport extends Object implements ILcdLayered
ILcdLayered
.Constructor and Description |
---|
TLcdLayeredSupport()
Create a new
TLcdLayeredSupport , without specifying the ILcdLayered which
delegates his methods to this support. |
TLcdLayeredSupport(ILcdLayered aLayeredToSupport)
Creates a new
TLcdLayeredSupport that works for the given ILcdLayered . |
Modifier and Type | Method and Description |
---|---|
boolean |
addLayer(ILcdLayer aLayer)
Adds an
ILcdLayer (containing an ILcdModel )
on the top of the list. |
boolean |
addLayer(ILcdLayer aLayer,
int aIndex)
Adds an
ILcdLayer (containing an ILcdModel )
at index aIndex to the list. |
void |
addLayeredListener(ILcdLayeredListener aLayeredListener)
Adds an
ILcdLayeredListener to this list. |
ILcdLayer |
bottomLayer()
Returns the first
ILcdLayer of the list. |
boolean |
containsLayer(ILcdLayer aLayer)
Tests if the given
ILcdLayer is in the list. |
ILcdLayer |
findModelLayer(ILcdModel aModel) |
void |
fireLayeredEvent(TLcdLayeredEvent aLayeredEvent) |
ILcdLayer |
getLayer(int aIndex)
Returns the
ILcdLayer in this ILcdLayered
with index aIndex . |
ILcdLayered |
getLayeredToSupport()
Returns the
ILcdLayered which delegates his methods to this support |
int |
indexOf(ILcdLayer aLayer)
Returns the index if the given layer is in the list.
|
static boolean |
isFireInitialEvents()
Returns true if some initial events are fired to a
ILcdLayeredListener when it is added. |
int |
layerCount()
Returns the number of
ILcdLayer objects in this ILcdLayered . |
ILcdLayer |
layerOf(ILcdModel aModel)
Returns the
ILcdLayer of this ILcdLayered that contains the given ILcdModel . |
Enumeration |
layers()
Returns an
Enumeration of all ILcdLayer objects currently
in this ILcdLayered ,
starting from the bottom layer to the top layer. |
Enumeration |
layersBackwards()
Returns an
Enumeration of all ILcdLayer objects currently in this ILcdLayered ,
starting from the top layer to the bottom layer. |
void |
moveLayerAt(int aIndex,
ILcdLayer aLayer)
Moves the given layer (which is already in
ILcdLayered ) to the existing index
aIndex. |
void |
removeAllLayers()
Removes all the
ILcdLayer from this list. |
void |
removeAllObjects()
Removes all the Objects in each
ILcdModel of each
ILcdLayer of the list. |
void |
removeLayer(ILcdLayer aLayer)
Removes an
ILcdLayer from the list. |
void |
removeLayer(String aLayerLabel)
Removes from the list the
ILcdLayer which label is aLayerLabel. |
void |
removeLayeredListener(ILcdLayeredListener aLayeredListener)
Removes an
ILcdLayeredListener from this list. |
static void |
setFireInitialEvents(boolean aFireInitialEvents)
Sets if some initial events are fired to a
ILcdLayeredListener
when it is added. |
void |
setLayeredToSupport(ILcdLayered aLayeredToSupport)
Sets the
ILcdLayered which delegates his methods to this support |
ILcdLayer |
topLayer()
Returns the last
ILcdLayer of the list. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addLayeredListener, getLayers, removeLayeredListener
public TLcdLayeredSupport(ILcdLayered aLayeredToSupport)
TLcdLayeredSupport
that works for the given ILcdLayered
.aLayeredToSupport
- The layered to support.public TLcdLayeredSupport()
TLcdLayeredSupport
, without specifying the ILcdLayered
which
delegates his methods to this support. Make sure setLayeredToSupport(ILcdLayered)
is called
before using an instance of this class.public static boolean isFireInitialEvents()
ILcdLayeredListener
when it is added. Default is false.ILcdLayeredListener
that is added.setFireInitialEvents(boolean)
public static void setFireInitialEvents(boolean aFireInitialEvents)
ILcdLayeredListener
when it is added. Prior to version 6.0, the default behavior was true,
meaning that a LAYER_REMOVED
and
LAYER_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 a
ILcdLayeredListener
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.aFireInitialEvents
- True if initial events are fired to a listener,
false otherwise.public ILcdLayered getLayeredToSupport()
ILcdLayered
which delegates his methods to this supportILcdLayered
which delegates his methods to this supportpublic void setLayeredToSupport(ILcdLayered aLayeredToSupport)
ILcdLayered
which delegates his methods to this supportaLayeredToSupport
- the ILcdLayered
which delegates his methods to this supportpublic int layerCount()
ILcdLayered
ILcdLayer
objects in this ILcdLayered
.layerCount
in interface ILcdLayered
ILcdLayer
objects in this ILcdLayered
.public Enumeration layers()
ILcdLayered
Enumeration
of all ILcdLayer
objects currently
in this ILcdLayered
,
starting from the bottom layer to the top layer.layers
in interface ILcdLayered
Enumeration
of all ILcdLayer
objects currently
in this ILcdLayered
,
starting from the bottom layer to the top layer.public Enumeration layersBackwards()
ILcdLayered
Enumeration
of all ILcdLayer
objects currently in this ILcdLayered
,
starting from the top layer to the bottom layer.layersBackwards
in interface ILcdLayered
Enumeration
of all ILcdLayer
objects currently in this ILcdLayered
,
starting from the top layer to the bottom layer.public int indexOf(ILcdLayer aLayer) throws NoSuchElementException
ILcdLayered
indexOf
in interface ILcdLayered
aLayer
- the layer whose index to returnaLayer
NoSuchElementException
- if aLayer
is not in the listpublic void moveLayerAt(int aIndex, ILcdLayer aLayer) throws NoSuchElementException, ArrayIndexOutOfBoundsException
ILcdLayered
ILcdLayered
) 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 all ILcdLayer
objects
in from previousIndex + 1 to aIndex is decremented with 1.
If previousIndex > aIndex, then the index of all ILcdLayer
objects
in from aIndex to previousIndex -1 is incremented with 1.
moveLayerAt
in interface ILcdLayered
aIndex
- the index of the position where to move the layer.aLayer
- the layer to move.NoSuchElementException
- if aLayer
is not in this ILcdLayered
.ArrayIndexOutOfBoundsException
- if aIndex
is not an index of one of
the layers of this ILcdLayered
.public ILcdLayer getLayer(int aIndex) throws ArrayIndexOutOfBoundsException
ILcdLayered
ILcdLayer
in this ILcdLayered
with index aIndex
.getLayer
in interface ILcdLayered
aIndex
- the position of the layer to retrieve in the ILcdLayered
.ILcdLayer
in this ILcdLayered
with index aIndex
.ArrayIndexOutOfBoundsException
- if the given index is invalidpublic ILcdLayer layerOf(ILcdModel aModel) throws NoSuchElementException
ILcdLayered
ILcdLayer
of this ILcdLayered
that contains the given ILcdModel
.layerOf
in interface ILcdLayered
aModel
- the model to check for in this ILcdLayered
.ILcdLayer
of this ILcdLayered
that contains the given ILcdModel
.NoSuchElementException
- if there is no layer containing the given modelpublic void addLayeredListener(ILcdLayeredListener aLayeredListener)
ILcdLayeredListener
to this list.addLayeredListener
in interface ILcdLayered
aLayeredListener
- the listener that from now on will be notified of all changes
to the ILcdLayered
ILcdLayered.removeLayeredListener(com.luciad.view.ILcdLayeredListener)
public void removeLayeredListener(ILcdLayeredListener aLayeredListener)
ILcdLayeredListener
from this list.removeLayeredListener
in interface ILcdLayered
aLayeredListener
- the listener that will no longer be notified of changes
to the ILcdLayered
ILcdLayered.addLayeredListener(ILcdLayeredListener)
public void fireLayeredEvent(TLcdLayeredEvent aLayeredEvent)
public void removeAllObjects()
ILcdModel
of each
ILcdLayer
of the list.public boolean containsLayer(ILcdLayer aLayer)
ILcdLayer
is in the list.containsLayer
in interface ILcdLayered
aLayer
- the layer to check whether it is in this layered.aLayer
is in this ILcdLayered
,
false otherwise.public ILcdLayer bottomLayer() throws NoSuchElementException
ILcdLayer
of the list.NoSuchElementException
public ILcdLayer topLayer() throws NoSuchElementException
ILcdLayer
of the list.NoSuchElementException
public boolean addLayer(ILcdLayer aLayer)
ILcdLayer
(containing an ILcdModel
)
on the top of the list.
No action is performed if the given ILcdLayer
is already
contained in the list.aLayer
- the layer to be addedtrue (false)
if the layer has been added (not been added).public boolean addLayer(ILcdLayer aLayer, int aIndex)
ILcdLayer
(containing an ILcdModel
)
at index aIndex
to the list.
No action is performed if the given ILcdLayer
is already
contained in the list.aLayer
- the layer to be addedaIndex
- the target index for aLayer
in the list. The index must be a value
greater than or equal to 0
and less than or equal to the current number of layers layerCount()
. (If the
index is equal to the current number of layers, the new element
is appended to the list.)true (false)
if the layer has been added (not been added).public void removeLayer(ILcdLayer aLayer)
ILcdLayer
from the list.
No action is performed if the given ILcdLayer
is not contained in the list.removeLayer
in interface ILcdLayered
aLayer
- the layer to remove.public void removeAllLayers()
ILcdLayer
from this list.
No action is performed if the given ILcdLayer
is not contained in the list.removeAllLayers
in interface ILcdLayered
public void removeLayer(String aLayerLabel)
ILcdLayer
which label is aLayerLabel.
No action is performed if the given ILcdLayer
is not contained in the list.