This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 178716 - Change Keyframe snippet using 'at' syntax
Summary: Change Keyframe snippet using 'at' syntax
Status: VERIFIED FIXED
Alias: None
Product: javafx
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P3 normal (vote)
Assignee: Karol Harezlak
URL:
Keywords:
Depends on:
Blocks: 178578
  Show dependency tree
 
Reported: 2009-12-16 02:35 UTC by Alexandr Scherbatiy
Modified: 2010-02-12 07:04 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexandr Scherbatiy 2009-12-16 02:35:20 UTC
Add 'at' item to the Animation category:
  at (5s)  { value => 20.0 tween Interpolator.LINEAR }

In JavaFX code it looks like:
-------------------------------------------------------
import javafx.animation.*;

var radius = 10.0;

Timeline {
    repeatCount: Timeline.INDEFINITE
    keyFrames: [
        at (5s)  { radius => 20.0 tween Interpolator.EASEBOTH }
        at (15s) { radius => 5.0 tween Interpolator.LINEAR }
        at (15s) { radius => 5.0 tween Interpolator.EASEIN }
    ]
}

-------------------------------------------------------
Comment 1 Karol Harezlak 2010-02-08 06:41:02 UTC
This should be up to user to use this functionality in code. I don't think it's a good idea to have it in template.
Comment 2 Alexandr Scherbatiy 2010-02-08 06:45:53 UTC
The template:
---------------------------------------
 at (5s)  { value => 20.0 tween Interpolator.LINEAR }
---------------------------------------

is just a short version of the KeyFrame template:
---------------------------------------
KeyFrame {
	time: 1s
}
---------------------------------------


So a user will have the option to use the full version or to use the short one.
Comment 3 Karol Harezlak 2010-02-10 08:31:23 UTC
Ok I understand but I'm not really familiar with this syntax. Could you provide full template for this component. It'd speed up development time so I don't have to investigate it?

Thanks,
Comment 4 Alexandr Scherbatiy 2010-02-11 02:15:10 UTC
The template is:
---------------------------------------------------
 at (5s)  { value => 190.0 tween Interpolator.LINEAR }
---------------------------------------------------

See the Source Code: Animated Orange Rectangle in:
http://javafx.com/docs/articles/animation_basics/
Comment 5 Alexandr Scherbatiy 2010-02-11 02:16:07 UTC
http://javafx.com/docs/articles/animation_basics/
Source Code: Keyframes Shortcut Using the at() Operator
----------------------------------------------------------
var slider1: Number;

Timeline {
 repeatCount: 1  
 keyFrames: [
     at (0s) {slider1 => 20.0},  //start point
     at (5s) {slider1 => 100.0 tween Interpolator.LINEAR} //end point
 ]; //close KeyFrames

 }.play();
----------------------------------------------------------
Comment 6 Karol Harezlak 2010-02-11 02:44:52 UTC
Now I understand  but I can see problem with it. We have to use "external" variable to make it work. In case that some one decided to use like this:

 var timeline = var slider1: Number;

Timeline {
 repeatCount: 1  
 keyFrames: [
     at (0s) {slider1 => 20.0},  //start point
     at (5s) {slider1 => 100.0 tween Interpolator.LINEAR} //end point
 ]; //close KeyFrames

 }.play();

It wont work, any possibility to use this syntax without declaring var?
Comment 7 Alexandr Scherbatiy 2010-02-11 03:50:35 UTC
The same is for the values template in the Animation category:
--------------------------------------------------------
values: [
    variable => 0.0 tween Interpolator.LINEAR
]
--------------------------------------------------------

The code is not compilable until you define the external variable.
Comment 8 Karol Harezlak 2010-02-11 06:02:18 UTC
changed in main,


changeset:

http://hg.netbeans.org/javafx/rev/6accc2587608
Comment 9 Alexandr Scherbatiy 2010-02-12 07:04:13 UTC
verified in NetBeans-JavaFX-Soma: #151