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

[CSS] Stylesheets for Animations

    Details

    • Type: Enhancement
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: 8u60
    • Fix Version/s: tbd
    • Component/s: javafx
    • Labels:
    • Subcomponent:
    • CPU:
      x86
    • OS:
      windows_8

      Description

      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.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              webbuggrp Webbug Group
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: