ilog.views.gantt
Interface IlvGanttModel

All Known Implementing Classes:
IlvAbstractGanttModel, IlvBasicFilterGanttModel, IlvDefaultGanttModel, IlvFilterGanttModel, IlvJDBCGanttModel, IlvTableGanttModel

public interface IlvGanttModel

IlvGanttModel defines the abstract behavior of the Gantt's data model. Any object that implements this interface can be displayed by the Gantt library. IlvGanttModel defines basic accessors for manipulating and querying the data model, as well as the events by which the data model will notify interested listeners about any changes.

An IlvGanttModel is responsible for managing 4 types of entities:

Each of these entity types routes event notification to interested listeners through the Gantt data model. They do not handle listener subscriptions directly. For each type of entity, there are essentially 2 types of event notifications. First are events indicating a change in a property or other characteristic of a specific entity instance. Second are events that indicate that an entity instance has been added to the data model, removed from the data model, or some other aspect of its membership in the data model has changed. For IlvActivity's and IlvResource's, separate listener interfaces are used for receiving notification of property changes (ActivityListener and ResourceListener) and data model membership changes (ActivityHierarchyListener and ResourceHierarchyListener). IlvReservation and IlvConstraint each use a single listener interface for all of their events, ReservationListener and ConstraintListener respectively.


Field Summary
static String ADJUSTING_PROPERTY
          Identifies that an adjustment session has begun or ended.
 
Method Summary
 Iterator activityPreorderIterator(IlvActivity parent)
          Returns an iterator that will traverse the parent activity and all of its descendants in preorder.
 void addActivity(IlvActivity newActivity, IlvActivity parent)
          Append newActivity as the last child of the specified parent activity.
 void addActivity(IlvActivity newActivity, IlvActivity parent, int index)
          Adds newActivity as a child of parent activity at the specified location in its list of child activities.
 void addActivityHierarchyListener(ActivityHierarchyListener aListener)
          Adds the specified listener to receive activity hierarchy events from this data model.
 void addActivityListener(ActivityListener aListener)
          Adds the specified listener to receive activity events from this data model.
 void addConstraint(IlvConstraint newConstraint)
          Adds newConstraint to the data model.
 void addConstraintListener(ConstraintListener aListener)
          Adds the specified listener to receive constraint events from this data model.
 void addGanttModelPropertyListener(GanttModelPropertyListener listener)
          Adds the specified listener to receive notification of changes to properties of the data model.
 void addReservation(IlvReservation newReservation)
          Adds newReservation to the data model.
 void addReservationListener(ReservationListener aListener)
          Adds the specified listener to receive reservation events from this data model.
 void addResource(IlvResource newResource, IlvResource parent)
          Append newResource as the last child of the specified parent resource.
 void addResource(IlvResource newResource, IlvResource parent, int index)
          Adds newResource as a child of parent resource at the specified location in its list of child resources.
 void addResourceHierarchyListener(ResourceHierarchyListener aListener)
          Adds the specified listener to receive resource hierarchy events from this data model.
 void addResourceListener(ResourceListener aListener)
          Adds the specified listener to receive resource events from this data model.
 Iterator childActivityIterator(IlvActivity parent)
          Returns an iterator over the parent activity's children.
 Iterator childResourceIterator(IlvResource parent)
          Returns an iterator over the parent resource's children.
 Iterator constraintIterator()
          Returns an iterator over all of the constraints in the data model.
 Iterator constraintIteratorFromActivity(IlvActivity fromActivity)
          Returns an iterator over the constraints in the data model that have the specified activity as their source or from activity.
 Iterator constraintIteratorToActivity(IlvActivity toActivity)
          Returns an iterator over the constraints in the data model that have the specified activity as their target or to activity.
 boolean contains(IlvConstraint constraint)
          Returns whether the specified constraint is a member of the data model.
 boolean contains(IlvHierarchyNode activityOrResource)
          Returns whether the specified activity or resource is a member of the data model.
 boolean contains(IlvReservation reservation)
          Returns whether the specified reservation is a member of the data model.
 void fireActivityEvent(ActivityEvent event)
          Fire an activityChanged event.
 void fireConstraintEvent(ConstraintEvent event)
          Fire a constraint event to all subscribed listeners.
 void fireReservationEvent(ReservationEvent event)
          Fire a reservation event to all subscribed listeners.
 void fireResourceEvent(ResourceEvent event)
          Fire a resourceChanged event.
 IlvHierarchyNode getChild(IlvHierarchyNode parent, int index)
          Returns the child of the specified parent activity or resource at index index.
 IlvActivity getChildActivity(IlvActivity parent, int index)
          Returns the child of the specified parent activity at index index.
 int getChildActivityCount(IlvActivity parent)
          Returns the number of children of the specified parent activity.
 int getChildActivityIndex(IlvActivity parent, IlvActivity child)
          Returns the index of the specified child in the parent activity's list of children.
 int getChildCount(IlvHierarchyNode parent)
          Returns the number of children of the specified parent activity or resource.
 int getChildIndex(IlvHierarchyNode parent, IlvHierarchyNode child)
          Returns the index of the specified child in the parent activity or resource's list of children.
 IlvResource getChildResource(IlvResource parent, int index)
          Returns the child of the specified parent resource at index index.
 int getChildResourceCount(IlvResource parent)
          Returns the number of children of the specified parent resource.
 int getChildResourceIndex(IlvResource parent, IlvResource child)
          Returns the index of the specified child in the parent resource's list of children.
 IlvHierarchyNode getParent(IlvHierarchyNode activityOrResource)
          Returns the parent of the specified activity or resource.
 IlvActivity getParentActivity(IlvActivity activity)
          Returns the parent activity of the specified activity, or null if the activity is the root activity of the data model.
 int getParentActivityIndex(IlvActivity activity)
          Returns the index of the specified activity within its parent activity.
 int getParentIndex(IlvHierarchyNode activityOrResource)
          Returns the index of the specified activity or resource within its parent.
 IlvResource getParentResource(IlvResource resource)
          Returns the parent resource of the specified resource, or null if the resource is the root resource of the data model.
 int getParentResourceIndex(IlvResource resource)
          Returns the index of the specified resource within its parent resource.
 IlvActivity getRootActivity()
          Returns the root activity of the data model or null if the data model contains no activities.
 IlvResource getRootResource()
          Returns the root resource of the data model or null if the data model contains no resources.
 boolean isAdjusting()
          Returns whether an adjustment session is currently active.
 void moveActivity(IlvActivity activity, IlvActivity newParent, int newIndex)
          Moves the specified activity from its current location in the tree to a new location.
 void moveResource(IlvResource resource, IlvResource newParent, int newIndex)
          Moves the specified resource from its current location in the tree to a new location.
 void removeActivity(IlvActivity activity)
          Removes the specified child activity from its parent.
 void removeActivity(IlvActivity parent, int index)
          Removes the child activity from parent that is at the specified location in its list of child activities.
 void removeActivityHierarchyListener(ActivityHierarchyListener aListener)
          Removes the specified listener so that it no longer receives activity hierarchy events from this data model.
 void removeActivityListener(ActivityListener aListener)
          Removes the specified listener so that it no longer receives activity events from this data model.
 void removeConstraint(IlvConstraint constraint)
          Removes the specified constraint from the data model.
 void removeConstraintListener(ConstraintListener aListener)
          Removes the specified listener so that it no longer receives constraint events from this data model.
 void removeGanttModelPropertyListener(GanttModelPropertyListener listener)
          Removes the specified listener so that it no longer receives notification of changes to properties of the data model.
 void removeReservation(IlvReservation reservation)
          Removes the specified reservation from the data model.
 void removeReservationListener(ReservationListener aListener)
          Removes the specified listener so that it no longer receives reservation events from this data model.
 void removeResource(IlvResource resource)
          Removes the specified child resource from its parent.
 void removeResource(IlvResource parent, int index)
          Removes the child resource from parent that is at the specified location in its list of child resources.
 void removeResourceHierarchyListener(ResourceHierarchyListener aListener)
          Removes the specified listener so that it no longer receives resource hierarchy events from this data model.
 void removeResourceListener(ResourceListener aListener)
          Removes the specified listener so that it no longer receives resource events from this data model.
 Iterator reservationIterator()
          Returns an iterator over all of the reservations in the data model.
 Iterator reservationIterator(IlvActivity activity)
          Returns an iterator over all of the reservations in the data model that are associated with the specified activity.
 Iterator reservationIterator(IlvResource resource)
          Returns an iterator over all of the reservations in the data model that are associated with the specified resource.
 Iterator reservationIterator(IlvResource resource, IlvTimeInterval interval)
          Returns an iterator over all of the reservations in the data model that are associated with the specified resource and where the assigned activity intersects the specified time interval.
 Iterator resourcePreorderIterator(IlvResource parent)
          Returns an iterator that will traverse the parent resource and all of its descendants in preorder.
 void setAdjusting(boolean adjusting)
          Starts or ends an adjustment session.
 void setRootActivity(IlvActivity root)
          Sets the root activity of the data model.
 void setRootResource(IlvResource root)
          Sets the root resource of the data model.
 

Field Detail

ADJUSTING_PROPERTY

static final String ADJUSTING_PROPERTY
Identifies that an adjustment session has begun or ended.

Since:
JViews 7.5
See Also:
setAdjusting(boolean), isAdjusting(), Constant Field Values
Method Detail

setAdjusting

void setAdjusting(boolean adjusting)
Starts or ends an adjustment session. Adjustment sessions can be nested and each call to setAdjusting(true) must be paired with a call to setAdjusting(false). An adjusting property event is fired when the outermost adjustment session begins and ends.

Parameters:
adjusting - True to start an adjustment session or false to end an adjustment session.
Since:
JViews 7.5
See Also:
isAdjusting()

