Class AbstractPolylineVisualSet<T>
java.lang.Object
com.amalgamasimulation.charts.visualsets.VisualSet<T>
com.amalgamasimulation.charts.visualsets.AbstractLineVisualSet<T>
com.amalgamasimulation.charts.visualsets.AbstractPolylineVisualSet<T>
- Type Parameters:
T- visual set data elements type
- All Implemented Interfaces:
IClipboardTextPropertyOwner<Double>,ILegendNodePropertiesOwner,IMinMaxValuePropertyOwner,IUpdatePolicyPropertyOwner,IAbstractChartVisualSet
- Direct Known Subclasses:
GanttPolylineVisualSet,PolylineVisualSet
public abstract class AbstractPolylineVisualSet<T>
extends AbstractLineVisualSet<T>
implements IClipboardTextPropertyOwner<Double>
Class that is the parent for all visual sets drawn on the chart by
points-and-lines. Differs from a line-based visual set in that the data
element arguments may not be strictly increasing.
- Author:
- Aleksey
-
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.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
FieldsFields 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateVisualElement(T contents) Creates a new instance ofVisualSet<T>.VisualElementcorresponding to the current VisualSet type.getClipboardText(Double object) Returns the text that will be copied to clipboard for the given object.protected intgetInjectionIndex(List<VisualSet<T>.VisualElement> list, VisualSet<T>.VisualElement element, T contents, int contentsIndex, Map<VisualSet<T>.VisualElement, Double> beginArgumentsCache) doublegetValue(double argument) Returns the value of the given X-axis argument.setClipboardText(Function<Double, String> clipboardTextExtractor) Sets the conversion method from values of each plot data element into text that will be copied to clipboard.setTooltipText(Function<T, String> tooltipTextExtractor) Adds tooltip text to display when the mouse is hovered over a visual element representing given data element.Methods inherited from class com.amalgamasimulation.charts.visualsets.AbstractLineVisualSet
getExtrapolation, getLegendColor, getLegendText, getLineColor, getLineStyle, getLineWidth, getMaxValue, getMinValue, getPointsAndLinesStyle, getPointSize, getValue, setExtrapolation, setLegendText, setLineColor, setLineStyle, setLineWidth, setMaxValue, setPointsAndLinesStyle, setPointSizeMethods inherited from class com.amalgamasimulation.charts.visualsets.VisualSet
addContextMenuHandler, addMouseEnterHandler, addMouseExitHandler, addMousePressedHandler, addVisibilityChangeHandler, addVisualElement, addVisualElement, addVisualSetChangeHandler, clearDependencies, getArgument, getContents, getContextMenuHandlers, getDataElements, getMaxArgument, getMinArgument, getMouseEnterHandlers, getMouseExitHandlers, getMousePressedHandlers, getName, getTooltipText, getUpdatePolicy, getVisibilityChangeHandlers, getVisibleVisualElementIndex, getVisibleVisualElementsCount, getVisualElements, isMouseTransparent, isNeedsUpdate, recalculateVisualElements, removeContextMenuHandler, removeMouseEnterHandler, removeMouseExitHandler, removeMousePressedHandler, removeVisibilityChangeHandler, removeVisualElement, removeVisualSetChangeHandler, setMouseTransparent, setUpdatePolicy, 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.IUpdatePolicyPropertyOwner
getUpdatePolicy, setUpdatePolicy
-
Field Details
-
clipboardTextExtractor
-
-
Constructor Details
-
AbstractPolylineVisualSet
public AbstractPolylineVisualSet(String name, Supplier<List<T>> dataElementsProvider, Function<T, Double> argumentExtractor, Function<T, Double> valueExtractor) Constructs a AbstractPolylineVisualSet 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.- 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
-
-
Method Details
-
setClipboardText
public AbstractPolylineVisualSet<T> setClipboardText(Function<Double, String> clipboardTextExtractor) 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>- Parameters:
clipboardTextExtractor- 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
-
setTooltipText
Description copied from class:VisualSetAdds tooltip text to display when the mouse is hovered over a visual element representing given data element.- Specified by:
setTooltipTextin classVisualSet<T>- Parameters:
tooltipTextExtractor- a function that specifies the rule for extracting a tooltip text from a data element- Returns:
- reference to this object
-
getClipboardText
Description copied from interface:IClipboardTextPropertyOwnerReturns the text that will be copied to clipboard for the given object.- Specified by:
getClipboardTextin interfaceIClipboardTextPropertyOwner<T>- Parameters:
object- object for which the clipboard text is being checked- Returns:
- the text that will be copied to clipboard for the given object
-
getValue
public double getValue(double argument) Returns the value of the given X-axis argument.- Parameters:
argument- X-axis argument for which the value is being checked- Returns:
- the value of the given X-axis argument
-
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 classVisualSet<T>
-
createVisualElement
Description copied from class:VisualSetCreates a new instance ofVisualSet<T>.VisualElementcorresponding to the current VisualSet type.- Specified by:
createVisualElementin classVisualSet<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
-