|
||||||||||
| PREV CLASS Documentation homepage NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectilog.cpl.style.IlpStyleListenerSupport
public class IlpStyleListenerSupport
Models a Style Listener that is interested in specific keys only.
This class also batches style changes, so that it fires its event to the style change listeners only when all the changes have been executed.
This class provides support for registering or unregistering listeners. If a synchronization strategy is given at constructor time, the registered listeners are executed according to the synchronization strategy.
In other words, this class transforms fine grained notification
(StyleListener notification) to large grained notification
(StyleChangeListener, StyleChangeEvent).
Furthermore is moves the execution from the current thread to the
synchronization strategy's target thread (if any).
StyleListener,
StyleChangeListener,
StyleChangeEvent| Field Summary | |
|---|---|
protected int |
batchLevel
Deprecated. |
protected EventListenerList |
listenerList
Deprecated. |
protected Set |
modifiedKeys
Deprecated. |
protected ArrayList |
queuedEvents
Deprecated. List of queued events. |
protected Object |
source
Deprecated. |
protected IlSynchronizationContext |
syncContext
Deprecated. Multi-thread event dispatching support |
protected Collection |
watchedKeys
Deprecated. |
| Constructor Summary | |
|---|---|
IlpStyleListenerSupport(Object source)
Deprecated. Please use the constructor with multi-thread support |
|
IlpStyleListenerSupport(Object source,
Collection watchedKeys)
Deprecated. Please use the constructor with multi-thread support |
|
IlpStyleListenerSupport(Object source,
Collection watchedKeys,
IlSynchronizationContext syncContext)
Deprecated. Creates a style change support that notifies of changes for a restricted collection of watched keys. |
|
| Method Summary | |
|---|---|
void |
addStyleChangeListener(StyleChangeListener l)
Deprecated. Registers a style change listener. |
void |
endChangingStyleValues()
Deprecated. Called after a batch of style change has occurred. |
protected void |
fireStyleChangeEvent()
Deprecated. Notify all listeners that have registered interest for notification on this event type. |
protected void |
fireStyleChangeEventInTargetThread(ilog.cpl.style.IlpStyleListenerSupport.QueuedEvent qevent)
Deprecated. Called only during writeLock. |
protected IlSynchronizationStrategy |
getSynchronizationStrategy()
Deprecated. Returns the synchronization strategy attached to the synchronization context for this style listener support. |
void |
removeAllStyleChangeListeners()
Deprecated. Unregisters all style change listeners. |
void |
removeStyleChangeListener(StyleChangeListener l)
Deprecated. Unregisters a style change listener. |
void |
startChangingStyleValues()
Deprecated. Called before a batch of style change occurs. |
void |
styleValueChanged(IlpAbstractStyle source,
IlpKey key)
Deprecated. Called each time a key changes. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Object source
protected Collection watchedKeys
protected EventListenerList listenerList
protected int batchLevel
protected Set modifiedKeys
protected IlSynchronizationContext syncContext
protected ArrayList queuedEvents
| Constructor Detail |
|---|
public IlpStyleListenerSupport(Object source)
source -
public IlpStyleListenerSupport(Object source,
Collection watchedKeys)
watchedKeys is null, all key changes are registered.
source - watchedKeys - Contains the list of keys which will be checked. The
listeners will be called only if one of the watchedKeys was changed.
public IlpStyleListenerSupport(Object source,
Collection watchedKeys,
IlSynchronizationContext syncContext)
watchedKeys is null, all key changes are registered.
source - watchedKeys - Contains the list of keys which will be checked. The
listeners will be called only if one of the watchedKeys was changed.syncContext - Synchronization context which defines the strategy used
to synchronize the event dispatching and the lock.| Method Detail |
|---|
public void addStyleChangeListener(StyleChangeListener l)
public void removeStyleChangeListener(StyleChangeListener l)
public void removeAllStyleChangeListeners()
protected void fireStyleChangeEvent()
protected void fireStyleChangeEventInTargetThread(ilog.cpl.style.IlpStyleListenerSupport.QueuedEvent qevent)
protected IlSynchronizationStrategy getSynchronizationStrategy()
null when there is no synchronization context
or the synchronization context fails to provide a synchronization
strategy. This later case occurs in BR #2003.28.
public void startChangingStyleValues()
startChangingStyleValues in interface StyleListener
public void styleValueChanged(IlpAbstractStyle source,
IlpKey key)
styleValueChanged in interface StyleListenersource - The style in which the event was generated.key - The key that has changed.public void endChangingStyleValues()
endChangingStyleValues in interface StyleListener
|
||||||||||
| PREV CLASS Documentation homepage NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||