Java Code Examples for javafx.scene.layout.Priority

The following examples show how to use javafx.scene.layout.Priority. These examples are extracted from open source projects. 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 Project: PeerWasp   Author: PeerWasp   File: ActivityItemCell.java    License: MIT License 7 votes vote down vote up
private void initializeGrid() {
	grid.setHgap(10);
	grid.setVgap(5);
	grid.setPadding(new Insets(0, 10, 0, 10));

	// icon column
	ColumnConstraints col1 = new ColumnConstraints();
	col1.setFillWidth(false);
	col1.setHgrow(Priority.NEVER);
	grid.getColumnConstraints().add(col1);

	// title column: grows
	ColumnConstraints col2 = new ColumnConstraints();
	col2.setFillWidth(true);
	col2.setHgrow(Priority.ALWAYS);
	grid.getColumnConstraints().add(col2);

	// date column
	ColumnConstraints col3 = new ColumnConstraints();
	col3.setFillWidth(false);
	col3.setHgrow(Priority.NEVER);
	grid.getColumnConstraints().add(col3);
}
 
Example #2
Source Project: constellation   Author: constellation-app   File: EasyGridPane.java    License: Apache License 2.0 6 votes vote down vote up
public void addColumnConstraint(boolean fillWidth, HPos alignment, Priority grow, double maxWidth, double minWidth, double prefWidth, double percentWidth) {
    ColumnConstraints constraint = new ColumnConstraints();
    constraint.setFillWidth(fillWidth);
    constraint.setHalignment(alignment);
    constraint.setHgrow(grow);
    constraint.setMaxWidth(maxWidth);
    constraint.setMinWidth(minWidth);
    constraint.setPrefWidth(prefWidth);

    if (percentWidth >= 0) {
        constraint.setPercentWidth(percentWidth);
    }

    getColumnConstraints().add(constraint);
}
 
Example #3
Source Project: oim-fx   Author: oimchat   File: NotificationBar.java    License: MIT License 6 votes vote down vote up
void updatePane() {
    actionsBar = ActionUtils.createButtonBar(getActions());
    actionsBar.opacityProperty().bind(transition);
    GridPane.setHgrow(actionsBar, Priority.SOMETIMES);
    pane.getChildren().clear();
    
    int row = 0;
    
    if (title != null) {
        pane.add(title, 0, row++);
    }
    
    pane.add(label, 0, row);
    pane.add(actionsBar, 1, row);
    
    if (isCloseButtonVisible()) {
        pane.add(closeBtn, 2, 0, 1, row+1);
    }
}
 
Example #4
Source Project: bisq   Author: bisq-network   File: FormBuilder.java    License: GNU Affero General Public License v3.0 6 votes vote down vote up
public static Tuple3<Label, TextField, Button> addTopLabelTextFieldButton(GridPane gridPane,
                                                                          int rowIndex,
                                                                          String title,
                                                                          String buttonTitle,
                                                                          double top) {

    TextField textField = new BisqTextField();
    textField.setEditable(false);
    textField.setMouseTransparent(true);
    textField.setFocusTraversable(false);
    Button button = new AutoTooltipButton(buttonTitle);
    button.setDefaultButton(true);

    HBox hBox = new HBox();
    hBox.setSpacing(10);
    hBox.getChildren().addAll(textField, button);
    HBox.setHgrow(textField, Priority.ALWAYS);

    final Tuple2<Label, VBox> labelVBoxTuple2 = addTopLabelWithVBox(gridPane, rowIndex, title, hBox, top);

    return new Tuple3<>(labelVBoxTuple2.first, textField, button);
}
 
Example #5
Source Project: constellation   Author: constellation-app   File: TransactionTypeNodeProvider.java    License: Apache License 2.0 6 votes vote down vote up
private VBox addFilter() {
    filterText.setPromptText("Filter transaction types");
    final ToggleGroup toggleGroup = new ToggleGroup();
    startsWithRb.setToggleGroup(toggleGroup);
    startsWithRb.setPadding(new Insets(0, 0, 0, 5));
    startsWithRb.setSelected(true);
    final RadioButton containsRadioButton = new RadioButton("Contains");
    containsRadioButton.setToggleGroup(toggleGroup);
    containsRadioButton.setPadding(new Insets(0, 0, 0, 5));

    toggleGroup.selectedToggleProperty().addListener((observable, oldValue, newValue) -> {
        populateTree();
    });

    filterText.textProperty().addListener((observable, oldValue, newValue) -> {
        populateTree();
    });

    final HBox headerBox = new HBox(new Label("Filter: "), filterText, startsWithRb, containsRadioButton);
    headerBox.setAlignment(Pos.CENTER_LEFT);
    headerBox.setPadding(new Insets(5));

    final VBox box = new VBox(schemaLabel, headerBox, treeView);
    VBox.setVgrow(treeView, Priority.ALWAYS);
    return box;
}
 
