Class GanttVisualSetContainer
java.lang.Object
com.amalgamasimulation.charts.visualsets.containers.AbstractVisualSetContainer<IGanttChartVisualSet>
com.amalgamasimulation.charts.visualsets.containers.GanttVisualSetContainer
- All Implemented Interfaces:
IYAxisCategoryVisualSetContainer<GanttChartRow>
public class GanttVisualSetContainer
extends AbstractVisualSetContainer<IGanttChartVisualSet>
implements IYAxisCategoryVisualSetContainer<GanttChartRow>
Class that represents the container for VisualSets used in the
AbstractGanttChart.- Author:
- Aleksey Kirillov
-
Field Summary
Fields inherited from class com.amalgamasimulation.charts.visualsets.containers.AbstractVisualSetContainer
defaultUpdatePolicy, listeners, sortedVisualSets, visualSets, visualSetsComparator, visualSetWindowSizeDescriptorsMap -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddSeparator(GanttChartRow ganttChartRow, Color color, double width) Sets theGanttChartRowSeparatorthat should be placed under the given ganttChartRow.protected voidaddVisualSetInternal(IGanttChartVisualSet visualSet) Collapses the entire tree structure, leaving only top-level elements visible.booleancontainsAnyChild(GanttChartRow ganttChartRow) Checks if given ganttChartRow contains at least one child row with at least oneVisualSet.Expands the entire tree structure, making all elements at all nesting levels visible.getChildrens(GanttChartRow ganttChartRow) Returns the childrens list for givenGanttChartRow.Returns the comparator forGanttChartRow's.Returns the internalvisualSetscomparator i.e.getParent(GanttChartRow ganttChartRow) Returns the parentGanttChartRowfor the givenGanttChartRow.Returns the policy for calculating the height of theGanttChartRow.getSeparator(GanttChartRow ganttChartRow) Returns theGanttChartRowSeparatorthat should be placed under the given ganttChartRow.Returns list of existedGanttChartRowSeparator's.Returns a flat list of GanttChartRows.intgetTreeLevel(GanttChartRow ganttChartRow) Returns the nesting level of the givenGanttChartRow.getVisualSets(GanttChartRow ganttChartRow) Returns a list ofvisualSetsdrawn on the given ganttChartRow.protected voidbooleanisTree()Checks if this container is a tree container.booleanisTreeStateExpanded(GanttChartRow ganttChartRow) Checks if the givenGanttChartRowis currently expanded.Creates a new instance ofAbstractVisualSetContainercorresponding to the current container type.protected voidprotected voidprotected voidprotected voidremoveSeparator(GanttChartRow ganttChartRow) Removes theGanttChartRowSeparatorthat should be placed under the given ganttChartRow.setChildrenProvider(Function<GanttChartRow, List<GanttChartRow>> childrenProvider) Sets the childrens prodiver i.e.setGanttChartRowsComparator(Comparator<GanttChartRow> ganttChartRowsComparator) Sets the comparator forGanttChartRow's.setRowHeightPolicy(IRowHeightPolicy rowHeightPolicy) Sets the policy for calculating the height of theGanttChartRow.setRowHeightPolicy(RowHeightPolicy rowHeightPolicy, double rowHeightPolicyValue) Deprecated.use setRowHeightPolicy(IRowHeightPolicy rowHeightPolicy) insteadsetTreeState(GanttChartRow ganttChartRow, boolean expanded, boolean recursively) Sets the expand status of the given ganttChartRow.Methods inherited from class com.amalgamasimulation.charts.visualsets.containers.AbstractVisualSetContainer
addVisualSet, addVisualSet, addVisualSet, addVisualSetContainerChangeHandler, addVisualSets, clear, containsVisualSet, getDefaultUpdatePolicy, getVisualSets, getVisualSetsComparator, getVisualSetsInjectionIndex, getWindowSizeDescriptor, removeVisualSet, removeVisualSetContainerChangeHandler, reset, reset, setDefaultUpdatePolicy, setVisualSetsComparator
-
Constructor Details
-
GanttVisualSetContainer
public GanttVisualSetContainer()Default GanttVisualSetContainer constructor.
-
-
Method Details
-
onVisualSetsClear
protected void onVisualSetsClear()- Specified by:
onVisualSetsClearin classAbstractVisualSetContainer<IGanttChartVisualSet>
-
setRowHeightPolicy
Sets the policy for calculating the height of theGanttChartRow. It is possible to set theGanttChartRowheight depending on the number of lines or depending on the fixed line size.- Parameters:
rowHeightPolicy- policy for calculating the height of theGanttChartRow- Returns:
- reference to this object
-
setRowHeightPolicy
public GanttVisualSetContainer setRowHeightPolicy(RowHeightPolicy rowHeightPolicy, double rowHeightPolicyValue) Deprecated.use setRowHeightPolicy(IRowHeightPolicy rowHeightPolicy) insteadSets the policy for calculating the height of theGanttChartRow. It is possible to set theGanttChartRowheight depending on the number of lines or depending on the fixed line size.- Parameters:
rowHeightPolicy- policy for calculating the height of theGanttChartRowrowHeightPolicyValue- corresponding numeric value for the selected policy- Returns:
- reference to this object
-
getRowHeightPolicy
Returns the policy for calculating the height of theGanttChartRow.- Specified by:
getRowHeightPolicyin interfaceIYAxisCategoryVisualSetContainer<GanttChartRow>- Returns:
- the policy for calculating the height of the
GanttChartRow
-
setGanttChartRowsComparator
public GanttVisualSetContainer setGanttChartRowsComparator(Comparator<GanttChartRow> ganttChartRowsComparator) Sets the comparator forGanttChartRow's. The comparator determines the sorting order in which theganttChartRowsare located.- Parameters:
ganttChartRowsComparator- new comparator forGanttChartRow's- Returns:
- reference to this object
-
addSeparator
Sets theGanttChartRowSeparatorthat should be placed under the given ganttChartRow.- Parameters:
ganttChartRow-GanttChartRowfor which the separator is being setcolor- separator line colorwidth- separator line width, in pixels- Returns:
- reference to this object
-
getSeparator
Returns theGanttChartRowSeparatorthat should be placed under the given ganttChartRow. Returns null if no separator is set.- Parameters:
ganttChartRow-GanttChartRowfor which the separator is being checked- Returns:
- the
GanttChartRowSeparatorthat should be placed under the given ganttChartRow
-
getSeparators
Returns list of existedGanttChartRowSeparator's.- Returns:
- list of existed
GanttChartRowSeparator's
-
removeSeparator
Removes theGanttChartRowSeparatorthat should be placed under the given ganttChartRow.- Parameters:
ganttChartRow-GanttChartRowfor which the separator is being removed- Returns:
- reference to this object
-
getVisualSets
Returns a list ofvisualSetsdrawn on the given ganttChartRow.- Parameters:
ganttChartRow-GanttChartRowfor which the list ofvisualSetsare being checked- Returns:
- a list of
visualSetsdrawn on the given ganttChartRow
-
containsAnyChild
Checks if given ganttChartRow contains at least one child row with at least oneVisualSet.Used in tree structures.
- Specified by:
containsAnyChildin interfaceIYAxisCategoryVisualSetContainer<GanttChartRow>- Parameters:
ganttChartRow-GanttChartRowfor which the childs are being checked- Returns:
trueif given given ganttChartRow contains at least one child row with at least oneVisualSet,falseotherwise
-
getTreeFlatGanttChartRows
Returns a flat list of GanttChartRows. A flat list is a list with a direct order of elements, as the user would see it in a tree in expandAll-mode.Used in tree structures.
- Returns:
- a flat list of GanttChartRows
-
isTree
public boolean isTree()Description copied from interface:IYAxisCategoryVisualSetContainerChecks if this container is a tree container.- Specified by:
isTreein interfaceIYAxisCategoryVisualSetContainer<GanttChartRow>- Returns:
trueif this container is a tree container,falseotherwise
-
setChildrenProvider
public GanttVisualSetContainer setChildrenProvider(Function<GanttChartRow, List<GanttChartRow>> childrenProvider) Sets the childrens prodiver i.e. the function that specifies the parent-child relationship betweenGanttChartRow's for the tree structure.Used in tree structures.
- Parameters:
childrenProvider- the function that specifies the parent-child relationship betweenGanttChartRow's for the tree structure- Returns:
- reference to this object
-
getGanttChartRowsComparator
Returns the comparator forGanttChartRow's. The comparator determines the sorting order in which theganttChartRowsare located.- Returns:
- the comparator for
GanttChartRow's
-
getChildrens
Returns the childrens list for givenGanttChartRow.Used in tree structures.
- Specified by:
getChildrensin interfaceIYAxisCategoryVisualSetContainer<GanttChartRow>- Parameters:
ganttChartRow-GanttChartRowfor which the childrens list is being checked- Returns:
- the childrens list for given
GanttChartRow
-
isTreeStateExpanded
Checks if the givenGanttChartRowis currently expanded.Used in tree structures.
- Specified by:
isTreeStateExpandedin interfaceIYAxisCategoryVisualSetContainer<GanttChartRow>- Parameters:
ganttChartRow-GanttChartRowfor which the expand status is being checked- Returns:
truethe givenGanttChartRowis currently expanded,falseotherwise
-
expandAll
Expands the entire tree structure, making all elements at all nesting levels visible.Used in tree structures.
- Returns:
- reference to this object
-
collapseAll
Collapses the entire tree structure, leaving only top-level elements visible.Used in tree structures.
- Returns:
- reference to this object
-
setTreeState
public GanttVisualSetContainer setTreeState(GanttChartRow ganttChartRow, boolean expanded, boolean recursively) Sets the expand status of the given ganttChartRow. Provides the opportunity to expand a list of elements recursively, i.e. also expand all parent elements, up to the top-level elements.Used in tree structures.
- Specified by:
setTreeStatein interfaceIYAxisCategoryVisualSetContainer<GanttChartRow>- Parameters:
ganttChartRow-GanttChartRowfor which the expand status is being setexpanded- new expand statusrecursively- determines whether the new status should be applied to all parent elements up to top-level elements- Returns:
- reference to this object
-
getTreeLevel
Returns the nesting level of the givenGanttChartRow.Used in tree structures to define parent-child dependencies between
GanttChartRow's.- Specified by:
getTreeLevelin interfaceIYAxisCategoryVisualSetContainer<GanttChartRow>- Parameters:
ganttChartRow-GanttChartRowfor which the nesting level is being checked- Returns:
- the nesting level of the given
GanttChartRow
-
getParent
Returns the parentGanttChartRowfor the givenGanttChartRow.Used in tree structures to define parent-child dependencies between
GanttChartRow's.- Specified by:
getParentin interfaceIYAxisCategoryVisualSetContainer<GanttChartRow>- Parameters:
ganttChartRow-GanttChartRowfor which the parent row is being checked- Returns:
- the parent
GanttChartRowfor the givenGanttChartRow
-
addVisualSetInternal
- Specified by:
addVisualSetInternalin classAbstractVisualSetContainer<IGanttChartVisualSet>
-
onBeforeRemoveVisualSetInternal
- Specified by:
onBeforeRemoveVisualSetInternalin classAbstractVisualSetContainer<IGanttChartVisualSet>
-
onAfterRemoveVisualSetInternal
- Specified by:
onAfterRemoveVisualSetInternalin classAbstractVisualSetContainer<IGanttChartVisualSet>
-
invalidateDependencies
protected void invalidateDependencies()- Specified by:
invalidateDependenciesin classAbstractVisualSetContainer<IGanttChartVisualSet>
-
onVisualSetsChange
protected void onVisualSetsChange()- Specified by:
onVisualSetsChangein classAbstractVisualSetContainer<IGanttChartVisualSet>
-
getInternalVisualSetsComparator
Description copied from class:AbstractVisualSetContainerReturns the internalvisualSetscomparator i.e. the function that determines the sorting order ofvisualSets. The internal comparator is applied as last comparator, after all other sorting operations.- Specified by:
getInternalVisualSetsComparatorin classAbstractVisualSetContainer<IGanttChartVisualSet>- Returns:
- the internal
visualSetscomparator
-
newInstance
Description copied from class:AbstractVisualSetContainerCreates a new instance ofAbstractVisualSetContainercorresponding to the current container type.- Specified by:
newInstancein classAbstractVisualSetContainer<IGanttChartVisualSet>- Returns:
- a new instance of
AbstractVisualSetContainercorresponding to the current container type
-