isAdjusting

boolean isAdjusting()
Returns whether an adjustment session is currently active.

Returns:
Whether an adjustment session is active.
Since:
JViews 7.5
See Also:
setAdjusting(boolean)

addGanttModelPropertyListener

void addGanttModelPropertyListener(GanttModelPropertyListener listener)
Adds the specified listener to receive notification of changes to properties of the data model. The listener is registered for all bound properties of the model, including the following: Note that the listener will only be notified of changes to properties of the data model itself. It will not be notified of changes to the properties of activities, resources, constraints, or reservations that are members of the data model.

Parameters:
listener - The listener that will be subscribed to subsequent GanttModelPropertyEvents.
Since:
JViews 7.5
See Also:
removeGanttModelPropertyListener(ilog.views.gantt.event.GanttModelPropertyListener)

removeGanttModelPropertyListener

void removeGanttModelPropertyListener(GanttModelPropertyListener listener)
Removes the specified listener so that it no longer receives notification of changes to properties of the data model.

Parameters:
listener - The listener that will be unsubscribed from receiving. GanttModelPropertyEvents.
Since:
JViews 7.5
See Also:
addGanttModelPropertyListener(ilog.views.gantt.event.GanttModelPropertyListener)

contains

boolean contains(IlvHierarchyNode activityOrResource)
Returns whether the specified activity or resource is a member of the data model.

Parameters:
activityOrResource - The activity or resource.
Returns:
Whether the specified activity or resource is a member of the data model.
Since:
JViews 5.5

getParent

IlvHierarchyNode getParent(IlvHierarchyNode activityOrResource)
Returns the parent of the specified activity or resource. This method returns null if the activity is the root activity of the data model or if the resource is the root resource of the data model.

Parameters:
activityOrResource - The activity or resource.
Returns:
The parent of the specified activity or resource.
Throws:
IllegalArgumentException - if activityOrResource is not a member of this data model.
Since:
JViews 5.5

getParentIndex

int getParentIndex(IlvHierarchyNode activityOrResource)
Returns the index of the specified activity or resource within its parent. If the activity is the root activity of the data model or the resource is the root resource of the data model, then -1 is returned.

Parameters:
activityOrResource - The activity or resource.
Returns:
The index of the specified activity or resource.
Throws:
IllegalArgumentException - if activityOrResource is not a member of this data model.
Since:
JViews 5.5

getChildCount

int getChildCount(IlvHierarchyNode parent)
Returns the number of children of the specified parent activity or resource.

Parameters:
parent - The parent activity or resource.
Returns:
The number of child activities or resources.
Throws:
IllegalArgumentException - if parent is not a member of this data model.
Since:
JViews 5.5

getChild

IlvHierarchyNode getChild(IlvHierarchyNode parent,
                          int index)
Returns the child of the specified parent activity or resource at index index.

Parameters:
parent - The parent activity or resource.
index - The child index.
Returns:
The child at index index.
Throws:
IllegalArgumentException - if parent is not a member of this data model.
IndexOutOfBoundsException - if index is out of range (index < 0 || index >= getChildCount(parent)).
Since:
JViews 5.5

getChildIndex

int getChildIndex(IlvHierarchyNode parent,
                  IlvHierarchyNode child)
Returns the index of the specified child in the parent activity or resource's list of children.

Parameters:
parent - The parent activity or resource.
child - The child activity or resource to find the index of.
Returns:
The index of the child, or -1 if it is not a child of parent.
Throws:
IllegalArgumentException - if parent is not a member of this data model.
Since:
JViews 5.5

getRootActivity

IlvActivity getRootActivity()
Returns the root activity of the data model or null if the data model contains no activities.

Returns:
The root activity or null.

setRootActivity

void setRootActivity(IlvActivity root)
Sets the root activity of the data model. This also causes all constraints and reservations to be removed from the data model. The data model will first fire ConstraintRemovedEvents and ReservationRemovedEvents for each removed constraint and reservation. The removingActivity property of these events will be true. Then, if there was a previous root activity, the data model will fire an ActivitiesRemovedEvent for the old root. Finally, if the new root activity is not null, the data model will fire an ActivitiesInsertedEvent for the new root.

Parameters:
root - The new root activity or null if the data model is to contain no activities.
See Also:
ActivityHierarchyListener.activitiesInserted(ilog.views.gantt.event.ActivitiesInsertedEvent), ActivityHierarchyListener.activitiesRemoved(ilog.views.gantt.event.ActivitiesRemovedEvent)

getParentActivity

IlvActivity getParentActivity(IlvActivity activity)
Returns the parent activity of the specified activity, or null if the activity is the root activity of the data model.

Parameters:
activity - The activity. The implementation of this method should use IlvGanttModelUtil.checkValidMemberActivity(ilog.views.gantt.IlvActivity, ilog.views.gantt.IlvGanttModel) to validate activity.
Returns:
The parent activity or null.
Throws:
IllegalArgumentException - if activity is not a member of this data model.
Since:
JViews 5.5

