ilog.ds.adapter
Class IlAbstractAdapter
java.lang.Object
|
+--ilog.ds.adapter.IlAbstractAdapter
- All Implemented Interfaces:
- BatchListener, DataSourceListener, java.util.EventListener, IlFreezableAdapter
- Direct Known Subclasses:
- IlAbstractGanttModelAdapter, IlAbstractJTableAdapter, IlAbstractJTreeAdapter, IlAbstractListModelAdapter, IlAbstractSDMModelAdapter, IlsDefaultIlvGrapherAdapter
- public abstract class IlAbstractAdapter
- extends java.lang.Object
- implements BatchListener, DataSourceListener, IlFreezableAdapter
Base class for adapters to model or model-related classes. It implements the
batch mechanism: at the end of each batch, the previously received events
stored using the addDSEvent method are processed using its
synchronization strategy.
|
Constructor Summary |
IlAbstractAdapter()
public constructor Initializes the synchronization strategy by using
IlSynchronizationStrategy.GetDefault() |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
_dispatchListeners
protected ilog.util.IlEventListenerList _dispatchListeners
_syncStrategy
protected IlSynchronizationStrategy _syncStrategy
_events
protected java.util.ArrayList _events
_frozenEvents
protected java.util.ArrayList _frozenEvents
_inBatchedEvents
protected boolean _inBatchedEvents
_isFrozen
protected boolean _isFrozen
_inTransaction
protected boolean _inTransaction
IlAbstractAdapter
public IlAbstractAdapter()
- public constructor Initializes the synchronization strategy by using
IlSynchronizationStrategy.GetDefault()
GetColor
public static java.awt.Color GetColor(java.lang.String color)
setSynchronizationStrategy
public void setSynchronizationStrategy(IlSynchronizationStrategy syncStrategy)
- Sets the synchronization strategy to use
- Parameters:
syncStrategy - the new synchronization strategy to use
getSynchronizationStrategy
public IlSynchronizationStrategy getSynchronizationStrategy()
- Gets the synchronization strategy used by this adapter
- Returns:
- the synchronization strategy.
getSynchronizationObject
protected java.lang.Object getSynchronizationObject()
- Gets the object to synchronize in the synchronization strategy used by
this adapter.
- Returns:
- this by default, the data model generally (in subsclasses)
setFrozen
public void setFrozen(boolean isFrozen)
- Freezes or unfreeze the adapter. When the adapter is frozen, all the
incoming events are buffered instead of being dispatched at each end of
batch. When the adapter is unfrozen, all the buffered events, if there
are any, are dispatched.
- Specified by:
setFrozen in interface IlFreezableAdapter
isFrozen
public boolean isFrozen()
- Returns true if the adapter is frozen.
- Specified by:
isFrozen in interface IlFreezableAdapter
startBatch
public void startBatch(BatchEvent e)
- Description copied from interface:
BatchListener
- Start of batch
- Specified by:
startBatch in interface BatchListener
endBatch
public void endBatch(BatchEvent e)
- Description copied from interface:
BatchListener
- End of batch
- Specified by:
endBatch in interface BatchListener
isInTransaction
public boolean isInTransaction()
- Returns:
true if the adapter is in transaction (component
thread side).- See Also:
startBatch(ilog.ds.BatchEvent),
endBatch(ilog.ds.BatchEvent)
internalDataSourceChange
protected void internalDataSourceChange(DataSourceEvent evt)
- Internal code called in the Swing event thread.
isInBatchedEvents
public boolean isInBatchedEvents()
- Returns:
true if the adapter is processing the batched
events. (swing (or other synchronization strategy) thread side).- See Also:
preDispatchBatchedEvents(java.util.ArrayList),
postDispatchBatchedEvents(java.util.ArrayList),
dispatchBatchedEvent(java.util.EventObject),
dispatchBatchedEvents(java.util.ArrayList)
preDispatchBatchedEvents
protected void preDispatchBatchedEvents(java.util.ArrayList events)
- dispatching events methods
postDispatchBatchedEvents
protected void postDispatchBatchedEvents(java.util.ArrayList events)
dispatchBatchedEvent
protected void dispatchBatchedEvent(java.util.EventObject event)
dispatchBatchedEvents
protected void dispatchBatchedEvents(java.util.ArrayList batchedEvents)
addDSEvent
protected void addDSEvent(java.lang.Object event)
clearDSEvents
protected void clearDSEvents()
addDispatchListener
public void addDispatchListener(DispatchListener l)
removeDispatchListener
public void removeDispatchListener(DispatchListener l)
firePreDispatchBatchedEventsEvent
protected void firePreDispatchBatchedEventsEvent(DispatchEvent e)
firePostDispatchBatchedEventsEvent
protected void firePostDispatchBatchedEventsEvent(DispatchEvent e)