ilog.views.gantt.event
Class ActivityTimeIntervalEvent

java.lang.Object
  extended by java.util.EventObject
      extended by ilog.views.gantt.util.event.IlvPropertyEvent
          extended by ilog.views.gantt.event.ActivityPropertyEvent
              extended by ilog.views.gantt.event.ActivityTimeIntervalEvent
All Implemented Interfaces:
ActivityEvent, Serializable

public class ActivityTimeIntervalEvent
extends ActivityPropertyEvent

ActivityTimeIntervalEvent is fired by an IlvActivity both before and after its time interval is modified. Immediately before its time interval is modified, an IlvActivity fires an aboutToChange ActivityTimeIntervalEvent in all listeners registered with the Gantt data model. Listeners can modify or constrain the proposed time interval by invoking setNewTimeInterval(). Alternatively, a listener can veto the proposed change by invoking veto().

After its time interval is modified, an IlvActivity will fire a changed ActivityTimeIntervalEvent in all listeners registered with the Gantt data model. Listeners can access the old and new values of the activity's time interval, but cannot modify them via the event mechanism.

See Also:
IlvActivity, IlvGanttModel.addActivityListener(ilog.views.gantt.event.ActivityListener), Serialized Form

Field Summary
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
ActivityTimeIntervalEvent(IlvActivity activity, IlvTimeInterval oldInterval, IlvTimeInterval newInterval, boolean aboutToChangeEvent)
          Constructs a new ActivityTimeIntervalEvent generated by the specified activity and with the specified old and new time interval values.
 
Method Summary
 IlvTimeInterval getNewTimeInterval()
          Returns the activity's new time interval.
 IlvTimeInterval getOldTimeInterval()
          Returns the activity's old time interval.
 void setNewTimeInterval(IlvTimeInterval interval)
          Sets the activity's proposed new time interval.
 
Methods inherited from class ilog.views.gantt.event.ActivityPropertyEvent
getActivity
 
Methods inherited from class ilog.views.gantt.util.event.IlvPropertyEvent
getNewValue, getOldValue, isAboutToChangeEvent, isChangedEvent, isVetoed, setNewValue, veto
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ActivityTimeIntervalEvent

public ActivityTimeIntervalEvent(IlvActivity activity,
                                 IlvTimeInterval oldInterval,
                                 IlvTimeInterval newInterval,
                                 boolean aboutToChangeEvent)
Constructs a new ActivityTimeIntervalEvent generated by the specified activity and with the specified old and new time interval values.

Parameters:
activity - the activity where the event originated
oldInterval - the activity's previous time interval
newInterval - the activity's new time interval
aboutToChangeEvent - true if this is an activityTimeIntervalAboutToChange event or false if this is an activityTimeIntervalChanged event.
Method Detail

getOldTimeInterval

public IlvTimeInterval getOldTimeInterval()
Returns the activity's old time interval. If this is being asked in the context of a listener's activityTimeIntervalAboutToChange event handler, then this will be the same as the activity's current interval since the change has not actually occurred yet. In the context of a listener's activityTimeIntervalChanged method, this will be the activity's interval prior to the current modification being reported.

Returns:
The old IlvTimeInterval of the activity.

getNewTimeInterval

public IlvTimeInterval getNewTimeInterval()
Returns the activity's new time interval. If this is being asked in the context of a listener's activityTimeIntervalAboutToChange event handler, then this is the activity's proposed value. In the context of a listener's activityTimeIntervalChanged method, this is the activity's new time interval which is being reported.

Returns:
The new IlvTimeInterval of the activity.

setNewTimeInterval

public void setNewTimeInterval(IlvTimeInterval interval)
Sets the activity's proposed new time interval. This method only has meaning in the context of a listener's activityTimeIntervalAboutToChange event handler. By using this method, a listener can constrain changes to the activity's interval.

Parameters:
interval - the activity's time interval


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