The Source for Java Technology Collaboration

Home » java.net Forums » OpenJFX » JavaFX Script Language Discussion

Thread: Issues encountered with JavaFX Compiler

Welcome, Guest Help
Login Login
Guest Settings Guest Settings
This question is answered. Helpful answers available: 2. Correct answers available: 1.

Reply to this Thread Reply to this Thread Search Forum Search Forum Back to Thread List Back to Thread List

Permlink Replies: 9 - Last Post: Mar 19, 2008 1:52 AM by: michaeljharper Threads: [ Previous | Next ]
michaeljharper

Posts: 6
Issues encountered with JavaFX Compiler
Posted: Mar 16, 2008 9:50 PM
 
  Click to reply to this thread Reply

Hi,

We are undertaking a new project and I have been looking at JavaFX and Adobe Flex as candidates for RIA. I spent quite a lot of time looking at the javafx compiler and here are some the issues I came across.

The example applet on this site from complied code didn't work with the bind operator - the compiler I downloaded refused to compile it. In the end I took the keyword bind out and it allowed it.

Also the mechanisms for operations didn't work - again the compiler objected to the syntax, 'sorry couldn't understand ------ ' etc. To date I haven't got this working.

So two things really. a) it's fairly hard to develop confidence that we are going in the right direction if examples and the compiler are incompatible. It's only because I don't like to be beaten that I've found my way around some issues - sadly not others. b) I just don't know what the status of the compiler and for that matter javafx is at which is why I began to look at Adobe Flex.

The project I am looking to use either Flex or JavaFX in can wait for full commercial safe systems for 6 - 9 months, I would rather use JavaFX because the language appears extremely powerful, but I need some assurance that I'm going down the right path.

Any chance someone could answer the reasons why the compiled applet code didn't work with the recommended compiler download, and where the compiler is right now and where it's going to be in about 6 to 9 months.

Thanks very much

Mike

goddard

Posts: 17
Re: Issues encountered with JavaFX Compiler
Posted: Mar 17, 2008 3:13 AM   in response to: michaeljharper
 
  Click to reply to this thread Reply

Hi Mike,

use function keyword instead of operation. I would appreciate if the compiler team could give us regular updates each two weeks or so on new syntax. I have a problem with this:
Cell.onMouseEntered = function(e) {
red = [1.00.. 0.00 step 0.05] dur 5000 linear; };

It seems like the hack with dur keyword doesn't work for animation anymore.

Jiri

jim_weaver

Posts: 37
Re: Issues encountered with JavaFX Compiler
Posted: Mar 17, 2008 6:06 AM   in response to: goddard
 
  Click to reply to this thread Reply

Jiri,

The dur operator doesn't exist in compiled JavaFX Script. It has been replaced by the KeyFrame animation approach. See Chris Oliver's weblog post on the subject on the JavaFX category of his blog:
http://blogs.sun.com/chrisoliver/category/JavaFX

Also, look at the following posts for code examples of KeyFrame animation:

http://learnjavafx.typepad.com/weblog/2008/01/spinning-wheel.html
http://learnjavafx.typepad.com/weblog/2008/03/really-this-tim.html

Please keep in mind that the implementation of KeyFrame animation on compiled JavaFX Script is not yet complete, so the examples expose some of the underlying infrastructure, rather than keywords like "tween" that you'll see in Chris' post.

Thanks,
Jim Weaver
"Helping you become a JavaFXpert" weblog:
http://JavaFXpert.com

goddard

Posts: 17
Re: Issues encountered with JavaFX Compiler
Posted: Mar 17, 2008 7:29 AM   in response to: jim_weaver
 
  Click to reply to this thread Reply

Thanks again Jim :)
I know dur's not a part of compiled JFX, but I couldn't find the right replacement for that.

jim_weaver

Posts: 37
Re: Issues encountered with JavaFX Compiler
Posted: Mar 17, 2008 10:40 AM   in response to: goddard
 
  Click to reply to this thread Reply

Jiri,

Did the links help you find the replacement for dur, or would you like further explanation?

Thanks,
Jim Weaver

jim_weaver

Posts: 37
Re: Issues encountered with JavaFX Compiler
Posted: Mar 17, 2008 5:53 AM   in response to: michaeljharper
 
  Click to reply to this thread Reply

The JavaFX Script compiler team has provided two ways of creating compiled JavaFX Script applets. Please see the following blog posts:

http://learnjavafx.typepad.com/weblog/2008/03/creating-compil.html
http://learnjavafx.typepad.com/weblog/2008/03/creating-comp-1.html

FWIW, the firsts of these posts is a more "Java applet-like" approach, and the second of these posts is a more "JavaFX-like" approach. Please let me know if you have any questions or problems.

Thanks,
Jim Weaver
"Helping you become a JavaFXpert" weblog:
http://JavaFXpert.com

jim_weaver

Posts: 37
Re2: Issues encountered with JavaFX Compiler
Posted: Mar 17, 2008 6:26 AM   in response to: michaeljharper
 
  Click to reply to this thread Reply

Michael,

Addressing your second question (please see my response to your first one in a separate reply). Based upon the solid and accelerating progress being made by the JavaFX Script compiler team, and the status of the other piece of the rich-client Java puzzle (Java SE 6 u10), I have a high comfort level that a stable 1.0 version will be available in the timeframe in which you need it.

In my opinion, compiled JavaFX Script in its current state will support the prototyping and design activities associated with an RIA project quite nicely.

Join the fray! (frayed?) :-)
Jim Weaver
"Helping you become a JavaFXpert" weblog:
http://JavaFXpert.com

michaeljharper

Posts: 6
Re: Re2: Issues encountered with JavaFX Compiler
Posted: Mar 17, 2008 9:53 PM   in response to: jim_weaver
 
  Click to reply to this thread Reply

Thanks Jim,

Thats more reassuring. Im still a little lost when it comes to comparing Java FX that you can run in interpeter mode against the complied version. I will look for the specification for the language grammer hopefully this will clarify things a little.

jim_weaver

Posts: 37
Re: Re2: Issues encountered with JavaFX Compiler
Posted: Mar 18, 2008 6:19 AM   in response to: michaeljharper
 
  Click to reply to this thread Reply

Michael,

There are some resources you can look at for compiled syntax differences, and I'd really like to pull together one document but haven't devoted the time to it. Here are some resources, with varying levels of accuracy due to the dates:

The JavaFX Script Programming Reference (in progress)
http://openjfx.java.sun.com/current-build/doc/JavaFX-Language.html

My Rosetta Stone post:
http://learnjavafx.typepad.com/weblog/2008/01/compiled-javafx.html

Jo Voordeckers' document:
http://docs.google.com/View?docid=ddjchfgv_4d7vs8wfp

PlanetJFX Converting to Compiler Syntax article:
http://jfx.wikia.com/wiki/Converting_to_the_New_Syntax

But the most definitive place to look is in the source code of the compiler download. The regression tests and feature tests, as well as the sandbox and demos, etc. all have to have correct syntax or the continuous build fails ;-)

Thanks,
Jim Weaver

michaeljharper

Posts: 6
Re: Re2: Issues encountered with JavaFX Compiler
Posted: Mar 19, 2008 1:52 AM   in response to: jim_weaver
 
  Click to reply to this thread Reply

Thanks again, this was very helpful and I'm starting to get the shape of a prototype in place (embedded in a portlet on jboss)

I have one problem I can't find an answer for but I'll post that separately.

Mike




 XML java.net RSS