public class EventBuffer extends java.lang.Object implements LegendListener, LayerCollectionListener, SelectionListener, ViewPortListenerEx1, LayerListener
EventBuffer represents a buffer of events that allows store
listeners of events produced in layers of a MapContext instance,
and configure its dispatching mode.
The dispatching mode:
true : dispatches each new event received.false : accumulates all new events received in a internal
buffer, and only will dispatch them (according to the order they were
received) when changes the mode.| Constructor and Description |
|---|
EventBuffer() |
| Modifier and Type | Method and Description |
|---|---|
void |
activationChanged(LayerEvent e)
Called when the activation of a layer has changed.
|
boolean |
addAtomicEventListener(AtomicEventListener listener)
Appends, if wasn't, the specified listener to the end of the internal
list of atomic event listeners.
|
void |
backColorChanged(ColorEvent e)
Called when the background color of the view port has changed.
|
void |
beginAtomicEvent()
Enables buffer in accumulation event mode.
|
void |
drawValueChanged(LayerEvent e)
Called when a draw value of a layer has changed.
|
void |
editionChanged(LayerEvent e)
Called when the edition of a layer has changed.
|
void |
endAtomicEvent()
Disables buffer in accumulation event mode.
|
void |
extentChanged(ExtentEvent e)
Called when the extent of the view port has changed.
|
java.util.List<AtomicEventListener> |
getAtomicEventListeners() |
void |
layerAdded(LayerCollectionEvent e)
Called when a layer has been added or replaced in the internal list of layers.
|
void |
layerAdding(LayerCollectionEvent e)
Called when a layer is just going to be added or replaced in the internal list of layers.
|
void |
layerMoved(LayerPositionEvent e)
Called when a layer has been moved in the internal list of layers.
|
void |
layerMoving(LayerPositionEvent e)
Called when a layer is just going to be moved in the internal list of layers.
|
void |
layerRemoved(LayerCollectionEvent e)
Called when a layer has been removed from the internal list of layers.
|
void |
layerRemoving(LayerCollectionEvent e)
Called when a layer is just going to be removed from the internal list of layers.
|
void |
legendChanged(LegendChangedEvent e)
Called when the legend of a vector layer has changed.
|
void |
nameChanged(LayerEvent e)
Called when the name of a layer has changed.
|
void |
projectionChanged(ProjectionEvent e)
Called when the projection of the view port has changed.
|
boolean |
removeAtomicEventListener(AtomicEventListener listener)
Removes a single instance of the
AtomicEventListener from the internal list,
if it is present (optional operation).Returns true
if the list contained the specified element (or equivalently, if the list
changed as a result of the call)
. |
void |
selectionChanged(SelectionEvent e)
Called when the selection in a vector layer has changed.
|
void |
selectionColorChanged(ColorEvent e)
Called when the selection color of the view port has changed.
|
void |
visibilityChanged(LayerCollectionEvent e)
Called when the visibility of the collection of layers has changed.
|
void |
visibilityChanged(LayerEvent e)
Called when the visibility of a layer has changed.
|
public void beginAtomicEvent()
endAtomicEvent.endAtomicEvent()public void endAtomicEvent()
beginAtomicEvent()public void legendChanged(LegendChangedEvent e)
LegendListenerlegendChanged in interface LegendListenere - the LegendChangedEvent contains contextual information about the eventpublic void layerAdded(LayerCollectionEvent e)
LayerCollectionListenerCalled when a layer has been added or replaced in the internal list of layers.
layerAdded in interface LayerCollectionListenere - a layer collection event objectpublic void layerMoved(LayerPositionEvent e)
LayerCollectionListenerCalled when a layer has been moved in the internal list of layers.
layerMoved in interface LayerCollectionListenere - a layer collection event objectpublic void layerRemoved(LayerCollectionEvent e)
LayerCollectionListenerCalled when a layer has been removed from the internal list of layers.
layerRemoved in interface LayerCollectionListenere - a layer collection event objectpublic void layerAdding(LayerCollectionEvent e) throws CancelationException
LayerCollectionListenerCalled when a layer is just going to be added or replaced in the internal list of layers.
layerAdding in interface LayerCollectionListenere - a layer collection event objectCancelationException - if cancels the adding operation, this exception will have the message
that user will see.public void layerMoving(LayerPositionEvent e) throws CancelationException
LayerCollectionListenerCalled when a layer is just going to be moved in the internal list of layers.
layerMoving in interface LayerCollectionListenere - a layer collection event objectCancelationException - if cancels the moving operation, this exception will have the message
that user will see.public void layerRemoving(LayerCollectionEvent e) throws CancelationException
LayerCollectionListenerCalled when a layer is just going to be removed from the internal list of layers.
layerRemoving in interface LayerCollectionListenere - a layer collection event objectCancelationException - if cancels the removing operation, this exception will have the message
that user will see.public void visibilityChanged(LayerCollectionEvent e) throws CancelationException
LayerCollectionListenerCalled when the visibility of the collection of layers has changed.
visibilityChanged in interface LayerCollectionListenere - a layer collection event objectCancelationException - if cancels the operation of change visibility, this exception will have the
message that user will see.public void selectionChanged(SelectionEvent e)
SelectionListenerCalled when the selection in a vector layer has changed.
The SelectionEvent event must be launched invoking
the fireSelectionEvents method of the layer.
selectionChanged in interface SelectionListenere - a selection event on a vector layerpublic void extentChanged(ExtentEvent e)
ViewPortListenerCalled when the extent of the view port has changed.
extentChanged in interface ViewPortListenere - an extend event objectpublic boolean addAtomicEventListener(AtomicEventListener listener)
listener - an object that implements the atomic event listenertrue if has added the listener successfully;
otherwise falseremoveAtomicEventListener(AtomicEventListener),
fireAtomicEventListener()public java.util.List<AtomicEventListener> getAtomicEventListeners()
public boolean removeAtomicEventListener(AtomicEventListener listener)
Removes a single instance of the
AtomicEventListener from the internal list,
if it is present (optional operation).Returns true
if the list contained the specified element (or equivalently, if the list
changed as a result of the call)
.
listener, - element to be removed from this list, if presentaddAtomicEventListener(AtomicEventListener),
fireAtomicEventListener()public void visibilityChanged(LayerEvent e)
LayerListenerCalled when the visibility of a layer has changed.
visibilityChanged in interface LayerListenere - a visibility changed layer event objectpublic void activationChanged(LayerEvent e)
LayerListenerCalled when the activation of a layer has changed.
activationChanged in interface LayerListenere - an activation changed layer event objectpublic void nameChanged(LayerEvent e)
LayerListenerCalled when the name of a layer has changed.
nameChanged in interface LayerListenere - a name changed layer event objectpublic void backColorChanged(ColorEvent e)
ViewPortListenerCalled when the background color of the view port has changed.
backColorChanged in interface ViewPortListenere - a color event objectpublic void selectionColorChanged(ColorEvent e)
ViewPortListenerEx1Called when the selection color of the view port has changed.
selectionColorChanged in interface ViewPortListenerEx1e - a color event objectpublic void editionChanged(LayerEvent e)
LayerListenerCalled when the edition of a layer has changed.
editionChanged in interface LayerListenere - an edition changed layer event objectpublic void projectionChanged(ProjectionEvent e)
ViewPortListenerCalled when the projection of the view port has changed.
projectionChanged in interface ViewPortListenere - a projection event objectpublic void drawValueChanged(LayerEvent e)
LayerListenerCalled when a draw value of a layer has changed.
drawValueChanged in interface LayerListenere - an edition changed layer event object