Example usage for javafx.scene.control Separator Separator

List of usage examples for javafx.scene.control Separator Separator

Introduction

In this page you can find the example usage for javafx.scene.control Separator Separator.

Prototype

public Separator() 

Source Link

Document

Creates a new horizontal separator with halignment and valignment set to their respective CENTER values.

Usage

From source file:Main.java

@Override
public void start(Stage stage) {
    Scene scene = new Scene(new Group());
    stage.setWidth(300);//ww w.  j  a  v a 2  s .  co  m
    stage.setHeight(150);

    ToolBar toolBar = new ToolBar(new Button("New"), new Button("Open"), new Button("Save"), new Separator(),
            new Button("Clean"), new Button("Compile"), new Button("Run"), new Separator(), new Button("Debug"),
            new Button("Profile"));
    System.out.println(toolBar.getItems());
    ((Group) scene.getRoot()).getChildren().add(toolBar);

    stage.setScene(scene);
    stage.show();
}

From source file:Main.java

@Override
public void start(Stage stage) {
    Scene scene = new Scene(new Group());
    stage.setWidth(300);/*from  www  .  java  2s. c o  m*/
    stage.setHeight(150);

    ToolBar toolBar = new ToolBar(new Button("New"), new Button("Open"), new Button("Save"), new Separator(),
            new Button("Clean"), new Button("Compile"), new Button("Run"), new Separator(), new Button("Debug"),
            new Button("Profile"));
    toolBar.setOrientation(Orientation.HORIZONTAL);

    System.out.println(toolBar.orientationProperty());
    ((Group) scene.getRoot()).getChildren().add(toolBar);

    stage.setScene(scene);
    stage.show();
}

From source file:Main.java

@Override
public void start(Stage stage) {
    Scene scene = new Scene(new Group());
    stage.setWidth(300);//from w w  w.ja v a  2s  .c om
    stage.setHeight(150);

    ToolBar toolBar = new ToolBar(new Button("New"), new Button("Open"), new Button("Save"), new Separator(),
            new Button("Clean"), new Button("Compile"), new Button("Run"), new Separator(), new Button("Debug"),
            new Button("Profile"));
    toolBar.setOrientation(Orientation.HORIZONTAL);

    System.out.println(toolBar.getOrientation());
    ((Group) scene.getRoot()).getChildren().add(toolBar);

    stage.setScene(scene);
    stage.show();
}

From source file:Main.java

@Override
public void start(Stage stage) {
    Scene scene = new Scene(new Group());
    stage.setTitle("Tooltip Sample");
    stage.setWidth(300);/*from w  w w.  ja  v  a2 s.c  o  m*/
    stage.setHeight(150);

    ToolBar toolBar = new ToolBar(new Button("New"), new Button("Open"), new Button("Save"), new Separator(),
            new Button("Clean"), new Button("Compile"), new Button("Run"), new Separator(), new Button("Debug"),
            new Button("Profile"));

    ((Group) scene.getRoot()).getChildren().add(toolBar);

    stage.setScene(scene);
    stage.show();
}

From source file:Main.java

@Override
public void start(Stage stage) {
    Scene scene = new Scene(new Group());
    stage.setWidth(300);/* w  w w . ja  v a 2 s.  com*/
    stage.setHeight(150);

    ToolBar toolBar = new ToolBar();
    toolBar.getItems().add(new Button("New"));
    toolBar.getItems().add(new Button("Open"));
    toolBar.getItems().add(new Button("Save"));
    toolBar.getItems().add(new Separator());
    toolBar.getItems().add(new Button("Clean"));
    toolBar.getItems().add(new Button("Compile"));
    toolBar.getItems().add(new Button("Run"));
    toolBar.getItems().add(new Separator());
    toolBar.getItems().add(new Button("Debug"));
    toolBar.getItems().add(new Button("Profile"));
    toolBar.setOrientation(Orientation.HORIZONTAL);

    System.out.println(toolBar.orientationProperty());
    ((Group) scene.getRoot()).getChildren().add(toolBar);

    stage.setScene(scene);
    stage.show();
}

From source file:Main.java

