Skip to main content

What I don't like on JavaFX

2 replies [Last post]
theuserbl
Offline
Joined: 2004-05-04
Points: 0

A new version of JavaFX is out, and I want to say, what I don't like on JavaFX.

1. JavaFX 1.2 is binary incompatible to JavaFX 1.0 and 1.1

JavaFX 1.2 is completly different to the versions before.
JavaFX can not run old JavaFX-compiled programs.
In JavaFX 1.0 in all .class-files was a main-Method and Java starts the running Class-File direct.
Now in JavaFX 1.2 in no generated .class-file is a main-Method. And Java starts at first its runtime as a Java-program and that starts then the JavaFX-program.

Nothing is wrong with binary-incompatiblity, if it would be in Beta-phase or so.
But at the moment it changed after the 1.0 release.
Will the binary format after every new JavaFX version change?
Who creates then jfx-binary-programs, when they can not run on newer versions?

2. The JavaFX license

The license don't allow to copy JavaFX and its runtime or give it away.
So, if you creates a JavaFX-program, the end-user have to download the JFX-runtime hinself. The EULA don't allow to give the runtime with iot away.

3. Is JavaFX OpenSource

The binary license have the mistake I have mentioned in (2.).
But how open is JavaFX ?
OpenJDK is under the GPL + GNU Classpath exception.

Ok, the Compiler IS OpenSource https://openjfx-compiler.dev.java.net/
And Scenegraph https://scenegraph.dev.java.net/ is as a library under the GPL without GNU Classpath exception! And the last version on that side is 0.6 from March 2008!

So, do you know, if the COMPLETE JavaFX is OpenSource or will be?

4. The syntax of JavaFX

I don't like the Syntax of JavaFX so much.
I think it would be better, if JavaFX becomes a XML-precompiler or something like that.

For example, I have creates with ReportMill JFXBuilder a simple picture with a box, a star and so with color-gradients.
If I save it, JFXBuilder creates a xml-file with the extension .rpt which looks this:

<?xml version="1.0" encoding="UTF-8"?>

And this is the generated JavaFX Code, which JFXBuilder creates from the same picture:

import javafx.scene.*;
import javafx.scene.shape.*;
import javafx.scene.paint.*;
import com.jfxbuilder.fx.*;

// Scene Definition
var scene = Scene {
fill: Color.WHITE
width: 600
height: 400
content: [ArcX {
translateX: 146
translateY: 65
width: 227
height: 88
length: 360
stroke: Color.BLACK
strokeWidth: 1
fill: LinearGradient {
startX: -0.102
startY: 0.719
endX: 1.102
endY: 0.281
proportional: true
stops: [Stop {
offset: 0
color: Color {red: 1, green: 0.416, blue: 0.596}
}, Stop {
offset: 1
color: Color {red: 0, green: 0.067, blue: 0.318}
}]
}
}, RectangleX {
translateX: 109
translateY: 113
width: 120
height: 87
opacity: 0.8
stroke: Color.BLACK
strokeWidth: 1
fill: Color {red: 0.008, green: 0.992, blue: 0.369}
}, PathX {
elements: [MoveTo {x: 195.233, y: 97.617},
LineTo {x: 127.782, y: 119.533},
LineTo {x: 127.782, y: 190.455},
LineTo {x: 86.094, y: 133.078},
LineTo {x: 18.643, y: 154.994},
LineTo {x: 60.33, y: 97.617},
LineTo {x: 18.643, y: 40.239},
LineTo {x: 86.094, y: 62.155},
LineTo {x: 127.782, y: 4.778},
LineTo {x: 127.782, y: 75.7},
ClosePath { },
MoveTo {x: 0, y: 0},
MoveTo {x: 195.233, y: 195.233}]
translateX: 155.383
translateY: 83.383
width: 195.233
height: 195.233
rotate: 37.926
opacity: 0.7
stroke: Color.BLACK
strokeWidth: 1
fill: LinearGradient {
startX: -0.065
startY: 0.911
endX: 1.065
endY: 0.089
proportional: true
stops: [Stop {
offset: 0
color: Color {red: 0.392, green: 0.996, blue: 0.996}
}, Stop {
offset: 1
color: Color {red: 1, green: 0.98, blue: 0.498}
}]
}
}, PathX {
elements: [MoveTo {x: 0, y: 26},
LineTo {x: 104, y: 0}]
translateX: 302
translateY: 65
width: 104
height: 26
stroke: Color.BLACK
strokeWidth: 1
fill: null
}]
};

What is easyier to read?
What code can you see on one monitor-side without scrolling?

Greatings
theuserbl

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
alexsch
Offline
Joined: 2007-07-12
Points: 0

> For example, I have creates with ReportMill
> JFXBuilder a simple picture with a box, a star and so
> with color-gradients.
> If I save it, JFXBuilder creates a xml-file with the
> extension .rpt which looks this:
>
>
>
>
>
> > causes-wrap-type="1">
>
> > color2="#001151" roll="-20" />
>

> > opacity="0.8" causes-wrap-type="1">
>
>
>

> > height="195.233" roll="37.926" opacity="0.7"
> causes-wrap-type="1" startangle="0">
>
> > color2="#fffa7f" roll="-36" />
>

>
> causes-wrap-type="1">
>
> /line>
>
> document>

Is it possible to use functions, loops, define new classes for this xml file?

augusto
Offline
Joined: 2003-06-11
Points: 0

Wait a minute, is this even a fair comparison?

You have a "star" tag already defined in the XML file, while in the JFX code you are drawing the star manually. Of course the jfx code is going to be longer, you already defined the star elsewhere ... you could have done the same with the JFX code if you defined a "star" class.

Also in JFX you could specify the colors using the hex value too instead of the longer way you have used here.