ilog.ds.adapter
Class IlAbstractGanttModelAdapter

java.lang.Object
  |
  +--ilog.ds.adapter.IlAbstractAdapter
        |
        +--ilog.ds.adapter.IlAbstractGanttModelAdapter
All Implemented Interfaces:
ilog.views.gantt.event.ActivityHierarchyListener, ilog.views.gantt.event.ActivityListener, BatchListener, ilog.views.gantt.event.ConstraintListener, DataSourceListener, EventListener, GanttDSListener, IlFreezableAdapter, ilog.views.gantt.event.ReservationListener, ilog.views.gantt.event.ResourceHierarchyListener, ilog.views.gantt.event.ResourceListener
Direct Known Subclasses:
IlsGanttDS2IlvHierarchyChartAdapter

public abstract class IlAbstractGanttModelAdapter
extends IlAbstractAdapter
implements GanttDSListener, ilog.views.gantt.event.ActivityListener, ilog.views.gantt.event.ActivityHierarchyListener, ilog.views.gantt.event.ResourceHierarchyListener, ilog.views.gantt.event.ResourceListener, ilog.views.gantt.event.ConstraintListener, ilog.views.gantt.event.ReservationListener

This class adapts the events from the IlGanttDataSource to a JViews IlvGanttModel. It does not implement how elements are created or updated, that is, how the properties from the data source are mapped to the IlvActivity, IlvResource, IlvConstraint, IlvReservation themselves. This class supports the mapping between the data source objects and the model objects. It stores the data source reference.

See Also:
IlGanttDataSource, IlGanttDataSourceEditor, IlvActivity, IlvResource, IlvConstraint, IlvReservation

Field Summary
protected  Map _ds2model
           
protected  IlGanttDataSource _gds
           
protected  IlGanttDataSourceEditor _gdse
           
protected  ilog.views.gantt.IlvGanttModel _gm
           
protected  Map _model2ds
           
protected  ilog.views.gantt.IlvActivity _rootActivity
           
protected  ilog.views.gantt.IlvResource _rootResource
           
protected  long _timeConstant
           
protected  long _timeFactor
           
 
Fields inherited from class ilog.ds.adapter.IlAbstractAdapter
_dispatchListeners, _events, _frozenEvents, _inBatchedEvents, _inTransaction, _isFrozen, _syncStrategy
 
Constructor Summary
IlAbstractGanttModelAdapter()
           
 
Method Summary
 void activitiesInserted(ilog.views.gantt.event.ActivitiesInsertedEvent evt)
           
 void activitiesRemoved(ilog.views.gantt.event.ActivitiesRemovedEvent evt)
           
 void activityChange(ActivityEvent e)
          This method is invoked when an activity has been added, removed, or updated in the GanttDataSource.
 void activityChanged(ilog.views.gantt.event.ActivityEvent evt)
           
 void activityMoved(ilog.views.gantt.event.ActivityMovedEvent evt)
           
 void activityPropertyChange(ilog.views.gantt.event.ActivityPropertyEvent evt)
           
 void constraintChange(ConstraintEvent e)
          This method is invoked when a constraint has been added, removed, or updated in the GanttDataSource.
 void constraintChanged(ilog.views.gantt.event.ConstraintEvent evt)
           
 void constraintInserted(ilog.views.gantt.event.ConstraintInsertedEvent evt)
           
 void constraintRemoved(ilog.views.gantt.event.ConstraintRemovedEvent evt)
           
 void ConstraintTypeChange(ilog.views.gantt.event.ConstraintTypeEvent evt)
           
protected abstract  ilog.views.gantt.IlvActivity createActivity(Map properties)
          Method called to create an activity in the gantt model.
protected abstract  ilog.views.gantt.IlvConstraint createConstraint(ilog.views.gantt.IlvActivity fromActivity, ilog.views.gantt.IlvActivity toActivity, Map properties)
          Method called to create a constraint in the gantt model.
protected abstract  ilog.views.gantt.IlvReservation createReservation(ilog.views.gantt.IlvResource resource, ilog.views.gantt.IlvActivity activity, Map properties)
          Method called to create a reservation in the gantt model.
