java类javafx.stage.StageBuilder的实例源码

UiTestApplication.java 文件源码 项目:sakuli 阅读 22 收藏 0 点赞 0 评论 0
@Override
public void run() {
    Rectangle2D bounds = Screen.getPrimary().getVisualBounds();
    //create Login scene
    Scene loginScene = gotoLogin();
    width = bounds.getWidth();
    height = bounds.getHeight() * HEIGHT_PERCENTAGE;
    Stage stage = StageBuilder.create()
            .x(0).y(0)
            .width(width)
            .height(height)
            .title("Sakuli Login Sample")
            .scene(loginScene)
            .onCloseRequest(new EventHandler<WindowEvent>() {
                @Override
                public void handle(WindowEvent event) {
                    LOGGER.info("PLATFORM exit!");
                }
            }).build();
    LOGGER.info("set width '{}' and height '{}'", width, height);
    start(stage);
}
SampleUICommand.java 文件源码 项目:fxpoc 阅读 24 收藏 0 点赞 0 评论 0
/**
 * {@inheritDoc}
 */
@Override
protected void execute(final Wave wave) {

    LOGGER.info("Display a pop up from JAT");

    final Stage s = StageBuilder.create()
            .title("Sample Ui Command Test")
            .style(StageStyle.DECORATED)
            .scene(SceneBuilder.create()
                    .root(LabelBuilder.create().text("Run into JAT").build())
                    .build())

            .build();

    s.show();
    // Sample for popup => Attach owner !!!
    // getLocalFacade().getGlobalFacade().getApplication().getStage()
}
QueueUploadCellRenderer.java 文件源码 项目:simplejavayoutubeuploader 阅读 23 收藏 0 点赞 0 评论 0
@Override
public void handle(final ActionEvent event) {
    if (item.getStatus().isRunning()) {
        return;
    }
    try {
        final GuiceFXMLLoader.Result result = fxmlLoader.load(getClass().getResource("/de/chaosfisch/uploader/view/ConfirmDialog.fxml"), resources);
        final ConfirmDialogController controller = result.getController();
        controller.setTitle(resources.getString("dialog.removeupload.title"));
        controller.setMessage(resources.getString("dialog.removeupload.message"));

        final Parent parent = result.getRoot();
        final Scene scene = SceneBuilder.create().root(parent).build();
        final Stage stage = StageBuilder.create().scene(scene).build();
        stage.initStyle(StageStyle.UNDECORATED);
        stage.initModality(Modality.APPLICATION_MODAL);
        stage.showAndWait();
        stage.requestFocus();
        if (controller.ask()) {
            uploadService.delete(upload);
        }
    } catch (final IOException e) {
        logger.error("Couldn't load ConfirmDialog", e);
    }
}
QueueUploadCellRenderer.java 文件源码 项目:simplejavayoutubeuploader 阅读 19 收藏 0 点赞 0 评论 0
@Override
public void handle(final ActionEvent arg0) {
    if (!item.getStatus().isRunning()) {
        return;
    }

    try {
        final GuiceFXMLLoader.Result result = fxmlLoader.load(getClass().getResource("/de/chaosfisch/uploader/view/ConfirmDialog.fxml"), resources);
        final ConfirmDialogController controller = result.getController();
        controller.setTitle(resources.getString("dialog.abortupload.title"));
        controller.setMessage(resources.getString("dialog.abortupload.message"));

        final Parent parent = result.getRoot();
        final Scene scene = SceneBuilder.create().root(parent).build();
        final Stage stage = StageBuilder.create().scene(scene).build();
        stage.initStyle(StageStyle.UNDECORATED);
        stage.initModality(Modality.APPLICATION_MODAL);
        stage.showAndWait();
        stage.requestFocus();
        if (controller.ask()) {
            uploadService.abort(item);
        }
    } catch (final IOException e) {
        logger.error("Couldn't load ConfirmDialog", e);
    }
}
DialogHelper.java 文件源码 项目:simplejavayoutubeuploader 阅读 36 收藏 0 点赞 0 评论 0
public void showPlaylistAddDialog() {
    try {
        final GuiceFXMLLoader.Result result = fxmlLoader.load(getClass().getResource(
                "/de/chaosfisch/uploader/view/PlaylistAddDialog.fxml"), resources);
        final Parent parent = result.getRoot();

        final Scene scene = SceneBuilder.create().root(parent).build();
        final Stage stage = StageBuilder.create().scene(scene).build();
        stage.initStyle(StageStyle.UNDECORATED);
        stage.initModality(Modality.APPLICATION_MODAL);
        stage.requestFocus();
        stage.showAndWait();
    } catch (final IOException e) {
        logger.error("Couldn't load PlaylistAddDialog", e);
    }
}
DialogHelper.java 文件源码 项目:simplejavayoutubeuploader 阅读 33 收藏 0 点赞 0 评论 0
public void showErrorDialog(final String title, final String message) {
    try {
        final GuiceFXMLLoader.Result result = fxmlLoader.load(getClass().getResource(
                "/de/chaosfisch/uploader/view/ErrorDialog.fxml"), resources);
        final ErrorDialogController controller = result.getController();
        controller.setTitle(title);
        controller.setMessage(message);

        final Parent parent = result.getRoot();
        final Scene scene = SceneBuilder.create().root(parent).build();
        final Stage stage = StageBuilder.create().scene(scene).build();
        stage.initStyle(StageStyle.UNDECORATED);
        stage.initModality(Modality.APPLICATION_MODAL);
        stage.showAndWait();
        stage.requestFocus();
    } catch (final IOException e) {
        logger.error("Couldn't load ConfirmDialog", e);
    }
}
DialogHelper.java 文件源码 项目:simplejavayoutubeuploader 阅读 36 收藏 0 点赞 0 评论 0
public void showInputDialog(final String title, final String input, final Callback callback, final boolean blocking) {
    try {
        final GuiceFXMLLoader.Result result = fxmlLoader.load(getClass().getResource(
                "/de/chaosfisch/uploader/view/InputDialog.fxml"), resources);
        final Parent parent = result.getRoot();
        final InputDialogController controller = result.getController();
        controller.setTitle(resources.containsKey(title) ? resources.getString(title) : title);
        controller.setInput(resources.containsKey(input) ? resources.getString(input) : input);
        controller.setCallback(callback);

        final Scene scene = SceneBuilder.create().fill(Color.TRANSPARENT).root(parent).build();
        final Stage stage = StageBuilder.create().scene(scene).build();
        stage.initStyle(StageStyle.UNDECORATED);
        stage.initModality(Modality.APPLICATION_MODAL);
        if (blocking) {
            stage.showAndWait();
        } else {
            stage.show();
        }
        stage.requestFocus();
    } catch (final IOException e) {
        logger.error("Couldn't load InputDialog", e);
    }
}
DialogHelper.java 文件源码 项目:simplejavayoutubeuploader 阅读 40 收藏 0 点赞 0 评论 0
public void showAccountPermissionsDialog(final Account account) {
    try {
        final GuiceFXMLLoader.Result result = fxmlLoader.load(getClass().getResource(
                "/de/chaosfisch/uploader/view/AccountAddDialog.fxml"), resources);
        final Parent parent = result.getRoot();
        ((AccountAddDialogController) result.getController()).initAuth(account);

        final Scene scene = SceneBuilder.create().root(parent).build();
        final Stage stage = StageBuilder.create().scene(scene).build();
        stage.initStyle(StageStyle.DECORATED);
        stage.initModality(Modality.APPLICATION_MODAL);
        stage.setResizable(true);
        stage.requestFocus();
        stage.showAndWait();
    } catch (final Exception e) {
        logger.error("Couldn't load AccountAddDialog", e);
    }
}
QueueCommandController.java 文件源码 项目:simplejavayoutubeuploader 阅读 19 收藏 0 点赞 0 评论 0
@FXML
void startQueue(final ActionEvent event) {
    try {
        final GuiceFXMLLoader.Result result = fxmlLoader.load(getClass().getResource("/de/chaosfisch/uploader/view/ConfirmDialog.fxml"), resources);
        final ConfirmDialogController controller = result.getController();
        controller.setTitle(resources.getString("dialog.youtubetos.title"));
        controller.setMessage(resources.getString("dialog.youtubetos.message"));

        final Parent parent = result.getRoot();
        final Scene scene = SceneBuilder.create().root(parent).build();
        final Stage stage = StageBuilder.create().scene(scene).build();
        stage.initStyle(StageStyle.UNDECORATED);
        stage.initModality(Modality.APPLICATION_MODAL);
        stage.showAndWait();
        stage.requestFocus();
        if (controller.ask()) {
            uploadService.startUploading();
        }
    } catch (final IOException e) {
        logger.error("Couldn't load ConfirmDialog", e);
    }
}
FxPlayerApplication.java 文件源码 项目:fx-player 阅读 21 收藏 0 点赞 0 评论 0
@Override
public void start(Stage stage) throws Exception {
    String title = ResourceBundle.getBundle(getClass().getName(), Locale.getDefault())
            .getString("title");
    String version = ResourceBundle.getBundle(getClass().getName(), Locale.getDefault())
            .getString("version");
    if ((version != null) && !version.isEmpty()) {
        title = title + " - " + version;
    }
    StageBuilder.create().title(title)
            .icons(new Image(getClass().getResourceAsStream("icon.png"))).applyTo(stage);

    stage.setOnCloseRequest(new EventHandler<WindowEvent>() {

        @Override
        public void handle(WindowEvent event) {
            Platform.exit();
        }
    });

    FxUtils.scene(stage, PlayList.class);
    stage.show();
}
App.java 文件源码 项目:btc1k 阅读 29 收藏 0 点赞 0 评论 0
@Override
public void start (Stage primaryStage) throws Exception
{
    instance = this;

    restClient = new RestClient (SERVER_URI);
    vault = new Vault (fetchKeys ());

    FXMLLoader loader = new FXMLLoader (App.class.getResource ("main.fxml"));
    Parent root = (Parent) loader.load ();

    Scene scene = SceneBuilder.create ()
            .root (root)
            .stylesheets ("com/bitsofproof/btc1k/fx/main.css")
            .build ();

    StageBuilder.create ()
            .title ("BTC-1K")
            .scene (scene)
            .minWidth (600)
            .minHeight (600)
            .applyTo (primaryStage);

    primaryStage.show ();

}


问题


面经


文章

微信
公众号

扫码关注公众号