Java Code Examples for javafx.scene.layout.VBox#setVgrow()

The following examples show how to use javafx.scene.layout.VBox#setVgrow() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: UnitsContainerClassic.java    From helloiot with GNU General Public License v3.0 6 votes vote down vote up
@Override 
public void addLayout(String layout) {
    if ("StartLine".equals(layout)) {
        HBox lastPane = new HBox();
        lastPane.getStyleClass().add("linecontainer");
        VBox.setVgrow(lastPane, Priority.NEVER);
        container.getChildren().add(lastPane);
    } else if ("StartFlow".equals(layout)) {
        FlowPane flow = new FlowPane();
        flow.getStyleClass().add("linecontainer");
        VBox.setVgrow(flow, Priority.NEVER);    
        container.getChildren().add(flow);
    } else {
        throw new IllegalArgumentException("Layout not supported: " + layout);
    }
}
 
Example 2
Source File: ChatClient.java    From reactive-grpc with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
private Scene buildScene() {
    messages.setWrapText(true);
    messages.setEditable(false);
    VBox.setVgrow(messages, Priority.ALWAYS);

    HBox.setHgrow(message, Priority.ALWAYS);

    send.setText("Send");
    send.setDefaultButton(true);

    HBox hBox = new HBox();
    hBox.setSpacing(5);
    hBox.getChildren().addAll(message, send);

    VBox vBox = new VBox();
    vBox.setSpacing(5);
    vBox.setPadding(new Insets(10, 10, 10, 10));
    vBox.getChildren().addAll(messages, hBox);

    return new Scene(vBox, 300, 500);
}
 
Example 3
Source File: FixtureSelection.java    From marathonv5 with Apache License 2.0 6 votes vote down vote up
private void initComponents() {
    VBox.setVgrow(fixtureList, Priority.ALWAYS);
    fixtureList.setId("fixture-list-view");
    fixtureList.setItems(fixtuers);
    fixtureList.setOnMouseClicked((e) -> {
        if (e.getClickCount() == 2)
            onSelect(fixtureList.getSelectionModel().getSelectedItem());
    });
    fixtureList.getSelectionModel().select(selectedFixture);
    fixtureList.getSelectionModel().selectedIndexProperty().addListener((listener) -> {
        updateButtonState();
    });

    selectButton.setOnAction((e) -> onSelect(fixtureList.getSelectionModel().getSelectedItem()));
    cancelButton.setOnAction((e) -> onCancel());
    buttonBar.getButtons().addAll(selectButton, cancelButton);
    buttonBar.setButtonMinWidth(Region.USE_PREF_SIZE);
    updateButtonState();
}
 
Example 4
Source File: AddPreferenceStage.java    From marathonv5 with Apache License 2.0 6 votes vote down vote up
@Override
public Parent getContentPane() {
    VBox content = new VBox();
    content.getStyleClass().add("add-preference-stage");
    content.setId("addPreferenceStage");
    FormPane form = new FormPane("add-preference-stage-form", 3);
    integerValueField.textProperty().addListener(new ChangeListener<String>() {
        @Override
        public void changed(ObservableValue<? extends String> observable, String oldValue, String newValue) {
            if (!newValue.matches("\\d*")) {
                integerValueField.setText(newValue.replaceAll("[^\\d]", ""));
            }
        }
    });
    StackPane pane = new StackPane(stringValueField, integerValueField, booleanValueField);
    pane.setAlignment(Pos.CENTER_LEFT);
    //@formatter:off
    form.addFormField("Property name:", nameField)
        .addFormField("Method:", typeComboBox, new Region())
        .addFormField("Value:", pane);
    //@formatter:on
    GridPane.setHgrow(typeComboBox, Priority.NEVER);
    VBox.setVgrow(form, Priority.ALWAYS);
    content.getChildren().addAll(form, buttonBar);
    return content;
}
 
Example 5
Source File: CheckedNumberTextField.java    From chart-fx with Apache License 2.0 6 votes vote down vote up
public CheckedNumberTextField(final double initialValue) {
    super(Double.toString(initialValue));

    final ValidationSupport support = new ValidationSupport();
    final Validator<String> validator = (final Control control, final String value) -> {
        final boolean condition = value == null || !(value.matches(CheckedNumberTextField.NUMBER_REGEX) || CheckedNumberTextField.isNumberInfinity(value));

        // change text colour depending on validity as a number
        setStyle(condition ? "-fx-text-inner-color: red;" : "-fx-text-inner-color: black;");
        return ValidationResult.fromMessageIf(control, "not a number", Severity.ERROR, condition);
    };
    support.registerValidator(this, true, validator);

    snappedTopInset();
    snappedBottomInset();
    HBox.setHgrow(this, Priority.ALWAYS);
    VBox.setVgrow(this, Priority.ALWAYS);
}
 
Example 6
Source File: TestApplication.java    From marathonv5 with Apache License 2.0 5 votes vote down vote up
public TestApplication(Stage parent, Properties props) {
    initOwner(parent);
    MPFUtils.replaceEnviron(props);
    String model = props.getProperty(Constants.PROP_PROJECT_LAUNCHER_MODEL);
    if (model == null || model.equals("")) {
        commandField.setText("Select a launcher and set the parameters required.");
        show();
    } else {
        IRuntimeLauncherModel launcherModel = LauncherModelHelper.getLauncherModel(model);
        launchCommand = launcherModel.createLauncher(props);
    }
    initModality(Modality.APPLICATION_MODAL);
    BorderPane content = new BorderPane();
    VBox builder = new VBox();
    builder.setSpacing(5);
    outputArea.setEditable(false);
    errorArea.setEditable(false);
    VBox.setVgrow(errorArea, Priority.ALWAYS);
    builder.getChildren().addAll(new Label("Command"), commandField, new Label("Standard Output & Error"), outputArea,
            new Label("Message"), errorArea);
    closeButton.setOnAction((event) -> {
        if (launchCommand != null) {
            launchCommand.destroy();
        }
        close();
    });
    content.setCenter(builder);
    content.setBottom(new HBox(5, FXUIUtils.createFiller(), closeButton));
    setScene(new Scene(content));
}
 
Example 7
Source File: Story.java    From mars-sim with GNU General Public License v3.0 5 votes vote down vote up
/** @return the content of the address, with a signature and portrait attached. */
private Pane getContent() {
  final VBox content = new VBox();
  content.getStyleClass().add("address");

  //int rand = RandomUtil.getRandomInt(1);

  final Label address = new Label(START1+START2+MID1+MID2+MID3+MID4);

  address.setWrapText(true);
  ScrollPane addressScroll = makeScrollable(address);

  final ImageView signature = new ImageView(); signature.setId("signature");
  final ImageView lincolnImage = new ImageView(); lincolnImage.setId("portrait");
  VBox.setVgrow(addressScroll, Priority.ALWAYS);

  final Region spring = new Region();
  HBox.setHgrow(spring, Priority.ALWAYS);
  
  //final Node alignedSignature = HBoxBuilder.create().children(spring, signature).build();
  final HBox alignedSignature = new HBox(spring, signature);
  
  Label date = new Label(DATE);
  date.setAlignment(Pos.BOTTOM_RIGHT);

  content.getChildren().addAll(
      lincolnImage,
      addressScroll,
      alignedSignature,
      date
  );

  return content;
}
 
Example 8
Source File: MainView.java    From Schillsaver with MIT License 5 votes vote down vote up
/**
 * Creates the content area panel.
 *
 * @return
 *         The content area panel.
 */
private SplitPane createContentArea() {
    final SplitPane contentArea = new SplitPane(jobsList);

    HBox.setHgrow(contentArea, Priority.ALWAYS);
    VBox.setVgrow(contentArea, Priority.ALWAYS);

    jobsList.setFocusTraversable(false);

    return contentArea;
}
 
Example 9
Source File: EditAxis.java    From chart-fx with Apache License 2.0 5 votes vote down vote up
private Node createSpacer() {
    final Region spacer = new Region();
    // Make it always grow or shrink according to the available space
    VBox.setVgrow(spacer, Priority.ALWAYS);
    HBox.setHgrow(spacer, Priority.ALWAYS);
    return spacer;
}
 
Example 10
Source File: Styler.java    From Maus with GNU General Public License v3.0 5 votes vote down vote up
public static VBox vContainer(int spacing, Node... nodes) {
    VBox vBox = new VBox(spacing);
    VBox.setVgrow(vBox, Priority.ALWAYS);
    vBox.setMaxWidth(Double.MAX_VALUE);
    for (Node r : nodes) {
        vBox.getChildren().add(r);
    }
    return vBox;
}
 