@Override
public void start(Stage stage) {
    Group root = new Group();
    Scene scene = new Scene(root, 500, 200);
    stage.setScene(scene);/*from   ww  w.  j  av a  2  s  .  co  m*/

    GridPane grid = new GridPane();
    grid.setPadding(new Insets(10, 10, 10, 10));
    grid.setVgap(2);
    grid.setHgap(5);

    scene.setRoot(grid);

    caption.setFont(Font.font("Verdana", 20));

    GridPane.setConstraints(caption, 0, 0);
    GridPane.setColumnSpan(caption, 8);
    grid.getChildren().add(caption);

    final Separator sepHor = new Separator();
    sepHor.setValignment(VPos.CENTER);
    GridPane.setConstraints(sepHor, 0, 1);
    GridPane.setColumnSpan(sepHor, 7);
    grid.getChildren().add(sepHor);

    stage.show();
}

From source file:com.github.drbookings.ui.controller.UpcomingController.java

private static void addCheckInNotes(final LocalDate date, final VBox box,
        final List<CheckInOutDetails> checkInNotes) {

    if (checkInNotes.size() > 0) {
        for (final CheckInOutDetails next : checkInNotes) {
            final TextFlow tf = new TextFlow();
            final Text t0 = new Text("Room " + next.room);
            t0.getStyleClass().add("emphasis");
            final Text t1 = new Text(" (" + next.bookingOrigin + ")");
            tf.getChildren().addAll(t0, t1);
            if (!StringUtils.isBlank(next.notes)) {
                final Text t2 = new Text(": " + next.notes);
                t2.getStyleClass().add("guest-message");
                tf.getChildren().add(t2);
            }//ww  w.  j  av  a  2  s. c om
            box.getChildren().add(tf);
        }
        box.getChildren().add(new Separator());
    }
}

From source file:com.github.drbookings.ui.controller.UpcomingController.java

private static void addCheckOutNotes(final LocalDate date, final VBox box,
        final List<CheckInOutDetails> checkOutNotes) {
    if (checkOutNotes.size() > 0) {
        for (final CheckInOutDetails next : checkOutNotes) {
            final TextFlow tf = new TextFlow();
            final Text t0 = new Text("Room " + next.room);
            t0.getStyleClass().add("emphasis");
            final Text t1 = new Text(" (" + next.bookingOrigin + ")");
            tf.getChildren().addAll(t0, t1);
            if (!StringUtils.isBlank(next.notes)) {
                final Text t2 = new Text(": " + next.notes);
                t2.getStyleClass().add("guest-message");
                tf.getChildren().add(t2);
            }//from  w w w  .  j  a  va  2s  .c  o  m
            box.getChildren().add(tf);
        }
        box.getChildren().add(new Separator());
    }
}

From source file:eu.over9000.skadi.ui.dialogs.PerformUpdateDialog.java

