Package de.gsi.chart

Class XYChart

  • All Implemented Interfaces:
    javafx.beans.Observable, javafx.css.Styleable, javafx.event.EventTarget, javafx.scene.control.Skinnable

    public class XYChart
    extends Chart
    Chart designed primarily to display data traces using DataSet interfaces which are more flexible and efficient than the observable lists used by XYChart. Brief history: original design inspired by Oracle, extended by CERN (i.e. plugin concept/zoomer), modified to mitigate JavaFX performance issues and extended renderer concept/canvas-concept/interfaces/+more plugins by GSI. Refactored and re-write in 2018 to make it compatible with GPLv3 which -- in the spirit of 'Ship of Theseus' -- makes it de-facto a new development. Contributions, bug-fixes, and modifications are welcome. Hope you find this library useful and enjoy!
    Author:
    braeun, rstein
    • Field Detail

      • polarPlot

        protected javafx.beans.property.BooleanProperty polarPlot
    • Constructor Detail

      • XYChart

        public XYChart()
      • XYChart

        public XYChart​(Axis xAxis,
                       Axis yAxis)
        Construct a new XYChart with the given axes.
        Parameters:
        xAxis - the axis to use as primary x-Axis
        yAxis - the axis to use as primary y-Axis
    • Method Detail

      • isPolarPlot

        public final boolean isPolarPlot()
        whether renderer should use polar coordinates (x -> interpreted as phi, y as radial coordinate)
        Returns:
        true if renderer is plotting in polar coordinates
      • setPolarPlot

        public final XYChart setPolarPlot​(boolean state)
        Sets whether renderer should use polar coordinates (x -> interpreted as phi, y as radial coordinate)
        Parameters:
        state - true if renderer is parallelising sub-functionalities
        Returns:
        itself (fluent design)
      • polarStepSizeProperty

        public javafx.beans.property.ObjectProperty<PolarTickStep> polarStepSizeProperty()
      • setPolarStepSize

        public void setPolarStepSize​(PolarTickStep step)
      • polarPlotProperty

        public final javafx.beans.property.BooleanProperty polarPlotProperty()
        Sets whether renderer should use polar coordinates (x -> interpreted as phi, y as radial coordinate)
        Returns:
        true if renderer is plotting in polar coordinates
      • getXAxis

        public Axis getXAxis()
        Returns the x axis.
        Returns:
        x axis
      • getYAxis

        public Axis getYAxis()
        Returns the y axis.
        Returns:
        y axis
      • getAllDatasets

        public javafx.collections.ObservableList<de.gsi.dataset.DataSet> getAllDatasets()
        Overrides:
        getAllDatasets in class Chart
        Returns:
        datasets attached to the chart and datasets attached to all renderers
      • getAllShownDatasets

        public javafx.collections.ObservableList<de.gsi.dataset.DataSet> getAllShownDatasets()
        Returns:
        datasets attached to the chart and datasets attached to all renderers TODO: change to change listener that add/remove datasets from a global observable list
      • verticalGridLinesVisibleProperty

        public final javafx.beans.property.BooleanProperty verticalGridLinesVisibleProperty()
        Indicates whether vertical grid lines are visible or not.
        Returns:
        verticalGridLinesVisible property
      • isVerticalGridLinesVisible

        public final boolean isVerticalGridLinesVisible()
        Indicates whether vertical grid lines are visible.
        Returns:
        true if vertical grid lines are visible else false.
      • setVerticalGridLinesVisible

        public final void setVerticalGridLinesVisible​(boolean value)
        Sets the value of the verticalGridLinesVisibleProperty().
        Parameters:
        value - true to make vertical lines visible
      • horizontalGridLinesVisibleProperty

        public final javafx.beans.property.BooleanProperty horizontalGridLinesVisibleProperty()
        Indicates whether horizontal grid lines are visible or not.
        Returns:
        horizontalGridLinesVisible property
      • getGridRenderer

        public GridRenderer getGridRenderer()
        Returns:
        nomen est omen
      • isHorizontalGridLinesVisible

        public final boolean isHorizontalGridLinesVisible()
        Indicates whether horizontal grid lines are visible.
        Returns:
        true if horizontal grid lines are visible else false.
      • setHorizontalGridLinesVisible

        public final void setHorizontalGridLinesVisible​(boolean value)
        Sets the value of the verticalGridLinesVisibleProperty().
        Parameters:
        value - true to make vertical lines visible
      • updateAxisRange

        public void updateAxisRange()
        Description copied from class: Chart
        update axes ranges (if necessary). This is supposed to be implemented in derived classes
        Specified by:
        updateAxisRange in class Chart
      • getDataSetForAxis

        protected java.util.List<de.gsi.dataset.DataSet> getDataSetForAxis​(Axis axis)
      • updateNumericAxis

        protected void updateNumericAxis​(Axis axis,
                                         java.util.List<de.gsi.dataset.DataSet> dataSets)
      • redrawCanvas

        protected void redrawCanvas()
        Description copied from class: Chart
        (re-)draw canvas (if necessary). This is supposed to be implemented in derived classes
        Specified by:
        redrawCanvas in class Chart
      • axisSideChanged

        protected void axisSideChanged​(javafx.beans.value.ObservableValue<? extends Side> change,
                                       Side oldValue,
                                       Side newValue)
      • axesChanged

        protected void axesChanged​(javafx.collections.ListChangeListener.Change<? extends Axis> change)
        add XYChart specific axis handling (ie. placement around charts, add new DefaultNumericAxis if one is missing, etc.)
        Specified by:
        axesChanged in class Chart
        Parameters:
        change - the new axis change that is being added