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

[CSS] Stylesheets for Animations

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Duplicate
    • Icon: P4 P4
    • tbd
    • 8u60
    • javafx
    • x86
    • windows_8

      A DESCRIPTION OF THE REQUEST :
      It seems rather odd that the timeline and animation interfaces are completely lacking any styling support. This means they are only customizable programmatically and not by end users. A recent example I have is creating a timeline to animate the border of a Rectangle instance and not having any way of setting the properties from a style sheet. In this case it would be nice to be able to set the duration, target, and source values among other properties from a style sheet.

      JUSTIFICATION :
      Customizing animations is a fundamental part of application styling. The Qt framework's Qt Quick platform makes animation properties an integral part of the application styling.
      http://doc.qt.io/qt-5/qtquick-statesanimations-animations.html

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      I would expect to be able to style Transitions and Animations from style sheets.
      ACTUAL -
      There is no support for styling transitions and animations using style sheets.

      ---------- BEGIN SOURCE ----------
      Rectangle rectangle = new Rectangle();
      // this is used to animate the dotted border of a rectangle
      strokeTimeline = new Timeline();
      strokeTimeline.setCycleCount(Timeline.INDEFINITE);
      // 12 is the cumulative offset of the stroke dash array in the style sheet
      KeyValue kv = new KeyValue(rectangle.strokeDashOffsetProperty(), 12);
      KeyFrame kf = new KeyFrame(Duration.millis(500), kv);
      strokeTimeline.getKeyFrames().add(kf);
      strokeTimeline.play();
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      The only current work around is to extend the transitions manually and add the CSSMetaData which is rather cumbersome and not very flexible. It also produces a large amount of boiler plate code.

            Unassigned Unassigned
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: