当前位置: 首页>>代码示例>>Java>>正文


Java FxToolkit.showStage方法代码示例

本文整理汇总了Java中org.testfx.api.FxToolkit.showStage方法的典型用法代码示例。如果您正苦于以下问题:Java FxToolkit.showStage方法的具体用法?Java FxToolkit.showStage怎么用?Java FxToolkit.showStage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.testfx.api.FxToolkit的用法示例。


在下文中一共展示了FxToolkit.showStage方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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();
	}
 
开发者ID:tom91136,项目名称:GestureFX,代码行数:17,代码来源:GesturePaneTest.java

示例2: basicBeforeEach

import org.testfx.api.FxToolkit; //导入方法依赖的package包/类
/**
 * Set up application before each test.
 * Afterwards, calls the {@link #beforeEach()} method.
 *
 * @throws TimeoutException if unable to set up application
 * @throws UIInitialisationException if ui was not properly initialized
 * @see FxToolkit#setupApplication(Class, String...)
 */
@BeforeEach
public final void basicBeforeEach() throws TimeoutException, UIInitialisationException {
    this.primaryStage = FxToolkit.registerPrimaryStage();
    this.application = (Hygene) FxToolkit.setupApplication(Hygene.class);

    this.context = Hygene.getInstance().getContext();

    FxToolkit.showStage();

    beforeEach();
}
 
开发者ID:ProgrammingLife2017,项目名称:hygene,代码行数:20,代码来源:UITestBase.java

示例3: 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;
}
 
开发者ID:se-edu,项目名称:addressbook-level4,代码行数:17,代码来源:SystemTestSetupHelper.java

示例4: 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);
}
 
开发者ID:se-edu,项目名称:addressbook-level4,代码行数:8,代码来源:HelpWindowTest.java

示例5: setUiPart

import org.testfx.api.FxToolkit; //导入方法依赖的package包/类
public void setUiPart(final UiPart<? extends Parent> uiPart) {
    try {
        FxToolkit.setupScene(() -> {
            Scene scene = new Scene(uiPart.getRoot());
            scene.getStylesheets().setAll(CSS_FILES);
            return scene;
        });
        FxToolkit.showStage();
    } catch (TimeoutException te) {
        throw new AssertionError("Timeout should not happen.", te);
    }
}
 
开发者ID:se-edu,项目名称:addressbook-level4,代码行数:13,代码来源:UiPartRule.java

示例6: launchApplication

import org.testfx.api.FxToolkit; //导入方法依赖的package包/类
@Test
public void launchApplication() throws Exception {
    WaitForAsyncUtils.waitForFxEvents();
    when:
    //Conditionally executing as the initial dialog box is shown only of
    //no repositories are linked with the application
    metaDataJSON = new File(io.github.gitfx.util.WorkbenchUtil.GITFX_WORKBENCH_RECENT_REPO_FILE);
    if(!metaDataJSON.exists())
      clickOn("OK");
    FxToolkit.showStage();
    then:
    //Temprarily these clickOn are also working as asserts for presence of
    //UI element. Need to add some more TestFX asserts. 
    clickOn("#gitsync");
    clickOn("#gitclone");
    clickOn("#gitinit");
    /*clickOn("Cancel");
    clickOn("#gitinit");
    clickOn("Cancel");*/
    clickOn("#gitsync");
    /*clickOn("Sync Everything");
    clickOn("OK");
    clickOn("#gitsync");
    clickOn("Sync Everything");
    clickOn("Cancel");
    clickOn("#gitsync");
    clickOn("Particular Repository");
    clickOn("OK");
    clickOn("Others");
    clickOn("Changes");
    clickOn("History");*/
}
 
开发者ID:jughyd,项目名称:GitFx,代码行数:33,代码来源:GitFxAppTest.java


注:本文中的org.testfx.api.FxToolkit.showStage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。