Class AbstractRegionVisualSet<T>

All Implemented Interfaces:
IBeginEndArgumentPropertyOwner<T>, IUpdatePolicyPropertyOwner, IAbstractChartVisualSet
Direct Known Subclasses:
RangeRegionVisualSet, RegionVisualSet

public abstract class AbstractRegionVisualSet<T> extends LabeledVisualSet<T> implements IBeginEndArgumentPropertyOwner<T>
  • Constructor Details

    • AbstractRegionVisualSet

      public AbstractRegionVisualSet(String name, Supplier<List<T>> dataElementsProvider, Function<T,Double> beginArgumentExtractor, Function<T,Double> endArgumentExtractor)
      Constructs a RegionVisualSet with given name, data elements and begin/end argument extractors, i.e. a functions that specifies the rule for extracting a begin/end arguments from a data element. Creates a default GanttChartRow based on the given name.
      Parameters:
      name - visual set name is used to sort and name the visual sets on the chart
      dataElementsProvider - data elements list provider. The provider is invalidated every time the chart is being redrawn
      beginArgumentExtractor - a function that specifies the rule for extracting a begin argument from a data element
      endArgumentExtractor - a function that specifies the rule for extracting an end argument from a data element
  • Method Details

    • setBackgroundColor

      public AbstractRegionVisualSet<T> setBackgroundColor(Function<T,Color> backgroundColorExtractor)
      Sets the background color for each data element. The color may be different for different data elements.
      Parameters:
      backgroundColorExtractor - the background color extractor, i.e. method returning color depending on the data element
      Returns:
      reference to this object
    • setBorderColor

      public AbstractRegionVisualSet<T> setBorderColor(Function<T,Color> borderColorExtractor)
      Sets the border color for each data element. The color may be different for different data elements.
      Parameters:
      borderColorExtractor - the border color extractor, i.e. method returning color depending on the data element
      Returns:
      reference to this object
    • setBorderWidth

      public AbstractRegionVisualSet<T> setBorderWidth(Function<T,Double> borderWidthExtractor)
      Sets the border width in pixels for each data element. The width may be different for different data elements.
      Parameters:
      borderWidthExtractor - the border width extractor, i.e. method returning width in pixels depending on the data element
      Returns:
      reference to this object
    • getBackgroundColor

      public Color getBackgroundColor(T element)
      Returns the background color for given data element.
      Parameters:
      element - data element for which the background color is being checked
      Returns:
      the background color for given data element
    • getBorderColor

      public Color getBorderColor(T element)
      Returns the border color for given data element.
      Parameters:
      element - data element for which the border color is being checked
      Returns:
      the border color for given data element
    • getBorderWidth

      public double getBorderWidth(T element)
      Returns the border width in pixels for given data element.
      Parameters:
      element - data element for which the border width in pixels is being checked
      Returns:
      the border width in pixels for given data element
    • setLabelText

      public AbstractRegionVisualSet<T> setLabelText(LabelSide labelSide, Function<? extends T,String> labelTextExtractor, Function<? extends T,Double> labelTextSizeExtractor, Function<? extends T,Color> labelTextColorExtractor)
      Description copied from class: LabeledVisualSet
      Sets the labels of the rectangles representing plot data elements. The label of each rectangle is set independently of the labels on other sides of this rectangle or the labels on other rectangles. The label will not be displayed if the specified text is empty.
      Overrides:
      setLabelText in class LabeledVisualSet<T>
      Parameters:
      labelSide - the LabelSide of rectangle where the corresponding label will be drawn
      labelTextExtractor - the text of the label
      labelTextSizeExtractor - the font size of the label
      labelTextColorExtractor - the color of the label
      Returns:
      reference to this object
    • setTooltipText

      public AbstractRegionVisualSet<T> setTooltipText(Function<T,String> tooltipTextExtractor)
      Description copied from class: VisualSet
      Adds tooltip text to display when the mouse is hovered over a visual element representing given data element.
      Specified by:
      setTooltipText in class VisualSet<T>
      Parameters:
      tooltipTextExtractor - a function that specifies the rule for extracting a tooltip text from a data element
      Returns:
      reference to this object
    • getBeginArgument

      public double getBeginArgument(T element)
      Description copied from interface: IBeginEndArgumentPropertyOwner
      Returns the begin X-axis argument of the visual corresponding to the given element.
      Specified by:
      getBeginArgument in interface IBeginEndArgumentPropertyOwner<T>
      Parameters:
      element - data element for which the begin argument is being checked
      Returns:
      the begin X-axis argument of the visual corresponding to the given element
    • getEndArgument

      public double getEndArgument(T element)
      Description copied from interface: IBeginEndArgumentPropertyOwner
      Returns the end X-axis argument of the visual corresponding to the given element.
      Specified by:
      getEndArgument in interface IBeginEndArgumentPropertyOwner<T>
      Parameters:
      element - data element for which the end argument is being checked
      Returns:
      the end X-axis argument of the visual corresponding to the given element