Example #6
Source Project: marathonv5   Author: jalian-systems   File: SplitDockingContainer.java    License: Apache License 2.0 6 votes vote down vote up
public SplitDockingContainer(DockingDesktop desktop, IDockingContainer parent, Dockable base, Dockable dockable, Split position,
        double proportion) {
    setMaxHeight(Double.MAX_VALUE);
    setMaxWidth(Double.MAX_VALUE);
    HBox.setHgrow(this, Priority.ALWAYS);
    VBox.setVgrow(this, Priority.ALWAYS);
    getProperties().put(DockingDesktop.DOCKING_CONTAINER, parent);
    setOrientation(position.getOrientation());
    ObservableList<Node> items = getItems();
    if (position == Split.LEFT || position == Split.TOP) {
        items.add(new TabDockingContainer(desktop, this, dockable));
        items.add(new TabDockingContainer(desktop, this, base));
    } else {
        items.add(new TabDockingContainer(desktop, this, base));
        items.add(new TabDockingContainer(desktop, this, dockable));
    }
    setDividerPositions(proportion);
}
 
Example #7
Source Project: pattypan   Author: yarl   File: LoadPane.java    License: MIT License 6 votes vote down vote up
private void setContent() {
  addElement("validate-intro", 40);

  browsePath.setDisable(true);
  reloadButton.setDisable(true);

  addElementRow(
          new Node[]{browseButton, browsePath, reloadButton},
          new Priority[]{Priority.NEVER, Priority.ALWAYS, Priority.NEVER}
  );
  addElement(new WikiScrollPane(infoContainer));

  prevButton.linkTo("StartPane", stage);
  nextButton.linkTo("CheckPane", stage);
  nextButton.setDisable(true);
}
 
Example #8
Source Project: marathonv5   Author: jalian-systems   File: AddPreferenceStage.java    License: 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 #9
Source Project: marathonv5   Author: jalian-systems   File: FixtureSelection.java    License: 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 #10
Source Project: bisq   Author: bisq-network   File: ProposalsView.java    License: GNU Affero General Public License v3.0 6 votes vote down vote up
private void createProposalsTableView() {
    proposalsHeadline = new TableGroupHeadline(Res.get("dao.proposal.active.header"));
    GridPane.setRowIndex(proposalsHeadline, ++gridRow);
    GridPane.setMargin(proposalsHeadline, new Insets(Layout.GROUP_DISTANCE, -10, -10, -10));
    root.getChildren().add(proposalsHeadline);

    tableView = new TableView<>();
    tableView.setPlaceholder(new AutoTooltipLabel(Res.get("table.placeholder.noData")));
    tableView.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);

    createProposalColumns();
    GridPane.setRowIndex(tableView, gridRow);
    GridPane.setHgrow(tableView, Priority.ALWAYS);
    GridPane.setVgrow(tableView, Priority.SOMETIMES);
    GridPane.setMargin(tableView, new Insets(Layout.FIRST_ROW_AND_GROUP_DISTANCE, -10, 5, -10));
    root.getChildren().add(tableView);

    tableView.setItems(sortedList);
}
 
Example #11
Source Project: Quelea   Author: quelea-projection   File: StatusPanel.java    License: GNU General Public License v3.0 6 votes vote down vote up
/**
 * Create a new status panel.
 * <p/>
 * @param group the group this panel is part of.
 * @param labelText the text to put on the label on this panel.
 * @param index the index of this panel on the group.
 */
