Menu

javafx

aappddeevv

There is a javafx vocabulary which is the now becoming the primary vocabulary for XIML because I am using currently using javafx for a project.

Binding

The start of a general vocabulary binding mechanism similar to WPF is in place. Underneath, it supports JavaFX properties or POJO properties as source objects and JavaFX properties as targets only. It saves you time and energy. I found the JavaFX binding models very complex compared to jgoodies. I believe that you could reduce the class clutter significantly with redesign but that's another conversation.

Builders

You do not need to use any builders in the XIML markup. You can instantiate objects with static factory methods or arguments as you would expect. I don't see any need for builders in JavaFX and thinks its tremendous class clutter. I started producing support for builder instantiation patterns but its not working yet in case you do indeed want to use a builder as a direct object in the markup. One problem I was having is that the builders themselves cannot be created using new either so its almost like a double layer to contend with.

Skin

Skin is just like the builder concept. Its quite the duplicate. Skin class names are normally set via CSS but they can also be set programmatically. Since a Skin is like a Builder, and a Builder is a MarkupExtension, XIML supports defining skins in the XIML markup file since its just another property on a control. Its not clear how useful this is yet because you still need to bind various properties or handlers to those on the control class itself.

Event Handling

You can provide an event handler for your bind target (which could be separate bind target or the root object of the object graph). Just specify the method name for the OnAction (or whatever) method. The hookup is created in a type converter that converts between a string and an EventHandler. The call is performed through reflection when the action occurs. The method name is checked against the bind target (which is often the root object).

Right now the action will be looked up on the bind target, but its fairly trivial to allow the target of the method call to be set to another object with conversion of the argument along the way. I'll get that code out shortly.

Tree Navigation

There is a tree helper class that allows you to properly navigate down a tree. It has to check default property annotations and the like to do this properly because javafx controls do not consistently story their children in the children list.

Root Instance

XIML has a concept of a root instance so you can "initialize" the object that is calling the XIML loader. This allows a whole host of scenarios that are quite nice. Either XIML can create a root node and return it to you from the markup file or you can use it for initialization and your object can subclass a Node class. This means its easier to make your objects seamlessly look like built-in JavaFX Node classes.

Code Generation

I have not had time to work on this. But you can code generate out the object graph into java code and use aspects to have a tree partial class setup.


MongoDB Logo MongoDB