Interface IPiecewiseVisualSet
- All Known Implementing Classes:
GanttPiecewisePolylineVisualSet,PiecewiseLineVisualSet,PiecewisePolylineVisualSet
public interface IPiecewiseVisualSet
-
Method Summary
Modifier and TypeMethodDescriptiondoubleReturns an actual plot X-axis length in pixels.doubleReturns a current argument shown on plot.default doublegetDiscretizationFactor(double actualRange, double maxPointsInActualRange) getDiscretizedDataElements(DoubleConsumer appliedDiscretizationFactorConsumer) Returns the data elements to display, discretizing the PiecewiseFunction if necessary.default PiecewiseFunctiongetDiscretizedFunction(PiecewiseFunction piecewiseFunction, double discretizationFactor, double maxArgument) Discretizes the given PiecewiseFunction with the given step.default IntervalgetDisplayedInterval(double maxArgument) Returns the displayed arguments range limited from the right by the given max argument.Returns a current displayed range on plot.doubleintReturns the minimum pixels per plot point for discretization.Returns data elements list provider.Returns the InterpolationType e.g.Returns the PiecewiseVisualSetRangePolicy for discretization.getPlotPoints(PiecewiseFunction piecewiseFunction, double maxArgument) Returns the plot points of the given PiecewiseFunction according to thePiecewiseVisualSetRangePolicy.default doublegetRequiredDiscretizationFactor(PiecewiseFunction piecewiseFunction, double maxArgument) Returns the discretization factor (step) required to display the given PiecewiseFunction in the displayed range, or NaN if the discretization is not necessary.default voidbooleanReturns the necessity rule for discretization.setAxisLengthInPixelsExtractor(Supplier<Double> axisLengthInPixelsExtractor) Sets a function that specifies the rule for extracting an actual plot X-axis length in pixels.setCurrentArgumentExtractor(Supplier<Double> currentArgumentExtractor) Sets a function that specifies the rule for extracting a current argument shown on plot.setDiscretizeIfNecessaryExtractor(Supplier<Boolean> discretizeIfNecessaryExtractor) Sets a function that specifies the necessity rule for discretization.setDisplayedRangeExtractor(Supplier<Pair<Double, Double>> displayedRangeExtractor) Sets a function that specifies the rule for extracting a current displayed range on plot.voidsetMaxArgument(double maxArgument) voidsetMinArgument(double minArgument) setMinPixelsPerPlotPointExtractor(Supplier<Integer> minPixelsPerPlotPointExtractor) Sets a function that specifies the minimum pixels per plot point for discretization.setPiecewiseFunctionExtractor(Supplier<PiecewiseFunction> piecewiseFunctionExtractor) Sets data elements list provider.setPiecewiseFunctionInterpolationType(PiecewiseFunction.InterpolationType interpolationType) Sets the InterpolationType e.g.setPiecewiseVisualSetRangePolicy(PiecewiseVisualSetRangePolicy piecewiseVisualSetRangePolicy) Sets anPiecewiseVisualSetRangePolicyfor the IPiecewiseVisualSet displayed on the chart.
-
Method Details
-
getDiscretizedDataElements
-
getDiscretizedDataElements
default List<Pair<Double,Double>> getDiscretizedDataElements(DoubleConsumer appliedDiscretizationFactorConsumer) Returns the data elements to display, discretizing the PiecewiseFunction if necessary. Reports the discretization factor (step) to the given consumer only if the discretization was actually applied.- Parameters:
appliedDiscretizationFactorConsumer- consumer of the applied discretization factor- Returns:
- the data elements to display
-
getDiscretizedFunction
default PiecewiseFunction getDiscretizedFunction(PiecewiseFunction piecewiseFunction, double discretizationFactor, double maxArgument) Discretizes the given PiecewiseFunction with the given step. With thePiecewiseVisualSetRangePolicy.DISPLAYED_RANGE_ONLYpolicy only the displayed range is discretized, so the cost does not depend on the length of the function. The range is extended by a step on both sides, so that the values of the displayed steps are not affected by the function being zero outside the range. The steps are aligned to the multiples of the step size, as when the whole function is discretized.- Parameters:
piecewiseFunction- the function to discretizediscretizationFactor- the discretization stepmaxArgument- the max argument to display, limits the displayed range from the right- Returns:
- the discretized function
-
getDisplayedInterval
Returns the displayed arguments range limited from the right by the given max argument.- Parameters:
maxArgument- the max argument to display- Returns:
- the displayed arguments range
-
getRequiredDiscretizationFactor
default double getRequiredDiscretizationFactor(PiecewiseFunction piecewiseFunction, double maxArgument) Returns the discretization factor (step) required to display the given PiecewiseFunction in the displayed range, or NaN if the discretization is not necessary.- Parameters:
piecewiseFunction- the function to displaymaxArgument- the max argument to display, limits the displayed range from the right- Returns:
- the discretization factor or NaN
-
getPlotPoints
default List<Pair<Double,Double>> getPlotPoints(PiecewiseFunction piecewiseFunction, double maxArgument) Returns the plot points of the given PiecewiseFunction according to thePiecewiseVisualSetRangePolicy.- Parameters:
piecewiseFunction- the function to displaymaxArgument- the max argument to display, limits the displayed range from the right- Returns:
- the plot points
-
invalidatePiecewiseMinMaxArguments
default void invalidatePiecewiseMinMaxArguments() -
setMinArgument
void setMinArgument(double minArgument) -
setMaxArgument
void setMaxArgument(double maxArgument) -
getMaxArgument
double getMaxArgument() -
getDiscretizationFactor
default double getDiscretizationFactor(double actualRange, double maxPointsInActualRange) -
setPiecewiseFunctionExtractor
IPiecewiseVisualSet setPiecewiseFunctionExtractor(Supplier<PiecewiseFunction> piecewiseFunctionExtractor) Sets data elements list provider. The provider is invalidated every time the chart is being redrawn.- Parameters:
piecewiseFunctionExtractor- data elements list provider- Returns:
- reference to this object
-
setDiscretizeIfNecessaryExtractor
IPiecewiseVisualSet setDiscretizeIfNecessaryExtractor(Supplier<Boolean> discretizeIfNecessaryExtractor) Sets a function that specifies the necessity rule for discretization.- Parameters:
discretizeIfNecessaryExtractor- a function that specifies the necessity rule for discretization- Returns:
- reference to this object
-
setMinPixelsPerPlotPointExtractor
IPiecewiseVisualSet setMinPixelsPerPlotPointExtractor(Supplier<Integer> minPixelsPerPlotPointExtractor) Sets a function that specifies the minimum pixels per plot point for discretization.- Parameters:
minPixelsPerPlotPointExtractor- a function that specifies the minimum pixels per plot point for discretization- Returns:
- reference to this object
-
setDisplayedRangeExtractor
IPiecewiseVisualSet setDisplayedRangeExtractor(Supplier<Pair<Double, Double>> displayedRangeExtractor) Sets a function that specifies the rule for extracting a current displayed range on plot.- Parameters:
displayedRangeExtractor- a function that specifies the rule for extracting a current displayed range on plot- Returns:
- reference to this object
-
setAxisLengthInPixelsExtractor
Sets a function that specifies the rule for extracting an actual plot X-axis length in pixels.- Parameters:
axisLengthInPixelsExtractor- a function that specifies the rule for extracting an actual plot X-axis length in pixels- Returns:
- reference to this object
-
setPiecewiseVisualSetRangePolicy
IPiecewiseVisualSet setPiecewiseVisualSetRangePolicy(PiecewiseVisualSetRangePolicy piecewiseVisualSetRangePolicy) Sets anPiecewiseVisualSetRangePolicyfor the IPiecewiseVisualSet displayed on the chart.- Parameters:
piecewiseVisualSetRangePolicy- anPiecewiseVisualSetRangePolicyfor the IPiecewiseVisualSet displayed on the chart.- Returns:
- reference to this object
-
setPiecewiseFunctionInterpolationType
IPiecewiseVisualSet setPiecewiseFunctionInterpolationType(PiecewiseFunction.InterpolationType interpolationType) Sets the InterpolationType e.g. the interpolation method between PiecewiseFunction grid points. InterpolationType.PEAK used by default.- Parameters:
interpolationType- the interpolation method between PiecewiseFunction grid points.- Returns:
- reference to this object
-
setCurrentArgumentExtractor
Sets a function that specifies the rule for extracting a current argument shown on plot.- Parameters:
currentArgumentExtractor- a function that specifies the rule for extracting a current argument shown on plot- Returns:
- reference to this object
-
getPiecewiseFunctionInterpolationType
PiecewiseFunction.InterpolationType getPiecewiseFunctionInterpolationType()Returns the InterpolationType e.g. the interpolation method between PiecewiseFunction grid points.- Returns:
- the InterpolationType e.g. the interpolation method between PiecewiseFunction grid points.
-
getPiecewiseVisualSetRangePolicy
PiecewiseVisualSetRangePolicy getPiecewiseVisualSetRangePolicy()Returns the PiecewiseVisualSetRangePolicy for discretization.- Returns:
- the PiecewiseVisualSetRangePolicy for discretization
-
getPiecewiseFunction
PiecewiseFunction getPiecewiseFunction()Returns data elements list provider.- Returns:
- data elements list provider.
-
isDiscretizeIfNecessary
boolean isDiscretizeIfNecessary()Returns the necessity rule for discretization.- Returns:
- the necessity rule for discretization
-
getMinPixelsPerPlotPoint
int getMinPixelsPerPlotPoint()Returns the minimum pixels per plot point for discretization.- Returns:
- the minimum pixels per plot point for discretization
-
getCurrentArgument
double getCurrentArgument()Returns a current argument shown on plot.- Returns:
- a current argument shown on plot
-
getDisplayedRange
Returns a current displayed range on plot.- Returns:
- a current displayed range on plot
-
getAxisLengthInPixels
double getAxisLengthInPixels()Returns an actual plot X-axis length in pixels.- Returns:
- an actual plot X-axis length in pixels
-