Interface IPiecewiseVisualSet

All Known Implementing Classes:
GanttPiecewisePolylineVisualSet, PiecewiseLineVisualSet, PiecewisePolylineVisualSet

public interface IPiecewiseVisualSet
  • Method Details

    • getDiscretizedDataElements

      default List<Pair<Double,Double>> 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 the PiecewiseVisualSetRangePolicy.DISPLAYED_RANGE_ONLY policy 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 discretize
      discretizationFactor - the discretization step
      maxArgument - the max argument to display, limits the displayed range from the right
      Returns:
      the discretized function
    • getDisplayedInterval

      default Interval getDisplayedInterval(double maxArgument)
      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 display
      maxArgument - 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 the PiecewiseVisualSetRangePolicy.
      Parameters:
      piecewiseFunction - the function to display
      maxArgument - 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

      IPiecewiseVisualSet setAxisLengthInPixelsExtractor(Supplier<Double> axisLengthInPixelsExtractor)
      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 an PiecewiseVisualSetRangePolicy for the IPiecewiseVisualSet displayed on the chart.
      Parameters:
      piecewiseVisualSetRangePolicy - an PiecewiseVisualSetRangePolicy for 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

      IPiecewiseVisualSet setCurrentArgumentExtractor(Supplier<Double> currentArgumentExtractor)
      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

      Pair<Double,Double> 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