public interface ILspPaintGroupsChangeListener
working set
.
The listener can support a synchronizing its state with other listeners. This mechanism works as
follows:
prepareChanges(java.util.List<com.luciad.view.lightspeed.layer.paintgroup.TLspPaintGroupsChangedEvent>, java.lang.Object, com.luciad.view.lightspeed.layer.paintgroup.ILspPaintGroupsChangeListener.Callback)
method is called: the listener performs the necessary
preparation for the events and calls ILspPaintGroupsChangeListener.Callback.changesReady(java.lang.Object)
when it is ready. Note
that the listener should not update its internal state yet.commitChanges(java.lang.Object)
method is called: the listener updates its internal state, using
the data prepared earlier, to reflect the changes. Note that his commit should be as
lightweight as possible as it might block the paint thread.ILcdModel
'sEventQueue.invokeAndWait(java.lang.Runnable)
)task executor
view listener
Modifier and Type | Interface and Description |
---|---|
static interface |
ILspPaintGroupsChangeListener.Callback
Callback to indicate when the changes for an event are ready to be committed.
|
Modifier and Type | Method and Description |
---|---|
void |
commitChanges(Object aEventId)
Called when the changes for a specified event should be committed.
|
void |
prepareChanges(List<TLspPaintGroupsChangedEvent> aEvents,
Object aEventId,
ILspPaintGroupsChangeListener.Callback aCallback)
Called when the paint groups will change.
|
void prepareChanges(List<TLspPaintGroupsChangedEvent> aEvents, Object aEventId, ILspPaintGroupsChangeListener.Callback aCallback)
ILspPaintGroupsChangeListener.Callback.changesReady(java.lang.Object)
method must be invoked when the listener is
ready to commit the changes.
If aEventId
is null
then the changes may be committed immediately. In this case
there will be no call to commitChanges(Object)
.
Note that it is not mandatory to do this two-phased commit cycle. You may commit or apply the changes immediately, but you still must invoke the callback.
aEvents
- the changesaEventId
- the event id or null
aCallback
- the callback or null
void commitChanges(Object aEventId)
aEventId
- the event id