public class SortGanttModel
extends ilog.views.gantt.model.filter.IlvBasicFilterGanttModel
SortGanttModel
provides a sorted view of an underlying data model's
activities. The children of each parent activity are sorted by
setting an activity comparator implementation.Modifier and Type | Class and Description |
---|---|
static interface |
SortGanttModel.ActivityComparator
Implementations of the
ActivityComparator interface can be used to sort
the activities in a SortGanttModel . |
static class |
SortGanttModel.ActivityEndTimeComparator
ActivityENdTimeComparator is used to sort the activities in a
SortGanttModel according to their end times. |
static class |
SortGanttModel.ActivityNameComparator
ActivityNameComparator is used to sort the activities in a
SortGanttModel according to the lexical ordering of their names. |
static class |
SortGanttModel.ActivityStartTimeComparator
ActivityStartTimeComparator is used to sort the activities in a
SortGanttModel according to their start times. |
static class |
SortGanttModel.CustomActivityComparator
ActivityStartTimeComparator is used to sort the activities in a
SortGanttModel according to their start times. |
Constructor and Description |
---|
SortGanttModel(ilog.views.gantt.IlvGanttModel filteredModel,
ilog.views.util.filter.IlvFilter activityFilter,
ilog.views.util.filter.IlvFilter resourceFilter)
Creates a new sorted model that encapsulates the specified filtered
model.
|
Modifier and Type | Method and Description |
---|---|
java.util.Iterator |
activityPreorderIterator() |
java.util.Iterator |
activityPreorderIterator(ilog.views.gantt.IlvActivity activity) |
void |
addActivity(ilog.views.gantt.IlvActivity newActivity,
ilog.views.gantt.IlvActivity parent,
int index)
Adds
newActivity as a child of parent activity at the
specified location in its list of child activities. |
boolean |
contains(ilog.views.gantt.IlvHierarchyNode arg0) |
SortGanttModel.ActivityComparator |
getActivityComparator()
Returns the activity comparator used for sorting, or
null if sorting
is not active. |
ilog.views.gantt.IlvActivity |
getChildActivity(ilog.views.gantt.IlvActivity parent,
int index)
Returns the child of the specified parent activity at index
index . |
int |
getChildActivityIndex(ilog.views.gantt.IlvActivity parent,
ilog.views.gantt.IlvActivity child)
Returns the index of the specified child in the parent activity's list
of children.
|
ilog.views.gantt.IlvActivity |
getParentActivity(ilog.views.gantt.IlvActivity activity)
Returns the index of the specified activity within its parent activity.
|
int |
getParentActivityIndex(ilog.views.gantt.IlvActivity activity)
Returns the index of the specified activity within its parent activity.
|
void |
initSKDUtil() |
void |
moveActivity(ilog.views.gantt.IlvActivity activity,
ilog.views.gantt.IlvActivity newParent,
int newIndex)
Moves the specified activity from its current location in the tree to a new location.
|
void |
reInitCache()
Re-initialize the cache.
|
void |
removeActivity(ilog.views.gantt.IlvActivity activity)
Removes the specified child
activity from its parent. |
void |
removeActivity(ilog.views.gantt.IlvActivity parent,
int index)
Removes the child activity from
parent that is at the specified location
in its list of child activities. |
java.util.Iterator<ilog.views.gantt.IlvReservation> |
reservationIterator(ilog.views.gantt.IlvActivity arg0) |
void |
setActivityComparator(SortGanttModel.ActivityComparator activityComparator)
Sets the activity comparator used for sorting.
|
void |
setFilteredModel(ilog.views.gantt.IlvGanttModel model)
Sets the filtered model that this model encapsulates.
|
addResource, constraintIterator, constraintIteratorFromActivity, constraintIteratorToActivity, contains, contains, getActivityFilter, getChildActivityCount, getChildResource, getChildResourceCount, getChildResourceIndex, getParentResourceIndex, getResourceFilter, getRootActivity, getRootResource, moveResource, removeResource, removeResource, reservationIterator, reservationIterator, reservationIterator, setActivityFilter, setResourceFilter
addConstraint, addReservation, fireActivityEvent, fireResourceEvent, getFilteredModel, getParentResource, isAdjusting, isBatching, removeConstraint, removeReservation, setAdjusting, setBatching, setRootActivity, setRootResource
addActivity, addActivityHierarchyListener, addActivityListener, addConstraintListener, addGanttModelPropertyListener, addReservationListener, addResource, addResourceHierarchyListener, addResourceListener, childActivityIterator, childResourceIterator, clear, fireConstraintEvent, fireReservationEvent, getChild, getChildCount, getChildIndex, getParent, getParentIndex, removeActivityHierarchyListener, removeActivityListener, removeConstraintListener, removeGanttModelPropertyListener, removeReservationListener, removeResourceHierarchyListener, removeResourceListener, resourcePreorderIterator, resourcePreorderIterator
public SortGanttModel(ilog.views.gantt.IlvGanttModel filteredModel, ilog.views.util.filter.IlvFilter activityFilter, ilog.views.util.filter.IlvFilter resourceFilter)
filteredModel
- arg1
- arg2
- public void initSKDUtil()
public void setFilteredModel(ilog.views.gantt.IlvGanttModel model)
setFilteredModel
in class ilog.views.gantt.model.filter.IlvBasicFilterGanttModel
model
- The data model that this model encapsulates.public java.util.Iterator activityPreorderIterator()
activityPreorderIterator
in class ilog.views.gantt.model.IlvAbstractGanttModel
public java.util.Iterator activityPreorderIterator(ilog.views.gantt.IlvActivity activity)
activityPreorderIterator
in interface ilog.views.gantt.IlvGanttModel
activityPreorderIterator
in class ilog.views.gantt.model.IlvAbstractGanttModel
public void reInitCache()
public SortGanttModel.ActivityComparator getActivityComparator()
null
if sorting
is not active.public void setActivityComparator(SortGanttModel.ActivityComparator activityComparator)
activityComparator
- The activity comparator, or null
to disable
sorting.public void addActivity(ilog.views.gantt.IlvActivity newActivity, ilog.views.gantt.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
.addActivity
in interface ilog.views.gantt.IlvGanttModel
addActivity
in class ilog.views.gantt.model.filter.IlvBasicFilterGanttModel
newActivity
- The activity to add.parent
- The parent activity to which newActivity
is added.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
.public void removeActivity(ilog.views.gantt.IlvActivity parent, int index)
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 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
.removeActivity
in interface ilog.views.gantt.IlvGanttModel
removeActivity
in class ilog.views.gantt.model.filter.IlvBasicFilterGanttModel
parent
- The parent activity from which to remove the child activity.index
- The location within parent
's list of children to remove
the child activity.public void removeActivity(ilog.views.gantt.IlvActivity activity)
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
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.removeActivity
in interface ilog.views.gantt.IlvGanttModel
removeActivity
in class ilog.views.gantt.model.filter.IlvBasicFilterGanttModel
activity
- The activity to remove. It must be a member of this data model, but
cannot be the root activity.public void moveActivity(ilog.views.gantt.IlvActivity activity, ilog.views.gantt.IlvActivity newParent, int newIndex)
ActivityMovedEvent
.moveActivity
in interface ilog.views.gantt.IlvGanttModel
moveActivity
in class ilog.views.gantt.model.filter.IlvBasicFilterGanttModel
activity
- The activity to move. It must be a member of this data model, but
cannot be the root activity.newParent
- The parent activity to which activity
will be made a
child. It must be a member of this data model.newIndex
- The location within newParent
's list of children into
which activity
will be inserted. If newIndex
>= getChildActivityCount(newParent)
, then
activity
will be appended as the last child of
newParent
.public int getParentActivityIndex(ilog.views.gantt.IlvActivity activity)
-1
is
returned.getParentActivityIndex
in interface ilog.views.gantt.IlvGanttModel
getParentActivityIndex
in class ilog.views.gantt.model.filter.IlvBasicFilterGanttModel
activity
- The activity.public ilog.views.gantt.IlvActivity getParentActivity(ilog.views.gantt.IlvActivity activity)
-1
is
returned.getParentActivity
in interface ilog.views.gantt.IlvGanttModel
getParentActivity
in class ilog.views.gantt.model.filter.IlvFilterGanttModel
activity
- The activity.public boolean contains(ilog.views.gantt.IlvHierarchyNode arg0)
contains
in interface ilog.views.gantt.IlvGanttModel
contains
in class ilog.views.gantt.model.filter.IlvBasicFilterGanttModel
public ilog.views.gantt.IlvActivity getChildActivity(ilog.views.gantt.IlvActivity parent, int index)
index
.getChildActivity
in interface ilog.views.gantt.IlvGanttModel
getChildActivity
in class ilog.views.gantt.model.filter.IlvBasicFilterGanttModel
parent
- The parent activity.index
- The child index.index
.public int getChildActivityIndex(ilog.views.gantt.IlvActivity parent, ilog.views.gantt.IlvActivity child)
getChildActivityIndex
in interface ilog.views.gantt.IlvGanttModel
getChildActivityIndex
in class ilog.views.gantt.model.filter.IlvBasicFilterGanttModel
parent
- The parent activity.child
- The child activity to find the index of.-1
if the
activity is not a child of parent
.public java.util.Iterator<ilog.views.gantt.IlvReservation> reservationIterator(ilog.views.gantt.IlvActivity arg0)
reservationIterator
in interface ilog.views.gantt.IlvGanttModel
reservationIterator
in class ilog.views.gantt.model.filter.IlvBasicFilterGanttModel