Package com.luciad.view
Class TLcdLayeredEvent
java.lang.Object
java.util.EventObject
com.luciad.util.ALcdDispatchableEvent
com.luciad.view.TLcdLayeredEvent
- All Implemented Interfaces:
ILcdDispatchableEvent
,Serializable
TLcdLayeredEvent
implements dispatchable events
for an ILcdLayered
.- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Deprecated.static final int
Event ID to indicate that aILcdLayer
has been added to anILcdLayered
.static final int
Event ID to indicate that the position of aILcdLayer
in aILcdLayered
has changed.static final int
Event ID to indicate that aILcdLayer
has been removed from anILcdLayered
.static final int
Event ID to indicate that something has changed.Fields inherited from class java.util.EventObject
source
-
Constructor Summary
ConstructorDescriptionTLcdLayeredEvent
(ILcdLayered source, int id) Creates an event with given source and change type.TLcdLayeredEvent
(ILcdLayered source, int id, ILcdLayer aLayer) Creates an event with given source, change type and layer for which the change occurred.TLcdLayeredEvent
(ILcdLayered source, int id, ILcdLayer aLayer, int aOriginalIndex, int aNewIndex) Creates an event with given source, change type, layer and index for which the change occurred. -
Method Summary
Modifier and TypeMethodDescriptionvoid
dispatch
(EventListener listener) Sends thisILcdDispatchableEvent
to the given listener.int
getID()
Returns an ID indicating the type of event.getLayer()
Returns theILcdLayer
which caused a change on theILcdLayered
, ornull
when no layer was set during the construction of this event.Returns theILcdLayered
the change causing this event has occurred on.int
Returns the index of the layer ingetLayered()
after the event occured.int
Returns the index of the layer ingetLayered()
before the event occurred.toString()
Returns the source and a string representation of the type of event.Methods inherited from class com.luciad.util.ALcdDispatchableEvent
paramString
Methods inherited from class java.util.EventObject
getSource
-
Field Details
-
STATE_CHANGED
public static final int STATE_CHANGEDEvent ID to indicate that something has changed. This ID is bit-wise part of the other event modes.- See Also:
-
LAYER_ADDED
public static final int LAYER_ADDEDEvent ID to indicate that aILcdLayer
has been added to anILcdLayered
. This ID contains the STATE_CHANGED ID.- See Also:
-
LAYER_REMOVED
public static final int LAYER_REMOVEDEvent ID to indicate that aILcdLayer
has been removed from anILcdLayered
. This ID contains the STATE_CHANGED ID.- See Also:
-
LAYER_MOVED
public static final int LAYER_MOVEDEvent ID to indicate that the position of aILcdLayer
in aILcdLayered
has changed. This ID contains the STATE_CHANGED ID.- See Also:
-
ALL_REMOVED
Deprecated.Use multipleLAYER_REMOVED
events instead, so that the listener knows what layers were removed.Event ID to indicate that allILcdLayer
have been removed from anILcdLayered
. This ID contains the STATE_CHANGED ID.- See Also:
-
-
Constructor Details
-
TLcdLayeredEvent
public TLcdLayeredEvent() -
TLcdLayeredEvent
Creates an event with given source and change type.- Parameters:
source
- the originatingILcdLayered
of this event.id
- the type of change of this event. Can be one of STATE_CHANGED, LAYER_ADDED, LAYER_MOVED, LAYER_REMOVED, ALL_REMOVED.
-
TLcdLayeredEvent
Creates an event with given source, change type and layer for which the change occurred.- Parameters:
source
- the originatingILcdLayered
of this event.id
- the type of change of this event. Can be one of STATE_CHANGED, LAYER_ADDED, LAYER_MOVED, LAYER_REMOVED, ALL_REMOVED.aLayer
- theILcdLayer
for which a change occurred.
-
TLcdLayeredEvent
public TLcdLayeredEvent(ILcdLayered source, int id, ILcdLayer aLayer, int aOriginalIndex, int aNewIndex) Creates an event with given source, change type, layer and index for which the change occurred.- Parameters:
source
- the originatingILcdLayered
of this eventid
- the type of change of this event. Can be one of STATE_CHANGED, LAYER_ADDED, LAYER_MOVED, LAYER_REMOVED, ALL_REMOVED.aLayer
- theILcdLayer
for which a change occurredaOriginalIndex
- the index of the layer in theILcdLayered
before the change, or -1 when theid
isALL_REMOVED
or when the layer was added to theILcdLayered
aNewIndex
- the index of the layer in theILcdLayered
after the change, or -1 when theid
isALL_REMOVED
or when the layer is removed from theILcdLayered
- See Also:
-
-
Method Details
-
dispatch
Description copied from interface:ILcdDispatchableEvent
Sends thisILcdDispatchableEvent
to the given listener.- Specified by:
dispatch
in interfaceILcdDispatchableEvent
- Specified by:
dispatch
in classALcdDispatchableEvent
- Parameters:
listener
- the listener that will receive thisILcdDispatchableEvent
.
-
getID
public int getID()Returns an ID indicating the type of event.- Returns:
- the ID of this event, which indicates the type of event. The ID can be one of STATE_CHANGED, LAYER_ADDED, LAYER_MOVED, LAYER_REMOVED, ALL_REMOVED.
-
getLayered
Returns theILcdLayered
the change causing this event has occurred on.- Returns:
- the
ILcdLayered
the change causing this event has occurred on.
-
getLayer
Returns theILcdLayer
which caused a change on theILcdLayered
, ornull
when no layer was set during the construction of this event.- Returns:
- the
ILcdLayer
which caused a change on theILcdLayered
, ornull
when no layer was set during the construction of this event.
-
toString
Returns the source and a string representation of the type of event.- Overrides:
toString
in classALcdDispatchableEvent
- Returns:
- the source and a string representation of the type of event.
-
getOriginalIndex
public int getOriginalIndex()Returns the index of the layer in
getLayered()
before the event occurred. In case of:LAYER_ADDED
: the index will be -1, since the layer was not a part of theILcdLayered
before the eventLAYER_REMOVED
: the index is the old index of the removed layer, before the remove operation took placeLAYER_MOVED
: the index is the original index of the layer, before the move operation took placeALL_REMOVED
: the index is irrelevant, and -1 will be returned
- Returns:
- the index of the
ILcdLayer
in theILcdLayered
before the event occurred, or -1 if no index was set
-
getNewIndex
public int getNewIndex()Returns the index of the layer in
getLayered()
after the event occured. In case of:LAYER_ADDED
: the index will be the index on which the layer was added.LAYER_REMOVED
: the index will be -1, since the layer is no longer part of theILcdLayered
LAYER_MOVED
: the index will be the new index of the layer, after the move operation took placeALL_REMOVED
: the index is irrelevant, and -1 will be returned
- Returns:
- the index of the
ILcdLayer
in theILcdLayered
after the event occured, or -1 if no index was set
-
LAYER_REMOVED
events instead, so that the listener knows what layers were removed.