Example 11
Source File: ToolbarTestModule.java    From WorkbenchFX with Apache License 2.0 5 votes vote down vote up
private void setupStyling() {
  contentBox.getStyleClass().add("toolbar-module");
  contentBox.getStylesheets().add(
      ToolbarTestModule.class.getResource("toolbar-module.css").toExternalForm()
  );
  contentBox.setStyle("-fx-background-color: #f2f2f2;");

  contentBox.setAlignment(Pos.CENTER);
  topBox.setAlignment(Pos.CENTER);
  VBox.setVgrow(topBox, Priority.ALWAYS);
  bottomBox.setAlignment(Pos.CENTER);
  bottomBox.setMinHeight(100);
  bottomBox.setSpacing(25);
}
 
Example 12
Source File: MainView.java    From Schillsaver with MIT License 5 votes vote down vote up
/**
 * Creates the menu bar panel.
 *
 * @return
 *         The menu bar panel.
 */
private Pane createMenuBar() {
    final HBox pane = new HBox(button_createJob, button_editJob, button_deleteSelectedJobs, button_processJobs, button_programSettings);

    HBox.setHgrow(pane, Priority.ALWAYS);
    VBox.setVgrow(pane, Priority.NEVER);

    HBox.setHgrow(button_createJob, Priority.ALWAYS);
    HBox.setHgrow(button_editJob, Priority.ALWAYS);
    HBox.setHgrow(button_deleteSelectedJobs, Priority.ALWAYS);
    HBox.setHgrow(button_processJobs, Priority.ALWAYS);
    HBox.setHgrow(button_programSettings, Priority.ALWAYS);

    return pane;
}
 
Example 13
Source File: SettingsView.java    From Schillsaver with MIT License 5 votes vote down vote up
private Pane createControlRow(final @NonNull Button button, final @NonNull TextField field) {
    final HBox hBox = new HBox(button, field);
    VBox.setVgrow(hBox, Priority.ALWAYS);

    HBox.setHgrow(button, Priority.NEVER);
    HBox.setHgrow(field, Priority.ALWAYS);

    button.setMinWidth(256);

    return hBox;
}
 
Example 14
Source File: SnowFlakeSample.java    From chart-fx with Apache License 2.0 4 votes vote down vote up
@Override
public void start(final Stage primaryStage) {
    final XYChart chart1 = getChristmasChart(false);
    final XYChart chart2 = getChristmasChart(true);

    final CheckBox cbTransposed = new CheckBox("flip tree");
    cbTransposed.setTooltip(new Tooltip("press to flip tree"));
    cbTransposed.setGraphic(new Glyph(FONT_AWESOME, FONT_SYMBOL_TRANSPOSE).size(FONT_SIZE));
    cbTransposed.selectedProperty().bindBidirectional(flipProperty);

    final CheckBox cbSnow = new CheckBox("snow");
    cbSnow.setTooltip(new Tooltip("press to switch on/off snow"));
    cbSnow.setGraphic(new Glyph(FONT_AWESOME, FONT_SYMBOL_SNOW).size(FONT_SIZE));
    cbSnow.selectedProperty().bindBidirectional(snowProperty);

    Slider nFlakeSpeed = new Slider(0.0, 2, velocityProperty.get());
    nFlakeSpeed.setBlockIncrement(0.1);
    nFlakeSpeed.setMajorTickUnit(0.1);
    velocityProperty.bind(nFlakeSpeed.valueProperty());

    Spinner<Integer> nSnowFlakes = new Spinner<>(10, 1000, 200, numberOfFlakesProperty.get());
    numberOfFlakesProperty.bind(nSnowFlakes.valueProperty());

    Spinner<Double> meanFlakeSize = new Spinner<>(0.1, 20.0, meanSizeProperty.get(), 0.1);
    meanSizeProperty.bind(meanFlakeSize.valueProperty());

    Spinner<Double> rmsFlakeSize = new Spinner<>(0.1, 20.0, rmsSizeProperty.get(), 0.1);
    rmsSizeProperty.bind(rmsFlakeSize.valueProperty());

    final ToolBar toolBar = new ToolBar(cbTransposed, cbSnow, new Label("speed:"), nFlakeSpeed, //
            new Label("n-flakes:"), nSnowFlakes, new Label("mean-size:"), meanFlakeSize, //
            new Label("rms-size:"), rmsFlakeSize);
    final HBox hBox = new HBox(chart1, chart2);

    VBox.setVgrow(hBox, Priority.ALWAYS);
    final Scene scene = new Scene(new VBox(toolBar, hBox), WIDTH, HEIGHT);

    primaryStage.setTitle(SnowFlakeSample.class.getSimpleName());
    primaryStage.setOnCloseRequest(evt -> Platform.exit());
    primaryStage.setScene(scene);
    primaryStage.show();
    if (LOGGER.isDebugEnabled()) {
        LOGGER.atDebug().log("scene initialised");
    }
}
 
