|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.swing.tree.DefaultMutableTreeNode com.dlsc.flexgantt.model.treetable.DefaultMutableTreeTableNode<T> com.dlsc.flexgantt.model.gantt.DefaultGanttChartNode<T,S>
T
- the type of the wrapped user / business objectS
- the type of the timeline objectspublic class DefaultGanttChartNode<T,S extends ITimelineObject>
The default implementation of IGanttChartNode
that can be used in
combination with the DefaultGanttChartModel
. A Gantt chart node is
an extension of a tree table node and provides the information that is
required to populate the right-hand side of the Gantt chart with data. Gantt
chart nodes can wrap the actual model objects of the application's domain
model. The type of these user / business objects can be made known to the
node via the use of Generics. Doing so allows for a type-specific method to
retrieve the user object (see DefaultMutableTreeTableNode.getTypedUserObject()
.
Field Summary |
---|
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode |
---|
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject |
Constructor Summary | |
---|---|
DefaultGanttChartNode()
Constructs a new Gantt chart node. |
|
DefaultGanttChartNode(boolean allowsChildren)
Constructs a new Gantt chart node. |
|
DefaultGanttChartNode(T userObject)
Constructs a new Gantt chart node. |
|
DefaultGanttChartNode(T userObject,
boolean allowsChildren)
Constructs a new Gantt chart node. |
Method Summary | |
---|---|
void |
addTimelineObject(ILayer layer,
S timelineObject)
Adds a timeline object to the node for the given layer. |
void |
addTimelineObjects(ILayer layer,
java.util.Collection<S> timelineObjects)
Adds a collection of timeline objects to the node. |
void |
addTimelineObjects(ILayer layer,
S[] timelineObjects)
Adds the timeline objects on the node for the given layer. |
void |
clearTimelineObjects(ILayer layer)
Removes all timeline objects (currently shown on the given layer) from the node. |
int |
getDropActions(S timelineObject,
long timePoint)
Returns the drop actions that can be performed on the node related to timeline objects. |
int |
getLineCount()
Returns how many lines will be shown within the row that is occuupied by the Gantt chart node. |
int |
getLineHeight(int lineIndex,
int rowHeight)
Returns the height of the line with the given index based on the given row height. |
int |
getLineLocation(int lineIndex,
int rowHeight)
Returns the location of the line with the given index based on the given row height. |
java.util.List<S> |
getTimelineObjects()
Returns a list of all timeline objects on all layers. |
java.util.List<S> |
getTimelineObjects(ILayer layer)
Returns a list of all timeline objects that are associated with the given layer. |
java.util.Iterator<S> |
getTimelineObjectsIterator(ILayer layer,
ITimeSpan span)
Returns an iterator for all timeline objects on the given layer for the given time span. |
java.util.Iterator<S> |
getTimelineObjectsIterator(ITimeSpan span)
Returns an iterator for all timeline objects on all layers for the given time span. |
boolean |
isSelectable(ITimeSpan span)
Determines whether the given time span can be selected for the node. |
void |
removeTimelineObject(ILayer layer,
S timelineObject)
Removes the given timeline object from the node. |
void |
removeTimelineObjects(ILayer layer,
java.util.Collection<S> timelineObjects)
Removes a collection of objects from the node. |
void |
removeTimelineObjects(ILayer layer,
S[] timelineObjects)
Removes the given timeline objects from the node. |
void |
setLineCount(int count)
Specifies how many lines will be shown within the node's row. |
void |
setTimelineObject(ILayer layer,
S timelineObject)
Sets a single timeline object on the node for the given layer. |
void |
setTimelineObjects(ILayer layer,
java.util.Collection<S> timelineObjects)
Sets the timeline objects on the node for the given layer. |
void |
setTimelineObjects(ILayer layer,
S[] timelineObjects)
Sets the timeline objects on the node for the given layer. |
void |
sortTimelineObjects(ILayer layer)
Sorts the timeline objects that are located on the hierarchy / tree node. |
void |
validateTimelineObjectList(ILayer layer)
A debugging method to validate the list used for the given layer. |
Methods inherited from class com.dlsc.flexgantt.model.treetable.DefaultMutableTreeTableNode |
---|
add, compare, compare, getColumnValue, getComparator, getDragActions, getDropActions, getKey, getKeyComparator, getRowHeaderValue, getRowHeight, getRowHeightMaximum, getRowHeightMinimum, getToolTipText, getTypedUserObject, getUserObject, insert, isDeletable, isKeyEditable, isResizable, isRowLineVisible, isSelectable, isSorting, isValueEditable, setColumnValue, setComparator, setDeletable, setDragActions, setKey, setKeyComparator, setKeyEditable, setResizable, setRowHeaderValue, setRowHeight, setRowHeightMaximum, setRowHeightMinimum, setRowLineVisible, setSelectable, setToolTipText, setTypedUserObject, setUserObject, setValueEditable, sort |
Methods inherited from class javax.swing.tree.DefaultMutableTreeNode |
---|
breadthFirstEnumeration, children, clone, depthFirstEnumeration, getAllowsChildren, getChildAfter, getChildAt, getChildBefore, getChildCount, getDepth, getFirstChild, getFirstLeaf, getIndex, getLastChild, getLastLeaf, getLeafCount, getLevel, getNextLeaf, getNextNode, getNextSibling, getParent, getPath, getPathToRoot, getPreviousLeaf, getPreviousNode, getPreviousSibling, getRoot, getSharedAncestor, getSiblingCount, getUserObjectPath, isLeaf, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, remove, removeAllChildren, removeFromParent, setAllowsChildren, setParent, toString |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.dlsc.flexgantt.model.treetable.ITreeTableNode |
---|
getColumnValue, getDragActions, getDropActions, getKey, getRowHeaderValue, getRowHeight, getRowHeightMaximum, getRowHeightMinimum, getToolTipText, isDeletable, isKeyEditable, isResizable, isRowLineVisible, isSelectable, isValueEditable, setColumnValue, setKey, setRowHeaderValue, setRowHeight, sort |
Methods inherited from interface javax.swing.tree.TreeNode |
---|
children, getAllowsChildren, getChildAt, getChildCount, getIndex, getParent, isLeaf |
Methods inherited from interface javax.swing.tree.MutableTreeNode |
---|
remove, remove, removeFromParent, setParent |
Methods inherited from interface java.util.Comparator |
---|
equals |
Constructor Detail |
---|
public DefaultGanttChartNode(T userObject, boolean allowsChildren)
userObject
- the wrapped user / business / domain model objectallowsChildren
- if TRUE the node will be asked for its children and a node
expansion icon will be displayed in the tree tablepublic DefaultGanttChartNode(T userObject)
userObject
- the wrapped user / business / domain model objectpublic DefaultGanttChartNode(boolean allowsChildren)
allowsChildren
- if TRUE the node will be asked for its children and a node
expansion icon will be displayed in the tree tablepublic DefaultGanttChartNode()
Method Detail |
---|
public void addTimelineObject(ILayer layer, S timelineObject)
layer
- the layer to which the timeline object gets addedtimelineObject
- the timeline object that gets addedremoveTimelineObject(ILayer, ITimelineObject)
,
addTimelineObjects(ILayer, Collection)
public void setTimelineObjects(ILayer layer, java.util.Collection<S> timelineObjects)
layer
- the layer on which the timeline objects will be showntimelineObjects
- the collection of timeline objects being set on the nodeaddTimelineObject(ILayer, ITimelineObject)
,
addTimelineObjects(ILayer, ITimelineObject[])
public void setTimelineObjects(ILayer layer, S[] timelineObjects)
layer
- the layer on which the timeline objects will be showntimelineObjects
- the array of timeline objects being set on the nodeaddTimelineObject(ILayer, ITimelineObject)
,
addTimelineObjects(ILayer, Collection)
public void setTimelineObject(ILayer layer, S timelineObject)
layer
- the layer on which the timeline objects will be showntimelineObject
- the timeline object being set on the node for the given layeraddTimelineObjects(ILayer, Collection)
public void addTimelineObjects(ILayer layer, java.util.Collection<S> timelineObjects)
IGanttChartNode
addTimelineObjects
in interface IGanttChartNode<S extends ITimelineObject>
layer
- the layer to which the objects will be addedtimelineObjects
- the objects that will be addedIGanttChartNode.removeTimelineObjects(ILayer, Collection)
public void addTimelineObjects(ILayer layer, S[] timelineObjects)
layer
- the layer on which the timeline objects will be showntimelineObjects
- the collection of timeline objects being addedaddTimelineObject(ILayer, ITimelineObject)
,
addTimelineObjects(ILayer, Collection)
public void removeTimelineObject(ILayer layer, S timelineObject)
layer
- the layer on which the timeline object is currently showntimelineObject
- the object that gets removedremoveTimelineObjects(ILayer, Collection)
,
removeTimelineObjects(ILayer, ITimelineObject[])
public void removeTimelineObjects(ILayer layer, java.util.Collection<S> timelineObjects)
IGanttChartNode
removeTimelineObjects
in interface IGanttChartNode<S extends ITimelineObject>
layer
- the layer in which the timeline objects are currently showntimelineObjects
- the objects to removeIGanttChartNode.addTimelineObjects(ILayer, Collection)
public void removeTimelineObjects(ILayer layer, S[] timelineObjects)
layer
- the layer on which the timeline object is currently showntimelineObjects
- the objects that gets removedremoveTimelineObject(ILayer, ITimelineObject)
,
removeTimelineObjects(ILayer, Collection)
public java.util.List<S> getTimelineObjects()
IGanttChartNode
getTimelineObjects
in interface IGanttChartNode<S extends ITimelineObject>
IGanttChartNode.getTimelineObjects(ILayer)
public java.util.List<S> getTimelineObjects(ILayer layer)
IGanttChartNode
getTimelineObjects
in interface IGanttChartNode<S extends ITimelineObject>
layer
- the layer for which to return the timeline objects
IGanttChartNode.getTimelineObjectsIterator(ILayer, ITimeSpan)
,
IGanttChartNode.addTimelineObjects(ILayer, Collection)
,
IGanttChartNode.removeTimelineObjects(ILayer, Collection)
public java.util.Iterator<S> getTimelineObjectsIterator(ITimeSpan span)
span
- the time span for which to return the timeline objects
getTimelineObjects(ILayer)
,
getTimelineObjects()
public java.util.Iterator<S> getTimelineObjectsIterator(ILayer layer, ITimeSpan span)
IGanttChartNode
getTimelineObjectsIterator
in interface IGanttChartNode<S extends ITimelineObject>
layer
- the layer for which to return the timeline objectsspan
- the time span for which to return the timeline objects
IGanttChartNode.getTimelineObjects(ILayer)
,
IGanttChartNode.getTimelineObjects()
public void clearTimelineObjects(ILayer layer)
IGanttChartNode
clearTimelineObjects
in interface IGanttChartNode<S extends ITimelineObject>
layer
- the layer from which to remove all timeline objectspublic boolean isSelectable(ITimeSpan span)
IGanttChartNode
isSelectable
in interface IGanttChartNode<S extends ITimelineObject>
span
- the time span to check for selectability
public void setLineCount(int count)
count
- the numer of lines shown within the node's rowgetLineCount()
public int getLineCount()
IGanttChartNode
getLineCount
in interface IGanttChartNode<S extends ITimelineObject>
public int getLineLocation(int lineIndex, int rowHeight)
IGanttChartNode
IGanttChartNode.getLineCount()
) and multiply
it with the line index. This way all lines will be distributed equally
across the total height of the row.
getLineLocation
in interface IGanttChartNode<S extends ITimelineObject>
lineIndex
- the index of the line for which to return a location (if the
total line count is 4 then the indices will be 0, 1, 2, 3)rowHeight
- the total height of the Gantt chart row (this value can vary
depending on whether the user or the application resized the
row)
public int getLineHeight(int lineIndex, int rowHeight)
IGanttChartNode
IGanttChartNode.getLineCount()
) but
applications are free to let lines overlap if so desired.
getLineHeight
in interface IGanttChartNode<S extends ITimelineObject>
lineIndex
- the index of the line for which to return the height (if the
total line count is 4 then the indices will be 0, 1, 2, 3)rowHeight
- the total height of the Gantt chart row (this value can vary
depending on whether the user or the application resized the
row)
public void sortTimelineObjects(ILayer layer)
layer
- the layer on which to sort the timeline objectspublic void validateTimelineObjectList(ILayer layer)
layer
- the layer to validatepublic int getDropActions(S timelineObject, long timePoint)
IGanttChartNode
DnDConstants
. Possible values are:
DnDConstants.ACTION_COPY
DnDConstants.ACTION_MOVE
DnDConstants.ACTION_COPY_OR_MOVE
ITimelineObject.getDragActions()
.
getDropActions
in interface IGanttChartNode<S extends ITimelineObject>
timelineObject
- the timeline object that might get dropped onto this nodetimePoint
- the time point where the timeline object might get dropped
DefaultDragAndDropCommand
,
IDragAndDropPolicy.getDragActions(Object, Object, IGanttChartModel)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |