ilog.cpl.style
Class IlpStyleListenerSupport

java.lang.Object
  extended by ilog.cpl.style.IlpStyleListenerSupport
All Implemented Interfaces:
StyleListener, EventListener

Deprecated. The Style API has been replaced by the Cascading Style Sheet mechanism. Refer to the User's Manual for further information.

public class IlpStyleListenerSupport
extends Object
implements StyleListener

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).

Since:
JTGO 3.0
See Also:
StyleListener, StyleChangeListener, StyleChangeEvent
Deprecated Since:
JTGO 3.5

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

source

protected Object source
Deprecated. 
Internal method or field: do not use!

watchedKeys

protected Collection watchedKeys
Deprecated. 
Internal method or field: do not use!

listenerList

protected EventListenerList listenerList
Deprecated. 
Internal method or field: do not use!

batchLevel

protected int batchLevel
Deprecated. 
Internal method or field: do not use!

modifiedKeys

protected Set modifiedKeys
Deprecated. 
Internal method or field: do not use!

syncContext

protected IlSynchronizationContext syncContext
Deprecated. 
Multi-thread event dispatching support

Internal method or field: do not use!

queuedEvents

protected ArrayList queuedEvents
Deprecated. 
List of queued events. Only to be modified while this is locked!

Internal method or field: do not use!
Constructor Detail

IlpStyleListenerSupport

public IlpStyleListenerSupport(Object source)
Deprecated. Please use the constructor with multi-thread support

Creates a style change support that notifies of changes for any style key.

Parameters:
source -
Deprecated Since:
JTGO 3.1

IlpStyleListenerSupport

public IlpStyleListenerSupport(Object source,
                               Collection watchedKeys)
Deprecated. Please use the constructor with multi-thread support

Creates a style change support that notifies of changes for a restricted collection of watched keys. When watchedKeys is null, all key changes are registered.

Parameters:
source -
watchedKeys - Contains the list of keys which will be checked. The listeners will be called only if one of the watchedKeys was changed.
Deprecated Since:
JTGO 3.1

IlpStyleListenerSupport

public IlpStyleListenerSupport(Object source,
                               Collection watchedKeys,
                               IlSynchronizationContext syncContext)
Deprecated. 
Creates a style change support that notifies of changes for a restricted collection of watched keys. When watchedKeys is null, all key changes are registered.

Parameters:
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.
Since:
JTGO 3.1
Method Detail

addStyleChangeListener

public void addStyleChangeListener(StyleChangeListener l)
Deprecated. 
Registers a style change listener.


removeStyleChangeListener

public void removeStyleChangeListener(StyleChangeListener l)
Deprecated. 
Unregisters a style change listener.


removeAllStyleChangeListeners

public void removeAllStyleChangeListeners()
Deprecated. 
Unregisters all style change listeners. It is necessary to call this function when you deregister this StyleListener from within the synchronization strategy's target thread, to avoid running the attached StyleChangeListeners when they shouldn't be run.

Internal method or field: do not use!

fireStyleChangeEvent

protected void fireStyleChangeEvent()
Deprecated. 
Notify all listeners that have registered interest for notification on this event type. The event instance is lazily created using the parameters passed into the fire method.

Internal method or field: do not use!

fireStyleChangeEventInTargetThread

protected void fireStyleChangeEventInTargetThread(ilog.cpl.style.IlpStyleListenerSupport.QueuedEvent qevent)
Deprecated. 
Called only during writeLock.

Internal method or field: do not use!

getSynchronizationStrategy

protected IlSynchronizationStrategy getSynchronizationStrategy()
Deprecated. 
Returns the synchronization strategy attached to the synchronization context for this style listener support. May return 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.

Internal method or field: do not use!

startChangingStyleValues

public void startChangingStyleValues()
Deprecated. 
Called before a batch of style change occurs.

Specified by:
startChangingStyleValues in interface StyleListener
Internal method or field: do not use!

styleValueChanged

public void styleValueChanged(IlpAbstractStyle source,
                              IlpKey key)
Deprecated. 
Called each time a key changes.

Specified by:
styleValueChanged in interface StyleListener
Parameters:
source - The style in which the event was generated.
key - The key that has changed.
Internal method or field: do not use!

endChangingStyleValues

public void endChangingStyleValues()
Deprecated. 
Called after a batch of style change has occurred.

Specified by:
endChangingStyleValues in interface StyleListener
Internal method or field: do not use!


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.   . All Rights Reserved.