Example 15
Source File: ControlPropertiesConfigPopup.java    From arma-dialog-creator with MIT License 4 votes vote down vote up
private void initializeToControl() {
	editorPane = new ControlPropertiesEditorPane(this.control);
	editorPane.setMaxHeight(720d); //prevent the element from being godly large

	Color bg = this.control.getRenderer().getBackgroundColor();

	setBorderColor(bg);

	addHeader(control);

	myRootElement.getChildren().add(editorPane);
	VBox.setVgrow(editorPane, Priority.ALWAYS);

	addFooter(control);

}
 
Example 16
Source File: ResultPane.java    From marathonv5 with Apache License 2.0 4 votes vote down vote up
@SuppressWarnings("unchecked")
private void initResultTable() {
    resultTable.setId("resultTable");
    setLabel();
    TableColumn<Failure, String> messageColumn = new TableColumn<>("Message");
    messageColumn.setCellValueFactory(new PropertyValueFactory<>("message"));
    messageColumn.prefWidthProperty().bind(resultTable.widthProperty().multiply(0.50));

    TableColumn<Failure, String> fileNameColumn = new TableColumn<>("File");
    fileNameColumn.setCellValueFactory(new PropertyValueFactory<>("fileName"));
    fileNameColumn.prefWidthProperty().bind(resultTable.widthProperty().multiply(0.245));

    TableColumn<Failure, String> locationColumn = new TableColumn<>("Location");
    locationColumn.setCellValueFactory(new PropertyValueFactory<>("lineNumber"));
    locationColumn.prefWidthProperty().bind(resultTable.widthProperty().multiply(0.249));

    failuresList.addListener(new ListChangeListener<Failure>() {
        @Override
        public void onChanged(javafx.collections.ListChangeListener.Change<? extends Failure> c) {
            if (failuresList.size() == 0) {
                clearButton.setDisable(true);
            } else {
                clearButton.setDisable(false);
            }
        }
    });

    resultTable.getSelectionModel().selectedItemProperty().addListener((observable, oldValue, newValue) -> {
        if (newValue != null && newValue.getMessage() != null) {
            showMessageButton.setDisable(false);
        } else {
            showMessageButton.setDisable(true);
        }
    });

    resultTable.setRowFactory(e -> {
        TableRow<Failure> tableRow = new TableRow<>();
        tableRow.setOnMouseClicked(event -> {
            if (event.getClickCount() == 2 && !tableRow.isEmpty()) {
                SourceLine[] traceback = tableRow.getItem().getTraceback();
                if (traceback.length > 0) {
                    fireResultPaneSelectedEvent(traceback[0]);
                }
            }
        });
        return tableRow;
    });

    resultTable.setItems(failuresList);
    resultTable.getColumns().addAll(messageColumn, fileNameColumn, locationColumn);
    VBox tableContent = new VBox(tableLabel, resultTable);
    VBox.setVgrow(tableContent, Priority.ALWAYS);
    VBox.setVgrow(resultTable, Priority.ALWAYS);
    resultPaneLayout.setCenter(tableContent);
}
 
Example 17
Source File: ImageList.java    From phoebus with Eclipse Public License 1.0 4 votes vote down vote up
private Node createImageSection()
{
    preview.setPreserveRatio(true);
    preview.setManaged(false);

    final Button removeImage   = new Button(Messages.Remove, ImageCache.getImageView(ImageCache.class, "/icons/delete.png"));
    removeImage.setTooltip(new Tooltip(Messages.RemoveImage));
    removeImage.setOnAction(event ->
    {
        final Image image = preview.getImage();
        if (image != null)
        {
            images.getItems().remove(image);
            selectFirstImage();
        }
    });

    final StackPane left = new StackPane(preview, removeImage);
    // Image in background fills the area
    preview.setX(5);
    preview.setY(5);
    preview.fitWidthProperty().bind(left.widthProperty());
    preview.fitHeightProperty().bind(left.heightProperty());
    // Remove button on top, upper right corner
    StackPane.setAlignment(removeImage, Pos.TOP_RIGHT);
    StackPane.setMargin(removeImage, new Insets(5));

    images.setPlaceholder(new Label(Messages.NoImages));
    images.setStyle("-fx-control-inner-background-alt: #f4f4f4");
    images.setStyle("-fx-control-inner-background: #f4f4f4");
    images.setCellFactory(param -> new ImageCell(preview));

    // Show selected image in preview
    preview.imageProperty().bind(images.getSelectionModel().selectedItemProperty());
    // Enable button if something is selected
    removeImage.disableProperty().bind(Bindings.isEmpty(images.getSelectionModel().getSelectedItems()));

    VBox.setVgrow(images, Priority.ALWAYS);
    final VBox right = new VBox(new Label(Messages.ImagesTitle), images);
    right.setPadding(new Insets(5));

    final SplitPane split = new SplitPane(left, right);
    split.setDividerPositions(0.7);
    return split;
}
 
