Example usage for javafx.geometry Orientation HORIZONTAL

List of usage examples for javafx.geometry Orientation HORIZONTAL

Introduction

In this page you can find the example usage for javafx.geometry Orientation HORIZONTAL.

Prototype

Orientation HORIZONTAL

To view the source code for javafx.geometry Orientation HORIZONTAL.

Click Source Link

Document

The horizontal (right <-> left) orientation

Usage

From source file:Main.java

@Override
public void start(Stage primaryStage) {
    FlowPane flowPane = new FlowPane(Orientation.HORIZONTAL, 20, 20);
    flowPane.setPrefWrapLength(210);//from   ww w.j  ava 2  s  . c  om
    Button btn = new Button();

    for (int i = 0; i < 8; i++) {
        btn = new Button("Button");
        btn.setPrefSize(100, 50);
        flowPane.getChildren().add(btn);
    }
    System.out.println(flowPane.getRowValignment());

    Scene scene = new Scene(flowPane);
    primaryStage.setScene(scene);
    primaryStage.show();
}

From source file:Main.java

@Override
public void start(Stage primaryStage) {
    FlowPane flowPane = new FlowPane(Orientation.HORIZONTAL, 20, 20);
    flowPane.setPrefWrapLength(210);/*from   ww w. ja va2s .  c  o  m*/
    Button btn = new Button();

    for (int i = 0; i < 8; i++) {
        btn = new Button("Button");
        btn.setPrefSize(100, 50);
        flowPane.getChildren().add(btn);
    }
    System.out.println(flowPane.getContentBias());

    Scene scene = new Scene(flowPane);
    primaryStage.setScene(scene);
    primaryStage.show();
}

From source file:Main.java

@Override
public void start(Stage stage) {
    Scene scene = new Scene(new Group(), 450, 250);

    TilePane tile = new TilePane();

    tile.setHgap(8);/*from w  w  w .ja va  2  s  . c  om*/
    tile.setPrefColumns(4);
    for (int i = 0; i < 20; i++) {
        tile.getChildren().add(new CheckBox("CheckBox"));
    }
    tile.setOrientation(Orientation.HORIZONTAL);

    HBox hbox = new HBox(10);
    hbox.setPadding(new Insets(20, 0, 0, 20));
    hbox.getChildren().setAll(tile);

    Group root = (Group) scene.getRoot();
    root.getChildren().add(hbox);
    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 ww  .j av a  2s  . com*/
    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  www. j ava 2s . com*/
    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.setWidth(300);/*  w  w  w  .j a v a  2s . c o  m*/
    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:de.pixida.logtest.designer.automaton.AutomatonEditor.java

@Override
protected void init() {
    this.graph = new Graph(this);

    this.graphScrollPane.setContent(this.graph.getPane());
    this.splitPane.setOrientation(Orientation.HORIZONTAL);

    this.setCenter(this.splitPane);
}

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

/**
 * Creates the toolBar for the editor./*from  ww w  . j ava2  s.  c o m*/
 *
 * @return
 */

private ToolBar createToolBar() {

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

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

    toolBar.getItems().add(btnSave);

    return toolBar;

}

From source file:com.thomaskuenneth.tkmactuning.TKMacTuning.java

@Override
public void start(Stage primaryStage) {
    TabPane tabPane = new TabPane();
    tabPane.setTabClosingPolicy(TabPane.TabClosingPolicy.UNAVAILABLE);
    // Found here: http://stackoverflow.com/a/17488304/5956451
    tabPane.getStyleClass().add("floating");

    // TODO: propper error handling
    JSONTokener t = new JSONTokener(getClass().getResourceAsStream("resources/plugins.json"));
    JSONArray a = new JSONArray(t);
    a.forEach((Object anObject) -> {
        JSONObject jsonObject = (JSONObject) anObject;
        addPlugin(tabPane, jsonObject.getString("class"), jsonObject.getString("pluginName"));
    });/* w  w w. jav a2  s .c  om*/

    FlowPane buttonsPane = new FlowPane(Orientation.HORIZONTAL);
    buttonsPane.setPadding(LayoutConstants.PADDING_1);
    buttonsPane.setHgap(LayoutConstants.HORIZONTAL_CONTROL_GAP);
    buttonsPane.setAlignment(Pos.BASELINE_LEFT);
    final Button buttonReread = new Button(getString("reread"));
    buttonReread.setOnAction(event -> {
        PluginManager.reread(this);
    });
    buttonsPane.getChildren().add(buttonReread);
    final Button buttonApply = new Button(getString("apply"));
    buttonApply.setOnAction(event -> {
        PluginManager.save(this);
    });
    buttonsPane.getChildren().add(buttonApply);

    statusbar = new StatusBar();
    BorderPane borderPane = new BorderPane(tabPane);
    borderPane.setTop(buttonsPane);
    borderPane.setBottom(statusbar);
    primaryStage.setScene(new Scene(borderPane, 800, 600));
    primaryStage.setTitle(getString("application_name"));

    ready();
    primaryStage.show();
}

From source file:com.cdd.bao.editor.endpoint.BrowseEndpoint.java

public BrowseEndpoint(Stage stage) {
    this.stage = stage;

    stage.setTitle("BioAssay Schema Browser");

    treeRoot = new TreeItem<>(new Branch(this));
    treeView = new TreeView<>(treeRoot);
    treeView.setEditable(true);//from   w ww.  j  a  va 2 s  . c om
    treeView.setCellFactory(p -> new BrowseTreeCell());
    treeView.getSelectionModel().selectedItemProperty().addListener((observable, oldval, newval) -> {
        changeValue(newval.getValue());
    });

    display = new DisplaySchema();

    StackPane sp1 = new StackPane(), sp2 = new StackPane();
    sp1.getChildren().add(treeView);
    sp2.getChildren().add(display);

    splitter = new SplitPane();
    splitter.setOrientation(Orientation.HORIZONTAL);
    splitter.getItems().addAll(sp1, sp2);
    splitter.setDividerPositions(0.4, 1.0);

    root = new BorderPane();
    root.setTop(menuBar);
    root.setCenter(splitter);

    Scene scene = new Scene(root, 700, 600, Color.WHITE);

    stage.setScene(scene);

    treeView.setShowRoot(false);

    rebuildTree();

    Platform.runLater(() -> treeView.getFocusModel().focus(treeView.getSelectionModel().getSelectedIndex())); // for some reason it defaults to not the first item

    new Thread(() -> backgroundLoadTemplates()).start();
}