protected abstract  ilog.views.gantt.IlvResource createResource(Map properties)
          Method called to create a resource in the gantt model.
 void dataSourceChange(DataSourceEvent e)
          DataSourceListener implementation
protected  void dispatchBatchedEvent(EventObject event)
           
protected  void dispatchBatchedEvents(ArrayList batchedEvents)
           
 ilog.views.gantt.IlvActivity getActivity(Object dsActivity)
           
 ilog.views.gantt.IlvConstraint getConstraint(Object dsConstraint)
           
 Object getDSActivity(ilog.views.gantt.IlvActivity activity)
           
 Object getDSConstraint(ilog.views.gantt.IlvConstraint constraint)
           
 Object getDSReservation(ilog.views.gantt.IlvReservation reservation)
           
 Object getDSResource(ilog.views.gantt.IlvResource resource)
           
 IlGanttDataSource getGanttDataSource()
          Gets the IlGanttDataSource in use by this adapter.
 IlGanttDataSourceEditor getGanttDataSourceEditor()
          Gets the IlGanttDataSourceEditor in use by this adapter.
 ilog.views.gantt.IlvGanttModel getModel()
          Gets the IlvGanttModel in use by this adapter.
 ilog.views.gantt.IlvReservation getReservation(Object dsReservation)
           
 ilog.views.gantt.IlvResource getResource(Object dsResource)
           
protected  Object getSynchronizationObject()
           
 long getTimeConstant()
           
 long getTimeFactor()
           
protected  void internalActivityAdded(ActivityEvent evt)
           
protected  void internalActivityRemoved(ActivityEvent evt)
           
protected  void internalActivityUpdated(ActivityEvent evt)
           
protected  void internalConstraintAdded(ConstraintEvent evt)
           
protected  void internalConstraintRemoved(ConstraintEvent evt)
           
protected  void internalConstraintUpdated(ConstraintEvent evt)
           
protected  void internalDataSourceChange(DataSourceEvent evt)
          Internal code called in the Swing event thread
protected  void internalReservationAdded(ReservationEvent evt)
           
protected  void internalReservationRemoved(ReservationEvent evt)
           
protected  void internalReservationUpdated(ReservationEvent evt)
           
protected  void internalResourceAdded(ResourceEvent evt)
           
protected  void internalResourceRemoved(ResourceEvent evt)
           
protected  void internalResourceUpdated(ResourceEvent evt)
           
protected  void internalRootActivitySet(ActivityEvent evt)
           
protected  void internalRootResourceSet(ResourceEvent evt)
           
 void reservationChange(ReservationEvent e)
          This method is invoked when a reservation has been added, removed, or updated in the GanttDataSource.
 void reservationChanged(ilog.views.gantt.event.ReservationEvent evt)
           
 void reservationInserted(ilog.views.gantt.event.ReservationInsertedEvent evt)
           
 void reservationRemoved(ilog.views.gantt.event.ReservationRemovedEvent evt)
           
 void reservedResourceChange(ilog.views.gantt.event.ReservedResourceEvent evt)
           
 void resourceChange(ResourceEvent e)
          This method is invoked when a resource has been added, removed, or updated in the GanttDataSource.
 void resourceChanged(ilog.views.gantt.event.ResourceEvent evt)
           
 void resourceMoved(ilog.views.gantt.event.ResourceMovedEvent evt)
           
 void resourcePropertyChange(ilog.views.gantt.event.ResourcePropertyEvent evt)
           
 void resourcesInserted(ilog.views.gantt.event.ResourcesInsertedEvent evt)
           
 void resourcesRemoved(ilog.views.gantt.event.ResourcesRemovedEvent evt)
           
 void setGanttDataSource(IlGanttDataSource gds)
          Sets the IlGanttDataSource to use.
 void setGanttDataSourceEditor(IlGanttDataSourceEditor gdse)
          Sets the IlGanttDataSourceEditor to use.
 void setModel(ilog.views.gantt.IlvGanttModel gm)
          Sets the IlvGanttModel to use
 void setTimeConstant(long timeConstant)
           
 void setTimeFactor(long timeFactor)
           
