com.dlsc.flexgantt.model.gantt
Interface IResourceNode<T>

Type Parameters:
T - the type of the timeline objects returned by the node
All Superinterfaces:
IGanttChartNode<T>, ITreeTableNode, javax.swing.tree.TreeNode
All Known Implementing Classes:
DefaultResourceNode

public interface IResourceNode<T>
extends IGanttChartNode<T>

A resource node implements additonal methods required by Gantt chart nodes that represent a resource. Typical for a resource is the notion of capacity. The IResourceNode assumes that a resource has a minimum and a maximum capacity. The values for these capacities can be used to visulize capacity restrictions on the resource. Additonally a set of capacity lines can be associated with each resource node, which allows (resource) row renderers to visualize a nice grid in the background of each row that shows a resource.

Since:
1.0
Author:
Dirk Lemmermann

Method Summary
 double getCapacityAt(int rowHeight, int y)
          Returns the capacity value for the given y coordinate.
 java.util.List<CapacityLine> getCapacityLines(int rowHeight, boolean major)
          Returns a list of capacity lines that can be picked up by row renderers to draw a nice scale in the background of the resource row.
 int getCapacityLocation(int rowHeight, double capacity)
          Returns the location / y-coordinate of a given capacity for a given row height.
 double getMaximumCapacity()
          Returns the maximum capacity of the resource.
 double getMinimumCapacity()
          Returns the minimum capacity of the resource.
 
Methods inherited from interface com.dlsc.flexgantt.model.gantt.IGanttChartNode
addTimelineObjects, clearTimelineObjects, getDropActions, getLineCount, getLineHeight, getLineLocation, getTimelineObjects, getTimelineObjects, getTimelineObjectsIterator, isSelectable, removeTimelineObjects
 
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
 

Method Detail

getMinimumCapacity

double getMinimumCapacity()
Returns the minimum capacity of the resource.

Returns:
the resource's minimum capacity
Since:
1.0

getMaximumCapacity

double getMaximumCapacity()
Returns the maximum capacity of the resource.

Returns:
the resource's maximum capacity
Since:
1.0

getCapacityLines

java.util.List<CapacityLine> getCapacityLines(int rowHeight,
                                              boolean major)
Returns a list of capacity lines that can be picked up by row renderers to draw a nice scale in the background of the resource row.

Parameters:
rowHeight - the height of the row in which the resource gets displayed
major - a flag signalling whether the application queries the major or the minor capacity lines
Returns:
a list of capacity lines that can be visualized in the Gantt chart
Since:
1.0

getCapacityLocation

int getCapacityLocation(int rowHeight,
                        double capacity)
Returns the location / y-coordinate of a given capacity for a given row height. This method is required for the correct placing of capacity lines.

Parameters:
rowHeight - the current height of the row in which the resource node gets displayed
capacity - the capacity for which to return a location
Returns:
the location of the given capacity (the y-coordinate within the coordinate space / interval [0, rowHeight])
Since:
1.0

getCapacityAt

double getCapacityAt(int rowHeight,
                     int y)
Returns the capacity value for the given y coordinate. The y coordinate uses the coordinate space of the row, which means that y = 0 is the bottom of the row.

Parameters:
rowHeight - the height of the row
y - the location for which to return a capacity
Returns:
the capacity at the given location
Since:
1.0