StatusPanel(StatusPanelGroup group, String labelText, int index) {
    setAlignment(Pos.CENTER);
    setSpacing(5);
    this.group = group;
    this.index = index;
    label = new Label(labelText);
    label.setAlignment(Pos.CENTER);
    label.setMaxHeight(Double.MAX_VALUE);
    HBox.setMargin(label, new Insets(5));
    progressBar = new ProgressBar();
    progressBar.setMaxWidth(Double.MAX_VALUE); //Allow progress bar to fill space.
    HBox.setHgrow(progressBar, Priority.ALWAYS);
    cancelButton = new Button("", new ImageView(new Image("file:icons/cross.png", 13, 13, false, true)));
    Utils.setToolbarButtonStyle(cancelButton);
    cancelButton.setAlignment(Pos.CENTER);
    getChildren().add(label);
    getChildren().add(progressBar);
    getChildren().add(cancelButton);
}
 
Example #12
Source Project: VocabHunter   Author: VocabHunter   File: FilterFileCell.java    License: Apache License 2.0 6 votes vote down vote up
public FilterFileCell(final I18nManager i18nManager, final Consumer<FilterFileModel> removalHandler, final Consumer<FilterFileModel> editHandler) {
    this.i18nManager = i18nManager;

    HBox.setHgrow(spacer, Priority.ALWAYS);
    hbox.setAlignment(Pos.CENTER_LEFT);
    iconBox.setAlignment(Pos.CENTER_LEFT);
    iconBox.getStyleClass().add("iconBox");

    buttonEdit.setOnAction(e -> editHandler.accept(lastItem));
    buttonEdit.setId("buttonEdit");
    buttonEdit.setTooltip(new Tooltip(i18nManager.text(FILTER_MAIN_LISTS_BUTTON_EDIT)));
    editIcon.setStyleClass("buttonEditIcon");

    buttonRemoveList.setOnAction(e -> removalHandler.accept(lastItem));
    buttonRemoveList.setTooltip(new Tooltip(i18nManager.text(FILTER_MAIN_LISTS_BUTTON_DELETE)));
    removeListIcon.setStyleClass("buttonDeleteIcon");
}
 
Example #13
Source Project: xdat_editor   Author: acmi   File: Controller.java    License: MIT License 6 votes vote down vote up
private Tab createTab(Field listField) {
    Tab tab = new Tab(listField.getName());

    SplitPane pane = new SplitPane();

    TextField filter = TextFields.createClearableTextField();
    VBox.setMargin(filter, new Insets(2));
    TreeView<Object> elements = createTreeView(listField, filter.textProperty());
    VBox.setVgrow(elements, Priority.ALWAYS);
    PropertySheet properties = createPropertySheet(elements);

    pane.getItems().addAll(new VBox(filter, elements), properties);
    pane.setDividerPositions(0.3);

    tab.setContent(wrap(pane));

    return tab;
}
 
Example #14
Source Project: milkman   Author: warmuuh   File: RestRequestEditController.java    License: MIT License 6 votes vote down vote up
public RestRequestEditControllerFxml(RestRequestEditController controller) {
	HBox.setHgrow(this, Priority.ALWAYS);
	var methods = new JFXComboBox<String>();
	add(methods);
	methods.setId("httpMethods");
	controller.httpMethod = methods;
	methods.setValue("GET");
	methods.getItems().add("GET");
	methods.getItems().add("POST");
	methods.getItems().add("PUT");
	methods.getItems().add("DELETE");
	methods.getItems().add("PATCH");
	methods.getItems().add("HEAD");
	methods.getItems().add("OPTIONS");
	
	controller.requestUrl = add(new LongTextField(), true);
	controller.requestUrl.setId("requestUrl");
}
 
Example #15
Source Project: MSPaintIDE   Author: MSPaintIDE   File: SettingNumberField.java    License: MIT License 6 votes vote down vote up
public SettingNumberField() {
    getStyleClass().add("theme-text");
    setStyle("-fx-padding: 10px 0");
    label.getStyleClass().add("theme-text");
    numberField.getStyleClass().add("theme-text");


    Node spacer = getHSpacer(10);
    HBox.setHgrow(label, Priority.NEVER);
    HBox.setHgrow(numberField, Priority.NEVER);
    HBox.setHgrow(spacer, Priority.NEVER);

    label.setPrefHeight(25);
    getChildren().add(label);
    getChildren().add(spacer);
    getChildren().add(numberField);
    numberField.textProperty().addListener(((observable, oldValue, newValue) -> SettingsManager.getInstance().setSetting(settingProperty.get(), newValue.isEmpty() ? 0 : Integer.valueOf(newValue))));
}
 
Example #16
Source Project: logbook-kai   Author: sanaehirotaka   File: Deck.java    License: MIT License 6 votes vote down vote up
@Override
protected void updateItem(DeckFleetPane item, boolean empty) {
    super.updateItem(item, empty);
    if (!empty) {
        if (item != null) {
            Label text = new Label();
            text.textProperty().bind(item.getFleetName().textProperty());
            Pane pane = new Pane();
            Button del = new Button("除去");
            del.getStyleClass().add("delete");
            del.setOnAction(e -> {
                Deck.this.fleetList.getItems().remove(item);
                Deck.this.fleets.getChildren().removeIf(node -> node == item);
            });
            HBox box = new HBox(text, pane, del);
            HBox.setHgrow(pane, Priority.ALWAYS);

            this.setGraphic(box);
        } else {
            this.setGraphic(null);
        }
    } else {
        this.setGraphic(null);
    }
}
 
Example #17
Source Project: bisq   Author: bisq-network   File: DaoLaunchWindow.java    License: GNU Affero General Public License v3.0 6 votes vote down vote up
private void createSlideControls() {
    sectionButtonsGroup = new ToggleGroup();

    HBox slideButtons = new HBox();
    slideButtons.setMaxWidth(616);
    slideButtons.getStyleClass().add("dao-launch-tab-box");

    sections.forEach(section -> {
        SectionButton sectionButton = new SectionButton(section.title.toUpperCase(), sections.indexOf(section));
        sectionButton.setMaxWidth(Double.MAX_VALUE);
        HBox.setHgrow(sectionButton, Priority.ALWAYS);
        slideButtons.getChildren().add(sectionButton);
    });

    sectionButtonsGroup.getToggles().get(0).setSelected(true);

    GridPane.setRowIndex(slideButtons, ++rowIndex);
    GridPane.setColumnSpan(slideButtons, 2);
    GridPane.setHalignment(slideButtons, HPos.CENTER);
    GridPane.setHgrow(slideButtons, Priority.NEVER);
    gridPane.getChildren().add(slideButtons);
}
 
Example #18
Source Project: bisq   Author: bisq-network   File: SpreadView.java    License: GNU Affero General Public License v3.0 6 votes vote down vote up
@Override
public void initialize() {
    tableView = new TableView<>();

    int gridRow = 0;
    GridPane.setRowIndex(tableView, gridRow);
    GridPane.setVgrow(tableView, Priority.ALWAYS);
    GridPane.setHgrow(tableView, Priority.ALWAYS);
    root.getChildren().add(tableView);
    Label placeholder = new AutoTooltipLabel(Res.get("table.placeholder.noData"));
    placeholder.setWrapText(true);
    tableView.setPlaceholder(placeholder);

    TableColumn<SpreadItem, SpreadItem> currencyColumn = getCurrencyColumn();
    tableView.getColumns().add(currencyColumn);
    numberOfOffersColumn = getNumberOfOffersColumn();
    tableView.getColumns().add(numberOfOffersColumn);
    numberOfBuyOffersColumn = getNumberOfBuyOffersColumn();
    tableView.getColumns().add(numberOfBuyOffersColumn);
    numberOfSellOffersColumn = getNumberOfSellOffersColumn();
    tableView.getColumns().add(numberOfSellOffersColumn);
    totalAmountColumn = getTotalAmountColumn();
    tableView.getColumns().add(totalAmountColumn);
    TableColumn<SpreadItem, SpreadItem> spreadColumn = getSpreadColumn();
    tableView.getColumns().add(spreadColumn);
    tableView.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);

    currencyColumn.setComparator(Comparator.comparing(o -> CurrencyUtil.getNameByCode(o.currencyCode)));
    numberOfOffersColumn.setComparator(Comparator.comparingInt(o3 -> o3.numberOfOffers));
    numberOfBuyOffersColumn.setComparator(Comparator.comparingInt(o3 -> o3.numberOfBuyOffers));
    numberOfSellOffersColumn.setComparator(Comparator.comparingInt(o2 -> o2.numberOfSellOffers));
    totalAmountColumn.setComparator(Comparator.comparing(o -> o.totalAmount));
    spreadColumn.setComparator(Comparator.comparingDouble(o -> o.percentageValue));

    numberOfOffersColumn.setSortType(TableColumn.SortType.DESCENDING);
    tableView.getSortOrder().add(numberOfOffersColumn);
    itemListChangeListener = c -> updateHeaders();
}
 