protected abstract  void updateActivity(ilog.views.gantt.IlvActivity activity, Map properties)
          Method called to update an activity in the gantt model.
protected abstract  void updateConstraint(ilog.views.gantt.IlvConstraint constraint, Map properties)
          Method called to update a constraint in the gantt model.
protected abstract  void updateReservation(ilog.views.gantt.IlvReservation reservation, Map properties)
          Method called to update a reservation in the gantt model.
protected abstract  void updateResource(ilog.views.gantt.IlvResource resource, Map properties)
          Method called to update a resource in the gantt model.
 
Methods inherited from class ilog.ds.adapter.IlAbstractAdapter
addDispatchListener, addDSEvent, clearDSEvents, endBatch, firePostDispatchBatchedEventsEvent, firePreDispatchBatchedEventsEvent, GetColor, getSynchronizationStrategy, isFrozen, isInBatchedEvents, isInTransaction, postDispatchBatchedEvents, preDispatchBatchedEvents, removeDispatchListener, setFrozen, setSynchronizationStrategy, startBatch
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_timeFactor

protected long _timeFactor

_timeConstant

protected long _timeConstant

_rootActivity

protected ilog.views.gantt.IlvActivity _rootActivity

_rootResource

protected ilog.views.gantt.IlvResource _rootResource

_model2ds

protected Map _model2ds

_ds2model

protected Map _ds2model

_gds

protected IlGanttDataSource _gds

_gdse

protected IlGanttDataSourceEditor _gdse

_gm

protected ilog.views.gantt.IlvGanttModel _gm
Constructor Detail

IlAbstractGanttModelAdapter

public IlAbstractGanttModelAdapter()
Method Detail

getSynchronizationObject

protected Object getSynchronizationObject()
Description copied from class: IlAbstractAdapter
Gets the object to synchronize in the synchronization strategy used by this adapter.
Overrides:
getSynchronizationObject in class IlAbstractAdapter
Following copied from class: ilog.ds.adapter.IlAbstractAdapter
Returns:
this by default, the data model generally (in subsclasses)

getDSActivity

public final Object getDSActivity(ilog.views.gantt.IlvActivity activity)

getDSResource

public final Object getDSResource(ilog.views.gantt.IlvResource resource)

getDSConstraint

public final Object getDSConstraint(ilog.views.gantt.IlvConstraint constraint)

getDSReservation

public final Object getDSReservation(ilog.views.gantt.IlvReservation reservation)

getActivity

public final ilog.views.gantt.IlvActivity getActivity(Object dsActivity)

getResource

public final ilog.views.gantt.IlvResource getResource(Object dsResource)

getConstraint

public final ilog.views.gantt.IlvConstraint getConstraint(Object dsConstraint)

getReservation

public final ilog.views.gantt.IlvReservation getReservation(Object dsReservation)

getTimeFactor

public long getTimeFactor()

getTimeConstant

public long getTimeConstant()

setTimeFactor

public void setTimeFactor(long timeFactor)

setTimeConstant

public void setTimeConstant(long timeConstant)

createActivity

protected abstract ilog.views.gantt.IlvActivity createActivity(Map properties)
Method called to create an activity in the gantt model.
Parameters:
properties - The properties from the data source
Returns:
the newly created IlvActivity, corresponding to the parameters.

updateActivity

protected abstract void updateActivity(ilog.views.gantt.IlvActivity activity,
                                       Map properties)
Method called to update an activity in the gantt model.
Parameters:
activity - the IlvActivity to update
properties - The updated properties from the data source

createResource

protected abstract ilog.views.gantt.IlvResource createResource(Map properties)
Method called to create a resource in the gantt model.
Parameters:
properties - The properties from the data source
Returns:
the newly created IlvResource, corresponding to the parameters.

updateResource

protected abstract void updateResource(ilog.views.gantt.IlvResource resource,
                                       Map properties)
Method called to update a resource in the gantt model.
Parameters:
resource - the IlvResource to update
properties - The updated properties from the data source