Example 18
Source File: SearchView.java    From phoebus with Eclipse Public License 1.0 4 votes vote down vote up
/** Create search view
 *
 *  <p>While technically a {@link SplitPane},
 *  should be treated as generic {@link Node},
 *  using only the API defined in here
 *
 *  @param model
 *  @param undo
 */
public SearchView(final Model model, final UndoableActionManager undo)
{
    this.model = model;
    this.undo = undo;

    // Archive List

    // Pattern: ____________ [Search]
    pattern.setTooltip(new Tooltip(Messages.SearchPatternTT));
    pattern.setMaxWidth(Double.MAX_VALUE);
    HBox.setHgrow(pattern, Priority.ALWAYS);
    final Button search = new Button(Messages.Search);
    search.setTooltip(new Tooltip(Messages.SearchTT));
    final HBox search_row = new HBox(5.0, new Label(Messages.SearchPattern), pattern, search);
    search_row.setAlignment(Pos.CENTER_LEFT);
    pattern.setOnAction(event -> searchForChannels());
    search.setOnAction(event -> searchForChannels());

    //  ( ) Add .. (x) Replace search result
    final RadioButton result_add = new RadioButton(Messages.AppendSearchResults);
    result_add.setTooltip(new Tooltip(Messages.AppendSearchResultsTT));
    result_replace = new RadioButton(Messages.ReplaceSearchResults);
    result_replace.setTooltip(new Tooltip(Messages.ReplaceSearchResultsTT));
    final ToggleGroup result_handling = new ToggleGroup();
    result_add.setToggleGroup(result_handling);
    result_replace.setToggleGroup(result_handling);
    result_replace.setSelected(true);
    final HBox replace_row = new HBox(5.0, result_add, result_replace);
    replace_row.setAlignment(Pos.CENTER_RIGHT);

    // PV Name  |  Source
    // ---------+--------
    //          |
    final TableColumn<ChannelInfo, String> pv_col = new TableColumn<>(Messages.PVName);
    pv_col.setCellValueFactory(cell ->  new SimpleStringProperty(cell.getValue().getName()));
    pv_col.setReorderable(false);
    channel_table.getColumns().add(pv_col);

    final TableColumn<ChannelInfo, String> archive_col = new TableColumn<>(Messages.ArchiveName);
    archive_col.setCellValueFactory(cell ->  new SimpleStringProperty(cell.getValue().getArchiveDataSource().getName()));
    archive_col.setReorderable(false);
    channel_table.getColumns().add(archive_col);
    channel_table.setPlaceholder(new Label(Messages.SearchPatternTT));

    // PV name column uses most of the space, archive column the rest
    pv_col.prefWidthProperty().bind(channel_table.widthProperty().multiply(0.8));
    archive_col.prefWidthProperty().bind(channel_table.widthProperty().subtract(pv_col.widthProperty()));

    channel_table.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);

    VBox.setVgrow(channel_table, Priority.ALWAYS);
    search_row.setPadding(new Insets(5, 5, 0, 5));
    replace_row.setPadding(new Insets(5, 5, 0, 5));
    final VBox bottom = new VBox(5, search_row,
                                    replace_row,
                                    channel_table);
    setOrientation(Orientation.VERTICAL);
    getItems().setAll(archive_list, bottom);
    setDividerPositions(0.2f);

    final ContextMenu menu = new ContextMenu();
    channel_table.setContextMenu(menu);
    channel_table.setOnContextMenuRequested(this::updateContextMenu);

    setupDrag();

    Platform.runLater(() -> pattern.requestFocus());
}
 
