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:
IlvActivity
's. The root of
the tree can be accessed via getRootActivity()
.IlvResource
's. The root of
the tree can be accessed via getRootResource()
.IlvReservation
's.IlvConstraint
's.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.Modifier and Type | Field and Description |
---|---|
static String |
ADJUSTING_PROPERTY
Identifies that an adjustment session has begun or ended.
|
static String |
BATCHING_PROPERTY
Identifies that a batching session has begun or ended.
|
Modifier and Type | Method and Description |
---|---|
Iterator<IlvActivity> |
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<IlvActivity> |
childActivityIterator(IlvActivity parent)
Returns an iterator over the parent activity's children.
|
Iterator<IlvResource> |
childResourceIterator(IlvResource parent)
Returns an iterator over the parent resource's children.
|
Iterator<IlvConstraint> |
constraintIterator()
Returns an iterator over all of the constraints in the data model.
|
Iterator<IlvConstraint> |
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<IlvConstraint> |
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.
|
boolean |
isBatching()
Returns whether a batching 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<IlvReservation> |
reservationIterator()
Returns an iterator over all of the reservations in the data model.
|
Iterator<IlvReservation> |
reservationIterator(IlvActivity activity)
Returns an iterator over all of the reservations in the data model
that are associated with the specified activity.
|
Iterator<IlvReservation> |
reservationIterator(IlvResource resource)
Returns an iterator over all of the reservations in the data model
that are associated with the specified resource.
|
Iterator<IlvReservation> |
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<IlvResource> |
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 |
setBatching(boolean batching)
Starts or ends a batching 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.
|
static final String ADJUSTING_PROPERTY
An adjustment session encompasses a user action or interaction, often comprising several mouse events and possibly extending over several seconds of time. For example, when user drags objects in a Gantt sheet, the entire interaction from the mouse-pressed event to the mouse-released event later will be in a single adjustment session.
Adjustment sessions can contain batching sessions. Batching sessions are shorter than adjustment sessions: A batching session does not last longer than the reaction on a single mouse event.
setAdjusting(boolean)
,
isAdjusting()
,
BATCHING_PROPERTY
,
Constant Field Valuesstatic final String BATCHING_PROPERTY
A batching session is meant to group together modifications to multiple activities, resources, constraints, or reservations, that occur immediately one after the other and that all arise from a single input event or from a single API call.
Batching sessions may be contained in adjustment sessions.
When an IlvGanttSheet
is connected to this model, a batching
session on this model automatically translates into an
IlvGanttSheet.beginRedrawSession(boolean)
/IlvGanttSheet.endRedrawSession()
pair of calls on that Gantt sheet, which implies an
IlvManager.initReDraws()
/IlvManager.reDrawViews()
pair of calls on its grapher, and a pair of
{#link setContentsAdjusting(true/false)
calls on that grapher.
setBatching(boolean)
,
isBatching()
,
ADJUSTING_PROPERTY
,
Constant Field Valuesvoid setAdjusting(boolean adjusting)
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.adjusting
- True to start an adjustment session or false to end an adjustment
session.isAdjusting()
boolean isAdjusting()
setAdjusting(boolean)
void setBatching(boolean batching)
setBatching(true)
must be paired with a call to
setBatching(false)
. A batching
property event
is fired when the outermost batching session begins and
ends.batching
- True to start a batching session or false to end a batching
session.isBatching()
boolean isBatching()
true
if a batching session is active.setBatching(boolean)
void addGanttModelPropertyListener(GanttModelPropertyListener listener)
listener
- The listener that will be subscribed to subsequent
GanttModelPropertyEvent
s.removeGanttModelPropertyListener(ilog.views.gantt.event.GanttModelPropertyListener)
void removeGanttModelPropertyListener(GanttModelPropertyListener listener)
listener
- The listener that will be unsubscribed from receiving.
GanttModelPropertyEvent
s.addGanttModelPropertyListener(ilog.views.gantt.event.GanttModelPropertyListener)
boolean contains(IlvHierarchyNode activityOrResource)
activityOrResource
- The activity or resource.IlvHierarchyNode getParent(IlvHierarchyNode activityOrResource)
null
if the activity is the root activity of the data
model or if the resource is the root resource of the data model.activityOrResource
- The activity or resource.IllegalArgumentException
- if activityOrResource
is
not a member of this data model.int getParentIndex(IlvHierarchyNode activityOrResource)
-1
is returned.activityOrResource
- The activity or resource.IllegalArgumentException
- if activityOrResource
is
not a member of this data model.int getChildCount(IlvHierarchyNode parent)
parent
- The parent activity or resource.IllegalArgumentException
- if parent
is not a member
of this data model.IlvHierarchyNode getChild(IlvHierarchyNode parent, int index)
index
.parent
- The parent activity or resource.index
- The child index.index
.IllegalArgumentException
- if parent
is not a member
of this data model.IndexOutOfBoundsException
- if index
is out of range
(index < 0 || index >= getChildCount(parent)).int getChildIndex(IlvHierarchyNode parent, IlvHierarchyNode child)
parent
- The parent activity or resource.child
- The child activity or resource to find the index of.-1
if it is not a
child of parent
.IllegalArgumentException
- if parent
is not a member
of this data model.IlvActivity getRootActivity()
null
if the
data model contains no activities.null
.void setRootActivity(IlvActivity root)
ConstraintRemovedEvent
s and
ReservationRemovedEvent
s 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.root
- The new root activity or null
if the data model
is to contain no activities.ActivityHierarchyListener.activitiesInserted(ilog.views.gantt.event.ActivitiesInsertedEvent)
,
ActivityHierarchyListener.activitiesRemoved(ilog.views.gantt.event.ActivitiesRemovedEvent)
IlvActivity getParentActivity(IlvActivity activity)
null
if the activity is the root activity of the data model.activity
- The activity. The implementation of this method should use
IlvGanttModelUtil.checkValidMemberActivity(ilog.views.gantt.IlvActivity, ilog.views.gantt.IlvGanttModel)
to validate
activity
.null
.IllegalArgumentException
- if activity
is not a
member of this data model.int getParentActivityIndex(IlvActivity activity)
-1
is returned.activity
- The activity. The implementation of this method should use
IlvGanttModelUtil.checkValidMemberActivity(ilog.views.gantt.IlvActivity, ilog.views.gantt.IlvGanttModel)
to validate
activity
.-1
.IllegalArgumentException
- if activity
is not a member
of this data model.int getChildActivityCount(IlvActivity parent)
parent
- The parent activity. The implementation of this method should
use IlvGanttModelUtil.checkValidMemberActivity(ilog.views.gantt.IlvActivity, ilog.views.gantt.IlvGanttModel)
to validate
parent
.IllegalArgumentException
- if parent
is not a member
of this data model.IlvActivity getChildActivity(IlvActivity parent, int index)
index
.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.index
.IllegalArgumentException
- if parent
is not a member
of this data model.IndexOutOfBoundsException
- if index
is out of range
(index < 0 || index >= getChildActivityCount(parent)).int getChildActivityIndex(IlvActivity parent, IlvActivity child)
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.-1
if the
activity is not a child of parent
.IllegalArgumentException
- if parent
is not a member
of this data model.Iterator<IlvActivity> childActivityIterator(IlvActivity parent)
parent
- The parent activity.parent
.Iterator<IlvActivity> activityPreorderIterator(IlvActivity parent)
next()
method will be parent
.parent
- The parent of the activity subtree.IlvGanttModelUtil.activityPreorderIterator(ilog.views.gantt.IlvGanttModel)
,
IlvAbstractGanttModel.activityPreorderIterator()
void addActivity(IlvActivity newActivity, IlvActivity parent, int index)
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
.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
.IllegalArgumentException
- if newActivity
is
null
or parent
is not a member of this data
model.IndexOutOfBoundsException
- if index
is out of range
(index < 0).ActivityHierarchyListener.activitiesInserted(ilog.views.gantt.event.ActivitiesInsertedEvent)
void addActivity(IlvActivity newActivity, IlvActivity parent)
newActivity
as the last child of the specified
parent
activity. After the activity has been added, the data
model will fire an ActivitiesInsertedEvent
.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
.IllegalArgumentException
- if newActivity
is
null
or parent
is not a member of this data
model.ActivityHierarchyListener.activitiesInserted(ilog.views.gantt.event.ActivitiesInsertedEvent)
void removeActivity(IlvActivity parent, int index)
ConstraintRemovedEvent
s and ReservationRemovedEvent
s for
each removed constraint and reservation. The removingActivity
property of these events will be true
. Then, the data model
will fire an ActivitiesRemovedEvent
.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.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)).ActivityHierarchyListener.activitiesRemoved(ilog.views.gantt.event.ActivitiesRemovedEvent)
void removeActivity(IlvActivity activity)
ConstraintRemovedEvent
s and
ReservationRemovedEvent
s 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.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.IllegalArgumentException
- if activity is
null
, is not a member of this data model, or is the root
activity.ActivityHierarchyListener.activitiesRemoved(ilog.views.gantt.event.ActivitiesRemovedEvent)
void moveActivity(IlvActivity activity, IlvActivity newParent, int newIndex)
ActivityMovedEvent
.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
.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).ActivityHierarchyListener.activityMoved(ilog.views.gantt.event.ActivityMovedEvent)
void addActivityHierarchyListener(ActivityHierarchyListener aListener)
aListener
- The listener which will be subscribed to subsequent
ActivityHierarchyListener
events.void removeActivityHierarchyListener(ActivityHierarchyListener aListener)
aListener
- The listener which will be unsubscribed from receiving
ActivityHierarchyListener
events.void addActivityListener(ActivityListener aListener)
aListener
- The listener which will be subscribed to subsequent
ActivityListener
events.void removeActivityListener(ActivityListener aListener)
aListener
- The listener which will be unsubscribed from receiving
ActivityListener
events.void fireActivityEvent(ActivityEvent 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
.
event
- The activity event.ActivityListener.activityChanged(ilog.views.gantt.event.ActivityEvent)
IlvResource getRootResource()
null
if the
data model contains no resources.null
.void setRootResource(IlvResource root)
ReservationRemovedEvent
s 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.root
- The new root resource or null
if the data model
is to contain no resources.ResourceHierarchyListener.resourcesInserted(ilog.views.gantt.event.ResourcesInsertedEvent)
,
ResourceHierarchyListener.resourcesRemoved(ilog.views.gantt.event.ResourcesRemovedEvent)
IlvResource getParentResource(IlvResource resource)
null
if the resource is the root resource of the data model.resource
- The resource. The implementation of this method should use
IlvGanttModelUtil.checkValidMemberResource(ilog.views.gantt.IlvResource, ilog.views.gantt.IlvGanttModel)
to validate
resource
.null
.IllegalArgumentException
- if resource
is not a
member of this data model.int getParentResourceIndex(IlvResource resource)
-1
is
returned.resource
- The resource. The implementation of this method should use
IlvGanttModelUtil.checkValidMemberResource(ilog.views.gantt.IlvResource, ilog.views.gantt.IlvGanttModel)
to validate
resource
.-1
.IllegalArgumentException
- if resource
is not a
member of this data model.int getChildResourceCount(IlvResource parent)
parent
- The parent resource. The implementation of this method should
use IlvGanttModelUtil.checkValidMemberResource(ilog.views.gantt.IlvResource, ilog.views.gantt.IlvGanttModel)
to validate
parent
.IllegalArgumentException
- if parent
is not a member
of this data model.IlvResource getChildResource(IlvResource parent, int index)
index
.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.index
.IllegalArgumentException
- if parent
is not a member
of this data model.IndexOutOfBoundsException
- if index
is out of range
(index < 0 || index >= getChildResourceCount(parent)).int getChildResourceIndex(IlvResource parent, IlvResource child)
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.-1
if the
resource is not a child of parent
.IllegalArgumentException
- if parent
is not a member
of this data model.Iterator<IlvResource> childResourceIterator(IlvResource parent)
parent
- The parent resource.parent
.Iterator<IlvResource> resourcePreorderIterator(IlvResource parent)
next()
method will be parent
.parent
- The parent of the resource subtree.IlvGanttModelUtil.resourcePreorderIterator(ilog.views.gantt.IlvGanttModel)
,
IlvAbstractGanttModel.resourcePreorderIterator()
void addResource(IlvResource newResource, IlvResource parent, int index)
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
.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
.IllegalArgumentException
- if newResource
is
null
or parent
is not a member of this data
model.IndexOutOfBoundsException
- if index
is out of range
(index < 0).ResourceHierarchyListener.resourcesInserted(ilog.views.gantt.event.ResourcesInsertedEvent)
void addResource(IlvResource newResource, IlvResource parent)
newResource
as the last child of the specified
parent
resource. After the resource has been added, the data
model will fire a ResourcesInsertedEvent
.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
.IllegalArgumentException
- if newResource
is
null
or parent
is not a member of this data
model.ResourceHierarchyListener.resourcesInserted(ilog.views.gantt.event.ResourcesInsertedEvent)
void removeResource(IlvResource parent, int index)
ReservationRemovedEvent
s for each removed
reservation. The removingResource
property of these events will be true
.
Then, the data model will fire a ResourcesRemovedEvent
.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 resourceIllegalArgumentException
- 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)).ResourceHierarchyListener.resourcesRemoved(ilog.views.gantt.event.ResourcesRemovedEvent)
void removeResource(IlvResource resource)
ReservationRemovedEvent
s 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.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.IllegalArgumentException
- if resource is
null
, is not a member of this data model, or is the root
resource.ResourceHierarchyListener.resourcesRemoved(ilog.views.gantt.event.ResourcesRemovedEvent)
void moveResource(IlvResource resource, IlvResource newParent, int newIndex)
ResourceMovedEvent
.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
.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).ResourceHierarchyListener.resourceMoved(ilog.views.gantt.event.ResourceMovedEvent)
void addResourceHierarchyListener(ResourceHierarchyListener aListener)
aListener
- The listener which will be subscribed to subsequent
ResourceHierarchyListener
events.void removeResourceHierarchyListener(ResourceHierarchyListener aListener)
aListener
- The listener which will be unsubscribed from receiving
ResourceHierarchyListener
events.void addResourceListener(ResourceListener aListener)
aListener
- The listener which will be subscribed to subsequent
ResourceListener
events.void removeResourceListener(ResourceListener aListener)
aListener
- The listener which will be unsubscribed from receiving
ResourceListener
events.void fireResourceEvent(ResourceEvent 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
.
event
- The resource event.ResourceListener.resourceChanged(ilog.views.gantt.event.ResourceEvent)
boolean contains(IlvConstraint constraint)
constraint
- The constraint.Iterator<IlvConstraint> constraintIterator()
Iterator<IlvConstraint> constraintIteratorFromActivity(IlvActivity fromActivity)
fromActivity
- The from activity.Iterator<IlvConstraint> constraintIteratorToActivity(IlvActivity toActivity)
toActivity
- The to activity.void addConstraint(IlvConstraint newConstraint)
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
.
newConstraint
- The constraint to add.IllegalArgumentException
- if newConstraint
is
null
, is a member of a data model already, or its constrained
activities are not members of this data model.ConstraintInsertedEvent
,
ConstraintListener.constraintChanged(ilog.views.gantt.event.ConstraintEvent)
,
IlvGanttModelUtil.checkValidNewConstraint(ilog.views.gantt.IlvConstraint, ilog.views.gantt.IlvGanttModel)
void removeConstraint(IlvConstraint constraint)
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.
constraint
- The constraint to remove.IllegalArgumentException
- if constraint
is
null
or is not a member of this data modelConstraintRemovedEvent
,
ConstraintListener.constraintChanged(ilog.views.gantt.event.ConstraintEvent)
,
IlvGanttModelUtil.checkValidMemberConstraint(ilog.views.gantt.IlvConstraint, ilog.views.gantt.IlvGanttModel)
void addConstraintListener(ConstraintListener aListener)
aListener
- The listener which will be subscribed to subsequent
ConstraintListener
events.void removeConstraintListener(ConstraintListener aListener)
aListener
- The listener which will be unsubscribed from receiving
ConstraintListener
events.void fireConstraintEvent(ConstraintEvent 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
IlvConstraint
implementation that does not subclass
IlvAbstractConstraint
.
event
- The constraint eventConstraintListener.constraintChanged(ilog.views.gantt.event.ConstraintEvent)
boolean contains(IlvReservation reservation)
reservation
- The reservation.Iterator<IlvReservation> reservationIterator()
Iterator<IlvReservation> reservationIterator(IlvActivity activity)
activity
- The activity.Iterator<IlvReservation> reservationIterator(IlvResource resource)
resource
- The resource.Iterator<IlvReservation> reservationIterator(IlvResource resource, IlvTimeInterval interval)
resource
- The resource.interval
- The activity time interval of interest.void addReservation(IlvReservation newReservation)
newReservation
to the data model. The reservation's
resource and activity must already be members of this data model. After the
reservation has been added, the data model will fire a
ReservationInsertedEvent
.
The implementation of this method can use
IlvGanttModelUtil.checkValidNewReservation()
to
validate newReservation
.
newReservation
- The reservation to add.IllegalArgumentException
- if newReservation
is
null
, is a member of a data model already, its resource is
is not a member of this data model, or its activity is not a member of
this data model.ReservationInsertedEvent
,
ReservationListener.reservationChanged(ilog.views.gantt.event.ReservationEvent)
,
IlvGanttModelUtil.checkValidNewReservation(ilog.views.gantt.IlvReservation, ilog.views.gantt.IlvGanttModel)
void removeReservation(IlvReservation reservation)
reservation
from the data model. After
the reservation has been removed, the data model will fire a
ReservationRemovedEvent
.
The implementation of this method can use
IlvGanttModelUtil.checkValidMemberReservation()
to
validate reservation
before removing it.
reservation
- The reservation to remove.IllegalArgumentException
- if reservation
is
null
or is not a member of this data modelReservationRemovedEvent
,
ReservationListener.reservationChanged(ilog.views.gantt.event.ReservationEvent)
,
IlvGanttModelUtil.checkValidMemberReservation(ilog.views.gantt.IlvReservation, ilog.views.gantt.IlvGanttModel)
void addReservationListener(ReservationListener aListener)
aListener
- The listener which will be subscribed to subsequent
ReservationListener
events.void removeReservationListener(ReservationListener aListener)
aListener
- The listener which will be unsubscribed from receiving
ReservationListener
events.void fireReservationEvent(ReservationEvent 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
IlvReservation
implementation that does not subclass
IlvAbstractReservation
.
event
- The reservation event.ReservationListener.reservationChanged(ilog.views.gantt.event.ReservationEvent)
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.