JavaFX 1.1 API | Overview | Java FX
javafx.animation |
Provides the set of classes for the time-based animation framework. Provides the set of classes for the time-based animation framework. This framework defines a mapping of time to values for the target variable. This variable transitions between the declared values at certain points in time, by using the declared interpolation function to calculate the in-between value. |
javafx.animation.transition |
Provides the set of classes for ease of use transition based animations. Provides the set of classes for ease of use transition based animations. It offers a simple framework for incorporating animations onto an internal Timeline. It also provides high level constructs to compose the effects of multiple animations. |
javafx.async | |
javafx.data.pull | |
javafx.data.xml | |
javafx.ext.swing |
Provides the set of graphical user interface component classes that, to the maximum degree possible, work the same on all platforms. Provides the set of graphical user interface component classes that, to the maximum degree possible, work the same on all platforms. |
javafx.fxd |
Provides functionality to load JavaFX content files (FXD and FXZ format) generated by JavaFX Production Suite. Provides functionality to load JavaFX content files (FXD and FXZ format) generated by JavaFX Production Suite. JavaFX content format contains text descriptions of the graphical content of the JavaFX application. Descriptions are loaded by this package into the application during runtime. JavaFX content format exists in two forms, FXD and FXZ. FXD is a textual format using the same object literal syntax as JavaFX Script, so it is possible to copy and paste the descriptions from the FXD file directly to the JavaFX Script code (with some exceptions noted at the end of this document). Here is an example of a simple FXD file: Group { id: "face" content: [ Circle { id:"background" centerX:40 centerY:40 radius:39 fill:Color.YELLOW stroke:Color.BLACK strokeWidth:3.0}, Circle { centerX:25 centerY:30 radius:5 fill: Color.BLACK}, Circle { centerX:55 centerY:30 radius:5 fill: Color.BLACK}, Line{ startX:32 startY:23 endX:16 endY:15 stroke:Color.BLACK strokeWidth:4.0}, Line{ startX:45 startY:23 endX:61 endY:15 stroke:Color.BLACK strokeWidth:4.0}, QuadCurve { id: "mouth" stroke:Color.BLACK strokeWidth:3.0 fill: Color.TRANSPARENT startX:20 startY:60 endX:60 endY:60 controlX:40 controlY:80 } ] }The content is loaded using the javafx.fxd.FXDLoader class. It can be inserted into the scene graph using this snipped of code: var group:Group .... // a graphics group defined elsewhere var smileyNode = FXDLoader.load("{__DIR__}smiley.fxd"}; // loads the content insert smileyNode into group.content; // inserts the smiley into the groupThe FXD format currently supports all classes from the graphical Javafx packages. Details are provided at the end of this document. Here are the properties of FXD format, in contrast to JavaFX Script code:
{__DIR__} magic variable.
The following example demonstrates referencing embedded font and image files in the FXD description. All of the files are stored in an FXZ file called mygfx.fxz :
Group { content: [ ImageView { x: 10 y: 10 image: Image{ url: "{__DIR__}myimage.png"} }, Text { fill: Color.WHITE x: 20 y: 20 textOrigin: TextOrigin.TOP font: Font.fontFromURL("{__DIR__}myfont.ttf", 25.00) content: "Welcome !!!" }, ] }In the above example, the group contains two nodes - ImageView with
Image , which
loads its content from the myimage.png file. The other node is a Text
node and it uses a custom font with size 25. The font is loaded from the myfont.ttf
file. Both, the image and the font files are located in the same
directory as the mygfx.fxd file itself.
FXZ is simply a compressed version of the FXD content using zip compression
and file format. The FXZ file can also contain embedded assets, such as images or fonts. The structure of the FXZ file from the example above is as follows:
>
mygfx.fxz +- content.fxd +- myimage.png +- myfont.ttf +- ...The content.fxd file is the main content of the FXZ archive, containing the description of the graphic objects. The other
files, myimage.png and myfont.ttf are the embedded image and font assets.
FXZ files can be loaded in exactly the same way as FXD files, using
the javafx.fxd.FXDLoader class.
FXD Format Syntax Details
FXD format follows the same object literals syntax as JavaFX Script.
Besides object literals, constructor functions (such as Font.font) are supported. This
makes FXD format highly compatible with JavaFX Script, and it
is possible to copy the FXD content directly to the JavaFX script code (with the exception
of the Font.fontFromURL construct, which does not have a JavaFX Script equivalent).
The differences between FXD format and JavaFX Script code are the following:
//@version tag at the beginning of the FXD
file. For example:
//@version 1.0 |
javafx.geometry | |
javafx.io.http | |
javafx.lang |
This package provides JavaFX Script Runtime APIs This package provides JavaFX Script Runtime APIs
BuiltinsThis class is automatically imported to all JavaFX ScriptsFXThe FX class contains number of static entry points for a couple of different API sets provided by JavaFX Script.
|
javafx.reflect |
Provides reflective access to JavaFX values and types. Provides reflective access to JavaFX values and types. This packages defines a Java API (rather than a JavaFX API), so it can be used from both Java and JavaFX code. A future JavaFX API may be layered on top of this. ContextThe objects in this package are directly or indirectly created from a FXContext. In the default case there is a singleFXContext instance that
uses Java reflection. You get one of these by doing:
FXLocal.Context ctx = FXLocal.getContext();Alternatively, you can do: FXContext ctx = FXContext.getInstance();The latter is more abstract (as it supports proxying for remote VMs) but the more specific FXLocal.Context supports some extra
operations that only make sense for same-VM reflection.
ValuesThe various reflection operations do not directly use Java values. Instead, an javafx.reflect.FXObjectValue is ahandleor proxy for an Object . This extra layer of indirection
isn't needed in many cases, bur it is useful for remote invocation,
remote control, or in general access to data in a different VM.
Object creationTo do the equivalent of the JavaFX code:you can do:var x = ...; var z = Foo { a: 10; b: bind x.y }; FXContext rcontext = ...; FXClassType cls = rcontext.findClass(...); FXObjectValue x = ...; FXObjectValue z = cls.allocation(); z.initVar("a", ???); z.bindVar("b", ???); z = obj.initialize(); Sequence operationsUse javafx.reflect.FXSequenceBuilder to create a new sequence. To get the number of items in a sequence, use ValueRef.getItemCount. To index into a sequence, use ValueRef.getItem. Design notes and issuesSome design principles, influenced by the "Mirrored reflection" APIs (Bracha and Ungar: Mirrors: Design Principles for Meta-level Facilities of Object-Oritented Programming Languages, OOPSLA 2004), and JDI :
Limitations
|
javafx.scene |
Provides the set of base classes for the JavaFX Scene Graph API. Provides the set of base classes for the JavaFX Scene Graph API. This package includes the Scene class, which defines the scene to be rendered. It also includes the base Node class, a Group class that contains a sequence of child nodes for rendering, and a CustomNode class for defining Node subclasses that create internal nodes as content. Nodes are connected in a scene graph, which is a tree-like data structure where each item in the tree has zero or one parent. Each node is either a "leaf" node with no child nodes or a "branch" with zero or more child nodes. |
javafx.scene.control | |
javafx.scene.effect |
Provides the set of classes for attaching graphical filter effects to JavaFX Scene Graph Nodes. Provides the set of classes for attaching graphical filter effects to JavaFX Scene Graph Nodes. An effect is a graphical algorithm that produces an image, typically
as a modification of a source image.
An effect can be associated with a scene graph |
javafx.scene.effect.light |
Provides the set of classes for light source implementations needed for the Lighting effect. Provides the set of classes for light source implementations needed for the Lighting effect. |
javafx.scene.image |
Provides the set of classes for loading and displaying images. Provides the set of classes for loading and displaying images.
|
javafx.scene.input |
Provides the set of classes for mouse and keyboard input event handling. Provides the set of classes for mouse and keyboard input event handling. |
javafx.scene.layout |
Provides the set of control classes for a layout framework that holds or organizes the nodes within it. Provides the set of control classes for a layout framework that holds or organizes the nodes within it. |
javafx.scene.media |
Provides the set of classes for integrating audio and video into JavaFX Applications. Provides the set of classes for integrating audio and video into JavaFX Applications. Currently, the primarily used for this package is media playback. There are 3 essential classes in the Media Package: Media, MediaPlayer, and MediaView.
This is an example of a simple media player application:
The |
javafx.scene.paint |
Provides the set of classes for colors and gradients used to fill shapes and backgrounds when rendering the scene graph. Provides the set of classes for colors and gradients used to fill shapes and backgrounds when rendering the scene graph. |
javafx.scene.shape |
Provides the set of 2D classes for defining and performing operations on objects related to two-dimensional geometry. Provides the set of 2D classes for defining and performing operations on objects related to two-dimensional geometry. |
javafx.scene.text |
Provides the set of classes for fonts and renderable Text Node. Provides the set of classes for fonts and renderable Text Node. |
javafx.scene.transform |
Provides the set of convenient classes to perform rotating, scaling,
shearing, and translation transformations for Provides the set of convenient classes to perform rotating, scaling,
shearing, and translation transformations for |
javafx.stage |
Provides the top-level container classes for JavaFX scripts. Provides the top-level container classes for JavaFX scripts. This package encapsulates the JavaFX graphical script surroundings for the Stage - Scene metaphor, with different capabilites available to the Stage depending on the underlying semantics of the runtime container. The JavaFX TM Stage interface provides
interfaces and classes for the environment and presentation of JavaFX
script instantiations. The stage presentation specifics for each
JavaFX runtime platform will allow a script to be presented on different
platforms with consistent functionality across each runtime. The main areas of functionality of
|
javafx.util |