Class LineVisualSetContainer
java.lang.Object
com.amalgamasimulation.visualsets.containers.AbstractVisualSetContainer<ILineChartVisualSet>
com.amalgamasimulation.visualsets.containers.LineVisualSetContainer
Class that represents the container for VisualSets used in the AbstractLineChart.
- Author:
- Aleksey Kirillov
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Map<LineVisualSet<?>, List<LineVisualSet<?>>> protected Map<LineVisualSet<?>, LineVisualSet<?>> protected Map<LineVisualSet<?>, LineVisualSet<?>> Fields inherited from class com.amalgamasimulation.visualsets.containers.AbstractVisualSetContainer
defaultUpdatePolicy, listeners, sortedVisualSets, visualSets, visualSetsComparator, visualSetWindowSizeDescriptorsMap -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddStackDependency(LineVisualSet<?> topVisualSet, LineVisualSet<?> bottomVisualSet) Adds a single dependency-pair to the list of dependent LineVisualSets.protected voidaddVisualSetInternal(ILineChartVisualSet visualSet) protected voidRemoves the stacks ofPiecewiseLineVisualSets, so that the functions of the visual sets removed from the container are not held by the stacks of the remaining visual sets until the next update of the stacksReturns the internalvisualSetscomparator i.e.List<LineVisualSet<?>> getStackDependencyList(LineVisualSet<?> lineVisualSet) Returns a list of all dependentLineVisualSet's whose data is located under the specifiedLineVisualSet.Map<LineVisualSet<?>, LineVisualSet<?>> Returns a map of all dependent LineVisualSets whose data is located under the specified LineVisualSet-keys.protected voidCreates a new instance ofAbstractVisualSetContainercorresponding to the current container type.protected voidprotected voidprotected voidprotected void<V extends LineVisualSet<?>>
voidsetStackDependencyList(List<V> stackDependencyList) Specifies the order of LineVisualSets to display as a stack cumulative plot.voidupdatePiecewiseLineStacks(Predicate<LineVisualSet<?>> stackedVisualSetFilter) Updates the stacks consisting ofPiecewiseLineVisualSets only, so that their edges are the discretized sums of the functions (seePiecewiseLineVisualSetStack).Methods inherited from class com.amalgamasimulation.visualsets.containers.AbstractVisualSetContainer
addVisualSet, addVisualSet, addVisualSet, addVisualSetContainerChangeHandler, addVisualSets, clear, containsVisualSet, getDefaultUpdatePolicy, getVisualSets, getVisualSetsComparator, getVisualSetsInjectionIndex, getWindowSizeDescriptor, removeVisualSet, removeVisualSetContainerChangeHandler, reset, reset, setDefaultUpdatePolicy, setVisualSetsComparator
-
Field Details
-
stackDependencyMap
-
stackDependencyReversedMap
-
stackDependencyListsMap
-
-
Constructor Details
-
LineVisualSetContainer
public LineVisualSetContainer()
-
-
Method Details
-
setStackDependencyList
Specifies the order of LineVisualSets to display as a stack cumulative plot. The list must follow the required bottom-to-top display order and cannot contain duplicates.- Parameters:
stackDependencyList- list that represents the order of LineVisualSets to display as a stack cumulative plot
-
addStackDependency
Adds a single dependency-pair to the list of dependent LineVisualSets. Dependent visual sets are displayed as a stack cumulative plot. The resulted list cannot contain duplicates or cyclic dependencies. A valid result is a flat list, the order in which corresponds to the required bottom-to-top display order.- Parameters:
topVisualSet- visualSet located above the bottomVisualSetbottomVisualSet- visualSet located below the topVisualSet
-
getStackDependencyList
Returns a list of all dependentLineVisualSet's whose data is located under the specifiedLineVisualSet. Map values does contain the specified element itself.- Parameters:
lineVisualSet- lineVisualSet for which the list of all dependentLineVisualSet's is being checked- Returns:
- a list of all dependent
LineVisualSet's whose data is located under the specifiedLineVisualSet
-
getStackDependencyMap
Returns a map of all dependent LineVisualSets whose data is located under the specified LineVisualSet-keys. The list does contain the specified element itself.- Returns:
- a map of all dependent LineVisualSets whose data is located under the specified LineVisualSet-keys
-
updatePiecewiseLineStacks
Updates the stacks consisting ofPiecewiseLineVisualSets only, so that their edges are the discretized sums of the functions (seePiecewiseLineVisualSetStack). The visual sets of other stacks display their own data. Must be called before the visual sets data is recalculated, as the stacks capture the current functions of the visual sets.- Parameters:
stackedVisualSetFilter- the filter of the visual sets that are displayed and considered in the stacks
-
clearPiecewiseLineStacks
protected void clearPiecewiseLineStacks()Removes the stacks ofPiecewiseLineVisualSets, so that the functions of the visual sets removed from the container are not held by the stacks of the remaining visual sets until the next update of the stacks -
addVisualSetInternal
- Specified by:
addVisualSetInternalin classAbstractVisualSetContainer<ILineChartVisualSet>
-
onBeforeRemoveVisualSetInternal
- Specified by:
onBeforeRemoveVisualSetInternalin classAbstractVisualSetContainer<ILineChartVisualSet>
-
onAfterRemoveVisualSetInternal
- Specified by:
onAfterRemoveVisualSetInternalin classAbstractVisualSetContainer<ILineChartVisualSet>
-
invalidateDependencies
protected void invalidateDependencies()- Specified by:
invalidateDependenciesin classAbstractVisualSetContainer<ILineChartVisualSet>
-
onVisualSetsChange
protected void onVisualSetsChange()- Specified by:
onVisualSetsChangein classAbstractVisualSetContainer<ILineChartVisualSet>
-
onVisualSetsClear
protected void onVisualSetsClear()- Specified by:
onVisualSetsClearin classAbstractVisualSetContainer<ILineChartVisualSet>
-
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<ILineChartVisualSet>- Returns:
- the internal
visualSetscomparator
-
newInstance
Description copied from class:AbstractVisualSetContainerCreates a new instance ofAbstractVisualSetContainercorresponding to the current container type.- Specified by:
newInstancein classAbstractVisualSetContainer<ILineChartVisualSet>- Returns:
- a new instance of
AbstractVisualSetContainercorresponding to the current container type
-