getParentActivityIndex

int getParentActivityIndex(IlvActivity activity)
Returns the index of the specified activity within its parent activity. If the activity is the root activity of the data model, then -1 is returned.

Parameters:
activity - The activity. The implementation of this method should use IlvGanttModelUtil.checkValidMemberActivity(ilog.views.gantt.IlvActivity, ilog.views.gantt.IlvGanttModel) to validate activity.
Returns:
The index of the activity or -1.
Throws:
IllegalArgumentException - if activity is not a member of this data model.
Since:
JViews 5.5

getChildActivityCount

int getChildActivityCount(IlvActivity parent)
Returns the number of children of the specified parent activity.

Parameters:
parent - The parent activity. The implementation of this method should use IlvGanttModelUtil.checkValidMemberActivity(ilog.views.gantt.IlvActivity, ilog.views.gantt.IlvGanttModel) to validate parent.
Returns:
The number of child activities.
Throws:
IllegalArgumentException - if parent is not a member of this data model.
Since:
JViews 5.5

getChildActivity

IlvActivity getChildActivity(IlvActivity parent,
                             int index)
Returns the child of the specified parent activity at index index.

Parameters:
parent - The parent activity. The implementation of this method should use IlvGanttModelUtil.checkValidMemberActivity(ilog.views.gantt.IlvActivity, ilog.views.gantt.IlvGanttModel) to validate parent.
index - The child index.
Returns:
The child activity at index index.
Throws:
IllegalArgumentException - if parent is not a member of this data model.
IndexOutOfBoundsException - if index is out of range (index < 0 || index >= getChildActivityCount(parent)).
Since:
JViews 5.5

getChildActivityIndex

int getChildActivityIndex(IlvActivity parent,
                          IlvActivity child)
Returns the index of the specified child in the parent activity's list of children.

Parameters:
parent - The parent activity. The implementation of this method should use IlvGanttModelUtil.checkValidMemberActivity(ilog.views.gantt.IlvActivity, ilog.views.gantt.IlvGanttModel) to validate parent.
child - The child activity to find the index of.
Returns:
The index of the child activity, or -1 if the activity is not a child of parent.
Throws:
IllegalArgumentException - if parent is not a member of this data model.
Since:
JViews 5.5

childActivityIterator

Iterator childActivityIterator(IlvActivity parent)
Returns an iterator over the parent activity's children.

Parameters:
parent - The parent activity.
Returns:
An iterator over the children of parent.
Since:
JViews 5.5

activityPreorderIterator

Iterator activityPreorderIterator(IlvActivity parent)
Returns an iterator that will traverse the parent activity and all of its descendants in preorder. The first activity returned by the iterator's next() method will be parent.

Parameters:
parent - The parent of the activity subtree.
Returns:
An iterator for traversing the subtree of activities in preorder.
Since:
JViews 5.5
See Also:
IlvGanttModelUtil.activityPreorderIterator(ilog.views.gantt.IlvGanttModel), IlvAbstractGanttModel.activityPreorderIterator()

addActivity

void addActivity(IlvActivity newActivity,
                 IlvActivity parent,
                 int index)
Adds newActivity as a child of parent activity at the specified location in its list of child activities. The current child activity at index index and any subsequent activities are shifted to the right by having their indices incremented. After the activity has been added, the data model will fire an ActivitiesInsertedEvent.

Parameters:
newActivity - The activity to add.
parent - The parent activity to which newActivity is added. The implementation of this method should use IlvGanttModelUtil.checkValidMemberActivity(ilog.views.gantt.IlvActivity, ilog.views.gantt.IlvGanttModel) to validate parent.
index - The location within the parent activity's list of children to insert the new activity. If index >= getChildActivityCount(parent) then newActivity is appended as the last child of parent.
Throws:
IllegalArgumentException - if newActivity is null or parent is not a member of this data model.
IndexOutOfBoundsException - if index is out of range (index < 0).
See Also:
ActivityHierarchyListener.activitiesInserted(ilog.views.gantt.event.ActivitiesInsertedEvent)

addActivity

void addActivity(IlvActivity newActivity,
                 IlvActivity parent)
Append newActivity as the last child of the specified parent activity. After the activity has been added, the data model will fire an ActivitiesInsertedEvent.

Parameters:
newActivity - The activity to add.
parent - The parent activity to which newActivity is added. The implementation of this method should use IlvGanttModelUtil.checkValidMemberActivity(ilog.views.gantt.IlvActivity, ilog.views.gantt.IlvGanttModel) to validate parent.
Throws:
IllegalArgumentException - if newActivity is null or parent is not a member of this data model.
See Also:
ActivityHierarchyListener.activitiesInserted(ilog.views.gantt.event.ActivitiesInsertedEvent)

removeActivity

void removeActivity(IlvActivity parent,
                    int index)
