|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.swing.tree.DefaultTreeModel com.dlsc.flexgantt.model.treetable.DefaultTreeTableModel<T> com.dlsc.flexgantt.model.gantt.DefaultGanttChartModel<T,S>
T
- the type of the hierarchy (Gantt chart) nodesS
- the type of the timeline objectspublic class DefaultGanttChartModel<T extends IGanttChartNode<S>,S extends ITimelineObject>
The default implementation of a Gantt chart model. For detailed information
on its usage please read the comments on IGanttChartModel
.
Field Summary |
---|
Fields inherited from class javax.swing.tree.DefaultTreeModel |
---|
asksAllowsChildren, listenerList, root |
Constructor Summary | |
---|---|
DefaultGanttChartModel(T node)
Constructs a new Gantt chart model. |
|
DefaultGanttChartModel(T node,
boolean asksAllowsChildren)
Constructs a new Gantt chart model. |
Method Summary | |
---|---|
void |
addGanttChartModelListener(IGanttChartModelListener l)
Adds a listener to the model. |
void |
addLayer(ILayer layer)
Adds a layer to the model. |
void |
addRelationship(IRelationship<S> relationship)
Adds a single relationship to the model. |
void |
addRelationships(java.util.Collection<IRelationship<S>> relationships)
Adds a collection of relationships to the model. |
void |
addTimelineObject(T node,
ILayer layer,
S timelineObject)
Adds a single timeline object to the timeline of the given tree node. |
void |
addTimelineObjects(T node,
ILayer layer,
java.util.Collection<S> timelineObjects)
Adds a collection of objects to the timeline of the given tree node. |
void |
clearRelationships()
Removes all relationships from the model. |
void |
clearTimelineObjects()
Removes all timeline objects from all nodes and all layers. |
void |
clearTimelineObjects(ILayer layer)
Removes all timeline objects from the given layer for all nodes. |
void |
clearTimelineObjects(T node)
Removes all timeline objects from the given tree node from all layers. |
void |
clearTimelineObjects(T node,
ILayer layer)
Removes all timeline objects from the given tree node and layer. |
void |
fireGanttChartChanged(GanttChartModelEvent evt)
Fires the given event to the model listeners. |
java.util.Iterator<S> |
getChildrenTimelineObjects(S parent)
Returns an iterator over the children of the given parent timeline object. |
java.util.Iterator<ILayer> |
getLayers()
Returns an iterator over the layers used by the model. |
java.util.Iterator<IRelationship<S>> |
getRelationships()
Returns all relationships so that they can be visualized by the RelationshipLayer . |
java.util.Iterator<IRelationship<S>> |
getRelationships(S obj)
Returns those relationships that have the given timeline object either as a source or as a target object. |
TimelineObjectPath |
getTimelineObjectPath(T node,
S timelineObject,
ILayer layer)
Returns a timeline object path for the given node and object. |
java.util.Iterator<S> |
getTimelineObjectsIterator(T node,
ILayer layer,
ITimeSpan span)
Returns an Iterator that can be used to iterate over all timeline
objects stored on the given node and layer within the given time span. |
ITimeSpan |
getTimeSpan(S timelineObject)
Returns the time span of the given timeline object. |
boolean |
isParentTimelineObject(S timelineObject)
Determines whether the given timeline object is a parent timeline object. |
void |
removeGanttChartModelListener(IGanttChartModelListener l)
Removes a listener from the model. |
void |
removeLayer(ILayer layer)
Removes a layer from the model. |
void |
removeRelationship(IRelationship relationship)
Removes a single relationship from the model. |
void |
removeRelationships(java.util.Collection<IRelationship> rel)
Removes a collection of relationships from the model. |
void |
removeTimelineObject(T node,
ILayer layer,
S timelineObject)
Removes a single timeline object from the given node and layer. |
void |
removeTimelineObjects(T node,
ILayer layer,
java.util.Collection<S> timelineObjects)
Removes a collection of objects from the given tree node and layer. |
void |
setRelationships(java.util.Collection<IRelationship<S>> relationships)
Sets all relationships at once. |
void |
setTimeSpan(S timelineObject,
ITimeSpan span)
Sets a new time span on the given timeline object. |
void |
timelineObjectChanged(S timelineObject)
Triggers a GanttChartModelEvent that informs listeners that the
given timeline object has been changed. |
Methods inherited from class com.dlsc.flexgantt.model.treetable.DefaultTreeTableModel |
---|
addTreeTableModelListener, fireTreeNodeKeyChanged, fireTreeNodeValuesChanged, getColumnValue, getKey, getRoot, getRowHeaderValue, removeTreeTableModelListener, setColumnValue, setKey, setRoot, setRoot, setRowHeaderValue, sort, sort, sort, sort |
Methods inherited from class javax.swing.tree.DefaultTreeModel |
---|
addTreeModelListener, asksAllowsChildren, fireTreeNodesChanged, fireTreeNodesInserted, fireTreeNodesRemoved, fireTreeStructureChanged, getChild, getChildCount, getIndexOfChild, getListeners, getPathToRoot, getPathToRoot, getTreeModelListeners, insertNodeInto, isLeaf, nodeChanged, nodesChanged, nodeStructureChanged, nodesWereInserted, nodesWereRemoved, reload, reload, removeNodeFromParent, removeTreeModelListener, setAsksAllowsChildren, valueForPathChanged |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.dlsc.flexgantt.model.treetable.ITreeTableModel |
---|
addTreeTableModelListener, getColumnValue, getKey, getRowHeaderValue, removeTreeTableModelListener, setColumnValue, setKey, sort |
Methods inherited from interface javax.swing.tree.TreeModel |
---|
addTreeModelListener, getChild, getChildCount, getIndexOfChild, getRoot, isLeaf, removeTreeModelListener, valueForPathChanged |
Constructor Detail |
---|
public DefaultGanttChartModel(T node, boolean asksAllowsChildren)
node
- the root nodeasksAllowsChildren
- if true, the node is allowed to have child nodes -- otherwise,
it is always a leaf nodepublic DefaultGanttChartModel(T node)
node
- the root nodeMethod Detail |
---|
public void addLayer(ILayer layer)
layer
- the layer to addpublic void removeLayer(ILayer layer)
layer
- the layer to removepublic java.util.Iterator<ILayer> getLayers()
IGanttChartModel
TimelineObjectLayer
for each layer
model definition.
getLayers
in interface IGanttChartModel<T extends IGanttChartNode<S>,S extends ITimelineObject>
IGanttChartModel.getTimelineObjectsIterator(Object, ILayer, ITimeSpan)
public void addGanttChartModelListener(IGanttChartModelListener l)
IGanttChartModel
addGanttChartModelListener
in interface IGanttChartModel<T extends IGanttChartNode<S>,S extends ITimelineObject>
l
- the new listenerIGanttChartModel.removeGanttChartModelListener(IGanttChartModelListener)
,
GanttChartModelEvent
public void removeGanttChartModelListener(IGanttChartModelListener l)
IGanttChartModel
removeGanttChartModelListener
in interface IGanttChartModel<T extends IGanttChartNode<S>,S extends ITimelineObject>
l
- the listener to removeIGanttChartModel.addGanttChartModelListener(IGanttChartModelListener)
public void fireGanttChartChanged(GanttChartModelEvent evt)
evt
- the model event to be issued to the listenersaddGanttChartModelListener(IGanttChartModelListener)
,
removeGanttChartModelListener(IGanttChartModelListener)
public void addTimelineObject(T node, ILayer layer, S timelineObject)
GanttChartModelEvent
to be fired where the ID of the event is
equal to GanttChartModelEvent.ID.TIMELINE_OBJECTS_ADDED
.
node
- the tree node on which to add objectslayer
- the layer where the objects shall appeartimelineObject
- the object to addremoveTimelineObjects(IGanttChartNode, ILayer, Collection)
,
clearTimelineObjects(IGanttChartNode, ILayer)
,
IGanttChartModel.getTimelineObjectsIterator(Object, ILayer, ITimeSpan)
public void addTimelineObjects(T node, ILayer layer, java.util.Collection<S> timelineObjects)
GanttChartModelEvent
to be fired where the ID of the event is
equal to GanttChartModelEvent.ID.TIMELINE_OBJECTS_ADDED
.
node
- the tree node on which to add objectslayer
- the layer where the objects shall appeartimelineObjects
- the objects to addremoveTimelineObjects(IGanttChartNode, ILayer, Collection)
,
clearTimelineObjects(IGanttChartNode, ILayer)
,
IGanttChartModel.getTimelineObjectsIterator(Object, ILayer, ITimeSpan)
public void clearTimelineObjects(T node, ILayer layer)
GanttChartModelEvent
to be fired with
the ID equal to GanttChartModelEvent.ID.TIMELINE_OBJECTS_REMOVED
.
node
- the node on which to remove all timeline objectslayer
- the layer on which to remove all timeline objectsremoveTimelineObjects(IGanttChartNode, ILayer, Collection)
,
clearTimelineObjects()
,
clearTimelineObjects(ILayer)
,
clearTimelineObjects(IGanttChartNode)
public void clearTimelineObjects(T node)
GanttChartModelEvent
to be fired
with the ID equal to
GanttChartModelEvent.ID.TIMELINE_OBJECTS_REMOVED
.
node
- the node on which to remove all timeline objectsremoveTimelineObjects(IGanttChartNode, ILayer, Collection)
,
clearTimelineObjects()
,
clearTimelineObjects(ILayer)
,
clearTimelineObjects(IGanttChartNode, ILayer)
public void clearTimelineObjects(ILayer layer)
GanttChartModelEvent
to be fired with
the ID equal to GanttChartModelEvent.ID.TIMELINE_OBJECTS_REMOVED
.
layer
- the layer on which to remove all timeline objectsremoveTimelineObjects(IGanttChartNode, ILayer, Collection)
,
clearTimelineObjects()
,
clearTimelineObjects(IGanttChartNode)
,
clearTimelineObjects(IGanttChartNode, ILayer)
public void clearTimelineObjects()
GanttChartModelEvent
to be fired with
the ID equal to GanttChartModelEvent.ID.TIMELINE_OBJECTS_REMOVED
.
removeTimelineObjects(IGanttChartNode, ILayer, Collection)
,
clearTimelineObjects(ILayer)
,
clearTimelineObjects(IGanttChartNode)
,
clearTimelineObjects(IGanttChartNode, ILayer)
public java.util.Iterator<S> getTimelineObjectsIterator(T node, ILayer layer, ITimeSpan span)
IGanttChartModel
Iterator
that can be used to iterate over all timeline
objects stored on the given node and layer within the given time span.
This method is not allowed to return NULL.
getTimelineObjectsIterator
in interface IGanttChartModel<T extends IGanttChartNode<S>,S extends ITimelineObject>
node
- the tree node for which to return an iteratorlayer
- the layer for which to return an iteratorspan
- the time span for which to return an iterator
public ITimeSpan getTimeSpan(S timelineObject)
IGanttChartModel
DefaultGanttChartModel
does store the span on the internally used IGanttChartNode
instances.
getTimeSpan
in interface IGanttChartModel<T extends IGanttChartNode<S>,S extends ITimelineObject>
timelineObject
- the object for which to return the time span
public void removeTimelineObject(T node, ILayer layer, S timelineObject)
GanttChartModelEvent
to be fired with ID
equal to GanttChartModelEvent.ID.TIMELINE_OBJECTS_REMOVED
.
node
- the tree node from which to remove objectslayer
- the layer from which to remove objectstimelineObject
- the object that will be removedremoveTimelineObjects(IGanttChartNode, ILayer, Collection)
public void removeTimelineObjects(T node, ILayer layer, java.util.Collection<S> timelineObjects)
GanttChartModelEvent
to be fired
with ID equal to GanttChartModelEvent.ID.TIMELINE_OBJECTS_REMOVED
.
node
- the tree node from which to remove objectslayer
- the layer from which to remove objectstimelineObjects
- the objects that will be removedaddTimelineObjects(IGanttChartNode, ILayer, Collection)
,
clearTimelineObjects(IGanttChartNode, ILayer)
public void setTimeSpan(S timelineObject, ITimeSpan span)
GanttChartModelEvent
to be fired where the ID is
equal to GanttChartModelEvent.ID.TIMELINE_OBJECT_CHANGED
.
timelineObject
- the target timeline objectspan
- the new time spanIGanttChartModel.getTimeSpan(Object)
public void addRelationship(IRelationship<S> relationship)
RelationshipLayer
to draw the lines and arrows between timeline
objects. Calling this method will cause a GanttChartModelEvent
to
be thrown (ID equals GanttChartModelEvent.ID.RELATIONSHIP_ADDED
).
relationship
- the relationship object to addaddRelationships(Collection)
public void addRelationships(java.util.Collection<IRelationship<S>> relationships)
RelationshipLayer
to draw the lines and arrows
between timeline objects. Calling this method will cause a
GanttChartModelEvent
to be thrown where the ID is equal to
GanttChartModelEvent.ID.RELATIONSHIP_ADDED
.
relationships
- the relationships that need to be addedremoveRelationships(Collection)
,
clearRelationships()
public void clearRelationships()
GanttChartModelEvent
to be thrown where the ID is equal to
GanttChartModelEvent.ID.RELATIONSHIP_REMOVED
.
getRelationships()
,
addRelationships(Collection)
,
removeRelationships(Collection)
public java.util.Iterator<IRelationship<S>> getRelationships()
IGanttChartModel
RelationshipLayer
.
getRelationships
in interface IGanttChartModel<T extends IGanttChartNode<S>,S extends ITimelineObject>
public void setRelationships(java.util.Collection<IRelationship<S>> relationships)
relationships
- the new relationsips to usepublic java.util.Iterator<IRelationship<S>> getRelationships(S obj)
IGanttChartModel
RelationshipLayer
wants to
figure out which lines need to be drawn.
getRelationships
in interface IGanttChartModel<T extends IGanttChartNode<S>,S extends ITimelineObject>
obj
- the object for which to return relationships
public void removeRelationship(IRelationship relationship)
relationship
- the relationship to removeremoveRelationships(Collection)
public void removeRelationships(java.util.Collection<IRelationship> rel)
GanttChartModelEvent
to be thrown where the ID is
equal to GanttChartModelEvent.ID.RELATIONSHIP_REMOVED
.
rel
- the relationships to removegetRelationships()
,
addRelationships(Collection)
,
clearRelationships()
public void timelineObjectChanged(S timelineObject)
GanttChartModelEvent
that informs listeners that the
given timeline object has been changed.
timelineObject
- the object that was modifiedpublic TimelineObjectPath getTimelineObjectPath(T node, S timelineObject, ILayer layer)
node
- the Gantt chart nodetimelineObject
- the timeline objectlayer
- the layer on which the timeline object is displayed
public java.util.Iterator<S> getChildrenTimelineObjects(S parent)
IGanttChartModel
getChildrenTimelineObjects
in interface IGanttChartModel<T extends IGanttChartNode<S>,S extends ITimelineObject>
parent
- the parent timeline object
public boolean isParentTimelineObject(S timelineObject)
IGanttChartModel
isParentTimelineObject
in interface IGanttChartModel<T extends IGanttChartNode<S>,S extends ITimelineObject>
timelineObject
- the timeline object to check
IGanttChartModel.getChildrenTimelineObjects(Object)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |