-
- All Known Implementing Classes:
ToolkitServiceImpl
public interface ToolkitService
Interface that handles setting up anApplication
,Stage
,Scene
, orrootNode
and application cleanup on theJavaFX Application Thread
.
-
-
Method Summary
Modifier and Type Method Description Future<Void>
cleanupApplication(javafx.application.Application application)
CallsApplicationService.stop(Application)
on the given application.Future<javafx.application.Application>
setupApplication(Supplier<javafx.stage.Stage> stageSupplier, Class<? extends javafx.application.Application> applicationClass, String... applicationArgs)
Creates, initializes, and starts the given applicationClass and returns aFuture
whoseFuture.get()
returns the created application.Future<javafx.application.Application>
setupApplication(Supplier<javafx.stage.Stage> stageSupplier, Supplier<javafx.application.Application> applicationSupplier, String... applicationArgs)
Creates, initializes, and starts the supplied application and returns aFuture
whoseFuture.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<javafx.stage.Stage>
setupPrimaryStage(CompletableFuture<javafx.stage.Stage> primaryStageFuture, Class<? extends javafx.application.Application> applicationClass, String... applicationArgs)
If the givenCompletableFuture.isDone()
, returns that future; otherwise, launches the given application with its arguments.Future<javafx.scene.Scene>
setupScene(javafx.stage.Stage stage, Supplier<? extends javafx.scene.Scene> sceneSupplier)
Sets the given scene as the given stage's scene on theJavaFX Application Thread
and returns aFuture
whoseFuture.get()
returns the given scene.Future<javafx.scene.Parent>
setupSceneRoot(javafx.stage.Stage stage, Supplier<? extends javafx.scene.Parent> sceneRootSupplier)
Wraps the parent in a scene, sets that scene as the given stage's scene on theJavaFX Application Thread
, and returns aFuture
whoseFuture.get()
returns the given parent.Future<javafx.stage.Stage>
setupStage(javafx.stage.Stage stage, Consumer<javafx.stage.Stage> stageConsumer)
Calls the stageConsumer with the given stage on theJavaFX Application Thread
and returns aFuture
whoseFuture.get()
returns that stage.
-
-
-
Method Detail
-
setupPrimaryStage
Future<javafx.stage.Stage> setupPrimaryStage(CompletableFuture<javafx.stage.Stage> primaryStageFuture, Class<? extends javafx.application.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<javafx.stage.Stage> setupStage(javafx.stage.Stage stage, Consumer<javafx.stage.Stage> stageConsumer)
Calls the stageConsumer with the given stage on theJavaFX Application Thread
and returns aFuture
whoseFuture.get()
returns that stage.
-
setupScene
Future<javafx.scene.Scene> setupScene(javafx.stage.Stage stage, Supplier<? extends javafx.scene.Scene> sceneSupplier)
Sets the given scene as the given stage's scene on theJavaFX Application Thread
and returns aFuture
whoseFuture.get()
returns the given scene.
-
setupSceneRoot
Future<javafx.scene.Parent> setupSceneRoot(javafx.stage.Stage stage, Supplier<? extends javafx.scene.Parent> sceneRootSupplier)
Wraps the parent in a scene, sets that scene as the given stage's scene on theJavaFX Application Thread
, and returns aFuture
whoseFuture.get()
returns the given parent.
-
setupApplication
Future<javafx.application.Application> setupApplication(Supplier<javafx.stage.Stage> stageSupplier, Class<? extends javafx.application.Application> applicationClass, String... applicationArgs)
Creates, initializes, and starts the given applicationClass and returns aFuture
whoseFuture.get()
returns the created application.
-
setupApplication
Future<javafx.application.Application> setupApplication(Supplier<javafx.stage.Stage> stageSupplier, Supplier<javafx.application.Application> applicationSupplier, String... applicationArgs)
Creates, initializes, and starts the supplied application and returns aFuture
whoseFuture.get()
returns the created application.
-
cleanupApplication
Future<Void> cleanupApplication(javafx.application.Application application)
CallsApplicationService.stop(Application)
on the given application.
-
-