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
ConstructorsConstructorDescriptionCreate a newTLcdLayeredSupport, without specifying theILcdLayeredwhich delegates his methods to this support.TLcdLayeredSupport(ILcdLayered aLayeredToSupport) Creates a newTLcdLayeredSupportthat works for the givenILcdLayered. -
Method Summary
Modifier and TypeMethodDescriptionbooleanAdds anILcdLayer(containing anILcdModel) on the top of the list.booleanAdds anILcdLayer(containing anILcdModel) at indexaIndexto the list.voidaddLayeredListener(ILcdLayeredListener aLayeredListener) Adds anILcdLayeredListenerto this list.Returns the firstILcdLayerof the list.booleancontainsLayer(ILcdLayer aLayer) Tests if the givenILcdLayeris in the list.findModelLayer(ILcdModel aModel) voidfireLayeredEvent(TLcdLayeredEvent aLayeredEvent) getLayer(int aIndex) Returns theILcdLayerin thisILcdLayeredwith indexaIndex.Returns theILcdLayeredwhich delegates his methods to this supportintReturns the index if the given layer is in the list.static booleanReturns true if some initial events are fired to aILcdLayeredListenerwhen it is added.intReturns the number ofILcdLayerobjects in thisILcdLayered.Returns theILcdLayerof thisILcdLayeredthat contains the givenILcdModel.layers()Returns anEnumerationof allILcdLayerobjects currently in thisILcdLayered, starting from the bottom layer to the top layer.Returns anEnumerationof allILcdLayerobjects currently in thisILcdLayered, starting from the top layer to the bottom layer.voidmoveLayerAt(int aIndex, ILcdLayer aLayer) Moves the given layer (which is already inILcdLayered) to the existing index aIndex.voidRemoves all theILcdLayerfrom this list.voidRemoves all the Objects in eachILcdModelof eachILcdLayerof the list.voidremoveLayer(ILcdLayer aLayer) Removes anILcdLayerfrom the list.voidremoveLayer(String aLayerLabel) Removes from the list theILcdLayerwhich label is aLayerLabel.voidremoveLayeredListener(ILcdLayeredListener aLayeredListener) Removes anILcdLayeredListenerfrom this list.static voidsetFireInitialEvents(boolean aFireInitialEvents) Sets if some initial events are fired to aILcdLayeredListenerwhen it is added.voidsetLayeredToSupport(ILcdLayered aLayeredToSupport) Sets theILcdLayeredwhich delegates his methods to this supporttopLayer()Returns the lastILcdLayerof the list.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.luciad.view.ILcdLayered
addLayeredListener, getLayers, removeLayeredListener
-
Constructor Details
-
TLcdLayeredSupport
Creates a newTLcdLayeredSupportthat works for the givenILcdLayered.- Parameters:
aLayeredToSupport- The layered to support.
-
TLcdLayeredSupport
public TLcdLayeredSupport()Create a newTLcdLayeredSupport, without specifying theILcdLayeredwhich 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 aILcdLayeredListenerwhen it is added. Default is false.- Returns:
- true if events should be fired to a
ILcdLayeredListenerthat is added. - See Also:
-
setFireInitialEvents
public static void setFireInitialEvents(boolean aFireInitialEvents) Sets if some initial events are fired to aILcdLayeredListenerwhen it is added. Prior to version 6.0, the default behavior was true, meaning that aLAYER_REMOVEDandLAYER_ADDEDevent 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 aILcdLayeredListenerwhen 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 theILcdLayeredwhich delegates his methods to this support- Returns:
- the
ILcdLayeredwhich delegates his methods to this support
-
setLayeredToSupport
Sets theILcdLayeredwhich delegates his methods to this support- Parameters:
aLayeredToSupport- theILcdLayeredwhich delegates his methods to this support
-
layerCount
public int layerCount()Description copied from interface:ILcdLayeredReturns the number ofILcdLayerobjects in thisILcdLayered.- Specified by:
layerCountin interfaceILcdLayered- Returns:
- the number of
ILcdLayerobjects in thisILcdLayered.
-
layers
Description copied from interface:ILcdLayeredReturns anEnumerationof allILcdLayerobjects currently in thisILcdLayered, starting from the bottom layer to the top layer.- Specified by:
layersin interfaceILcdLayered- Returns:
- an
Enumerationof allILcdLayerobjects currently in thisILcdLayered, starting from the bottom layer to the top layer.
-
layersBackwards
Description copied from interface:ILcdLayeredReturns anEnumerationof allILcdLayerobjects currently in thisILcdLayered, starting from the top layer to the bottom layer.- Specified by:
layersBackwardsin interfaceILcdLayered- Returns:
- an
Enumerationof allILcdLayerobjects currently in thisILcdLayered, starting from the top layer to the bottom layer.
-
indexOf
Description copied from interface:ILcdLayeredReturns the index if the given layer is in the list.- Specified by:
indexOfin interfaceILcdLayered- Parameters:
aLayer- the layer whose index to return- Returns:
- the index of
aLayer - Throws:
NoSuchElementException- ifaLayeris not in the list
-
moveLayerAt
public void moveLayerAt(int aIndex, ILcdLayer aLayer) throws NoSuchElementException, ArrayIndexOutOfBoundsException Description copied from interface:ILcdLayeredMoves 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.- Specified by:
moveLayerAtin interfaceILcdLayered- 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.
-
getLayer
Description copied from interface:ILcdLayeredReturns theILcdLayerin thisILcdLayeredwith indexaIndex.- Specified by:
getLayerin interfaceILcdLayered- 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
Description copied from interface:ILcdLayeredReturns theILcdLayerof thisILcdLayeredthat contains the givenILcdModel.- Specified by:
layerOfin interfaceILcdLayered- 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
-
addLayeredListener
Adds anILcdLayeredListenerto this list.- Specified by:
addLayeredListenerin interfaceILcdLayered- Parameters:
aLayeredListener- the listener that from now on will be notified of all changes to theILcdLayered- See Also:
-
removeLayeredListener
Removes anILcdLayeredListenerfrom this list.- Specified by:
removeLayeredListenerin 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 eachILcdModelof eachILcdLayerof the list. -
containsLayer
Tests if the givenILcdLayeris in the list.- Specified by:
containsLayerin interfaceILcdLayered- Parameters:
aLayer- the layer to check whether it is in this layered.- Returns:
- true if
aLayeris in thisILcdLayered, false otherwise.
-
bottomLayer
Returns the firstILcdLayerof the list.- Throws:
NoSuchElementException
-
topLayer
Returns the lastILcdLayerof the list.- Throws:
NoSuchElementException
-
addLayer
Adds anILcdLayer(containing anILcdModel) on the top of the list. No action is performed if the givenILcdLayeris 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 indexaIndexto the list. No action is performed if the givenILcdLayeris already contained in the list.- Parameters:
aLayer- the layer to be addedaIndex- the target index foraLayerin the list. The index must be a value greater than or equal to0and 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 anILcdLayerfrom the list. No action is performed if the givenILcdLayeris not contained in the list.- Specified by:
removeLayerin interfaceILcdLayered- Parameters:
aLayer- the layer to remove.
-
removeAllLayers
public void removeAllLayers()Removes all theILcdLayerfrom this list. No action is performed if the givenILcdLayeris not contained in the list.- Specified by:
removeAllLayersin interfaceILcdLayered
-
removeLayer
Removes from the list theILcdLayerwhich label is aLayerLabel. No action is performed if the givenILcdLayeris not contained in the list. -
findModelLayer
-