public abstract class IlvAbstractGanttModel extends Object implements IlvGanttModel, Serializable
IlvAbstractGanttModel
is the superclass of all
IlvGanttModel
implementations. It provides a basic framework of
event support that can be used by all concrete subclasses.ADJUSTING_PROPERTY, BATCHING_PROPERTY
Constructor and Description |
---|
IlvAbstractGanttModel()
Creates a new
IlvAbstractGanttModel . |
Modifier and Type | Method and Description |
---|---|
Iterator<IlvActivity> |
activityPreorderIterator()
Returns an iterator that traverses all activities in preorder.
|
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)
Appends
newActivity as the last child of the
parent activity. |
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 |
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 |
addReservationListener(ReservationListener aListener)
Adds the specified listener to receive reservation events
from this data model.
|
void |
addResource(IlvResource newResource,
IlvResource parent)
Appends
newResource as the last child of the
parent resource. |
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.
|
void |
clear()
Removes all objects from the data model.
|
protected void |
fireActivitiesInserted(IlvActivity parent,
int[] childIndices)
Fires an
ActivitiesInsertedEvent . |
protected void |
fireActivitiesInserted(IlvActivity parent,
List<IlvActivity> children)
Fires an
ActivitiesInsertedEvent . |
protected void |
fireActivitiesRemoved(IlvActivity parent,
List<IlvActivity> children,
int[] childIndices)
Fires an
ActivitiesRemovedEvent . |
protected void |
fireActivitiesRemoved(IlvActivity parent,
List<IlvActivity> children,
List<Integer> childIndices)
Fires an
ActivitiesRemovedEvent . |
void |
fireActivityEvent(ActivityEvent event)
Fires an
activityChanged event. |
protected void |
fireActivityInserted(IlvActivity parent,
IlvActivity child)
Fires an
ActivitiesInsertedEvent . |
protected void |
fireActivityMoved(IlvActivity activity,
IlvActivity oldParent,
int oldIndex,
IlvActivity newParent,
int newIndex)
Fires an
ActivityMovedEvent . |
protected void |
fireActivityRemoved(IlvActivity parent,
IlvActivity child,
int childIndex)
Fires an
ActivitiesRemovedEvent . |
void |
fireConstraintEvent(ConstraintEvent event)
Fires a constraint event to all subscribed listeners.
|
protected void |
fireConstraintInserted(IlvConstraint constraint)
Fires a
ConstraintInsertedEvent . |
protected void |
fireConstraintRemoved(IlvConstraint constraint)
Fires a
ConstraintRemovedEvent . |
protected void |
fireConstraintRemoved(IlvConstraint constraint,
boolean removingActivity)
Fires a
ConstraintRemovedEvent . |
protected void |
fireGanttModelPropertyEvent(GanttModelPropertyEvent event)
Fires a Gantt model property change event.
|
void |
fireReservationEvent(ReservationEvent event)
Fires a reservation event to all subscribed listeners.
|
protected void |
fireReservationInserted(IlvReservation reservation)
Fires a
ReservationInsertedEvent . |
protected void |
fireReservationRemoved(IlvReservation reservation)
Fires a
ReservationRemovedEvent . |
protected void |
fireReservationRemoved(IlvReservation reservation,
int removingEntity)
Fires a
ReservationRemovedEvent . |
void |
fireResourceEvent(ResourceEvent event)
Fires a
resourceChanged event. |
protected void |
fireResourceInserted(IlvResource parent,
IlvResource child)
Fires a
ResourcesInsertedEvent . |
protected void |
fireResourceMoved(IlvResource resource,
IlvResource oldParent,
int oldIndex,
IlvResource newParent,
int newIndex)
Fires a
ResourceMovedEvent . |
protected void |
fireResourceRemoved(IlvResource parent,
IlvResource child,
int childIndex)
Fires a
ResourcesRemovedEvent . |
protected void |
fireResourcesInserted(IlvResource parent,
int[] childIndices)
Fires a
ResourcesInsertedEvent . |
protected void |
fireResourcesInserted(IlvResource parent,
List<IlvResource> children)
Fires a
ResourcesInsertedEvent . |
protected void |
fireResourcesRemoved(IlvResource parent,
List<IlvResource> children,
int[] childIndices)
Fires a
ResourcesRemovedEvent . |
protected void |
fireResourcesRemoved(IlvResource parent,
List<IlvResource> children,
List<Integer> childIndices)
Fires a
ResourcesRemovedEvent . |
protected Iterator<ActivityHierarchyListener> |
getActivityHierarchyListeners()
Returns an iterator over the data model's
activity hierarchy event listeners . |
protected Iterator<ActivityListener> |
getActivityListeners()
Returns an iterator over the data model's
activity event listeners . |
IlvHierarchyNode |
getChild(IlvHierarchyNode parent,
int index)
Returns the child of the specified parent activity or resource at index
index . |
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.
|
IlvHierarchyNode |
getParent(IlvHierarchyNode activityOrResource)
Returns the parent of the specified activity or resource.
|
int |
getParentIndex(IlvHierarchyNode activityOrResource)
Returns the index of the specified activity or resource within its parent.
|
protected Iterator<ResourceHierarchyListener> |
getResourceHierarchyListeners()
Returns an iterator over the data model's
resource hierarchy event listeners . |
protected Iterator<ResourceListener> |
getResourceListeners()
Returns an iterator over the data model's
resource event listeners . |
boolean |
isAdjusting()
Returns whether an adjustment session is currently active.
|
boolean |
isBatching()
Returns whether a batching session is currently active.
|
protected boolean |
registerEventListener(String key,
Object listener)
Registers the specified event listener, which has just been
deserialized, with this data model.
|
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 |
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 |
removeReservationListener(ReservationListener aListener)
Removes the specified listener so that it no longer receives
reservation events from this data model.
|
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<IlvResource> |
resourcePreorderIterator()
Returns an iterator that traverses all resources in preorder.
|
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.
|
protected void |
writeEventListeners(ObjectOutputStream stream)
Serializes the transient event listeners of this data model to the
specified stream.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addActivity, addConstraint, addReservation, addResource, constraintIterator, constraintIteratorFromActivity, constraintIteratorToActivity, contains, contains, contains, getChildActivity, getChildActivityCount, getChildActivityIndex, getChildResource, getChildResourceCount, getChildResourceIndex, getParentActivity, getParentActivityIndex, getParentResource, getParentResourceIndex, getRootActivity, getRootResource, moveActivity, moveResource, removeActivity, removeActivity, removeConstraint, removeReservation, removeResource, removeResource, reservationIterator, reservationIterator, reservationIterator, reservationIterator, setRootActivity, setRootResource
public IlvAbstractGanttModel()
IlvAbstractGanttModel
.public void clear()
public void 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.setAdjusting
in interface IlvGanttModel
adjusting
- True to start an adjustment session or false to end an adjustment
session.isAdjusting()
public boolean isAdjusting()
isAdjusting
in interface IlvGanttModel
setAdjusting(boolean)
public 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.setBatching
in interface IlvGanttModel
batching
- True to start a batching session or false to end a batching
session.isBatching()
public boolean isBatching()
isBatching
in interface IlvGanttModel
true
if a batching session is active.setBatching(boolean)
public void addGanttModelPropertyListener(GanttModelPropertyListener listener)
addGanttModelPropertyListener
in interface IlvGanttModel
listener
- The listener that will be subscribed to subsequent
GanttModelPropertyEvent
s.removeGanttModelPropertyListener(ilog.views.gantt.event.GanttModelPropertyListener)
public void removeGanttModelPropertyListener(GanttModelPropertyListener listener)
removeGanttModelPropertyListener
in interface IlvGanttModel
listener
- The listener that will be unsubscribed from receiving.
GanttModelPropertyEvent
s.addGanttModelPropertyListener(ilog.views.gantt.event.GanttModelPropertyListener)
protected void fireGanttModelPropertyEvent(GanttModelPropertyEvent event)
event
- The property change event.addGanttModelPropertyListener(ilog.views.gantt.event.GanttModelPropertyListener)
,
GanttModelPropertyListener.propertyChanged(ilog.views.gantt.event.GanttModelPropertyEvent)
public 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.getParent
in interface IlvGanttModel
activityOrResource
- The activity or resource.IllegalArgumentException
- if activityOrResource
is
not a member of this data model.public int getParentIndex(IlvHierarchyNode activityOrResource)
-1
is returned.getParentIndex
in interface IlvGanttModel
activityOrResource
- The activity or resource.IllegalArgumentException
- if activityOrResource
is
not a member of this data model.public int getChildCount(IlvHierarchyNode parent)
getChildCount
in interface IlvGanttModel
parent
- The parent activity or resource.IllegalArgumentException
- if parent
is not a member
of this data model.public IlvHierarchyNode getChild(IlvHierarchyNode parent, int index)
index
.getChild
in interface IlvGanttModel
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)).public int getChildIndex(IlvHierarchyNode parent, IlvHierarchyNode child)
getChildIndex
in interface IlvGanttModel
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.public void addActivity(IlvActivity newActivity, IlvActivity parent)
newActivity
as the last child of the
parent
activity. After the activity has been added, the data
model fires an ActivitiesInsertedEvent
.addActivity
in interface IlvGanttModel
newActivity
- The activity to add.parent
- The parent activity to which newActivity
is
added. The implementation of this method uses
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)
public Iterator<IlvActivity> childActivityIterator(IlvActivity parent)
This implementation of childActivityIterator
is based on the
methods IlvGanttModel.getChildActivityCount(IlvActivity)
and
IlvGanttModel.getChildActivity(IlvActivity, int)
.
childActivityIterator
in interface IlvGanttModel
parent
- The parent activity.parent
.public Iterator<IlvActivity> activityPreorderIterator(IlvActivity parent)
next()
method will be parent.
This implementation of activityPreorderIterator
is based on
the method childActivityIterator(IlvActivity)
.
activityPreorderIterator
in interface IlvGanttModel
parent
- The parent of the activity subtree.activityPreorderIterator()
,
IlvGanttModelUtil.activityPreorderIterator(ilog.views.gantt.IlvGanttModel)
public Iterator<IlvActivity> activityPreorderIterator()
next()
method of the iterator
is the root activity
of the model.
This implementation of activityPreorderIterator
is based on
the method childActivityIterator(IlvActivity)
.
activityPreorderIterator(IlvActivity)
,
IlvGanttModelUtil.activityPreorderIterator(ilog.views.gantt.IlvGanttModel)
public void addActivityHierarchyListener(ActivityHierarchyListener aListener)
addActivityHierarchyListener
in interface IlvGanttModel
aListener
- The listener that will be subscribed to subsequent
ActivityHierarchyListener
events.removeActivityHierarchyListener(ilog.views.gantt.event.ActivityHierarchyListener)
public void removeActivityHierarchyListener(ActivityHierarchyListener aListener)
removeActivityHierarchyListener
in interface IlvGanttModel
aListener
- The listener that will be unsubscribed from receiving
ActivityHierarchyListener
events.addActivityHierarchyListener(ilog.views.gantt.event.ActivityHierarchyListener)
protected Iterator<ActivityHierarchyListener> getActivityHierarchyListeners()
activity hierarchy event listeners
.addActivityHierarchyListener(ilog.views.gantt.event.ActivityHierarchyListener)
,
removeActivityHierarchyListener(ilog.views.gantt.event.ActivityHierarchyListener)
protected void fireActivitiesInserted(IlvActivity parent, int[] childIndices)
ActivitiesInsertedEvent
. Note: This method
cannot be used to notify listeners when the root activity has been added.parent
- The parent activity to which child activities have been
added.childIndices
- An int
array that specifies the index
values of the inserted activities. The indices represent the final
state of the activity tree, after the child activities have been inserted.
The indices do not have to be pre-sorted.ActivityHierarchyListener.activitiesInserted(ilog.views.gantt.event.ActivitiesInsertedEvent)
protected void fireActivitiesInserted(IlvActivity parent, List<IlvActivity> children)
ActivitiesInsertedEvent
.parent
- The parent activity to which child activities have been
added.
If the reported insertion is that of the root activity, parent
should be null
and children
should be a
single-element list containing the root activity.children
- The list of child activities that have
been inserted. The activities do not have to be pre-sorted.ActivityHierarchyListener.activitiesInserted(ilog.views.gantt.event.ActivitiesInsertedEvent)
protected void fireActivityInserted(IlvActivity parent, IlvActivity child)
ActivitiesInsertedEvent
.parent
- The parent activity to which child activities have been
added.
If the reported insertion is that of the root activity, parent
should be null
and child
should be the root
activity.child
- The child activity that has been inserted.ActivityHierarchyListener.activitiesInserted(ilog.views.gantt.event.ActivitiesInsertedEvent)
protected void fireActivitiesRemoved(IlvActivity parent, List<IlvActivity> children, int[] childIndices)
ActivitiesRemovedEvent
.parent
- The parent activity from which child activities have been
removed.
If the reported deletion is that of the root activity, parent
should be null
, children
should be a
single-element list containing the root activity, and
childIndices
should be a single-element array with
childIndices[0]=0
.children
- The list of child activities that have
been removed. The activities do not have to be pre-sorted, but must be
arranged in parallel with childIndices
. In other words,
childIndices[i]
must contain the index that the activity
(IlvActivity)children.get(i)
had before it was removed.childIndices
- An int
array that specifies the index
values that the child activities had before they were removed. The indices
do not have to be pre-sorted, but must be arranged in parallel with
children
.ActivityHierarchyListener.activitiesRemoved(ilog.views.gantt.event.ActivitiesRemovedEvent)
protected void fireActivitiesRemoved(IlvActivity parent, List<IlvActivity> children, List<Integer> childIndices)
ActivitiesRemovedEvent
.parent
- The parent activity from which child activities have been
removed.
If the reported deletion is that of the root activity, parent
should be null
, children
should be a
single-element list containing the root activity, and
childIndices
should be a single-element list containing
Integer(0)
.children
- The list of child activities that have
been removed. The activities do not have to be pre-sorted, but must be
arranged in parallel with childIndices
. In other words,
childIndices[i]
must contain the index that the activity
(IlvActivity)children.get(i)
had before it was removed.childIndices
- A list of Integer
s that specifies the index
values that the child activities had before they were removed. The indices
do not have to be pre-sorted, but must be arranged in parallel with
children
.ActivityHierarchyListener.activitiesRemoved(ilog.views.gantt.event.ActivitiesRemovedEvent)
protected void fireActivityRemoved(IlvActivity parent, IlvActivity child, int childIndex)
ActivitiesRemovedEvent
.parent
- The parent activity from which the child activity has been
removed.
If the reported deletion is that of the root activity, parent
should be null
, child
should be the root
activity, and childIndex
should be 0
.child
- The child activity that has been removed.childIndex
- The index value that the child activity had before it
was removed.ActivityHierarchyListener.activitiesRemoved(ilog.views.gantt.event.ActivitiesRemovedEvent)
protected void fireActivityMoved(IlvActivity activity, IlvActivity oldParent, int oldIndex, IlvActivity newParent, int newIndex)
ActivityMovedEvent
.activity
- The activity that has been moved.oldParent
- The previous parent of the activity.oldIndex
- The index of the activity within oldParent
before it was moved.newParent
- The new parent of the activity.newIndex
- The index of the activity within newParent
after it has been moved.ActivityHierarchyListener.activityMoved(ilog.views.gantt.event.ActivityMovedEvent)
public void addActivityListener(ActivityListener aListener)
addActivityListener
in interface IlvGanttModel
aListener
- The listener that will be subscribed to subsequent
ActivityListener
events.removeActivityListener(ilog.views.gantt.event.ActivityListener)
public void removeActivityListener(ActivityListener aListener)
removeActivityListener
in interface IlvGanttModel
aListener
- The listener that will be unsubscribed from receiving
ActivityListener
events.addActivityListener(ilog.views.gantt.event.ActivityListener)
protected Iterator<ActivityListener> getActivityListeners()
activity event listeners
.addActivityListener(ilog.views.gantt.event.ActivityListener)
,
removeActivityListener(ilog.views.gantt.event.ActivityListener)
public void fireActivityEvent(ActivityEvent event)
activityChanged
event.
Warning: This method is considered to be part of an
IlvGanttModel
internal implementation rather than of the public
API.
Do not invoke this method directly unless you have created an
IlvActivity
implementation that does not subclass
IlvAbstractActivity
.
fireActivityEvent
in interface IlvGanttModel
event
- The activity event.ActivityListener.activityChanged(ilog.views.gantt.event.ActivityEvent)
public void addResource(IlvResource newResource, IlvResource parent)
newResource
as the last child of the
parent
resource. After the resource has been added, the data
model will fire a ResourcesInsertedEvent
.addResource
in interface IlvGanttModel
newResource
- The resource to add.parent
- The parent resource to which newResource
is
added. The implementation of this method uses
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)
public Iterator<IlvResource> childResourceIterator(IlvResource parent)
This implementation of childResourceIterator
is based on the
methods IlvGanttModel.getChildResourceCount(IlvResource)
and
IlvGanttModel.getChildResource(IlvResource, int)
.
childResourceIterator
in interface IlvGanttModel
parent
- The parent resource.parent
.public Iterator<IlvResource> resourcePreorderIterator(IlvResource parent)
next()
method will be parent
.
This implementation of resourcePreorderIterator
is based on
the method childResourceIterator(IlvResource)
.
resourcePreorderIterator
in interface IlvGanttModel
parent
- The parent of the resource subtree.resourcePreorderIterator()
,
IlvGanttModelUtil.resourcePreorderIterator(ilog.views.gantt.IlvGanttModel)
public Iterator<IlvResource> resourcePreorderIterator()
next()
method of the iterator
is the root resource
of the model.
This implementation of resourcePreorderIterator
is based on
the method childResourceIterator(IlvResource)
.
resourcePreorderIterator(IlvResource)
,
IlvGanttModelUtil.resourcePreorderIterator(ilog.views.gantt.IlvGanttModel)
public void addResourceHierarchyListener(ResourceHierarchyListener aListener)
addResourceHierarchyListener
in interface IlvGanttModel
aListener
- The listener that will be subscribed to subsequent
ResourceHierarchyListener
events.removeResourceHierarchyListener(ilog.views.gantt.event.ResourceHierarchyListener)
public void removeResourceHierarchyListener(ResourceHierarchyListener aListener)
removeResourceHierarchyListener
in interface IlvGanttModel
aListener
- The listener that will be unsubscribed from receiving
ResourceHierarchyListener
events.addResourceHierarchyListener(ilog.views.gantt.event.ResourceHierarchyListener)
protected Iterator<ResourceHierarchyListener> getResourceHierarchyListeners()
resource hierarchy event listeners
.addResourceHierarchyListener(ilog.views.gantt.event.ResourceHierarchyListener)
,
removeResourceHierarchyListener(ilog.views.gantt.event.ResourceHierarchyListener)
protected void fireResourcesInserted(IlvResource parent, int[] childIndices)
ResourcesInsertedEvent
. Note: This method cannot
be used to notify listeners when the root resource has been added.parent
- The parent resource to which child resources have been added.childIndices
- An int
array that specifies the index
values of the inserted resources. The indices represent the final
state of the resource tree, after the new child resources have been added.
The indices do not have to be pre-sorted.ResourceHierarchyListener.resourcesInserted(ilog.views.gantt.event.ResourcesInsertedEvent)
protected void fireResourcesInserted(IlvResource parent, List<IlvResource> children)
ResourcesInsertedEvent
.parent
- The parent resource to which child resources have been added.
If the reported insertion is that of the root resource, parent
should be null
and children
should be a
single-element list containing the root resource.children
- The list of child resources that have
been inserted. The resources do not have to be pre-sorted.ResourceHierarchyListener.resourcesInserted(ilog.views.gantt.event.ResourcesInsertedEvent)
protected void fireResourceInserted(IlvResource parent, IlvResource child)
ResourcesInsertedEvent
.parent
- The parent resource to which child resources have been
added.
If the reported insertion is that of the root resource, parent
should be null
and child
should be the root
resource.child
- The child resource that has been inserted.ResourceHierarchyListener.resourcesInserted(ilog.views.gantt.event.ResourcesInsertedEvent)
protected void fireResourcesRemoved(IlvResource parent, List<IlvResource> children, int[] childIndices)
ResourcesRemovedEvent
.parent
- The parent resource from which child resources have been
removed.
If the reported deletion is that of the root resource, parent
should be null
, children
should be a
single-element list containing the root resource, and
childIndices
should be a single-element array with
childIndices[0]=0
.children
- The list of child resources that have
been removed. The resources do not have to be pre-sorted, but must be
arranged parallel to childIndices
. In other words,
childIndices[i]
must contain the index that resource
(IlvResource)children.get(i)
had before it was removed.childIndices
- An int
array that specifies the index
values that the child resources had before they were removed. The indices
do not have to be pre-sorted, but must be arranged parallel to
children
.ResourceHierarchyListener.resourcesRemoved(ilog.views.gantt.event.ResourcesRemovedEvent)
protected void fireResourcesRemoved(IlvResource parent, List<IlvResource> children, List<Integer> childIndices)
ResourcesRemovedEvent
.parent
- The parent resource from which child resources have been
removed.
If the reported deletion is that of the root resource, parent
should be null
, children
should be a
single-element list containing the root resource, and
childIndices
should be a single-element list containing
Integer(0)
.children
- The list of child resources that have
been removed. The resources do not have to be pre-sorted, but must be
arranged in parallel with childIndices
. In other words,
childIndices[i]
must contain the index that the resource
(IlvResource)children.get(i)
had before it was removed.childIndices
- A list of Integer
s that specifies the index
values that the child resources had before they were removed. The indices
do not have to be pre-sorted, but must be arranged in parallel with
children
.ResourceHierarchyListener.resourcesRemoved(ilog.views.gantt.event.ResourcesRemovedEvent)
protected void fireResourceRemoved(IlvResource parent, IlvResource child, int childIndex)
ResourcesRemovedEvent
.parent
- The parent resource from which the child resource has been
removed.
If the reported deletion is that of the root resource, parent
should be null
, child
should be the root
resource, and childIndex
should be 0
.child
- The child resource that has been removed.childIndex
- The index value that the child resource had before it
was removed.ResourceHierarchyListener.resourcesRemoved(ilog.views.gantt.event.ResourcesRemovedEvent)
protected void fireResourceMoved(IlvResource resource, IlvResource oldParent, int oldIndex, IlvResource newParent, int newIndex)
ResourceMovedEvent
.resource
- The resource that has been moved.oldParent
- The previous parent of the resource.oldIndex
- The index of the resource within oldParent
before it was moved.newParent
- The new parent of the resource.newIndex
- The index of the resource within newParent
after it has been moved.ResourceHierarchyListener.resourceMoved(ilog.views.gantt.event.ResourceMovedEvent)
public void addResourceListener(ResourceListener aListener)
addResourceListener
in interface IlvGanttModel
aListener
- The listener that will be subscribed to subsequent
ResourceListener
events.removeResourceListener(ilog.views.gantt.event.ResourceListener)
public void removeResourceListener(ResourceListener aListener)
removeResourceListener
in interface IlvGanttModel
aListener
- The listener that will be unsubscribed from receiving
ResourceListener
events.addResourceListener(ilog.views.gantt.event.ResourceListener)
protected Iterator<ResourceListener> getResourceListeners()
resource event listeners
.addResourceListener(ilog.views.gantt.event.ResourceListener)
,
removeResourceListener(ilog.views.gantt.event.ResourceListener)
public void fireResourceEvent(ResourceEvent event)
resourceChanged
event.
Warning: This method is considered to be part of the
internal implementation of an IlvGanttModel
rather than of the
public API.
Do not invoke this method directly unless you have created an
IlvResource
implementation that does not subclass
IlvAbstractResource
.
fireResourceEvent
in interface IlvGanttModel
event
- The resource event.ResourceListener.resourceChanged(ilog.views.gantt.event.ResourceEvent)
public void addConstraintListener(ConstraintListener aListener)
addConstraintListener
in interface IlvGanttModel
aListener
- The listener that will be subscribed to subsequent
ConstraintListener
events.public void removeConstraintListener(ConstraintListener aListener)
removeConstraintListener
in interface IlvGanttModel
aListener
- The listener that will be unsubscribed from receiving
ConstraintListener
events.public void fireConstraintEvent(ConstraintEvent event)
Warning: This method is considered to be part of an
IlvGanttModel
internal implementation rather than of the public
API.
Do not invoke this method directly unless you have created an
IlvConstraint
implementation that does not subclass
IlvAbstractConstraint
.
fireConstraintEvent
in interface IlvGanttModel
event
- The constraint event.ConstraintListener.constraintChanged(ilog.views.gantt.event.ConstraintEvent)
protected void fireConstraintInserted(IlvConstraint constraint)
ConstraintInsertedEvent
.constraint
- The constraint that has been inserted.ConstraintInsertedEvent
,
ConstraintListener.constraintChanged(ilog.views.gantt.event.ConstraintEvent)
,
IlvGanttModel.addConstraint(ilog.views.gantt.IlvConstraint)
protected void fireConstraintRemoved(IlvConstraint constraint, boolean removingActivity)
ConstraintRemovedEvent
.constraint
- The constraint that has been removed.removingActivity
- Indicates whether the constraint was removed as the
side effect of removing an activity from the data model. This flag should
be set to true
when constraints are removed by the
IlvGanttModel.setRootActivity(IlvActivity)
,
IlvGanttModel.removeActivity(IlvActivity)
, or
IlvGanttModel.removeActivity(IlvActivity,int)
methods. It should
be set to false
at all other times.ConstraintRemovedEvent
,
ConstraintListener.constraintChanged(ilog.views.gantt.event.ConstraintEvent)
,
IlvGanttModel.removeConstraint(ilog.views.gantt.IlvConstraint)
protected void fireConstraintRemoved(IlvConstraint constraint)
ConstraintRemovedEvent
. The event indicates that the
constraint was not removed as a side effect of an activity removal.constraint
- The constraint that has been removed.ConstraintRemovedEvent
,
ConstraintListener.constraintChanged(ilog.views.gantt.event.ConstraintEvent)
,
IlvGanttModel.removeConstraint(ilog.views.gantt.IlvConstraint)
public void addReservationListener(ReservationListener aListener)
addReservationListener
in interface IlvGanttModel
aListener
- The listener that will be subscribed to subsequent
ReservationListener
events.public void removeReservationListener(ReservationListener aListener)
removeReservationListener
in interface IlvGanttModel
aListener
- The listener that will be unsubscribed from receiving
ReservationListener
events.public void fireReservationEvent(ReservationEvent event)
Warning: This method is considered to be part of an
IlvGanttModel
internal implementation rather than of a public API.
Do not invoke this method directly unless you have created an
IlvReservation
implementation that does not subclass
IlvAbstractReservation
.
fireReservationEvent
in interface IlvGanttModel
event
- The reservation event.ReservationListener.reservationChanged(ilog.views.gantt.event.ReservationEvent)
protected void fireReservationInserted(IlvReservation reservation)
ReservationInsertedEvent
.reservation
- The reservation that has been inserted.ReservationInsertedEvent
,
ReservationListener.reservationChanged(ilog.views.gantt.event.ReservationEvent)
,
IlvGanttModel.addReservation(ilog.views.gantt.IlvReservation)
protected void fireReservationRemoved(IlvReservation reservation, int removingEntity)
ReservationRemovedEvent
.reservation
- The reservation that has been removed.removingEntity
- Indicates whether the reservation was removed as the
side effect of removing an activity or resource from the data model. The
value should be set to ReservationRemovedEvent.REMOVING_ACTIVITY
when reservations are removed by the
IlvGanttModel.setRootActivity(IlvActivity)
,
IlvGanttModel.removeActivity(IlvActivity)
, or
IlvGanttModel.removeActivity(IlvActivity,int)
methods. The value
should be ReservationRemovedEvent.REMOVING_RESOURCE
when
reservations are removed by the
IlvGanttModel.setRootResource(IlvResource)
,
IlvGanttModel.removeResource(IlvResource)
, or
IlvGanttModel.removeResource(IlvResource,int)
methods. The value
should be ReservationRemovedEvent.REMOVING_NONE
at all other times.ReservationRemovedEvent
,
ReservationListener.reservationChanged(ilog.views.gantt.event.ReservationEvent)
,
IlvGanttModel.removeReservation(ilog.views.gantt.IlvReservation)
protected void fireReservationRemoved(IlvReservation reservation)
ReservationRemovedEvent
. The event indicates that the
reservation was not removed as a side effect of an activity or resource
removal.reservation
- The reservation that has been removed.ReservationRemovedEvent
,
ReservationListener.reservationChanged(ilog.views.gantt.event.ReservationEvent)
,
IlvGanttModel.removeReservation(ilog.views.gantt.IlvReservation)
protected void writeEventListeners(ObjectOutputStream stream) throws IOException
protected void writeEventListeners (ObjectOutputStream stream) throws IOException { super.writeEventListeners(stream); anIlvEventListenerCollection.save(stream, "uniqueFooEventKey"); .. etc ... }
IOException
registerEventListener(java.lang.String, java.lang.Object)
protected boolean registerEventListener(String key, Object listener)
super
. If super
returns false
, you should check whether the listener is
class-specific and needs to be registered. A typical subclass
implementation looks like this:
protected boolean registerEventListener (String key, Object listener) throws IOException { if (super.registerEventListener(key, listener)) return true; if ("uniqueFooEventKey".intern() == key) { addFooListener((FooListener)listener); return true; } ... etc ... return false; }
key
- Key string identifying the event listener. This key has
already been intern
ed, so its identity can be tested
against another intern
ed string.listener
- The deserialized event listener.true
if this data model recognized the event listener
and registered it, or false
otherwise.writeEventListeners(java.io.ObjectOutputStream)
© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.