Class FXExecutor
java.lang.Object
madkit.gui.FXExecutor
Provides a wrapper around the JavaFX
Platform
class with additional
functionality for managing calls to the JavaFX Platform.
Since MaDKit is not a JavaFX application per se, it needs to manage the JavaFX Platform
lifecycle. So, the JavaFX Platform is automatically started when the environment is not
in headless mode. This class provides methods to run actions on the JavaFX application
thread. Especially, it provides a way to run actions on the JavaFX thread and wait for
completion. This is useful when performing rendering actions in simulation.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
Returns whether the application is running in headless mode.static boolean
Returns whether the JavaFX Platform has started.static void
runAndWait
(Runnable action) Runs the specifiedRunnable
on the JavaFX application thread and waits for completion.static void
Runs the specifiedRunnable
on the JavaFX application thread at some unspecified time in the future.
-
Method Details
-
runAndWait
Runs the specifiedRunnable
on the JavaFX application thread and waits for completion.- Parameters:
action
- theRunnable
to run- Throws:
NullPointerException
- ifaction
isnull
-
runLater
-
isHeadlessMode
public static boolean isHeadlessMode()Returns whether the application is running in headless mode.- Returns:
true
if the application is in headless mode,false
otherwise
-
isStarted
public static boolean isStarted()Returns whether the JavaFX Platform has started.- Returns:
true
if the JavaFX Platform has started
-