public PerformUpdateDialog(RemoteVersionResult newVersion) {
    this.chosen = new SimpleObjectProperty<>(
            Paths.get(SystemUtils.USER_HOME, newVersion.getVersion() + ".jar").toFile());

    this.setHeaderText("Updating to " + newVersion.getVersion());
    this.setTitle("Skadi Updater");
    this.getDialogPane().getStyleClass().add("alert");
    this.getDialogPane().getStyleClass().add("information");

    final ButtonType restartButtonType = new ButtonType("Start New Version", ButtonBar.ButtonData.OK_DONE);
    this.getDialogPane().getButtonTypes().addAll(restartButtonType, ButtonType.CANCEL);

    Node btn = this.getDialogPane().lookupButton(restartButtonType);
    btn.setDisable(true);//  ww  w  .  j  av a 2  s  . c o m

    Label lbPath = new Label("Save as");
    TextField tfPath = new TextField();
    tfPath.textProperty()
            .bind(Bindings.createStringBinding(() -> this.chosen.get().getAbsolutePath(), this.chosen));
    tfPath.setPrefColumnCount(40);
    tfPath.setEditable(false);

    Button btChangePath = GlyphsDude.createIconButton(FontAwesomeIcons.FOLDER_OPEN, "Browse...");
    btChangePath.setOnAction(event -> {
        FileChooser fc = new FileChooser();
        fc.setTitle("Save downloaded jar..");
        fc.setInitialFileName(this.chosen.getValue().getName());
        fc.getExtensionFilters().add(new FileChooser.ExtensionFilter("Jar File", ".jar"));
        fc.setInitialDirectory(this.chosen.getValue().getParentFile());
        File selected = fc.showSaveDialog(this.getOwner());
        if (selected != null) {
            this.chosen.set(selected);
        }
    });

    ProgressBar pbDownload = new ProgressBar(0);
    pbDownload.setDisable(true);
    pbDownload.setMaxWidth(Double.MAX_VALUE);
    Label lbDownload = new Label("Download");
    Label lbDownloadValue = new Label();
    Button btDownload = GlyphsDude.createIconButton(FontAwesomeIcons.DOWNLOAD, "Start");
    btDownload.setMaxWidth(Double.MAX_VALUE);
    btDownload.setOnAction(event -> {
        btChangePath.setDisable(true);
        btDownload.setDisable(true);

        this.downloadService = new DownloadService(newVersion.getDownloadURL(), this.chosen.getValue());

        lbDownloadValue.textProperty().bind(this.downloadService.messageProperty());
        pbDownload.progressProperty().bind(this.downloadService.progressProperty());

        this.downloadService.setOnSucceeded(dlEvent -> {
            btn.setDisable(false);
        });
        this.downloadService.setOnFailed(dlFailed -> {
            LOGGER.error("new version download failed", dlFailed.getSource().getException());
            lbDownloadValue.textProperty().unbind();
            lbDownloadValue.setText("Download failed, check log file for details.");
        });

        this.downloadService.start();
    });

    final GridPane grid = new GridPane();
    grid.setHgap(10);
    grid.setVgap(10);

    grid.add(lbPath, 0, 0);
    grid.add(tfPath, 1, 0);
    grid.add(btChangePath, 2, 0);
    grid.add(new Separator(), 0, 1, 3, 1);
    grid.add(lbDownload, 0, 2);
    grid.add(pbDownload, 1, 2);
    grid.add(btDownload, 2, 2);
    grid.add(lbDownloadValue, 1, 3);

    this.getDialogPane().setContent(grid);

    this.setResultConverter(btnType -> {
        if (btnType == restartButtonType) {
            return this.chosen.getValue();
        }

        if (btnType == ButtonType.CANCEL) {
            if (this.downloadService.isRunning()) {
                this.downloadService.cancel();
            }
        }

        return null;
    });

}

From source file:be.makercafe.apps.makerbench.editors.JFXMillEditor.java

/**
 * Creates the toolBar for the editor.//w w  w  .  j a va  2  s.com
 *
 * @return
 */

private ToolBar createToolBar() {

    ToolBar toolBar = new ToolBar();
    toolBar.setOrientation(Orientation.HORIZONTAL);

    Button btnSave = GlyphsDude.createIconButton(MaterialDesignIcon.FLOPPY, "Save");
    btnSave.setOnAction(this::handleSaveButton);

    Button btnExportSTL = GlyphsDude.createIconButton(MaterialDesignIcon.EXPORT, "Export GCODE");

    btnExportSTL.setOnAction(this::handleExportAsGCodeFile);

    Button btnExportPNG = GlyphsDude.createIconButton(MaterialDesignIcon.CAMERA, "Export PNG");
    btnExportPNG.setOnAction(this::handleExportAsPngFile);

    Button btnRun = GlyphsDude.createIconButton(MaterialDesignIcon.RUN, "Run");
    btnRun.setOnAction(this::handleCompileAndRun);

    ToggleButton btnAutoCompile = GlyphsDude.createIconToggleButton(MaterialDesignIcon.AUTO_FIX,
            "Automatic run", null, ContentDisplay.LEFT);
    btnAutoCompile.setOnAction(this::handleAutoCompile);
    btnAutoCompile.setSelected(false);

    ToggleButton btn3DNav = GlyphsDude.createIconToggleButton(MaterialDesignIcon.ROTATE_3D, "3D Navigation ",
            null, ContentDisplay.LEFT);
    btn3DNav.setSelected(false);

    ComboBox cbxSourceExamples = new ComboBox();
    cbxSourceExamples.getItems().addAll("TestCut");
    this.cbxSourceExamples = cbxSourceExamples; // TODO: maybe cleaner way
    // to do this ?

    Button btnPasteSource = GlyphsDude.createIconButton(MaterialDesignIcon.CONTENT_PASTE, "Paste source");
    btnPasteSource.setOnAction(this::handlePasteSource);

    toolBar.getItems().addAll(btnSave, btnExportSTL, btnExportPNG, new Separator(), btnRun, new Separator(),
            btnAutoCompile, new Separator(), cbxSourceExamples, btnPasteSource);

    return toolBar;

}