ilog.views.gantt
Interface IlvReservation

All Known Implementing Classes:
IlvAbstractReservation, IlvGeneralReservation, IlvSimpleReservation, IlvTableReservation

public interface IlvReservation

IlvReservation defines the abstract behavior of an assignment of an IlvResource to an IlvActivity. The activity reserving the resource is immutable once the IlvReservation has been created. However, the resource that has been reserved can be modified by invoking setResource(ilog.views.gantt.IlvResource).

IlvReservation implementations are expected to route their property change events to the Gantt data model. Therefore, although there is no accessor to the data model in this interface, the reservation implementation must have some method of obtaining the model it belongs to. Here is an example of how the IlvReservation implementation should fire its property change events:

 void fireEvent (ReservationEvent event) {
   IlvGanttModel model = .....
   if (model != null)
     model.fireReservationEvent(event);
 }
 


Method Summary
 IlvActivity getActivity()
          Returns the activity for this reservation.
 IlvResource getResource()
          Returns the resource for this reservation.
 void setGanttModelImpl(IlvGanttModel model)
          This method is invoked by the IlvGanttModel when the reservation is added or removed.
 void setResource(IlvResource resource)
          Sets the resource for this reservation.
 

Method Detail

getResource

IlvResource getResource()
Returns the resource for this reservation.

Returns:
The resource.

setResource

void setResource(IlvResource resource)
Sets the resource for this reservation. If this reservation is a member of a data model then resource must be a member of the same data model. Before the resource is modified the reservation's data model, if any, will fire an aboutToChange ReservedResourceEvent. After the resource is modified, the reservation's data model will fire a changed ReservedResourceEvent.

The implementation of this method can use IlvGanttModelUtil.checkValidMemberResource(ilog.views.gantt.IlvResource, ilog.views.gantt.IlvGanttModel) to validate resource.

Parameters:
resource - The resource.
Throws:
IllegalArgumentException - if resource is null or is not a member of the same data model as this reservation
See Also:
ReservationEvent, ReservationListener.reservationChanged(ilog.views.gantt.event.ReservationEvent)

getActivity

IlvActivity getActivity()
Returns the activity for this reservation.

Returns:
The activity.

setGanttModelImpl

void setGanttModelImpl(IlvGanttModel model)
This method is invoked by the IlvGanttModel when the reservation is added or removed.

Warning: This method is considered to be part of an IlvReservation's internal implementation and is not a public API. You should only invoke this method directly if you have created your own IlvGanttModel implementation.

Parameters:
model - The data model that this reservation has been added to, or null if this reservation has been removed from the data model.


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