JavaFX 1.3 SDK
NetBeans JavaFX support is bundled with JavaFX 1.3 SDK. The Composer tool now also supports this new SDK. Composer includes new controls and resources for JavaFX 1.3. See the palette screenshot for a complete list.
New experimental Controls:
- Popup Menu
- Menu Button
- Split Menu Button
- Menu Item
- Check Menu Item
- Radio Menu Item
- Custom Menu Item
- Tool Bar
- Tree View
- Tree Cell
- Image Cursor
- Parallel Camera
- Perspective Camera
- List Cell Factory
- Tree Cell Factory
There are various kinds of Menus available. You can D'n'D then into the design like any other component.
The Menus have customizers so you can quickly create menu structure. Customizers include a few predefined templates.
Note: A customizer always deletes the previous Menu structure (including all assigned actions, ...) and replaces it with the new one.
Starting with JavaFX 1.3 SDK, the List View component has a cellFactory property that allows you to specify a factory for list cells used for rendering list items.
To use the cellFactory property, select a List View and press the "Add" button next to the "Cell Factory" property. This creates a List Cell Factory, including a List Cell that contains a Label to render a list item exactly the same way as it does without a custom cell factory.
If you want to change only the rendered text of a list item, create a custom cell factory, select its Label and edit the binding code of its "Text" property.
The Tree View is a new experimantal component in JavaFX 1.3 SDK. It can be used in a similar way as List View. It has a "Cell Factory" property. The "Root" property allows you to specify the tree items. The "Root" property editor allows you to specify a tree-like structure of items using indented text.
Customizable component include Menu, Data Source, Color, Templates, and JavaFX Graphics. Customizable components have a "Customize..." button at the top part of the Properties window.
Pressing the "Add" button next to the property in the Properties window previously only created the resource and assigned it to the property. Now it also selects the newly created resource so the Navigator and Properties windows are updated for it.
The color property editor is improved to allow you to specify a color using:
- An existing Resource (i.e. Color, Linear Gradient, Radial Gradient)
- A new Resource, which you then create
- A predefined value i.e. BLACK or WHITE
- Inline typing of a specific value in one of the following formats:
- colorname e.g. BLUE
- webcolor e.g. 0xFF0080 or #8000FF
- r,g,b,a as float e.g. 1.0, 0.0, 0.0, 1.0 (the alpha parameter is optional)
- r,g,b,a as hex-numbers e.g. 0x80, 0xFF, 0x00, 0.5 (the alpha is specified as an optional float parameter)
Note that the Color resource now has a customizer as well.
Data Sources Improvements
The customizer for data sources has been improved to show raw data that are read before parsing.
You may expand/collapse all items in the tree-view of the parsed-data as well as find an item with a specific value and copy it.
The expressions of child Data Sources can be edited.
The expression for specifying a child Filter Data Source has XPath-like notation.
The following document contains the Query Language specification:
The following docuemnt contains examples of the Query Language:
HTTP Data Source
Allows you to pass query parameters using the requestParams property.
File Data Source
The FileDataSource has been split into 3 independent datasources:
- ClassDataSource - resources on classpath
- FileDataSource - files on local filesystems
- StorageDataSource - resources within Java Storage API
The new Properties parser allows you to parse the input stream in a Java .properties file format.
A RecordSet.dump() method has been added for easier debugging.
Data Source vs. List View
The "DataSource.recordDisplayName" property has been removed. The property was used as a workaround for the missing list-cell rendering ability. This workaround is no longer needed because the List View has the "Cell Factory" property now.
If you want to specify a custom rendering of a Record in a List View, then:
- Create a List View and bind its Items to your DataSource.
- Press the "Add" button next to the "Cell Factory" property.
- Select the Label component within the created cellFactory and listCell component.
- Open the details property editor of the "Text" property of the label.
- Change the bind code of the property to your custom display name.
List View in Templates
Often List View items represent a sequence of Records from a DataSource. List Views have a selectedItem property, which in this case references the currently selected Record.
An "Index Buttons" template allows you to move a selected index within the List View so its selection can be manipulated by Buttons.
All existing List View components are now listed in a Desktop/Mobile Form template customizer as a Data Source. This way you may create a Form that shows details of a currently selected Record in a List View.
JavaFX FXD/Z Graphics
JavaFX Graphics files are recognized within your project files and automatically placed into the "Current Project - JavaFX Graphics Files" category in the Palette. You may D'n'D these graphics files into a design. Then a customizer dialog appears.
The customizer parses the D'n'D Graphics file for elements with IDs. These elements are listed. You can check/uncheck particular elements. Note that by default the customizer always keeps the current content. This means you usually have to press the "Select As Detected" button so only the items detected in the file are checked. Pressing OK creates a structure of checked elements in Navigator.
You may check the Graphics component or its children and change their properties in any state. This way you may control the visualization of Graphics in your design based on states.
Note that if you invoke the customizer again, it tries to parse the Graphics file again. This is useful when receiving a newer version of a Graphics file.
Improved Component Visualization
If you D'n'D an existing component into a Container such as an HBox or Tile, additional guidelines appear to visualize the place or position where the component is going to be placed.
Similar behavior occurs when you D'n'D a new component from the Palette to a Container in the Design view.
A runner script file (usually Main_run.fx class) is not generated anymore. Its content has been integrated into the .fx script file of your design. This file is now runnable.
The generated code style has been aligned with the JavaFX 1.3 SDK. This means the following changes:
- All components are declared using a "def" statement.
- The "init" constructor is placed within the guarded-block section. If you want to execute something during initialization, use the "postinit" constructor to specify your code.
- JavaFX FXD Graphics and recognized components from .fxd/z files are loaded from an FXDContent instance. The properties of these components are initialized in the master state, in the "init" constructor.
- LayoutInfo instances are created and assigned whenever a component is modified in any state. The LayoutInfo is declared as a separate "def" statement and is referenced directly in generated Timelines that represent state transitions.
- Cell Factories are represented as functions. Note that components within a cell factory resource do not support states, therefore no state-related code is generated.
- Custom code can be specified as a function that is called from the instance block or a KeyValue to resolve the new value. The function is placed outside of the guarded-block section and can be freely modified by a user.
- Bind code can be specified as a "var" variable that is bound from the instance block. The variable is placed outside of the guarded-block section and can be freely modified by a user.
Some of the properties of controls in JavaFX, such as Node.layoutInfo.width, do not have default values. If a specific value is assigned to such a property in one state while leaving the value as default in a second state, the Composer tool cannot set the property in the second state. A new Analyzer tool finds all cases where this problem occurs.
The following samples have been added:
- Weather and Maps (aka Location Info) - demonstrates query language, binding and multiple Data Sources
- NetBeans Logo - Uses NetBeans Logo created in Adobe Illustrator, converted to fxd using JavaFX Production Suite and then used in various animations