Interface ILspPaintGroupsChangeListener
- All Known Subinterfaces:
ILspEditableStyledPainter
,ILspLabelPainter
,ILspPainter
,ILspPathLocationLabelPainter
,ILspStampLocationLabelPainter
- All Known Implementing Classes:
TLsp3DMeshPainter
,TLspDensityPainter
,TLspLabelPainter
,TLspLOSCoveragePainter
,TLspOpenFlightPainter
,TLspShapePainter
,TLspTiledWMSProxyPainter
public interface ILspPaintGroupsChangeListener
Listener to receive notifications of changes in the paint groups.
It can for example be used to listen to changes of a layer's
working set
.
The listener can support a synchronizing its state with other listeners. This mechanism works as
follows:
- The
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 callsILspPaintGroupsChangeListener.Callback.changesReady(java.lang.Object)
when it is ready. Note that the listener should not update its internal state yet. - The
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.
- taking any locks on
ILcdModel
's - wait on the paint thread (ex.
EventQueue.invokeAndWait(java.lang.Runnable)
)
- schedule a task that can be executed asynchronously by using the view's
task executor
- schedule a task for the next repaint by using a
view listener
- Since:
- 2012.0
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Callback to indicate when the changes for an event are ready to be committed. -
Method Summary
Modifier and TypeMethodDescriptionvoid
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.
-
Method Details
-
prepareChanges
void prepareChanges(List<TLspPaintGroupsChangedEvent> aEvents, Object aEventId, ILspPaintGroupsChangeListener.Callback aCallback) Called when the paint groups will change. The listener should prepare the necessary changes for the events but not commit them yet. TheILspPaintGroupsChangeListener.Callback.changesReady(java.lang.Object)
method must be invoked when the listener is ready to commit the changes. IfaEventId
isnull
then the changes may be committed immediately. In this case there will be no call tocommitChanges(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.
- Parameters:
aEvents
- the changesaEventId
- the event id ornull
aCallback
- the callback ornull
-
commitChanges
Called when the changes for a specified event should be committed.- Parameters:
aEventId
- the event id
-