Example 19
Source File: InfoBox.java    From scenic-view with GNU General Public License v3.0 4 votes vote down vote up
public InfoBox(final Window owner, final String title, final String labelText, 
        final String textAreaText, final boolean editable, final int width, final int height) {
    final VBox pane = new VBox(20);
    pane.setId(StageController.FX_CONNECTOR_BASE_ID + "InfoBox");
    final Scene scene = new Scene(pane, width, height); 

    final Stage stage = new Stage(StageStyle.UTILITY);
    stage.setTitle(title);
    stage.initModality(Modality.WINDOW_MODAL);
    stage.initOwner(owner);
    stage.setScene(scene);
    stage.getIcons().add(ScenicViewGui.APP_ICON);

    final Label label = new Label(labelText);
    stage.setWidth(width);
    stage.setHeight(height);
    textArea = new TextArea();
    if (textAreaText != null) {
        textArea.setEditable(editable);
        textArea.setText(textAreaText);
        VBox.setMargin(textArea, new Insets(5, 5, 0, 5));
        VBox.setVgrow(textArea, Priority.ALWAYS);
    }
    final Button close = new Button("Close");
    VBox.setMargin(label, new Insets(5, 5, 0, 5));

    VBox.setMargin(close, new Insets(5, 5, 5, 5));

    pane.setAlignment(Pos.CENTER);

    close.setDefaultButton(true);
    close.setOnAction(new EventHandler<ActionEvent>() {
        @Override public void handle(final ActionEvent arg0) {
            stage.close();
        }
    });
    if (textArea != null) {
        pane.getChildren().addAll(label, textArea, close);
    } else {
        pane.getChildren().addAll(label, close);
    }

    stage.show();
}
 
Example 20
Source File: MetadataOverview.java    From sis with Apache License 2.0 4 votes vote down vote up
public MetadataOverview(final DefaultMetadata md, final String fromFile) {
    this.metadata = md;
    this.fromFile = fromFile;
    VBox root = new VBox();
    root.setStyle("-fx-background-color: linear-gradient(to bottom right, #aeb7c4, #fafafa);");

    // Creation of the differents views.
    VBox summaryView = createSummaryView();
    MetadataNode advancedView = new MetadataNode(md.asTreeTable());
    advancedView.setMaxHeight(Double.MAX_VALUE);
    VBox.setVgrow(advancedView, Priority.ALWAYS);

    // Create and configure view selection buttons.
    ToggleGroup buttonGroup = new ToggleGroup();
    ToggleButton tb1 = new ToggleButton("Summary");
    ToggleButton tb2 = new ToggleButton("Advanced");
    tb1.setStyle("-fx-text-fill: white; -fx-font-family: Arial Narrow;-fx-font-weight: bold; -fx-background-color: linear-gradient(#61a2b1, #2A5058); -fx-effect: dropshadow( three-pass-box , rgba(0,0,0,0.6) , 5, 0.0 , 0 , 1 ); -fx-padding: 0.8em;");
    tb2.setStyle("-fx-text-fill: white; -fx-font-family: Arial Narrow;-fx-font-weight: bold; -fx-background-color: linear-gradient(#61a2b1, #2A5058); -fx-effect: dropshadow( three-pass-box , rgba(0,0,0,0.6) , 5, 0.0 , 0 , 1 ); -fx-padding: 0.8em;");

    tb1.setToggleGroup(buttonGroup);
    tb1.setSelected(true);
    tb1.setDisable(true);
    tb2.setToggleGroup(buttonGroup);
    buttonGroup.selectToggle(tb1);
    buttonGroup.selectedToggleProperty().addListener((ObservableValue<? extends Toggle> observable, Toggle oldValue, Toggle newValue) -> {
        if (tb2.isSelected()) {
            tb2.setDisable(true);
            root.getChildren().remove(summaryView);
            root.getChildren().add(advancedView);
            tb1.setDisable(false);
        } else {
            tb1.setDisable(true);
            root.getChildren().add(summaryView);
            root.getChildren().remove(advancedView);
            tb2.setDisable(false);
        }
    });

    HBox toggleGroupLayout = new HBox();
    toggleGroupLayout.getChildren().addAll(tb1, tb2);
    toggleGroupLayout.setPadding(new Insets(0, 0, 10, 0));

    root.getChildren().add(toggleGroupLayout);
    root.getChildren().add(summaryView);

    this.getChildren().add(root);
}