Example #19
Source Project: milkman   Author: warmuuh   File: ManageWorkspacesDialog.java    License: MIT License 6 votes vote down vote up
private HBox createEntry(String workspaceName) {
	
	JFXButton renameButton = new JFXButton();
	renameButton.setGraphic(new FontAwesomeIconView(FontAwesomeIcon.PENCIL, "1.5em"));
	renameButton.setTooltip(new Tooltip("Rename workspace"));
	renameButton.setOnAction(e -> triggerRenameDialog(workspaceName));
	
	JFXButton deleteButton = new JFXButton();
	deleteButton.setGraphic(new FontAwesomeIconView(FontAwesomeIcon.TIMES, "1.5em"));
	deleteButton.setTooltip(new Tooltip("Delete workspace"));
	deleteButton.setOnAction(e -> {
		onCommand.invoke(new AppCommand.DeleteWorkspace(workspaceName));
		Platform.runLater(() -> workspaces.remove(workspaceName));
	});

	JFXButton exportButton = new JFXButton();
	exportButton.setGraphic(new FontAwesomeIconView(FontAwesomeIcon.UPLOAD, "1.5em"));
	exportButton.setTooltip(new Tooltip("Export workspace"));
	exportButton.setOnAction(e -> triggerExportWorkspaceDialog(workspaceName));

	Label wsName = new Label(workspaceName);
	HBox.setHgrow(wsName, Priority.ALWAYS);
	
	return new HBox(wsName, renameButton, deleteButton, exportButton);
}
 
Example #20
Source Project: chart-fx   Author: GSI-CS-CO   File: TilingPane.java    License: Apache License 2.0 6 votes vote down vote up
public TilingPane(final Layout layout, Node... nodes) {
    super();
    this.layout.set(layout);
    VBox.setVgrow(this, Priority.ALWAYS);
    getChildren().addListener((ListChangeListener<Node>) change -> {
        while (change.next()) {
            layoutNormal();
        }
    });

    this.layout.addListener((ch, o, n) -> layoutNormal());

    if (nodes != null) {
        getChildren().addAll(nodes);
    }
}
 
Example #21
Source Project: chart-fx   Author: GSI-CS-CO   File: EditAxis.java    License: Apache License 2.0 6 votes vote down vote up
private Pane getMinMaxButtons(final Axis axis, final boolean isHorizontal, final boolean isMin) {
    final Button incMaxButton = new Button("", new Glyph(EditAxis.FONT_AWESOME, "\uf077"));
    incMaxButton.setMaxWidth(Double.MAX_VALUE);
    VBox.setVgrow(incMaxButton, Priority.ALWAYS);
    HBox.setHgrow(incMaxButton, Priority.ALWAYS);
    incMaxButton.setOnAction(evt -> {
        axis.setAutoRanging(false);
        changeAxisRangeLimit(axis, isHorizontal ? isMin : !isMin, true);
    });

    final Button decMaxButton = new Button("", new Glyph(EditAxis.FONT_AWESOME, "\uf078"));
    decMaxButton.setMaxWidth(Double.MAX_VALUE);
    VBox.setVgrow(decMaxButton, Priority.ALWAYS);
    HBox.setHgrow(decMaxButton, Priority.ALWAYS);

    decMaxButton.setOnAction(evt -> {
        axis.setAutoRanging(false);
        changeAxisRangeLimit(axis, isHorizontal ? isMin : !isMin, false);
    });
    final Pane box = isHorizontal ? new VBox() : new HBox();
    box.getChildren().addAll(incMaxButton, decMaxButton);

    return box;
}
 
Example #22
Source Project: chart-fx   Author: GSI-CS-CO   File: EditAxis.java    License: Apache License 2.0 6 votes vote down vote up
private Pane getRangeChangeButtons(final Axis axis, final boolean isHorizontal) {
    final Button incMaxButton = new Button("", new Glyph(EditAxis.FONT_AWESOME, "expand"));
    incMaxButton.setMaxWidth(Double.MAX_VALUE);
    VBox.setVgrow(incMaxButton, Priority.NEVER);
    HBox.setHgrow(incMaxButton, Priority.NEVER);
    incMaxButton.setOnAction(evt -> {
        axis.setAutoRanging(false);
        changeAxisRange(axis, true);
    });

    final Button decMaxButton = new Button("", new Glyph(EditAxis.FONT_AWESOME, "compress"));
    decMaxButton.setMaxWidth(Double.MAX_VALUE);
    VBox.setVgrow(decMaxButton, Priority.NEVER);
    HBox.setHgrow(decMaxButton, Priority.NEVER);

    decMaxButton.setOnAction(evt -> {
        axis.setAutoRanging(false);
        changeAxisRange(axis, false);
    });
    final Pane boxMax = isHorizontal ? new VBox() : new HBox();
    boxMax.getChildren().addAll(incMaxButton, decMaxButton);

    return boxMax;
}
 
