private void addControl(String title, Control control, int rowIndex, boolean addSeparator) { add(createTitle(title), 0, rowIndex); add(control, 0, rowIndex + 1); GridPane.setMargin(control, new Insets(5, 0, 10, 0)); if (addSeparator) { Separator separator = new Separator(); add(separator, 0, rowIndex + 2); GridPane.setMargin(separator, new Insets(0, 0, 5, 0)); } }
/** * * @param node */ protected void apply(Node node) { // sanatize the node super.apply(node); // apply constraints if (row < 0) throw new IllegalArgumentException("You must set the row index"); javafx.scene.layout.GridPane.setRowIndex(node, row); if (col < 0) throw new IllegalArgumentException("You must set the col index"); javafx.scene.layout.GridPane.setColumnIndex(node, col); javafx.scene.layout.GridPane.setRowSpan(node, rowSpan); javafx.scene.layout.GridPane.setColumnSpan(node, colSpan); javafx.scene.layout.GridPane.setMargin(node, margin != null ? margin : marginReset); if (hgrow != null) GenericLayoutConstraints.overrideMaxWidth(node, this); javafx.scene.layout.GridPane.setHalignment(node, halignment != null ? halignment : halignmentReset); javafx.scene.layout.GridPane.setHgrow(node, hgrow != null ? hgrow : hgrowReset); javafx.scene.layout.GridPane.setValignment(node, valignment != null ? valignment : valignmentReset); if (vgrow != null) GenericLayoutConstraints.overrideMaxHeight(node, this); javafx.scene.layout.GridPane.setVgrow(node, vgrow != null ? vgrow : vgrowReset); } }
private Label addLabelContent(GridPane gridPane, int row, Attribute<?,?> attribute) { String mnemonicLabelText=uniformDesign.getLabelText(attribute); if (mnemonicLabelText!=null){ mnemonicLabelText="_"+mnemonicLabelText; } Label label = new Label(mnemonicLabelText); label.setMnemonicParsing(true); label.setWrapText(true); // label.setTextOverrun(OverrunStyle.CLIP); GridPane.setMargin(label, new Insets(0, 9, 0, 0)); StackPane pane = new StackPane(); pane.setPadding(new Insets(5,3,5,3)); pane.setAlignment(Pos.CENTER_LEFT); pane.getChildren().add(label); gridPane.add(pane, 0, row); if (row%2==0) { pane.setStyle("-fx-background-color: " + highlightBackground + ";"); } String tooltip=uniformDesign.getTooltipText(attribute); if (!Strings.isNullOrEmpty(tooltip)) { label.setTooltip(new Tooltip(tooltip)); } return label; } final static String highlightBackground = "#FCFCFC";
closeBtn.setFocusTraversable(false); closeBtn.opacityProperty().bind(transition); GridPane.setMargin(closeBtn, new Insets(0, 0, 0, 8));
graphicContainer.getStyleClass().add("graphic-container"); //$NON-NLS-1$ GridPane.setValignment(graphicContainer, VPos.TOP); GridPane.setMargin(graphicContainer, new Insets(0,10,0,0));
grid.addRow(2, labelTime, radioButtonDigital, radioButtonAnalog); GridPane.setHalignment(labelTime, HPos.RIGHT); GridPane.setMargin(radioButtonAnalog, new Insets(0, 0, 0, 20)); grid.add(labelDate, 0, 8); GridPane.setHalignment(labelDate, HPos.RIGHT); GridPane.setMargin(labelDate, new Insets(0, 0, 0, 40)); CheckBox box6 = new CheckBox("Wochentag anzeigen"); box6.setSelected(true);