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.
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.
- duplicates
-
JDK-8090892 CSS syntax for animated properties
- Closed