Removes the child activity from parent that is at the specified location in its list of child activities. Any subsequent child activities are shifted to the left by having their indices decremented. All constraints and reservations associated with the child activity and its children are also removed from the data model. After the activity has been removed, the data model will first fire ConstraintRemovedEvents and ReservationRemovedEvents for each removed constraint and reservation. The removingActivity property of these events will be true. Then, the data model will fire an ActivitiesRemovedEvent.

Parameters:
parent - The parent activity from which to remove the child activity. The implementation of this method should use IlvGanttModelUtil.checkValidMemberActivity(ilog.views.gantt.IlvActivity, ilog.views.gantt.IlvGanttModel) to validate parent.
index - The location within parent's list of children to remove the child activity.
Throws:
IllegalArgumentException - if parent is null or is not a member of this data model.
IndexOutOfBoundsException - if the index is out of range (index < 0 || index >= getChildActivityCount(parent)).
See Also:
ActivityHierarchyListener.activitiesRemoved(ilog.views.gantt.event.ActivitiesRemovedEvent)

removeActivity

void removeActivity(IlvActivity activity)
Removes the specified child activity from its parent. All constraints and reservations associated with the activity and its children are also removed from the data model. After the activity has been removed, the data model will first fire ConstraintRemovedEvents and ReservationRemovedEvents for each removed constraint and reservation. The removingActivity property of these events will be true. Then, the data model will fire an ActivitiesRemovedEvent. This method cannot be used to remove the data model's root activity. Use setRootActivity(null) for that purpose.

Parameters:
activity - The activity to remove. It must be a member of this data model, but cannot be the root activity. The implementation of this method should use IlvGanttModelUtil.checkValidNonRootMemberActivity(ilog.views.gantt.IlvActivity, ilog.views.gantt.IlvGanttModel) to validate activity before removing it.
Throws:
IllegalArgumentException - if activity is null, is not a member of this data model, or is the root activity.
See Also:
ActivityHierarchyListener.activitiesRemoved(ilog.views.gantt.event.ActivitiesRemovedEvent)

moveActivity

void moveActivity(IlvActivity activity,
                  IlvActivity newParent,
                  int newIndex)
Moves the specified activity from its current location in the tree to a new location. After the activity has been moved, the data model will fire an ActivityMovedEvent.

Parameters:
activity - The activity to move. It must be a member of this data model, but cannot be the root activity. The implementation of this method should use IlvGanttModelUtil.checkValidNonRootMemberActivity(ilog.views.gantt.IlvActivity, ilog.views.gantt.IlvGanttModel) to validate activity.
newParent - The parent activity to which activity will be made a child. It must be a member of this data model. The implementation of this method should use IlvGanttModelUtil.checkValidMemberActivity(ilog.views.gantt.IlvActivity, ilog.views.gantt.IlvGanttModel) to validate newParent.
newIndex - The location within newParent's list of children that activity will be inserted. If newIndex >= getChildActivityCount(newParent) then activity will be appended as the last child of newParent.
Throws:
IllegalArgumentException - if activity is null, is not a member of this data model, or is the root activity. Also, if newParent is not a member of this data model.
IndexOutOfBoundsException - if newIndex is out of range (newIndex < 0).
See Also:
ActivityHierarchyListener.activityMoved(ilog.views.gantt.event.ActivityMovedEvent)

addActivityHierarchyListener

void addActivityHierarchyListener(ActivityHierarchyListener aListener)
Adds the specified listener to receive activity hierarchy events from this data model.

Parameters:
aListener - The listener which will be subscribed to subsequent ActivityHierarchyListener events.

removeActivityHierarchyListener

void removeActivityHierarchyListener(ActivityHierarchyListener aListener)
Removes the specified listener so that it no longer receives activity hierarchy events from this data model.

Parameters:
aListener - The listener which will be unsubscribed from receiving ActivityHierarchyListener events.

addActivityListener

void addActivityListener(ActivityListener aListener)
Adds the specified listener to receive activity events from this data model.

Parameters:
aListener - The listener which will be subscribed to subsequent ActivityListener events.

removeActivityListener

void removeActivityListener(ActivityListener aListener)
Removes the specified listener so that it no longer receives activity events from this data model.

Parameters:
aListener - The listener which will be unsubscribed from receiving ActivityListener events.

fireActivityEvent

void fireActivityEvent(ActivityEvent event)
Fire an activityChanged event.

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

Parameters:
event - The activity event.
See Also:
ActivityListener.activityChanged(ilog.views.gantt.event.ActivityEvent)

getRootResource

IlvResource getRootResource()
Returns the root resource of the data model or null if the data model contains no resources.

Returns:
The root resource or null.

setRootResource

void setRootResource(IlvResource root)
Sets the root resource of the data model. This also causes all reservations to be removed from the data model. The data model will first fire ReservationRemovedEvents for each removed reservation. The removingResource property of these events will be true. Then, if there was a previous root resource, the data model will fire a ResourcesRemovedEvent for the old root. Finally, if the new root resource is not null, the data model will fire a ResourcesInsertedEvent for the new root.

