@Unstable public class ToolkitServiceImpl extends Object implements ToolkitService
Constructor and Description |
---|
ToolkitServiceImpl(ApplicationLauncher applicationLauncher,
ApplicationService applicationService) |
Modifier and Type | Method and Description |
---|---|
Future<Void> |
cleanupApplication(Application application)
Calls
ApplicationService.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 a
Future whose
Future.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 a
Future whose
Future.get() returns the created application. |
<T> Future<T> |
setupFixture(Callable<T> callable)
Runs the given callable on the
JavaFX Application Thread . |
Future<Void> |
setupFixture(Runnable runnable)
Runs the given runnable on the
JavaFX Application Thread . |
Future<Stage> |
setupPrimaryStage(PrimaryStageFuture primaryStageFuture,
Class<? extends Application> applicationClass,
String... applicationArgs)
If the given
AbstractFuture.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 the
JavaFX Application Thread and returns a
Future whose Future.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 the
JavaFX Application Thread , and returns a Future whose Future.get() returns
the given parent. |
Future<Stage> |
setupStage(Stage stage,
Consumer<Stage> stageConsumer)
Calls the stageConsumer with the given stage on the
JavaFX Application Thread and returns a
Future whose Future.get() returns that stage. |
public ToolkitServiceImpl(ApplicationLauncher applicationLauncher, ApplicationService applicationService)
public Future<Stage> setupPrimaryStage(PrimaryStageFuture primaryStageFuture, Class<? extends Application> applicationClass, String... applicationArgs)
ToolkitService
AbstractFuture.isDone()
, returns that future; otherwise, launches the given application
with its arguments.setupPrimaryStage
in interface ToolkitService
public Future<Void> setupFixture(Runnable runnable)
ToolkitService
JavaFX Application Thread
.setupFixture
in interface ToolkitService
public <T> Future<T> setupFixture(Callable<T> callable)
ToolkitService
JavaFX Application Thread
.setupFixture
in interface ToolkitService
public Future<Stage> setupStage(Stage stage, Consumer<Stage> stageConsumer)
ToolkitService
JavaFX Application Thread
and returns a
Future
whose Future.get()
returns that stage.setupStage
in interface ToolkitService
public Future<Scene> setupScene(Stage stage, Supplier<? extends Scene> sceneSupplier)
ToolkitService
JavaFX Application Thread
and returns a
Future
whose Future.get()
returns the given scene.setupScene
in interface ToolkitService
public Future<Parent> setupSceneRoot(Stage stage, Supplier<? extends Parent> sceneRootSupplier)
ToolkitService
JavaFX Application Thread
, and returns a Future
whose Future.get()
returns
the given parent.setupSceneRoot
in interface ToolkitService
public Future<Application> setupApplication(Supplier<Stage> stageSupplier, Class<? extends Application> applicationClass, String... applicationArgs)
ToolkitService
Future
whose
Future.get()
returns the created application.setupApplication
in interface ToolkitService
public Future<Application> setupApplication(Supplier<Stage> stageSupplier, Supplier<Application> applicationSupplier, String... applicationArgs)
ToolkitService
Future
whose
Future.get()
returns the created application.setupApplication
in interface ToolkitService
public Future<Void> cleanupApplication(Application application)
ToolkitService
ApplicationService.stop(Application)
on the given application.cleanupApplication
in interface ToolkitService