Class GanttRow<R,B>
java.lang.Object
overit.geocallapp.utilities.ux.ui.container.gantt.data.GanttRow<R,B>
- All Implemented Interfaces:
Serializable,Iterable<GanttBlock<B>>
- Direct Known Subclasses:
DataCollectionTemplateGanttRow,GanttRowClustered,MultistageGroupGanttRow,ProjectGanttRow
Define a Gantt row in a tree like structure.
So, a GanttRow can have other GantRows as children
and have a GanttRow as parent, with exception for
the root GanttRow.
A GanttRow collects also
GanttBlocks that
are the elements associated with this GanttRow- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Collection<GanttBlock<B>> protected Map<String, GanttBlock<B>> protected Stringprotected Stringprotected Rstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddBlock(GanttBlock<B> block) voidaddChildRow(GanttRow<R, B> child) voidaddIndicator(GanttBlockIndicator indicator) intDate[]expandToIncludeBlocks(Date[] range) Search in all the sub tree that starts with this row the required rowintgetId()intgetLevel()getPath()booleanhasChildWithId(String id) booleanisFake()Used mainly for the root node, where the data doesn't have a natural rootbooleanisLeaf()iterator()voidremoveIndicator(GanttBlockIndicator indicator) voidsetBaseTooltipItems(Map<String, String> baseTooltipItems) voidsetDescription(String description) voidvoidvoidsetRawData(R rawData) voidvisit(GanttRowVisitConsumer<R, B> consumer) Implementation of a breadth first traversal over the tree.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
ROW_PATH_SEPARATOR
- See Also:
-
_id
-
_description
-
_baseTooltipItems
-
_parent
-
_rawData
-
_childrenRowIndex
-
_children
-
_blocksIndex
-
_blocks
-
-
Constructor Details
-
GanttRow
public GanttRow()
-
-
Method Details
-
isFake
public boolean isFake()Used mainly for the root node, where the data doesn't have a natural root- Returns:
- true if the row is fake (have no domain data associated); false otherwise
-
getId
- Returns:
- the id of this row
-
setId
- Parameters:
id- the id to set to this row
-
getDescription
- Returns:
- the description to use as display info for this row
-
setDescription
- Parameters:
description- to use as display info for this row
-
getBaseTooltipItems
- Returns:
- a key, value map to use to build a tool-tip for this row. The keys will be used as labels (and translated if a '=' character is used as prefix)
-
setBaseTooltipItems
- Parameters:
baseTooltipItems- a key, value map to use to build a tool-tip for this row. The keys will be used as labels (and translated if a '=' character is used as prefix)
-
setParent
- Parameters:
parent- theGanttRowthat is parent of this row
-
getParent
- Returns:
- the
GanttRowparent for this row. If null, this row is the root
-
addChildRow
- Parameters:
child- add the givenGanttRowas child of this row
-
getChildren
- Returns:
- an Unmodifiable list with the
GanttRows children of this row
-
setRawData
- Parameters:
rawData- the domain data that holds this row
-
getRawData
- Returns:
- the raw domain data that holds this row
-
addBlock
- Parameters:
block- theGanttBlockto add to this row
-
getBlocks
- Returns:
- an unmodifiable Collection with the
GanttBlockof this row. The collection will respect the natural order of the blocks that is priority descending and begin date ascending
-
getLevel
public int getLevel()- Returns:
- the level of this row in the tree like structure of the Gantt rows
-
expandToIncludeBlocks
- Parameters:
range- a starting date range- Returns:
- a range dates expanded to include all the blocks of the row
-
getPath
- Returns:
- a path composed by the id of the rows to traverse to reach this node starting from the root *
-
getByPath
- Parameters:
path- a path of row's id- Returns:
- the node reached following the path starting from this
-
hasChildWithId
- Parameters:
id- the row's id to check- Returns:
- true if this row have a child with the given id; false otherwise
-
getChild
-
findRow
Search in all the sub tree that starts with this row the required row- Parameters:
id- the id of the row to search- Returns:
- the required
GanttRowif belong to the sub tree; null otherwise
-
getBlock
- Parameters:
id- theGanttBlock's to retrieve- Returns:
- the required
GanttBlock - Throws:
overit.geocall.asserts.AssertsException- if the given id belong to aGanttBlockthat is not in this row
-
getBranchSize
public int getBranchSize()- Returns:
- the number of rows in the sub tree that starts with this node
-
countBlocks
public int countBlocks()- Returns:
- the number of blocks in this row
-
isLeaf
public boolean isLeaf()- Returns:
- true, if this row have no child rows; false otherwise
-
getIndicators
- Returns:
- the indicators configured for this row
-
addIndicator
- Parameters:
indicator- the indicator to add
-
removeIndicator
- Parameters:
indicator- the indicator to remove
-
visit
Implementation of a breadth first traversal over the tree. For each node, is passed as parameter to the consumer to do something during the visit.- Parameters:
consumer-GanttRowVisitConsumerto implement to do something during the tree visit
-
iterator
-