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
FieldsModifier and TypeFieldDescriptionstatic final intDeprecated.static final intEvent ID to indicate that aILcdLayerhas been added to anILcdLayered.static final intEvent ID to indicate that the position of aILcdLayerin aILcdLayeredhas changed.static final intEvent ID to indicate that aILcdLayerhas been removed from anILcdLayered.static final intEvent ID to indicate that something has changed.Fields inherited from class java.util.EventObject
source -
Constructor Summary
ConstructorsConstructorDescriptionTLcdLayeredEvent(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 TypeMethodDescriptionvoiddispatch(EventListener listener) Sends thisILcdDispatchableEventto the given listener.intgetID()Returns an ID indicating the type of event.getLayer()Returns theILcdLayerwhich caused a change on theILcdLayered, ornullwhen no layer was set during the construction of this event.Returns theILcdLayeredthe change causing this event has occurred on.intReturns the index of the layer ingetLayered()after the event occured.intReturns 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
paramStringMethods 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 aILcdLayerhas 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 aILcdLayerhas 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 aILcdLayerin aILcdLayeredhas changed. This ID contains the STATE_CHANGED ID.- See Also:
-
ALL_REMOVED
Deprecated.Use multipleLAYER_REMOVEDevents instead, so that the listener knows what layers were removed.Event ID to indicate that allILcdLayerhave 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 originatingILcdLayeredof 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 originatingILcdLayeredof 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- theILcdLayerfor 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 originatingILcdLayeredof this eventid- the type of change of this event. Can be one of STATE_CHANGED, LAYER_ADDED, LAYER_MOVED, LAYER_REMOVED, ALL_REMOVED.aLayer- theILcdLayerfor which a change occurredaOriginalIndex- the index of the layer in theILcdLayeredbefore the change, or -1 when theidisALL_REMOVEDor when the layer was added to theILcdLayeredaNewIndex- the index of the layer in theILcdLayeredafter the change, or -1 when theidisALL_REMOVEDor when the layer is removed from theILcdLayered- See Also:
-
-
Method Details
-
dispatch
Description copied from interface:ILcdDispatchableEventSends thisILcdDispatchableEventto the given listener.- Specified by:
dispatchin interfaceILcdDispatchableEvent- Specified by:
dispatchin 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 theILcdLayeredthe change causing this event has occurred on.- Returns:
- the
ILcdLayeredthe change causing this event has occurred on.
-
getLayer
Returns theILcdLayerwhich caused a change on theILcdLayered, ornullwhen no layer was set during the construction of this event.- Returns:
- the
ILcdLayerwhich caused a change on theILcdLayered, ornullwhen no layer was set during the construction of this event.
-
toString
Returns the source and a string representation of the type of event.- Overrides:
toStringin 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 theILcdLayeredbefore 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
ILcdLayerin theILcdLayeredbefore 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 theILcdLayeredLAYER_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
ILcdLayerin theILcdLayeredafter the event occured, or -1 if no index was set
-
LAYER_REMOVEDevents instead, so that the listener knows what layers were removed.