-
- All Known Implementing Classes:
ToolkitServiceImpl
public interface ToolkitServiceInterface that handles setting up anApplication,Stage,Scene, orrootNodeand application cleanup on theJavaFX Application Thread.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Future<Void>cleanupApplication(Application application)CallsApplicationService.stop(Application)on the given application.Future<Application>setupApplication(Supplier<Stage> stageSupplier, Class<? extends Application> applicationClass, String... applicationArgs)Creates, initializes, and starts the given applicationClass and returns aFuturewhoseFuture.get()returns the created application.Future<Application>setupApplication(Supplier<Stage> stageSupplier, Supplier<Application> applicationSupplier, String... applicationArgs)Creates, initializes, and starts the supplied application and returns aFuturewhoseFuture.get()returns the created application.Future<Void>setupFixture(Runnable runnable)Runs the given runnable on theJavaFX Application Thread.<T> Future<T>setupFixture(Callable<T> callable)Runs the given callable on theJavaFX Application Thread.Future<Stage>setupPrimaryStage(CompletableFuture<Stage> primaryStageFuture, Class<? extends Application> applicationClass, String... applicationArgs)If the givenCompletableFuture.isDone(), returns that future; otherwise, launches the given application with its arguments.Future<Scene>setupScene(Stage stage, Supplier<? extends Scene> sceneSupplier)Sets the given scene as the given stage's scene on theJavaFX Application Threadand returns aFuturewhoseFuture.get()returns the given scene.Future<Parent>setupSceneRoot(Stage stage, Supplier<? extends Parent> sceneRootSupplier)Wraps the parent in a scene, sets that scene as the given stage's scene on theJavaFX Application Thread, and returns aFuturewhoseFuture.get()returns the given parent.Future<Stage>setupStage(Stage stage, Consumer<Stage> stageConsumer)Calls the stageConsumer with the given stage on theJavaFX Application Threadand returns aFuturewhoseFuture.get()returns that stage.
-
-
-
Method Detail
-
setupPrimaryStage
Future<Stage> setupPrimaryStage(CompletableFuture<Stage> primaryStageFuture, Class<? extends Application> applicationClass, String... applicationArgs)
If the givenCompletableFuture.isDone(), returns that future; otherwise, launches the given application with its arguments.
-
setupFixture
Future<Void> setupFixture(Runnable runnable)
Runs the given runnable on theJavaFX Application Thread.
-
setupFixture
<T> Future<T> setupFixture(Callable<T> callable)
Runs the given callable on theJavaFX Application Thread.
-
setupStage
Future<Stage> setupStage(Stage stage, Consumer<Stage> stageConsumer)
Calls the stageConsumer with the given stage on theJavaFX Application Threadand returns aFuturewhoseFuture.get()returns that stage.
-
setupScene
Future<Scene> setupScene(Stage stage, Supplier<? extends Scene> sceneSupplier)
Sets the given scene as the given stage's scene on theJavaFX Application Threadand returns aFuturewhoseFuture.get()returns the given scene.
-
setupSceneRoot
Future<Parent> setupSceneRoot(Stage stage, Supplier<? extends Parent> sceneRootSupplier)
Wraps the parent in a scene, sets that scene as the given stage's scene on theJavaFX Application Thread, and returns aFuturewhoseFuture.get()returns the given parent.
-
setupApplication
Future<Application> setupApplication(Supplier<Stage> stageSupplier, Class<? extends Application> applicationClass, String... applicationArgs)
Creates, initializes, and starts the given applicationClass and returns aFuturewhoseFuture.get()returns the created application.
-
setupApplication
Future<Application> setupApplication(Supplier<Stage> stageSupplier, Supplier<Application> applicationSupplier, String... applicationArgs)
Creates, initializes, and starts the supplied application and returns aFuturewhoseFuture.get()returns the created application.
-
cleanupApplication
Future<Void> cleanupApplication(Application application)
CallsApplicationService.stop(Application)on the given application.
-
-