createConstraint

protected abstract ilog.views.gantt.IlvConstraint createConstraint(ilog.views.gantt.IlvActivity fromActivity,
                                                                   ilog.views.gantt.IlvActivity toActivity,
                                                                   Map properties)
Method called to create a constraint in the gantt model.
Parameters:
properties - The properties from the data source
Returns:
the newly created IlvConstraint, corresponding to the parameters.

updateConstraint

protected abstract void updateConstraint(ilog.views.gantt.IlvConstraint constraint,
                                         Map properties)
Method called to update a constraint in the gantt model.
Parameters:
constraint - the IlvConstraint to update
properties - The updated properties from the data source

createReservation

protected abstract ilog.views.gantt.IlvReservation createReservation(ilog.views.gantt.IlvResource resource,
                                                                     ilog.views.gantt.IlvActivity activity,
                                                                     Map properties)
Method called to create a reservation in the gantt model.
Parameters:
properties - The properties from the data source
Returns:
the newly created IlvReservation, corresponding to the parameters.

updateReservation

protected abstract void updateReservation(ilog.views.gantt.IlvReservation reservation,
                                          Map properties)
Method called to update a reservation in the gantt model.
Parameters:
reservation - the IlvReservation to update
properties - The updated properties from the data source

setModel

public void setModel(ilog.views.gantt.IlvGanttModel gm)
Sets the IlvGanttModel to use

getModel

public ilog.views.gantt.IlvGanttModel getModel()
Gets the IlvGanttModel in use by this adapter.

getGanttDataSource

public IlGanttDataSource getGanttDataSource()
Gets the IlGanttDataSource in use by this adapter.

getGanttDataSourceEditor

public IlGanttDataSourceEditor getGanttDataSourceEditor()
Gets the IlGanttDataSourceEditor in use by this adapter.

setGanttDataSource

public void setGanttDataSource(IlGanttDataSource gds)
Sets the IlGanttDataSource to use.

setGanttDataSourceEditor

public void setGanttDataSourceEditor(IlGanttDataSourceEditor gdse)
Sets the IlGanttDataSourceEditor to use.

dataSourceChange

public void dataSourceChange(DataSourceEvent e)
DataSourceListener implementation
Following copied from interface: ilog.ds.DataSourceListener
Parameters:
e - The event
See Also:
DataSourceEvent

activityChange

public void activityChange(ActivityEvent e)
This method is invoked when an activity has been added, removed, or updated in the GanttDataSource.
Specified by:
activityChange in interface GanttDSListener
Parameters:
e - The event
See Also:
ActivityEvent, IlGanttDataSource

resourceChange

public void resourceChange(ResourceEvent e)
This method is invoked when a resource has been added, removed, or updated in the GanttDataSource.
Specified by:
resourceChange in interface GanttDSListener
Parameters:
e - The event
See Also:
ResourceEvent, IlGanttDataSource

constraintChange

public void constraintChange(ConstraintEvent e)
This method is invoked when a constraint has been added, removed, or updated in the GanttDataSource.
Specified by:
constraintChange in interface GanttDSListener
Parameters:
e - The event
See Also:
ConstraintEvent, IlGanttDataSource

reservationChange

public void reservationChange(ReservationEvent e)
This method is invoked when a reservation has been added, removed, or updated in the GanttDataSource.
Specified by:
reservationChange in interface GanttDSListener
Parameters:
e - The event
See Also:
ReservationEvent, IlGanttDataSource

internalDataSourceChange

protected void internalDataSourceChange(DataSourceEvent evt)
Internal code called in the Swing event thread
Overrides:
internalDataSourceChange in class IlAbstractAdapter

internalRootActivitySet

protected void internalRootActivitySet(ActivityEvent evt)

internalActivityAdded

protected void internalActivityAdded(ActivityEvent evt)

internalActivityUpdated

protected void internalActivityUpdated(ActivityEvent evt)

internalActivityRemoved

protected void internalActivityRemoved(ActivityEvent evt)

internalRootResourceSet

protected void internalRootResourceSet(ResourceEvent evt)