Parameters:
root - The new root resource or null if the data model is to contain no resources.
See Also:
ResourceHierarchyListener.resourcesInserted(ilog.views.gantt.event.ResourcesInsertedEvent), ResourceHierarchyListener.resourcesRemoved(ilog.views.gantt.event.ResourcesRemovedEvent)

getParentResource

IlvResource getParentResource(IlvResource resource)
Returns the parent resource of the specified resource, or null if the resource is the root resource of the data model.

Parameters:
resource - The resource. The implementation of this method should use IlvGanttModelUtil.checkValidMemberResource(ilog.views.gantt.IlvResource, ilog.views.gantt.IlvGanttModel) to validate resource.
Returns:
The parent resource or null.
Throws:
IllegalArgumentException - if resource is not a member of this data model.
Since:
JViews 5.5

getParentResourceIndex

int getParentResourceIndex(IlvResource resource)
Returns the index of the specified resource within its parent resource. If the resource is the root resource of the data model, -1 is returned.

Parameters:
resource - The resource. The implementation of this method should use IlvGanttModelUtil.checkValidMemberResource(ilog.views.gantt.IlvResource, ilog.views.gantt.IlvGanttModel) to validate resource.
Returns:
The index of the resource or -1.
Throws:
IllegalArgumentException - if resource is not a member of this data model.
Since:
JViews 5.5

getChildResourceCount

int getChildResourceCount(IlvResource parent)
Returns the number of children of the specified parent resource.

Parameters:
parent - The parent resource. The implementation of this method should use IlvGanttModelUtil.checkValidMemberResource(ilog.views.gantt.IlvResource, ilog.views.gantt.IlvGanttModel) to validate parent.
Returns:
The number of child resources.
Throws:
IllegalArgumentException - if parent is not a member of this data model.
Since:
JViews 5.5

getChildResource

IlvResource getChildResource(IlvResource parent,
                             int index)
Returns the child of the specified parent resource at index index.

Parameters:
parent - The parent resource. The implementation of this method should use IlvGanttModelUtil.checkValidMemberResource(ilog.views.gantt.IlvResource, ilog.views.gantt.IlvGanttModel) to validate parent.
index - The child index.
Returns:
The child resource at index index.
Throws:
IllegalArgumentException - if parent is not a member of this data model.
IndexOutOfBoundsException - if index is out of range (index < 0 || index >= getChildResourceCount(parent)).
Since:
JViews 5.5

getChildResourceIndex

int getChildResourceIndex(IlvResource parent,
                          IlvResource child)
Returns the index of the specified child in the parent resource's list of children.

Parameters:
parent - The parent resource. The implementation of this method should use IlvGanttModelUtil.checkValidMemberResource(ilog.views.gantt.IlvResource, ilog.views.gantt.IlvGanttModel) to validate parent.
child - The child resource to find the index of.
Returns:
The index of the child resource, or -1 if the resource is not a child of parent.
Throws:
IllegalArgumentException - if parent is not a member of this data model.
Since:
JViews 5.5

childResourceIterator

Iterator childResourceIterator(IlvResource parent)
Returns an iterator over the parent resource's children.

Parameters:
parent - The parent resource.
Returns:
An iterator over the children of parent.
Since:
JViews 5.5

resourcePreorderIterator

Iterator resourcePreorderIterator(IlvResource parent)
Returns an iterator that will traverse the parent resource and all of its descendants in preorder. The first resource returned by the iterator's next() method will be parent.

Parameters:
parent - The parent of the resource subtree.
Returns:
An iterator for traversing the subtree of resources in preorder.
Since:
JViews 5.5
See Also:
IlvGanttModelUtil.resourcePreorderIterator(ilog.views.gantt.IlvGanttModel), IlvAbstractGanttModel.resourcePreorderIterator()

addResource

void addResource(IlvResource newResource,
                 IlvResource parent,
                 int index)
Adds newResource as a child of parent resource at the specified location in its list of child resources. The current child resource at index index and any subsequent resources are shifted to the right by having their indices incremented. After the resource has been added, the data model will fire a ResourcesInsertedEvent.

Parameters:
newResource - The resource to add.
parent - The parent resource to which newResource is added. The implementation of this method should use IlvGanttModelUtil.checkValidMemberResource(ilog.views.gantt.IlvResource, ilog.views.gantt.IlvGanttModel) to validate parent.
index - The location within the parent resource's list of children to insert the new resource. If index >= getChildResourceCount(parent) then newResource is appended as the last child of parent.
Throws:
IllegalArgumentException - if newResource is null or parent is not a member of this data model.
IndexOutOfBoundsException - if index is out of range (index < 0).
See Also:
ResourceHierarchyListener.resourcesInserted(ilog.views.gantt.event.ResourcesInsertedEvent)

addResource

void addResource(IlvResource newResource,
                 IlvResource parent)
Append newResource as the last child of the specified parent resource. After the resource has been added, the data model will fire a ResourcesInsertedEvent.

Parameters:
newResource - The resource to add.
parent - The parent resource to which newResource is added. The implementation of this method should use IlvGanttModelUtil.checkValidMemberResource(ilog.views.gantt.IlvResource, ilog.views.gantt.IlvGanttModel) to validate parent.
Throws:
IllegalArgumentException - if newResource is null or parent is not a member of this data model.
See Also:
ResourceHierarchyListener.resourcesInserted(ilog.views.gantt.event.ResourcesInsertedEvent)

removeResource

void removeResource(IlvResource parent,
                    int index)
Removes the child resource from parent that is at the specified location in its list of child resources. Any subsequent child resources are shifted to the left by having their indices decremented. All reservations associated with the child resource and its children are also removed from the data model. After the resource has been removed, the data model will first fire ReservationRemovedEvents for each removed reservation. The removingResource property of these events will be true. Then, the data model will fire a ResourcesRemovedEvent.

Parameters:
parent - The parent resource from which to remove the child resource. The implementation of this method should use IlvGanttModelUtil.checkValidMemberResource(ilog.views.gantt.IlvResource, ilog.views.gantt.IlvGanttModel) to validate parent.
index - The location within parent's list of children to remove the child resource
Throws:
IllegalArgumentException - if parent is null or is not a member of this data model.
IndexOutOfBoundsException - if the index is out of range (index < 0 || index >= getChildResourceCount(parent)).
See Also:
ResourceHierarchyListener.resourcesRemoved(ilog.views.gantt.event.ResourcesRemovedEvent)

removeResource

void removeResource(IlvResource resource)
Removes the specified child resource from its parent. All reservations associated with the resource and its children are also removed from the data model. After the resource has been removed, the data model will first fire ReservationRemovedEvents for each removed reservation. The removingResource property of these events will be true. Then, the data model will fire a ResourcesRemovedEvent. This method cannot be used to remove the data model's root resource. Use setRootResource(null) for that purpose.

Parameters:
resource - The resource to remove. It must be a member of this data model, but cannot be the root resource. The implementation of this method should use IlvGanttModelUtil.checkValidNonRootMemberResource(ilog.views.gantt.IlvResource, ilog.views.gantt.IlvGanttModel) to validate resource before removing it.
Throws:
IllegalArgumentException - if resource is null, is not a member of this data model, or is the root resource.
See Also:
ResourceHierarchyListener.resourcesRemoved(ilog.views.gantt.event.ResourcesRemovedEvent)

moveResource

void moveResource(IlvResource resource,
                  IlvResource newParent,
                  int newIndex)
Moves the specified resource from its current location in the tree to a new location. After the resource has been moved, the data model will fire a ResourceMovedEvent.

Parameters:
resource - The resource to move. It must be a member of this data model, but cannot be the root resource. The implementation of this method should use IlvGanttModelUtil.checkValidNonRootMemberResource(ilog.views.gantt.IlvResource, ilog.views.gantt.IlvGanttModel) to validate resource.
newParent - The parent resource to which resource will be made a child. It must be a member of this data model. The implementation of this method should use IlvGanttModelUtil.checkValidMemberResource(ilog.views.gantt.IlvResource, ilog.views.gantt.IlvGanttModel) to validate newParent.
newIndex - The location within newParent's list of children that resource will be inserted. If newIndex >= getChildResourceCount(newParent) then resource will be appended as the last child of newParent.
Throws:
IllegalArgumentException - if resource is null, is not a member of this data model, or is the root resource. Also, if newParent is not a member of this data model.
IndexOutOfBoundsException - if newIndex is out of range (newIndex < 0).
See Also:
ResourceHierarchyListener.resourceMoved(ilog.views.gantt.event.ResourceMovedEvent)

addResourceHierarchyListener

void addResourceHierarchyListener(ResourceHierarchyListener aListener)
Adds the specified listener to receive resource hierarchy events from this data model.

Parameters:
aListener - The listener which will be subscribed to subsequent ResourceHierarchyListener events.

removeResourceHierarchyListener

void removeResourceHierarchyListener(ResourceHierarchyListener aListener)
Removes the specified listener so that it no longer receives resource hierarchy events from this data model.

Parameters:
aListener - The listener which will be unsubscribed from receiving ResourceHierarchyListener events.

addResourceListener

void addResourceListener(ResourceListener aListener)
Adds the specified listener to receive resource events from this data model.

Parameters:
aListener - The listener which will be subscribed to subsequent ResourceListener events.

removeResourceListener

void removeResourceListener(ResourceListener aListener)
Removes the specified listener so that it no longer receives resource events from this data model.

Parameters:
aListener - The listener which will be unsubscribed from receiving ResourceListener events.

fireResourceEvent

void fireResourceEvent(ResourceEvent event)
Fire a resourceChanged event.

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

Parameters:
event - The resource event.
See Also:
ResourceListener.resourceChanged(ilog.views.gantt.event.ResourceEvent)

contains

boolean contains(IlvConstraint constraint)
Returns whether the specified constraint is a member of the data model.

Parameters:
constraint - The constraint.
Returns:
Whether the specified constraint is a member of the data model.
Since:
JViews 5.5

constraintIterator

Iterator constraintIterator()
Returns an iterator over all of the constraints in the data model. The iterator will actually be over a copy of the constraints, making it safe to add or remove constraints during the course of the iteration.

Returns:
An iterator over all constraints in the data model.

constraintIteratorFromActivity

Iterator constraintIteratorFromActivity(IlvActivity fromActivity)
Returns an iterator over the constraints in the data model that have the specified activity as their source or from activity. The iterator will actually be over a copy of the constraints, making it safe to add or remove constraints during the course of the iteration.

Parameters:
fromActivity - The from activity.
Returns:
An iterator over all the constraints in the data model that have the specified activity as their from activity.

constraintIteratorToActivity

Iterator constraintIteratorToActivity(IlvActivity toActivity)
Returns an iterator over the constraints in the data model that have the specified activity as their target or to activity. The iterator will actually be over a copy of the constraints, making it safe to add or remove constraints during the course of the iteration.

Parameters:
toActivity - The to activity.
Returns:
An iterator over all the constraints in the data model that have the specified activity as their to activity.

addConstraint

void addConstraint(IlvConstraint newConstraint)
Adds newConstraint to the data model. The constraint's from and to activities must already be members of this data model. After the constraint has been added, the data model will fire a ConstraintInsertedEvent.

The implementation of this method can use IlvGanttModelUtil.checkValidNewConstraint() to validate newConstraint.

Parameters:
newConstraint - The constraint to add.
Throws:
IllegalArgumentException - if newConstraint is null, is a member of a data model already, or its constrained activities are not members of this data model.
See Also:
ConstraintInsertedEvent, ConstraintListener.constraintChanged(ilog.views.gantt.event.ConstraintEvent), IlvGanttModelUtil.checkValidNewConstraint(ilog.views.gantt.IlvConstraint, ilog.views.gantt.IlvGanttModel)

removeConstraint

void removeConstraint(IlvConstraint constraint)
Removes the specified constraint from the data model. After the constraint has been removed, the data model will fire a ConstraintRemovedEvent.

The implementation of this method can use IlvGanttModelUtil.checkValidMemberConstraint() to validate constraint before removing it.

Parameters:
constraint - The constraint to remove.
Throws:
IllegalArgumentException - if constraint is null or is not a member of this data model
See Also:
ConstraintRemovedEvent, ConstraintListener.constraintChanged(ilog.views.gantt.event.ConstraintEvent), IlvGanttModelUtil.checkValidMemberConstraint(ilog.views.gantt.IlvConstraint, ilog.views.gantt.IlvGanttModel)

addConstraintListener

void addConstraintListener(ConstraintListener aListener)
Adds the specified listener to receive constraint events from this data model.

Parameters:
aListener - The listener which will be subscribed to subsequent ConstraintListener events.

removeConstraintListener

void removeConstraintListener(ConstraintListener aListener)
Removes the specified listener so that it no longer receives constraint events from this data model.

Parameters:
aListener - The listener which will be unsubscribed from receiving ConstraintListener events.

fireConstraintEvent

void fireConstraintEvent(ConstraintEvent event)
Fire a constraint event to all subscribed listeners.

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

Parameters:
event - The constraint event
See Also:
ConstraintListener.constraintChanged(ilog.views.gantt.event.ConstraintEvent)

contains

boolean contains(IlvReservation reservation)
Returns whether the specified reservation is a member of the data model.

Parameters:
reservation - The reservation.
Returns:
Whether the specified reservation is a member of the data model.
Since:
JViews 5.5

reservationIterator

Iterator reservationIterator()
Returns an iterator over all of the reservations in the data model. The iterator will actually be over a copy of the reservations, making it safe to add or remove reservations during the course of the iteration.

Returns:
An iterator over all reservations in the data model.

reservationIterator

Iterator reservationIterator(IlvActivity activity)
Returns an iterator over all of the reservations in the data model that are associated with the specified activity. The iterator will actually be over a copy of the reservations, making it safe to add or remove reservations during the course of the iteration.

Parameters:
activity - The activity.
Returns:
An iterator over all the reservations in the data model that are associated with the specified activity.

reservationIterator

Iterator reservationIterator(IlvResource resource)
Returns an iterator over all of the reservations in the data model that are associated with the specified resource. The iterator will actually be over a copy of the reservations, making it safe to add or remove reservations during the course of the iteration.

Parameters:
resource - The resource.
Returns:
An iterator over all the reservations in the data model that are associated with the specified resource.

reservationIterator

Iterator reservationIterator(IlvResource resource,
                             IlvTimeInterval interval)
Returns an iterator over all of the reservations in the data model that are associated with the specified resource and where the assigned activity intersects the specified time interval. The iterator will actually be over a copy of the reservations, making it safe to add or remove reservations during the course of the iteration.

Paramet