JavaFX: Bringing Rich Experiences To All the Screens Of Your Life

Profile: desktop, common

Overview

FX, analogous to java.lang.System, is a place to store static utility methods.

Profile: common

Inherited Variables

Constructor Summary

public FX()
Returns
 

Method Summary

public static int addShutdownAction(com.sun.javafx.functions.Function0 action)

Adds an action to the queue to be executed at FX.exit() time This action will be added to the queue as a push stack, meaning that they will be excuted in FILO ordering.

Adds an action to the queue to be executed at FX.exit() time This action will be added to the queue as a push stack, meaning that they will be excuted in FILO ordering. Duplicate actions are not allowed and will cause the orignal Handle to be returned with no reordering.

Parameters
action

of type function():Void that will be executed at FX.exit() time. Only one copy of an action can be in the queue, an attempt to add the same action a second time will return the previous Handle without any reodering.

Returns
int
Handle used to remove the action if needed.
Throws
java.lang.NullPointerException if the action if null

Profile: common

 
public static void deferAction(com.sun.javafx.functions.Function0 action)

A deferAction represents an action that should be executed at a later time of the system's choosing.

A deferAction represents an action that should be executed at a later time of the system's choosing.

In systems based on event dispatch, such as Swing, execution of a deferAction generally means putting it on the event queue for later processing.

Parameters
action

of type function():Void that will be executed later based on the implementation.

Throws
java.lang.NullPointerException if the action if null

Profile: common

 
public static void exit()

Exits the Script and causes any Shutdown Actions to be called This may cause the Runtime to exit as System.exit() depending on the underlying implementation.

Exits the Script and causes any Shutdown Actions to be called This may cause the Runtime to exit as System.exit() depending on the underlying implementation.

Any Shutdown Actions that were previously added using the addShutdownAction() function will be exectued at this time in LIFO ordering.

A second call to FX.exit() once FX.exit() has started will result a IllegalStateException to be thrown, this can occur if a Timeline calls FX.exit() while FX.exit is started. If a call to FX.exit() occurs in a Shutdown Action, that action's function will simply exit without completing the rest of its operation and the next Shutdown Action, if any, will run.

This function will not normally return to the calling Script.

Throws
java.lang.IllegalStateException when called during the process of exiting.

Profile: common

 
public static java.lang.Object getArgument(java.lang.String name)

Returns the named incoming argument for the current JavaFX Script program; this is used for certain environments (in particular, applets) where incoming arguments are represented as name/value pairs.

Returns the named incoming argument for the current JavaFX Script program; this is used for certain environments (in particular, applets) where incoming arguments are represented as name/value pairs. This usually returns a String, but some environments may return other kinds of values. Accepts numbers in the form of Strings (e.g. getArgument("0")) to provide unification with getArguments. Returns null if the given named argument does not exist.

getArgument("javafx.applet") will return the underlying applet that is used to run the JavaFX script application inside the browser. This is an experimental facility, that may be changed in future versions.

This can be used as follows:

var applet = FX.getArgument("javafx.applet") as java.applet.Applet;

Once the applet is obtained, there are 4 suggested ways to use it

  1. to invoke AppletContext's showDocument() method(s)
  2. to invoke AppletContext's showStatus() method
  3. to retrieve the JSObject to interact with JavaScript in the page
  4. to retrieve the DOM object using bootstrapping mechanism in the new plugin

getArgument("javafx.applet") will return null if not running as an applet

Parameters
name
Returns
Object
a string representing the value for named or numeric argument, or null if given name does not exist.

Profile: common

 
public static com.sun.javafx.runtime.sequence.Sequence getArguments()

For JavaFX Script applications that are started on the command line,running application.

For JavaFX Script applications that are started on the command line,running application. This will return Unamed Arguments

Returns
Sequence
Sequence of commandline args as strings, this will return null under the following conditions: <ul> <li>No Incoming arguments on Command line</li> <li>Only Name, Value pairs on the Command line</li> </ul>

Profile: common

&nbsp;
public static java.lang.String getProperty(java.lang.String key)

Gets the system property indicated by the specified key.

Gets the system property indicated by the specified key.

System Properties in JavaFX environment can be classified into 2 types:

1. Runtime platform associated property. Those properties have an equivalent in current java runtime environment (SE/ME). The FX.getProperty() method retrieves those properties by mapping specified key with runtime platform key.
If there is a security manager, property access permission is checked. This may result in a SecurityException.

2. JavaFX specific property. Those properties are specific to JavaFX environment therefore value of the properties is specified in the JavaFX tree.


This set of system properties always includes values for the following keys:

Key Description of Associated Value
javafx.version JavaFX release version - javafx specific property
javafx.application.codebase Application codebase - javafx specific property
javafx.java.version Java Runtime Environment version
javafx.java.vendor Java Runtime Environment vendor
javafx.java.vendor.url Java vendor URL
javafx.java.io.tmpdir Default temp file path
javafx.java.ext.dirs Path of extension directory or directories
javafx.os.name Operating system name
javafx.os.arch Operating system architecture
javafx.os.version Operating system version
javafx.file.separator File separator
javafx.path.separator Path separator
javafx.line.separator Line separator
javafx.user.home User's home directory
javafx.user.dir User's current working directory
javafx.timezone User's timezone
javafx.language User's language
javafx.region User's region
javafx.encoding User's encoding

Parameters
key
Environment Property to be inquired
Returns
String
The string value of the property
Throws
java.lang.SecurityException if a security manager exists and its checkPropertyAccess method doesn't allow access to the specified system property.
java.lang.NullPointerException if key is null.

Profile: common

&nbsp;
public static boolean isInitialized(java.lang.Object varRef)

Test if an instance variable has been initialized.

Test if an instance variable has been initialized.

Parameters
varRef
The variable to be tested.
Returns
boolean
true if the object has been initialized
&nbsp;
public static boolean isSameObject(java.lang.Object a, java.lang.Object b)

Compare two JavaFX Script Objects

Compare two JavaFX Script Objects

Parameters
a
the first object to be compared
b
the second object to compare
Returns
boolean
true if they are the same object
&nbsp;
public static void print(java.lang.Object val)

Print the Object 'val'.

Print the Object 'val'.

Parameters
val
The Object to be printed
&nbsp;
public static void println(java.lang.Object val)

Print the Object 'val' and a new-line.

Print the Object 'val' and a new-line.

Parameters
val
The Object to be printed
&nbsp;
public static boolean removeShutdownAction(int handle)

Removes the action from the queue specified by the actionType parameter.

Removes the action from the queue specified by the actionType parameter.

Parameters
handle

of type function():Void that will be removed from the Shutdown Action Stack

Returns
boolean
a Boolean value signifing sucess or failure of removing the action

Profile: common

&nbsp;

Inherited Functions




Spec-Zone.ru - all specs in one place