本文整理汇总了Java中org.testfx.api.FxToolkit.setupStage方法的典型用法代码示例。如果您正苦于以下问题:Java FxToolkit.setupStage方法的具体用法?Java FxToolkit.setupStage怎么用?Java FxToolkit.setupStage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.testfx.api.FxToolkit
的用法示例。
在下文中一共展示了FxToolkit.setupStage方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setup
import org.testfx.api.FxToolkit; //导入方法依赖的package包/类
@Before
public void setup() throws Exception {
if (Platform.isFxApplicationThread()) throw new AssertionError("Invalid test state");
Thread.setDefaultUncaughtExceptionHandler(HANDLER);
FxToolkit.registerPrimaryStage();
// FxToolkit.registerStage(() -> new Stage(StageStyle.TRANSPARENT));
FxToolkit.setupSceneRoot(() -> {
if (!Platform.isFxApplicationThread()) throw new AssertionError("Invalid test state");
Thread.currentThread().setUncaughtExceptionHandler(HANDLER);
pane = target.createPane();
pane.setId(ID);
return pane;
});
FxToolkit.setupStage(Window::sizeToScene);
FxToolkit.showStage();
}
示例2: setupMainWindowHandle
import org.testfx.api.FxToolkit; //导入方法依赖的package包/类
/**
* Encapsulates the primary stage of {@code TestApp} in a {@code MainWindowHandle} and returns it.
*/
public MainWindowHandle setupMainWindowHandle() {
try {
FxToolkit.setupStage((stage) -> {
mainWindowHandle = new MainWindowHandle(stage);
mainWindowHandle.focus();
});
FxToolkit.showStage();
} catch (TimeoutException te) {
throw new AssertionError("Stage takes too long to set up.");
}
return mainWindowHandle;
}
示例3: setUp
import org.testfx.api.FxToolkit; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {
guiRobot.interact(() -> helpWindow = new HelpWindow());
Stage helpWindowStage = FxToolkit.setupStage((stage) -> stage.setScene(helpWindow.getRoot().getScene()));
FxToolkit.showStage();
helpWindowHandle = new HelpWindowHandle(helpWindowStage);
}
示例4: setupSpec
import org.testfx.api.FxToolkit; //导入方法依赖的package包/类
@Before
public void setupSpec() throws Exception {
FxToolkit.registerPrimaryStage();
FxToolkit.setupStage(Stage::show);
FxToolkit.setupScene(() -> {
stackPane = new StackPane();
return new Scene(stackPane, 200, 400);
// 25 cells (each 16px high) fit into the viewport
});
}
示例5: setStage
import org.testfx.api.FxToolkit; //导入方法依赖的package包/类
@Before
public void setStage() throws TimeoutException {
FxToolkit.setupStage(this::handleSetupStage);
}