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


Java FxToolkit类代码示例

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


FxToolkit类属于org.testfx.api包,在下文中一共展示了FxToolkit类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: setup

import org.testfx.api.FxToolkit; //导入依赖的package包/类
@Before
public void setup() throws Exception {
    FxToolkit.toolkitContext().setSetupTimeoutInMillis(60000);
    FxToolkit.toolkitContext().setLaunchTimeoutInMillis(60000);

    ApplicationTest.launch(FarmSimLauncher.class);
}
 
开发者ID:UQdeco2800,项目名称:farmsim,代码行数:8,代码来源:JavaFXUI.java

示例3: 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

示例4: basicAfterEach

import org.testfx.api.FxToolkit; //导入依赖的package包/类
/**
 * Hide the application after each test.
 * Afterwards, calls the {@link #afterEach()} method.
 *
 * @throws TimeoutException if unable to hide application
 */
@AfterEach
public final void basicAfterEach() throws TimeoutException, UIInitialisationException {
    FxToolkit.cleanupApplication(Hygene.getInstance());
    FxToolkit.cleanupStages();

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

示例5: afterEachTest

import org.testfx.api.FxToolkit; //导入依赖的package包/类
@After
public void afterEachTest() throws TimeoutException
{
   FxToolkit.hideStage();
   release(new KeyCode[]{});
   release(new MouseButton[]{});
}
 
开发者ID:Alienturnedhuman,项目名称:PearPlanner,代码行数:8,代码来源:FXBase.java

示例6: setUp

import org.testfx.api.FxToolkit; //导入依赖的package包/类
@Before
public void setUp() throws Exception {

    FxToolkit.registerPrimaryStage();
    /* Retrieve the tested widgets from the GUI. */
    incompleteBox = find("#incompleteBox");
    overdueBox = find("#overdueBox");
    upcomingBox = find("#upcomingBox");
    allBox = find("#allBox");
    completedBox = find("#completedBox");
    searchBox = find("#searchBox");
    surpriseBox = find("#surpriseBox");
    helpBox = find("#helpBox");
    incompleteTab = find("#incompleteTab");
    overdueTab = find("#overdueTab");
    upcomingTab = find("#upcomingTab");
    allTab = find("#allTab");
    completedTab = find("#completedTab");
    searchTab = find("#searchTab");
    surpriseTab = find("#surpriseTab");
    helpTab = find("#helpTab");
    incompleteCount = find("#incompleteCount");
    overdueCount = find("#overdueCount");
    upcomingCount = find("#upcomingCount");
    dayDisplayer = find("#dayDisplayer");
    listMain = find("#listMain");
    fbArea = find("#fbArea");
    cmdArea = find("#cmdArea");
    helpContent = find("#helpContent");
    surpriseOverlay = find("#surpriseOverlay");
    surpriseTitle = find("#surpriseTitle");
    taskDesc = find("#taskDesc");
    taskTime = find("#taskTime");
    surpriseBottom = find("#surpriseBottom");
    noSurpriseOverlay = find("#noSurpriseOverlay");
}
 
开发者ID:cs2103jan2016-w13-4j,项目名称:main,代码行数:37,代码来源:TestMain.java

示例7: tearDown

import org.testfx.api.FxToolkit; //导入依赖的package包/类
@After
public void tearDown() throws Exception {
    /* Close the window. It will be re-opened at the next test. */
    FxToolkit.cleanupStages();
    FxToolkit.hideStage();
    release(new KeyCode[] {});
    release(new MouseButton[] {});
    MainStorage.getInstance().use(originalStorageDirectory);
}
 
开发者ID:cs2103jan2016-w13-4j,项目名称:main,代码行数:10,代码来源:TestMain.java

示例8: setup

import org.testfx.api.FxToolkit; //导入依赖的package包/类
private void setup() throws Exception {
    clientInjector = Guice.createInjector(new AppModule());
    serverInjector = Guice.createInjector(new ServerModule());

    FxToolkit.registerPrimaryStage();
    FxToolkit.setupApplication(() -> new ApplicationAdapter(this));
}
 
开发者ID:aalmiray,项目名称:javatrove,代码行数:8,代码来源:FunctionalTestRule.java

示例9: setup

import org.testfx.api.FxToolkit; //导入依赖的package包/类
@Before
public void setup() throws Exception {
    FxToolkit.registerPrimaryStage();
    app = new TestApp();
    app.savedInitialView = AnnotatedView.class;
    app.splashScreen = new SplashScreen();
    FxToolkit.setupApplication(() -> app);
}
 
开发者ID:roskenet,项目名称:springboot-javafx-support,代码行数:9,代码来源:AbstractJavaFxApplicationSupportTest.java

示例10: setupApplication

import org.testfx.api.FxToolkit; //导入依赖的package包/类
/**
 * Sets up a new {@code TestApp} and returns it.
 */
public TestApp setupApplication(Supplier<ReadOnlyAddressBook> addressBook, String saveFileLocation) {
    try {
        FxToolkit.registerStage(Stage::new);
        FxToolkit.setupApplication(() -> testApp = new TestApp(addressBook, saveFileLocation));
    } catch (TimeoutException te) {
        throw new AssertionError("Application takes too long to set up.");
    }

    return testApp;
}
 
开发者ID:se-edu,项目名称:addressbook-level4,代码行数:14,代码来源:SystemTestSetupHelper.java

示例11: initialize

import org.testfx.api.FxToolkit; //导入依赖的package包/类
/**
 * Initializes TestFX.
 */
public static void initialize() {
    try {
        FxToolkit.registerPrimaryStage();
        FxToolkit.hideStage();
    } catch (TimeoutException e) {
        throw new AssertionError(e);
    }
}
 
开发者ID:se-edu,项目名称:addressbook-level4,代码行数:12,代码来源:SystemTestSetupHelper.java

示例12: 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

示例13: tearDownStage

import org.testfx.api.FxToolkit; //导入依赖的package包/类
/**
 * Tears down existing stages.
 */
public void tearDownStage() {
    try {
        FxToolkit.cleanupStages();
    } catch (TimeoutException te) {
        throw new AssertionError("Stage takes too long to tear down.");
    }
}
 
开发者ID:se-edu,项目名称:addressbook-level4,代码行数:11,代码来源:SystemTestSetupHelper.java

示例14: 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

示例15: 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


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