Class GanttPolylineVisualSet<T>
java.lang.Object
com.amalgamasimulation.charts.visualsets.VisualSet<T>
com.amalgamasimulation.charts.visualsets.AbstractLineVisualSet<T>
com.amalgamasimulation.charts.visualsets.AbstractPolylineVisualSet<T>
com.amalgamasimulation.charts.visualsets.GanttPolylineVisualSet<T>
- Type Parameters:
T- visual set data elements type
- All Implemented Interfaces:
IClipboardTextPropertyOwner<Double>,IGanttChartRowPropertyOwner,ILegendNodePropertiesOwner,IMinMaxValuePropertyOwner,IUpdatePolicyPropertyOwner,IAbstractChartVisualSet,IGanttChartVisualSet
public class GanttPolylineVisualSet<T>
extends AbstractPolylineVisualSet<T>
implements IGanttChartRowPropertyOwner, IGanttChartVisualSet
Visual set for drawing polylines.
Can be drawn on TimeGanttChart.
Polylines are drawn within a single GanttChartRow that does not have
its own numerical vertical axis.
A drawn polyline is usually used not for the purpose of represents exact values, but for the purpose of understanding the general profile of changing values.
The minimum Y-value within the data elements corresponds to the lower bound
of the GanttChartRow, and the maximum value corresponds to the upper
one. The remaining values are drawn relative to the minimum and maximum.
- Author:
- Aleksey Kirillov
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassInternal class that represents visual element for polyline data element.Nested classes/interfaces inherited from class com.amalgamasimulation.charts.visualsets.AbstractPolylineVisualSet
AbstractPolylineVisualSet.AbstractPolylineVisualElementNested classes/interfaces inherited from class com.amalgamasimulation.charts.visualsets.AbstractLineVisualSet
AbstractLineVisualSet.AbstractLineVisualElement, AbstractLineVisualSet.Extrapolation, AbstractLineVisualSet.PointsAndLinesStyleNested classes/interfaces inherited from class com.amalgamasimulation.charts.visualsets.VisualSet
VisualSet.ContextMenuHandler<T>, VisualSet.UpdatePolicy, VisualSet.VisualElement -
Field Summary
Fields inherited from class com.amalgamasimulation.charts.visualsets.AbstractPolylineVisualSet
clipboardTextExtractorFields inherited from class com.amalgamasimulation.charts.visualsets.AbstractLineVisualSet
extrapolation, legendTextProvider, lineColor, lineStyle, lineWidth, maxValueProvider, pointsAndLinesStyle, pointSize, valueExtractorFields inherited from class com.amalgamasimulation.charts.visualsets.VisualSet
argumentExtractor, contentsToBeginArguments, contentsToEndArguments, contentsToVisualElements, contextMenuHandlers, dataElementsProvider, listeners, maxArgument, maxValueCache, minArgument, minValueCache, mouseEnterHandlers, mouseExitHandlers, mousePressedHandlers, mouseTransparent, name, needsUpdate, oldContentsList, tooltipTextExtractor, updatePolicy, visibilityChangeHandlers, visualElementsList -
Constructor Summary
ConstructorsConstructorDescriptionGanttPolylineVisualSet(String name, GanttChartRow ganttChartRow, Supplier<List<T>> dataElementsProvider, Function<T, Double> argumentExtractor, Function<T, Double> valueExtractor) Constructs a GanttPolylineVisualSet with given name,GanttChartRow, data elements and arguments/value extractors, i.e.GanttPolylineVisualSet(String name, Supplier<List<T>> dataElementsProvider, Function<T, Double> argumentExtractor, Function<T, Double> valueExtractor) Constructs a GanttPolylineVisualSet with given name, data elements and arguments/value extractors, i.e. -
Method Summary
Modifier and TypeMethodDescriptionaddContextMenuHandler(VisualSet.ContextMenuHandler<T> contextMenuHandler) Adds the action to be executed every time a context menu for given data element is called.addMouseEnterHandler(BiConsumer<T, javafx.scene.input.MouseEvent> handler) Adds the action to be executed every time mouse enters to any visual element borders.addMouseExitHandler(BiConsumer<T, javafx.scene.input.MouseEvent> handler) Adds the action to be executed every time the mouse exits the previously entered element's bounds.addMousePressedHandler(BiConsumer<T, javafx.scene.input.MouseEvent> handler) Adds the action to be executed every time a mouse button is pressed.addVisibilityChangeHandler(Consumer<VisibilityChangeDescriptor<? extends IAbstractChartVisualSet>> visibilityChangeHandler) Adds the action to be executed every time the visibility of this VisualSet is changed.createVisualElement(T contents) Creates a new instance ofVisualSet<T>.VisualElementcorresponding to the current VisualSet type.Returns the reference to theGanttChartRowrow on which the visuals will be drawnprotected intgetInjectionIndex(List<VisualSet<T>.VisualElement> list, VisualSet<T>.VisualElement element, T contents, int contentsIndex, Map<VisualSet<T>.VisualElement, Double> beginArgumentsCache) doubleReturns the fraction height of the region in which polyline is drawn.getVisualElements(boolean recalculationRequired) Returns the list of visual elements corresponding to current data elements.setClipboardText(Function<Double, String> clipboardText) Sets the conversion method from values of each plot data element into text that will be copied to clipboard.setExtrapolation(AbstractLineVisualSet.Extrapolation extrapolation) Sets the of the plot i.e.setLegendText(Supplier<String> legendTextProvider) Sets theLegendlabel text represents this visual set.setLineColor(Color color) Sets the line color of the plot.setLineStyle(LineStyle lineStyle) Sets theLineStyleof the plot i.e.setLineWidth(double width) Sets the width of the line, in pixels.setMaxValue(Supplier<Double> maxValueProvider) Sets the supplier of max value.setMouseTransparent(boolean mouseTransparent) Sets the value of the property mouseTransparent.setPointsAndLinesStyle(AbstractLineVisualSet.PointsAndLinesStyle pointsAndLinesStyle) Sets theAbstractLineVisualSet.PointsAndLinesStyleof the plot i.e.setPointSize(double pointSize) Sets the diameter of the point, in pixels.setRowHeightFraction(double rowHeightFraction) Sets the fraction height of the region in which polyline is drawn.setTooltipText(Function<T, String> tooltipText) Adds tooltip text to display when the mouse is hovered over a visual element representing given data element.setUpdatePolicy(VisualSet.UpdatePolicy updatePolicy) Sets the newVisualSet.UpdatePolicyi.e.Methods inherited from class com.amalgamasimulation.charts.visualsets.AbstractPolylineVisualSet
getClipboardText, getValueMethods inherited from class com.amalgamasimulation.charts.visualsets.AbstractLineVisualSet
getExtrapolation, getLegendColor, getLegendText, getLineColor, getLineStyle, getLineWidth, getMaxValue, getMinValue, getPointsAndLinesStyle, getPointSize, getValueMethods inherited from class com.amalgamasimulation.charts.visualsets.VisualSet
addVisualElement, addVisualElement, addVisualSetChangeHandler, clearDependencies, getArgument, getContents, getContextMenuHandlers, getDataElements, getMaxArgument, getMinArgument, getMouseEnterHandlers, getMouseExitHandlers, getMousePressedHandlers, getName, getTooltipText, getUpdatePolicy, getVisibilityChangeHandlers, getVisibleVisualElementIndex, getVisibleVisualElementsCount, isMouseTransparent, isNeedsUpdate, recalculateVisualElements, removeContextMenuHandler, removeMouseEnterHandler, removeMouseExitHandler, removeMousePressedHandler, removeVisibilityChangeHandler, removeVisualElement, removeVisualSetChangeHandler, sortVisualElements, toString, update, updateMinMaxArgumentsValuesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.amalgamasimulation.charts.visualsets.types.IAbstractChartVisualSet
addVisualSetChangeHandler, getContents, getMaxArgument, getMinArgument, getName, getUpdatePolicy, getVisibilityChangeHandlers, getVisibleVisualElementsCount, isMouseTransparent, removeVisibilityChangeHandler, removeVisualSetChangeHandlerMethods inherited from interface com.amalgamasimulation.charts.visualsets.IUpdatePolicyPropertyOwner
getUpdatePolicy
-
Constructor Details
-
GanttPolylineVisualSet
public GanttPolylineVisualSet(String name, Supplier<List<T>> dataElementsProvider, Function<T, Double> argumentExtractor, Function<T, Double> valueExtractor) Constructs a GanttPolylineVisualSet with given name, data elements and arguments/value extractors, i.e. a functions that specifies the rule for extracting an argument/value from a data element. Creates a defaultGanttChartRowbased on the given name.- Parameters:
name- visual set name is used to sort and name the visual sets on the chartdataElementsProvider- data elements list provider. The provider is invalidated every time the chart is being redrawnargumentExtractor- a function that specifies the rule for extracting an argument from a data elementvalueExtractor- a function that specifies the rule for extracting a value from a data element
-
GanttPolylineVisualSet
public GanttPolylineVisualSet(String name, GanttChartRow ganttChartRow, Supplier<List<T>> dataElementsProvider, Function<T, Double> argumentExtractor, Function<T, Double> valueExtractor) Constructs a GanttPolylineVisualSet with given name,GanttChartRow, data elements and arguments/value extractors, i.e. a functions that specifies the rule for extracting an argument/value from a data element.- Parameters:
name- visual set name is used to sort and name the visual sets on the chartganttChartRow-GanttChartRowwhich displays this visual set i.e. the Y-axis valuedataElementsProvider- data elements list provider. The provider is invalidated every time the chart is being redrawnargumentExtractor- a function that specifies the rule for extracting an argument from a data elementvalueExtractor- a function that specifies the rule for extracting a value from a data element
-
-
Method Details
-
setRowHeightFraction
Sets the fraction height of the region in which polyline is drawn. Fraction is calculated relative to the height of the region allocated for correspondingGanttChartRow.The value must be greater than zero and not greater than 1.
The default value is 1.
- Parameters:
rowHeightFraction- new row height fraction- Returns:
- the fraction height of the region in which polyline is drawn
-
getRowHeightFraction
public double getRowHeightFraction()Returns the fraction height of the region in which polyline is drawn.- Returns:
- the fraction height of the region in which polyline is drawn
-
setTooltipText
Description copied from class:VisualSetAdds tooltip text to display when the mouse is hovered over a visual element representing given data element.- Overrides:
setTooltipTextin classAbstractPolylineVisualSet<T>- Parameters:
tooltipText- a function that specifies the rule for extracting a tooltip text from a data element- Returns:
- reference to this object
-
setLineColor
Description copied from class:AbstractLineVisualSetSets the line color of the plot. Transparent and semi-transparent colors are allowed.- Overrides:
setLineColorin classAbstractLineVisualSet<T>- Parameters:
color- the line color of the plot- Returns:
- reference to this object
-
setLineWidth
Description copied from class:AbstractLineVisualSetSets the width of the line, in pixels.- Overrides:
setLineWidthin classAbstractLineVisualSet<T>- Parameters:
width- the width of the line, in pixels- Returns:
- reference to this object
-
setPointSize
Description copied from class:AbstractLineVisualSetSets the diameter of the point, in pixels.- Overrides:
setPointSizein classAbstractLineVisualSet<T>- Parameters:
pointSize- the diameter of the point, in pixels- Returns:
- reference to this object
-
setPointsAndLinesStyle
public GanttPolylineVisualSet<T> setPointsAndLinesStyle(AbstractLineVisualSet.PointsAndLinesStyle pointsAndLinesStyle) Description copied from class:AbstractLineVisualSetSets theAbstractLineVisualSet.PointsAndLinesStyleof the plot i.e. the methodology of drawing the visual elements for data elements.- Overrides:
setPointsAndLinesStylein classAbstractLineVisualSet<T>- Parameters:
pointsAndLinesStyle- theAbstractLineVisualSet.PointsAndLinesStyleof the plot i.e. the methodology of drawing the visual elements for data elements- Returns:
- reference to this object
-
setClipboardText
Description copied from interface:IClipboardTextPropertyOwnerSets the conversion method from values of each plot data element into text that will be copied to clipboard.- Specified by:
setClipboardTextin interfaceIClipboardTextPropertyOwner<T>- Overrides:
setClipboardTextin classAbstractPolylineVisualSet<T>- Parameters:
clipboardText- an extractor that converts the value of each plot data element into text that will be copied to the clipboard- Returns:
- reference to this object
-
setMaxValue
Description copied from class:AbstractLineVisualSetSets the supplier of max value. This value allows to set some "natural" max value of the data being displayed It will be used when scaling the Y-axis of the chart.- Overrides:
setMaxValuein classAbstractLineVisualSet<T>- Parameters:
maxValueProvider- the supplier of max value- Returns:
- reference to this object
-
addContextMenuHandler
public GanttPolylineVisualSet<T> addContextMenuHandler(VisualSet.ContextMenuHandler<T> contextMenuHandler) Description copied from class:VisualSetAdds the action to be executed every time a context menu for given data element is called.- Overrides:
addContextMenuHandlerin classVisualSet<T>- Parameters:
contextMenuHandler- context menu call action- Returns:
- reference to this object
-
addMouseEnterHandler
public GanttPolylineVisualSet<T> addMouseEnterHandler(BiConsumer<T, javafx.scene.input.MouseEvent> handler) Description copied from class:VisualSetAdds the action to be executed every time mouse enters to any visual element borders.- Overrides:
addMouseEnterHandlerin classVisualSet<T>- Parameters:
handler- new mouse enter action- Returns:
- reference to this object
-
addMouseExitHandler
public GanttPolylineVisualSet<T> addMouseExitHandler(BiConsumer<T, javafx.scene.input.MouseEvent> handler) Description copied from class:VisualSetAdds the action to be executed every time the mouse exits the previously entered element's bounds.- Overrides:
addMouseExitHandlerin classVisualSet<T>- Parameters:
handler- new mouse exit action- Returns:
- reference to this object
-
addMousePressedHandler
public GanttPolylineVisualSet<T> addMousePressedHandler(BiConsumer<T, javafx.scene.input.MouseEvent> handler) Description copied from class:VisualSetAdds the action to be executed every time a mouse button is pressed.- Overrides:
addMousePressedHandlerin classVisualSet<T>- Parameters:
handler- new mouse button pressed action- Returns:
- reference to this object
-
addVisibilityChangeHandler
public GanttPolylineVisualSet<T> addVisibilityChangeHandler(Consumer<VisibilityChangeDescriptor<? extends IAbstractChartVisualSet>> visibilityChangeHandler) Description copied from interface:IAbstractChartVisualSetAdds the action to be executed every time the visibility of this VisualSet is changed.- Specified by:
addVisibilityChangeHandlerin interfaceIAbstractChartVisualSet- Overrides:
addVisibilityChangeHandlerin classVisualSet<T>- Parameters:
visibilityChangeHandler- visibility change action- Returns:
- reference to this object
-
setLegendText
Description copied from interface:ILegendNodePropertiesOwnerSets theLegendlabel text represents this visual set.- Specified by:
setLegendTextin interfaceILegendNodePropertiesOwner- Overrides:
setLegendTextin classAbstractLineVisualSet<T>- Parameters:
legendTextProvider- theLegendlabel text represents this visual set- Returns:
- reference to this object
-
setLineStyle
Description copied from class:AbstractLineVisualSetSets theLineStyleof the plot i.e. the methodology of drawing the lines for data elements.- Overrides:
setLineStylein classAbstractLineVisualSet<T>- Parameters:
lineStyle- theLineStyleof the plot i.e. the methodology of drawing the lines for data elements- Returns:
- reference to this object
-
getVisualElements
public List<GanttPolylineVisualSet<T>.GanttPolylineVisualElement> getVisualElements(boolean recalculationRequired) Description copied from interface:IAbstractChartVisualSetReturns the list of visual elements corresponding to current data elements. Cannot be changed by the user.- Specified by:
getVisualElementsin interfaceIAbstractChartVisualSet- Specified by:
getVisualElementsin interfaceIGanttChartVisualSet- Overrides:
getVisualElementsin classVisualSet<T>- Parameters:
recalculationRequired- flag of the need to recalculate the visual elements- Returns:
- the list of visual elements corresponding to current data elements
-
getInjectionIndex
protected int getInjectionIndex(List<VisualSet<T>.VisualElement> list, VisualSet<T>.VisualElement element, T contents, int contentsIndex, Map<VisualSet<T>.VisualElement, Double> beginArgumentsCache) - Overrides:
getInjectionIndexin classAbstractPolylineVisualSet<T>
-
setUpdatePolicy
Description copied from interface:IAbstractChartVisualSetSets the newVisualSet.UpdatePolicyi.e. the VisualSet update control rule.- Specified by:
setUpdatePolicyin interfaceIAbstractChartVisualSet- Specified by:
setUpdatePolicyin interfaceIUpdatePolicyPropertyOwner- Overrides:
setUpdatePolicyin classVisualSet<T>- Parameters:
updatePolicy- newVisualSet.UpdatePolicyi.e. the VisualSet update control rule- Returns:
- reference to this object
-
createVisualElement
Description copied from class:VisualSetCreates a new instance ofVisualSet<T>.VisualElementcorresponding to the current VisualSet type.- Overrides:
createVisualElementin classAbstractPolylineVisualSet<T>- Parameters:
contents- data element for which theVisualSet<T>.VisualElementis being checked- Returns:
- a new instance of
VisualSet<T>.VisualElementcorresponding to the current VisualSet type
-
setExtrapolation
public GanttPolylineVisualSet<T> setExtrapolation(AbstractLineVisualSet.Extrapolation extrapolation) Description copied from class:AbstractLineVisualSetSets the of the plot i.e. mode of extending a line to the maximum argument among all visual sets or to the current argument along the horizontal axis. Applicable only forAbstractLineVisualSet.- Overrides:
setExtrapolationin classAbstractLineVisualSet<T>- Parameters:
extrapolation- theAbstractLineVisualSet.Extrapolationof the plot- Returns:
- reference to this object
-
setMouseTransparent
Description copied from interface:IAbstractChartVisualSetSets the value of the property mouseTransparent. If true, this VisualSet is completely transparent to mouse events. When choosing target for mouse event, VisualSets with mouseTransparent set to true won't be taken into account.- Specified by:
setMouseTransparentin interfaceIAbstractChartVisualSet- Overrides:
setMouseTransparentin classVisualSet<T>- Parameters:
mouseTransparent- new value of property mouseTransparent- Returns:
- reference to this object
-
getGanttChartRow
Description copied from interface:IGanttChartRowPropertyOwnerReturns the reference to theGanttChartRowrow on which the visuals will be drawn- Specified by:
getGanttChartRowin interfaceIGanttChartRowPropertyOwner- Returns:
- the reference to the
GanttChartRowrow on which the visuals will be drawn
-