Example #23
Source Project: gef   Author: eclipse   File: DotHTMLLabelJavaFxNode.java    License: Eclipse Public License 2.0 6 votes vote down vote up
private void applyTableAlignAttributesOnTdPane(GridPane wrapper) {
	/*
	 * Graphviz documentation specifies for the ALIGN attribute on cells: If
	 * the cell does not contain text, then the contained image or table is
	 * centered.
	 *
	 * Further, by observation, unless the fixedsize attribute is set, in
	 * graphviz the inner table grows in both horizontal and vertical
	 * direction.
	 *
	 * TODO: revise these settings when the align attribute on table tags is
	 * implemented, as this may change some behaviour.
	 */
	GridPane.setHgrow(wrapper.getChildren().get(0), Priority.ALWAYS);
	GridPane.setVgrow(wrapper.getChildren().get(0), Priority.ALWAYS);
	wrapper.setAlignment(Pos.CENTER);
}
 
Example #24
Source Project: yfiton   Author: yfiton   File: NotificationBar.java    License: Apache License 2.0 6 votes vote down vote up
void updatePane() {
    actionsBar = ActionUtils.createButtonBar(getActions());
    actionsBar.opacityProperty().bind(transition);
    GridPane.setHgrow(actionsBar, Priority.SOMETIMES);
    pane.getChildren().clear();

    int row = 0;

    if (title != null) {
        pane.add(title, 0, row++);
    }

    pane.add(label, 0, row);
    pane.add(actionsBar, 1, row);

    if (isCloseButtonVisible()) {
        pane.add(closeBtn, 2, 0, 1, row + 1);
    }
}
 
Example #25
Source Project: MyBox   Author: Mararsh   File: EpidemicReportsChartController.java    License: Apache License 2.0 5 votes vote down vote up
protected LabeledBarChart addVerticalBarChart() {
        chartBox.getChildren().clear();
//        boolean intValue = !message("HealedRatio").equals(valueName)
//                && !message("DeadRatio").equals(valueName);
        LabeledBarChart barChart
                = LabeledBarChart.create(categoryAxisCheck.isSelected(), chartCoordinate)
                        .setIntValue(false)
                        .setLabelType(labelType)
                        .setTextSize(textSize);
        barChart.setAlternativeRowFillVisible(false);
        barChart.setAlternativeColumnFillVisible(false);
        barChart.setBarGap(0.0);
        barChart.setCategoryGap(0.0);
        barChart.setAnimated(false);
        barChart.getXAxis().setAnimated(false);
        barChart.getYAxis().setAnimated(false);
        barChart.getXAxis().setTickLabelRotation(90);
        barChart.setVerticalGridLinesVisible(vlinesCheck.isSelected());
        barChart.setHorizontalGridLinesVisible(hlinesCheck.isSelected());
        barChart.setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE);
        VBox.setVgrow(barChart, Priority.ALWAYS);
        HBox.setHgrow(barChart, Priority.ALWAYS);
        if (legendSide == null) {
            barChart.setLegendVisible(false);
        } else {
            barChart.setLegendVisible(true);
            barChart.setLegendSide(legendSide);
        }
        chartBox.getChildren().add(barChart);
        return barChart;
    }
 
Example #26
Source Project: oim-fx   Author: oimchat   File: ListCellTextFieldTest.java    License: MIT License 5 votes vote down vote up
public XCell() {
    super();
    hbox.getChildren().addAll(label, pane, button);
    HBox.setHgrow(pane, Priority.ALWAYS);
    button.setOnAction(new EventHandler<ActionEvent>() {
        @Override
        public void handle(ActionEvent event) {
            System.out.println(lastItem + " : " + event);
        }
    });
}
 
