Overview
FX, analogous to java.lang.System, is a place to store static utility methods.
Profile: common
Inherited Variables
Constructor Summary
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 atFX.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.
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
In systems based on event dispatch, such as Swing, execution of adeferAction
represents an action that should be executed at a later time of the system's choosing.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.
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()
onceFX.exit()
has started will result aIllegalStateException
to be thrown, this can occur if aTimeline
callsFX.exit()
while FX.exit is started. If a call toFX.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.
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 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
- to invoke AppletContext's showDocument() method(s)
- to invoke AppletContext's showStatus() method
- to retrieve the JSObject to interact with JavaScript in the page
- 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
- 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.screen.width
Screen width (pixels) - javafx specific property
javafx.screen.height
Screen height (pixels) - 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
Profile: common
- public static boolean isInitialized(java.lang.Object varRef)
- public static boolean isSameObject(java.lang.Object a, java.lang.Object b)
- public static void print(java.lang.Object val)
- public static void println(java.lang.Object val)
- 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