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():Voidthat 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
deferActionrepresents 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 adeferActionrepresents an action that should be executed at a later time of the system's choosing.deferActiongenerally means putting it on the event queue for later processing.-
Parameters
- action
-
of type
function():Voidthat 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 aIllegalStateExceptionto be thrown, this can occur if aTimelinecallsFX.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.versionJavaFX release version - javafx specific propertyjavafx.application.codebaseApplication codebase - javafx specific propertyjavafx.screen.widthScreen width (pixels) - javafx specific propertyjavafx.screen.heightScreen height (pixels) - javafx specific propertyjavafx.java.versionJava Runtime Environment versionjavafx.java.vendorJava Runtime Environment vendorjavafx.java.vendor.urlJava vendor URLjavafx.java.io.tmpdirDefault temp file pathjavafx.java.ext.dirsPath of extension directory or directoriesjavafx.os.nameOperating system namejavafx.os.archOperating system architecturejavafx.os.versionOperating system versionjavafx.file.separatorFile separatorjavafx.path.separatorPath separatorjavafx.line.separatorLine separatorjavafx.user.homeUser's home directoryjavafx.user.dirUser's current working directoryjavafx.timezoneUser's timezonejavafx.languageUser's languagejavafx.regionUser's regionjavafx.encodingUser'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():Voidthat will be removed from the Shutdown Action Stack
-
Returns
- boolean
- a Boolean value signifing sucess or failure of removing the action
Profile: common