Example #27
Source Project: bisq   Author: bisq-network   File: ProposalResultsWindow.java    License: GNU Affero General Public License v3.0 5 votes vote down vote up
private void addContent(EvaluatedProposal evaluatedProposal, Ballot ballot) {
    Proposal proposal = evaluatedProposal.getProposal();
    ProposalDisplay proposalDisplay = new ProposalDisplay(gridPane, bsqFormatter, daoFacade, null,
            navigation, preferences);
    proposalDisplay.createAllFields("", rowIndex, -Layout.FIRST_ROW_DISTANCE, proposal.getType(),
            false, "last");
    proposalDisplay.setEditable(false);
    proposalDisplay.onNavigate(this::doClose);

    proposalDisplay.applyProposalPayload(proposal);
    proposalDisplay.applyEvaluatedProposal(evaluatedProposal);
    proposalDisplay.setIsVoteIncludedInResult(isVoteIncludedInResult);

    Tuple2<Long, Long> meritAndStakeTuple = daoFacade.getMeritAndStakeForProposal(proposal.getTxId());
    long merit = meritAndStakeTuple.first;
    long stake = meritAndStakeTuple.second;
    proposalDisplay.applyBallotAndVoteWeight(ballot, merit, stake, isVoteIncludedInResult);

    Region spacer = new Region();
    GridPane.setVgrow(spacer, Priority.ALWAYS);
    GridPane.setRowIndex(spacer, proposalDisplay.incrementAndGetGridRow());
    gridPane.getChildren().add(spacer);

    addCloseButton(gridPane, proposalDisplay.incrementAndGetGridRow());

    createTabs();

    gridPane.setPadding(new Insets(0, 15, 15, 15));
    proposalTab.setContent(gridPane);
    votesTab.setContent(createVotesTable());
}
 
Example #28
Source Project: constellation   Author: constellation-app   File: ConversationBox.java    License: Apache License 2.0 5 votes vote down vote up
public BubbleBox(final ConversationMessage message) {
    setVgap(3);

    final ColumnConstraints spaceColumn = new ColumnConstraints();
    spaceColumn.setHgrow(Priority.ALWAYS);
    spaceColumn.setMinWidth(50);
    spaceColumn.setPrefWidth(50);

    final ColumnConstraints contentColumn = new ColumnConstraints();
    contentColumn.setHalignment(message.getConversationSide() == ConversationSide.LEFT ? HPos.LEFT : HPos.RIGHT);
    contentColumn.setFillWidth(false);
    contentColumn.setHgrow(Priority.NEVER);

    final RowConstraints contentRow = new RowConstraints();
    contentRow.setFillHeight(true);
    contentRow.setMaxHeight(Double.MAX_VALUE);
    contentRow.setValignment(VPos.TOP);

    getRowConstraints().addAll(contentRow);

    if (message.getConversationSide() == ConversationSide.LEFT) {
        contentColumnIndex = 0;
        getColumnConstraints().addAll(contentColumn, spaceColumn);
    } else {
        contentColumnIndex = 1;
        getColumnConstraints().addAll(spaceColumn, contentColumn);
    }

    update(message);
}
 
Example #29
Source Project: Schillsaver   Author: Valkryst   File: MainView.java    License: 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 #30
Source Project: phoebus   Author: ControlSystemStudio   File: PropertyPanel.java    License: Eclipse Public License 1.0 5 votes vote down vote up
/** @param selection Selection handler
 *  @param undo 'Undo' manager
 */
public PropertyPanel (final DisplayEditor editor)
{

    this.editor = editor;
    section = new PropertyPanelSection();

    searchField.setPromptText(Messages.SearchTextField);
    searchField.setTooltip(new Tooltip(Messages.PropertyFilterTT));
    searchField.textProperty().addListener( ( observable, oldValue, newValue ) -> setSelectedWidgets(editor.getWidgetSelectionHandler().getSelection()));
    HBox.setHgrow(searchField, Priority.NEVER);

    final HBox toolsPane = new HBox(6);
    toolsPane.setAlignment(Pos.CENTER_RIGHT);
    toolsPane.setPadding(new Insets(6));
    toolsPane.getChildren().add(searchField);

    final ScrollPane scrollPane = new ScrollPane();
    scrollPane.setFitToWidth(true);
    scrollPane.setContent(section);
    scrollPane.setMinHeight(0);

    setTop(toolsPane);
    setCenter(scrollPane);

    // Track currently selected widgets
    editor.getWidgetSelectionHandler().addListener(this::setSelectedWidgets);

    setMinHeight(0);
}