internalResourceAdded

protected void internalResourceAdded(ResourceEvent evt)

internalResourceUpdated

protected void internalResourceUpdated(ResourceEvent evt)

internalResourceRemoved

protected void internalResourceRemoved(ResourceEvent evt)

internalConstraintAdded

protected void internalConstraintAdded(ConstraintEvent evt)

internalConstraintUpdated

protected void internalConstraintUpdated(ConstraintEvent evt)

internalConstraintRemoved

protected void internalConstraintRemoved(ConstraintEvent evt)

internalReservationAdded

protected void internalReservationAdded(ReservationEvent evt)

internalReservationUpdated

protected void internalReservationUpdated(ReservationEvent evt)

internalReservationRemoved

protected void internalReservationRemoved(ReservationEvent evt)

dispatchBatchedEvent

protected void dispatchBatchedEvent(EventObject event)
Overrides:
dispatchBatchedEvent in class IlAbstractAdapter

dispatchBatchedEvents

protected void dispatchBatchedEvents(ArrayList batchedEvents)
Overrides:
dispatchBatchedEvents in class IlAbstractAdapter

activityChanged

public void activityChanged(ilog.views.gantt.event.ActivityEvent evt)
Specified by:
activityChanged in interface ilog.views.gantt.event.ActivityListener

activitiesInserted

public void activitiesInserted(ilog.views.gantt.event.ActivitiesInsertedEvent evt)
Specified by:
activitiesInserted in interface ilog.views.gantt.event.ActivityHierarchyListener

activitiesRemoved

public void activitiesRemoved(ilog.views.gantt.event.ActivitiesRemovedEvent evt)
Specified by:
activitiesRemoved in interface ilog.views.gantt.event.ActivityHierarchyListener

activityMoved

public void activityMoved(ilog.views.gantt.event.ActivityMovedEvent evt)
Specified by:
activityMoved in interface ilog.views.gantt.event.ActivityHierarchyListener

activityPropertyChange

public void activityPropertyChange(ilog.views.gantt.event.ActivityPropertyEvent evt)

resourceChanged

public void resourceChanged(ilog.views.gantt.event.ResourceEvent evt)
Specified by:
resourceChanged in interface ilog.views.gantt.event.ResourceListener

resourcesInserted

public void resourcesInserted(ilog.views.gantt.event.ResourcesInsertedEvent evt)
Specified by:
resourcesInserted in interface ilog.views.gantt.event.ResourceHierarchyListener

resourcesRemoved

public void resourcesRemoved(ilog.views.gantt.event.ResourcesRemovedEvent evt)
Specified by:
resourcesRemoved in interface ilog.views.gantt.event.ResourceHierarchyListener

resourceMoved

public void resourceMoved(ilog.views.gantt.event.ResourceMovedEvent evt)
Specified by:
resourceMoved in interface ilog.views.gantt.event.ResourceHierarchyListener

resourcePropertyChange

public void resourcePropertyChange(ilog.views.gantt.event.ResourcePropertyEvent evt)

constraintChanged

public void constraintChanged(ilog.views.gantt.event.ConstraintEvent evt)
Specified by:
constraintChanged in interface ilog.views.gantt.event.ConstraintListener

ConstraintTypeChange

public void ConstraintTypeChange(ilog.views.gantt.event.ConstraintTypeEvent evt)

constraintInserted

public void constraintInserted(ilog.views.gantt.event.ConstraintInsertedEvent evt)

constraintRemoved

public void constraintRemoved(ilog.views.gantt.event.ConstraintRemovedEvent evt)

reservationChanged

public void reservationChanged(ilog.views.gantt.event.ReservationEvent evt)
Specified by:
reservationChanged in interface ilog.views.gantt.event.ReservationListener

reservedResourceChange

public void reservedResourceChange(ilog.views.gantt.event.ReservedResourceEvent evt)

reservationInserted

public void reservationInserted(ilog.views.gantt.event.ReservationInsertedEvent evt)

reservationRemoved

public void reservationRemoved(ilog.views.gantt.event.ReservationRemovedEvent evt)