T
- the type of the wrapped user / business objectS
- the type of the timeline objectspublic class DefaultGanttChartNode<T,S extends ITimelineObject> extends DefaultMutableTreeTableNode<T> implements IGanttChartNode<S>
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()
.allowsChildren, children, EMPTY_ENUMERATION, parent, userObject
Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
void |
addTimelineObject(ILayer layer,
S timelineObject)
Adds a timeline object to the node for the given layer.
|
void |
addTimelineObjects(ILayer layer,
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 |
clearSpreadsheetValues(ISpreadsheet spreadsheet)
Removes all spreadsheet values from the node for the given spreadsheet.
|
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.
|
Object |
getSpreadsheetValue(ISpreadsheet spreadsheet,
ITimeSpan span)
Returns a value for the given time span.
|
List<S> |
getTimelineObjects()
Returns a list of all timeline objects on all layers.
|
List<S> |
getTimelineObjects(ILayer layer)
Returns a list of all timeline objects that are associated with the given
layer.
|
Iterator<S> |
getTimelineObjectsIterator(ILayer layer,
ITimeSpan span)
Returns an iterator for all timeline objects on the given layer for the
given time span.
|
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.
|
boolean |
isTimelineObjectCreatableAt(ITimeSpan span,
ILayer layer)
Determines whether a new timeline object can be created for the given
time span.
|
void |
removeTimelineObject(ILayer layer,
S timelineObject)
Removes the given timeline object from the node.
|
void |
removeTimelineObjects(ILayer layer,
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 |
setRowHeight(int rowHeight)
Specifies a new row height for the tree table node.
|
void |
setSpreadsheetValue(ISpreadsheet spreadsheet,
Object value,
ITimeSpan span)
Specifies a new value for the given time span.
|
void |
setTimelineObject(ILayer layer,
S timelineObject)
Sets a single timeline object on the node for the given layer.
|
void |
setTimelineObjects(ILayer layer,
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.
|
add, compare, compare, getColumnValue, getComparator, getDragActions, getDropActions, getKey, getKeyComparator, getPopupObject, getPopupTitleObject, getRowHeaderValue, getRowHeight, getRowHeightMaximum, getRowHeightMinimum, getToolTipText, getTypedUserObject, getUserObject, insert, isDeletable, isKeyEditable, isReassignable, isResizable, isRowLineVisible, isSelectable, isSorting, isValueEditable, setColumnValue, setComparator, setDefaultRowHeight, setDeletable, setDragActions, setKey, setKeyComparator, setKeyEditable, setPopupObject, setPopupTitleObject, setResizable, setRowHeaderValue, setRowHeightMaximum, setRowHeightMinimum, setRowLineVisible, setSelectable, setToolTipText, setTypedUserObject, setUserObject, setValueEditable, sort
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
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getColumnValue, getDragActions, getDropActions, getKey, getPopupObject, getPopupTitleObject, getRowHeaderValue, getRowHeight, getRowHeightMaximum, getRowHeightMinimum, getToolTipText, isDeletable, isKeyEditable, isReassignable, isResizable, isRowLineVisible, isSelectable, isValueEditable, setColumnValue, setKey, setRowHeaderValue, sort
children, getAllowsChildren, getChildAt, getChildCount, getIndex, getParent, isLeaf
remove, remove, removeFromParent, setParent
comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
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()
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, 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, 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, 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 List<S> getTimelineObjects()
IGanttChartNode
getTimelineObjects
in interface IGanttChartNode<S extends ITimelineObject>
IGanttChartNode.getTimelineObjects(ILayer)
public List<S> getTimelineObjects(ILayer layer)
IGanttChartNode
getTimelineObjects
in interface IGanttChartNode<S extends ITimelineObject>
layer
- the layer for which to return the timeline objectsIGanttChartNode.getTimelineObjectsIterator(ILayer, ITimeSpan)
,
IGanttChartNode.addTimelineObjects(ILayer, Collection)
,
IGanttChartNode.removeTimelineObjects(ILayer, Collection)
public Iterator<S> getTimelineObjectsIterator(ITimeSpan span)
span
- the time span for which to return the timeline objectsgetTimelineObjects(ILayer)
,
getTimelineObjects()
public 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 objectsIGanttChartNode.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 selectabilitypublic 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 void setRowHeight(int rowHeight)
ITreeTableNode
setRowHeight
in interface ITreeTableNode
setRowHeight
in class DefaultMutableTreeTableNode<T>
rowHeight
- the new row heightIRowPolicy.isRowResizable(Object, ITreeTableModel)
,
IRowPolicy.getRowResizeCommand(Object, ITreeTableModel, int)
,
DefaultRowPolicy
,
DefaultRowResizeCommand
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:
Declaring the drop actions is only half of the work needed for correct
drag and drop behaviour. A timeline object might be droppable onto
the node but it also needs to be draggable.This behaviour is
defined by calling 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 droppedDefaultDragAndDropCommand
,
IDragAndDropPolicy.getDragActions(TimelineObjectPath,
IGanttChartModel)
public boolean isTimelineObjectCreatableAt(ITimeSpan span, ILayer layer)
IGanttChartNode
isTimelineObjectCreatableAt
in interface IGanttChartNode<S extends ITimelineObject>
span
- the time span where the new timeline object will be createdlayer
- the layer to which the timeline object will be addedIEditTimelineObjectPolicy.isCreatable(Object, IGanttChartModel,
ILayer, ITimeSpan)
,
DefaultCreateTimelineObjectCommand
public void clearSpreadsheetValues(ISpreadsheet spreadsheet)
spreadsheet
- the spreadsheet for which to clear the datapublic Object getSpreadsheetValue(ISpreadsheet spreadsheet, ITimeSpan span)
IGanttChartNode
getSpreadsheetValue
in interface IGanttChartNode<S extends ITimelineObject>
spreadsheet
- the spreadsheet from where to lookup the valuespan
- the time span for which to return a valueIGanttChartNode.setSpreadsheetValue(ISpreadsheet, Object, ITimeSpan)
public void setSpreadsheetValue(ISpreadsheet spreadsheet, Object value, ITimeSpan span)
IGanttChartNode
setSpreadsheetValue
in interface IGanttChartNode<S extends ITimelineObject>
spreadsheet
- the spreadsheet where the value gets changedvalue
- the new spreadsheet cell valuespan
- the time span for which the new value is validIGanttChartNode.getSpreadsheetValue(ISpreadsheet, ITimeSpan)
Copyright © 2006–2020 Dirk Lemmermann Software & Consulting. All rights reserved.