Archives for the ‘javafx’ Category
Thursday, 2 April 2009
I was having a lot of problems getting the simplest test case below to run without throwing an odd exception:
import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx.scene.layout.*;
import javafx.ext.swing.SwingTextField;
import javafx.ext.swing.SwingButton;
Stage {
title : "MyApp"
scene: Scene {
width: 200
height: [...]
Tags: javafx
Posted in javafx | No Comments »
Monday, 30 March 2009
Setting custom cursors with JavaFx is relatively straightforward, but for one little catch. Your image has to be 32×32. If you want a 16×16 icon, simply leave the rest of the image transparent.
import java.awt.Toolkit;
import javafx.scene.Cursor;
import javafx.scene.image.Image;
public class ColorChooser extends Cursor
{
public override function impl_getAWTCursor(): java.awt.Cursor {
[...]
Posted in javafx | 2 Comments »
Tuesday, 24 March 2009
Just sharing some code snippets for deserialization of JavaFX objects.
function getValueType(obj:Object,name:String):String
{
var context:FXLocal.Context=FXLocal.getContext();
var objectValue:FXLocal.ObjectValue = new FXLocal.ObjectValue(obj,context);
var cls:FXClassType = objectValue.getClassType();
var varType:FXType = cls.getVariable(name).getType();
println("{name} {varType}");
if (varType instanceof FXSequenceType)
{
[...]
Tags: javafx
Posted in Java, javafx | No Comments »
Friday, 20 March 2009
I had a Group of circles, i.e.
var circles:Circle[];
var group:Group = Group { content: [circles] };
strangely, I couldn’t get newly inserted circles to render.
It turns out that you have to bind group.content to ensure that changes in circles are reflected in group.content.
Here’s a test routine.
import javafx.scene.*;
import javafx.scene.paint.*;
import javafx.scene.shape.*;
import javafx.stage.*;
var lines = for (i in [1..10])
[...]
Tags: javafx
Posted in javafx | 1 Comment »
Wednesday, 18 February 2009
Having spent a few weeks experimenting with JavaFX, and creating several examples, here is an assessment of whether JavaFX succeeds in it’s objective of being a graphics DSL. Bear in mind that I am evaluating it in terms of it’s ease in being a graphics DSL – if it makes my life easier, it succeeds. [...]
Tags: javafx
Posted in javafx | 1 Comment »
Friday, 13 February 2009
Here is a minimal test case illustrating how exasperating the default JavaFX Text node can be, especially when aligning text.
You’d be surprised to note that both pieces of text below are aligned using TextAlignment.CENTER.
import javafx.scene.text.*;
import javafx.scene.layout.*;
VBox
{
translateY:10
content:
[
Text {
[...]
Tags: javafx
Posted in General, Java, javafx | No Comments »
Thursday, 12 February 2009
Given the following piece of JavaFX Script
import javafx.scene.CustomNode;
import javafx.scene.Group;
import javafx.scene.Node;
import javafx.scene.shape.Rectangle;
import javafx.scene.paint.Color;
import java.lang.Math.sqrt;
class C extends CustomNode
{
// Test #1: Commented out
//var node: Group = Group {};
protected override function create():Node
{
return node;
[...]
Tags: javafx
Posted in Java, javafx | No Comments »
Wednesday, 4 February 2009
JavaFX gets to start on a clean slate, without burdens of compatibility with browsers. However, how well does it paint itself?
How are – say – Rectangles defined?
Is the startX based on center lines? or is it from the origin?
What about borders? Are borders painted to the bottom right of the origin?
How [...]
Tags: javafx
Posted in General, javafx | 3 Comments »
Wednesday, 10 December 2008
JavaFX 1.0 is finally out of the gate. There are probably many Java engineers and architects who are trying to figure out this technology and see how it could apply to their existing projects. Here is my assessment. Note this applies to JavaFX 1.0.
JavaFX 1.0 is not ready as a Flash replacement in public-facing projects
While [...]
Tags: javafx, ria
Posted in Flex, Java, javafx | 8 Comments »
Thursday, 18 September 2008
[Note: I've reposted this (with minor edits) as my original post got accidentally deleted. Thanks to Google cache]
Why is it? Why is it that Java applets -despite having the first mover advantage – achieved little traction. While Flash – a tool which targets graphic designers originally – continue to gain mindshare, and is now a [...]
Tags: Java, jvm
Posted in Java, PHP, Popular essays, javafx | No Comments »
Thursday, 4 September 2008
Update:Looks like the post has been linked from DZone. Tell me what you think? What kind of projects would you choose Java applets over Flash or AJAX?
After all these years, Java’s applet has not seen much adoption, while Flash continue to gain mindshare. Applets suffer from slow start up times, crashing browsers, heavy resource usage. [...]
Tags: Java, javafx, jvm
Posted in .Net, Java, javafx | 5 Comments »
Wednesday, 3 September 2008
Five years ago, when prototyping some apps for PDAs, I’d never consider HTML + javascript. This is because there are enough form factor issues as well as browser incompatibilities to keep one awake all night.
Things have changed.
WebKit seems to have gained ground in the mobile space, giving compatibility a much needed shot in the [...]
Tags: Flex, javafx, ria, silverlight
Posted in .Net, WPF, javafx | No Comments »
Friday, 29 August 2008
Jan Erik calls me the “high IQ” type. Unfortunately, I think he means “impractical” and “living in an invory tower”.
The idea of a inlining JavaFX script is actually a smaller and incremental goal. It is practical and is achievable. It will allow people who don’t have the JavaFX SDK to experiment with the technology, within [...]
Tags: WPF, javafx, ria, silverlight, xforms
Posted in .Net, Java, WPF, javafx | No Comments »
Friday, 29 August 2008
Jan Erik opined insightfully about JavaFX’s prospect:
Java.net is disconnected with reality. For every guy who knows Swing/Java there are a 1000 guys who know HTML/DOM/CSS/Javascript. Silverlight is only marginally important because Microsoft controls 90 percent of the desktop marked and is the company behind C#.
JavaFX will ride the JRE in the same way AIR is [...]
Tags: javafx, ria
Posted in Java, javafx | 1 Comment »
Tuesday, 26 August 2008
Continuing with our previous example, we now create a CustomNode Coverflows, which contain 11 covers.
A new function called positiveOrZero is introduced so that the tilt angle can be negative.
A fill attribute is introduced to the Cover class and it is bound to the Rectangle.
/**
* Coverflow.fx
**/
package coverflow;
import javafx.application.*;
import javafx.animation.*;
import javafx.input.*;
import javafx.scene.geometry.*;
import javafx.scene.*;
import javafx.scene.paint.*;
import [...]
Tags: javafx, ria
Posted in Java, javafx | 2 Comments »
Monday, 25 August 2008
The JavaFX compiler supports unicode source files, just as Java compiler does. To use them you need to
make sure the source does not include the three-byte byte-order-mark
call javafxc with the -encoding parameter
javafxc -encoding UTF-8 Chinese.fx
javafx Chinese
And now for the example
import javafx.application.*;
import javafx.scene.Font;
import javafx.scene.text.Text;
import javafx.scene.paint.Color;
Frame {
title: "JavaFX Unicode Example"
width: 400 height: 300
stage: [...]
Tags: javafx, ria
Posted in Java, javafx | No Comments »
Saturday, 23 August 2008
Warning: Apple Inc apparently has a patent on this. I’m merely doing this for performance comparison purposes and for self-education only.
It’s been about 2 weeks since my first JavaFX session. My initial distaste for the YAML syntax is largely gone. I have avoided using Netbeans, as vim is sufficient. The absence of closing tags in [...]
Tags: javafx, ria
Posted in Java, Netbeans, javafx | 1 Comment »
Friday, 22 August 2008
I was disappointed when I found out JavaFX interpreter is not shipping in the final Java runtime. Shipping the interpreter is key to inlining script with HTML, and will accelerate adoption of this shiny cross-browser platform.
There are tens of millions of web developers who have already been trained to edit text in a file and [...]
Tags: Flex, javafx, ria
Posted in Flex, Java, javafx | No Comments »
Thursday, 21 August 2008
Unfortunately, it appears that the only way to chain JavaFX effects together is by using a Group control. (There is a Effect(input1, input2) constructor, but I can’t seem to access it from JavaFX Script, while the Blend effect doesn’t chain effects, but instead applies them in parallel).
To achieve a Coverflow-like look, we apply a reflection [...]
Tags: javafx, ria
Posted in javafx | No Comments »
Thursday, 21 August 2008
me: What is the long term future of javafx.ext.swing.* classes in JavaFX’s
technological roadmap? Are new Node-based ui classes in-the-works to supercede this?
Joshua Marinacci: We plan to keep the swing classes but they will only be in the desktop profile. New gui classes based on nodes are in the works. These new gui components will be [...]
Tags: Flex, javafx, silverlight
Posted in .Net, Flex, Java, Netbeans, javafx | No Comments »