Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8090982

[XYChart] data association to chart/series should be more transparent

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: tbd
    • Component/s: javafx
    • Labels:

      Description

      There are several cases when XYChart's data (or series) manipulation fails:
      * when data is moved from one chart to another or between series (RT-37798)
      * when data is added as a duplicate (RT-37824)
      * when data from a different series is added, but it's not removed from the previous series

      These scenarios often produce artifacts (esp. when charts are animated) or exceptions. The problem is that since Data removal may be animated, the data can be part of a chart even after it has been removed from the data list. It it necessary to wait until the data is freed, before it is added to another chart.

      I propose the following solution to solve the problem:
      * Add seriesProperty and chartProperty that show the real association with a chart/series and are set to null when the data is really released. That should be immediate when chart is not animated.
      * Make Data extend Clonable for cases where it's not possible to wait for data release.
      * Throw exceptions when manipulating with data that is still associated with a chart. That would solve RT-37824.
      * Allow subclasses to react on the case when data is moved inside the series. Currently, there's only package-private method for that.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              msladecek Martin Sládeček
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Imported: