Java Code Examples for javafx.scene.control.CheckBox#setAlignment()
The following examples show how to use
javafx.scene.control.CheckBox#setAlignment() .
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: HyperlinkEditorFactory.java From constellation with Apache License 2.0 | 6 votes |
@Override protected Node createEditorControls() { final GridPane controls = new GridPane(); controls.setAlignment(Pos.CENTER); controls.setVgap(CONTROLS_DEFAULT_VERTICAL_SPACING); textField = new TextField(); textField.textProperty().addListener((o, n, v) -> { update(); }); noValueCheckBox = new CheckBox(NO_VALUE_LABEL); noValueCheckBox.setAlignment(Pos.CENTER); noValueCheckBox.selectedProperty().addListener((v, o, n) -> { textField.setDisable(noValueCheckBox.isSelected()); update(); }); controls.addRow(0, textField); controls.addRow(1, noValueCheckBox); return controls; }
Example 2
Source File: FloatObjectEditorFactory.java From constellation with Apache License 2.0 | 6 votes |
@Override protected Node createEditorControls() { final GridPane controls = new GridPane(); controls.setAlignment(Pos.CENTER); controls.setVgap(CONTROLS_DEFAULT_VERTICAL_SPACING); numberField = new TextField(); numberField.textProperty().addListener((o, n, v) -> { update(); }); noValueCheckBox = new CheckBox(NO_VALUE_LABEL); noValueCheckBox.setAlignment(Pos.CENTER); noValueCheckBox.selectedProperty().addListener((v, o, n) -> { numberField.setDisable(noValueCheckBox.isSelected()); update(); }); controls.addRow(0, numberField); controls.addRow(1, noValueCheckBox); return controls; }
Example 3
Source File: ByteObjectEditorFactory.java From constellation with Apache License 2.0 | 6 votes |
@Override protected Node createEditorControls() { final GridPane controls = new GridPane(); controls.setAlignment(Pos.CENTER); controls.setVgap(CONTROLS_DEFAULT_VERTICAL_SPACING); numberField = new TextField(); numberField.textProperty().addListener((o, n, v) -> { update(); }); noValueCheckBox = new CheckBox(NO_VALUE_LABEL); noValueCheckBox.setAlignment(Pos.CENTER); noValueCheckBox.selectedProperty().addListener((v, o, n) -> { numberField.setDisable(noValueCheckBox.isSelected()); update(); }); controls.addRow(0, numberField); controls.addRow(1, noValueCheckBox); return controls; }
Example 4
Source File: LocalDateTimeEditorFactory.java From constellation with Apache License 2.0 | 6 votes |
@Override protected Node createEditorControls() { final GridPane controls = new GridPane(); controls.setAlignment(Pos.CENTER); controls.setVgap(CONTROLS_DEFAULT_VERTICAL_SPACING); noValueCheckBox = new CheckBox(NO_VALUE_LABEL); noValueCheckBox.setAlignment(Pos.CENTER); noValueCheckBox.selectedProperty().addListener((v, o, n) -> { datePicker.setDisable(noValueCheckBox.isSelected()); hourSpinner.setDisable(noValueCheckBox.isSelected()); minSpinner.setDisable(noValueCheckBox.isSelected()); secSpinner.setDisable(noValueCheckBox.isSelected()); milliSpinner.setDisable(noValueCheckBox.isSelected()); update(); }); final HBox timeSpinnerContainer = createTimeSpinners(); controls.addRow(0, timeSpinnerContainer); controls.addRow(1, noValueCheckBox); return controls; }
Example 5
Source File: BooleanEditorFactory.java From constellation with Apache License 2.0 | 6 votes |
@Override protected Node createEditorControls() { final VBox controls = new VBox(); controls.setAlignment(Pos.CENTER); controls.setFillWidth(true); checkBox = new CheckBox("True"); checkBox.setAlignment(Pos.CENTER); checkBox.selectedProperty().addListener((v, o, n) -> { update(); }); controls.getChildren().add(checkBox); return controls; }
Example 6
Source File: LongObjectEditorFactory.java From constellation with Apache License 2.0 | 6 votes |
@Override protected Node createEditorControls() { final GridPane controls = new GridPane(); controls.setAlignment(Pos.CENTER); controls.setVgap(CONTROLS_DEFAULT_VERTICAL_SPACING); numberField = new TextField(); numberField.textProperty().addListener((o, n, v) -> { update(); }); noValueCheckBox = new CheckBox(NO_VALUE_LABEL); noValueCheckBox.setAlignment(Pos.CENTER); noValueCheckBox.selectedProperty().addListener((v, o, n) -> { numberField.setDisable(noValueCheckBox.isSelected()); update(); }); controls.addRow(0, numberField); controls.addRow(1, noValueCheckBox); return controls; }
Example 7
Source File: ShortObjectEditorFactory.java From constellation with Apache License 2.0 | 6 votes |
@Override protected Node createEditorControls() { final GridPane controls = new GridPane(); controls.setAlignment(Pos.CENTER); controls.setVgap(CONTROLS_DEFAULT_VERTICAL_SPACING); numberField = new TextField(); numberField.textProperty().addListener((o, n, v) -> { update(); }); noValueCheckBox = new CheckBox(NO_VALUE_LABEL); noValueCheckBox.setAlignment(Pos.CENTER); noValueCheckBox.selectedProperty().addListener((v, o, n) -> { numberField.setDisable(noValueCheckBox.isSelected()); update(); }); controls.addRow(0, numberField); controls.addRow(1, noValueCheckBox); return controls; }
Example 8
Source File: DoubleObjectEditorFactory.java From constellation with Apache License 2.0 | 6 votes |
@Override protected Node createEditorControls() { final GridPane controls = new GridPane(); controls.setAlignment(Pos.CENTER); controls.setVgap(CONTROLS_DEFAULT_VERTICAL_SPACING); numberField = new TextField(); numberField.textProperty().addListener((o, n, v) -> { update(); }); noValueCheckBox = new CheckBox(NO_VALUE_LABEL); noValueCheckBox.setAlignment(Pos.CENTER); noValueCheckBox.selectedProperty().addListener((v, o, n) -> { numberField.setDisable(noValueCheckBox.isSelected()); update(); }); controls.addRow(0, numberField); controls.addRow(1, noValueCheckBox); return controls; }
Example 9
Source File: TimeEditorFactory.java From constellation with Apache License 2.0 | 6 votes |
@Override protected Node createEditorControls() { final GridPane controls = new GridPane(); controls.setAlignment(Pos.CENTER); controls.setVgap(CONTROLS_DEFAULT_VERTICAL_SPACING); final HBox timeSpinnerContainer = createTimeSpinners(); noValueCheckBox = new CheckBox(NO_VALUE_LABEL); noValueCheckBox.setAlignment(Pos.CENTER); noValueCheckBox.selectedProperty().addListener((v, o, n) -> { hourSpinner.setDisable(noValueCheckBox.isSelected()); minSpinner.setDisable(noValueCheckBox.isSelected()); secSpinner.setDisable(noValueCheckBox.isSelected()); milliSpinner.setDisable(noValueCheckBox.isSelected()); update(); }); controls.addRow(0, timeSpinnerContainer); controls.addRow(1, noValueCheckBox); return controls; }
Example 10
Source File: IntegerObjectEditorFactory.java From constellation with Apache License 2.0 | 6 votes |
@Override protected Node createEditorControls() { final GridPane controls = new GridPane(); controls.setAlignment(Pos.CENTER); controls.setVgap(CONTROLS_DEFAULT_VERTICAL_SPACING); numberField = new TextField(); numberField.textProperty().addListener((o, n, v) -> { update(); }); noValueCheckBox = new CheckBox(NO_VALUE_LABEL); noValueCheckBox.setAlignment(Pos.CENTER); noValueCheckBox.selectedProperty().addListener((v, o, n) -> { numberField.setDisable(noValueCheckBox.isSelected()); update(); }); controls.addRow(0, numberField); controls.addRow(1, noValueCheckBox); return controls; }
Example 11
Source File: BooleanObjectEditorFactory.java From constellation with Apache License 2.0 | 6 votes |
@Override protected Node createEditorControls() { final GridPane controls = new GridPane(); controls.setAlignment(Pos.CENTER); controls.setVgap(CONTROLS_DEFAULT_VERTICAL_SPACING); checkBox = new CheckBox("True:"); checkBox.setAlignment(Pos.CENTER); checkBox.selectedProperty().addListener((v, o, n) -> { update(); }); noValueCheckBox = new CheckBox(NO_VALUE_LABEL); noValueCheckBox.setAlignment(Pos.CENTER); noValueCheckBox.selectedProperty().addListener((v, o, n) -> { checkBox.setDisable(noValueCheckBox.isSelected()); update(); }); controls.addRow(0, checkBox); controls.addRow(1, noValueCheckBox); return controls; }
Example 12
Source File: DateTimeEditorFactory.java From constellation with Apache License 2.0 | 4 votes |
@Override protected Node createEditorControls() { final GridPane controls = new GridPane(); controls.setAlignment(Pos.CENTER); controls.setVgap(CONTROLS_DEFAULT_VERTICAL_SPACING); noValueCheckBox = new CheckBox(NO_VALUE_LABEL); noValueCheckBox.setAlignment(Pos.CENTER); noValueCheckBox.selectedProperty().addListener((v, o, n) -> { datePicker.setDisable(noValueCheckBox.isSelected()); hourSpinner.setDisable(noValueCheckBox.isSelected()); minSpinner.setDisable(noValueCheckBox.isSelected()); secSpinner.setDisable(noValueCheckBox.isSelected()); milliSpinner.setDisable(noValueCheckBox.isSelected()); timeZoneComboBox.setDisable(noValueCheckBox.isSelected()); update(); }); final ObservableList<ZoneId> timeZones = FXCollections.observableArrayList(); ZoneId.getAvailableZoneIds().forEach(id -> { timeZones.add(ZoneId.of(id)); }); timeZoneComboBox = new ComboBox<>(); timeZoneComboBox.setItems(timeZones.sorted(zoneIdComparator)); final Callback<ListView<ZoneId>, ListCell<ZoneId>> cellFactory = (final ListView<ZoneId> p) -> new ListCell<ZoneId>() { @Override protected void updateItem(final ZoneId item, boolean empty) { super.updateItem(item, empty); if (item != null) { setText(TimeZoneUtilities.getTimeZoneAsString(currentValue == null ? null : currentValue.toLocalDateTime(), item)); } } }; final Label timeZoneComboBoxLabel = new Label("Time Zone:"); timeZoneComboBoxLabel.setId(LABEL_ID); timeZoneComboBoxLabel.setLabelFor(timeZoneComboBoxLabel); timeZoneComboBox.setCellFactory(cellFactory); timeZoneComboBox.setButtonCell(cellFactory.call(null)); timeZoneComboBox.getSelectionModel().select(TimeZoneUtilities.UTC); timeZoneComboBox.getSelectionModel().selectedItemProperty().addListener(updateTimeFromZone); final HBox timeZoneHbox = new HBox(timeZoneComboBoxLabel, timeZoneComboBox); timeZoneHbox.setSpacing(5); final HBox timeSpinnerContainer = createTimeSpinners(); controls.addRow(0, timeSpinnerContainer); controls.addRow(1, timeZoneHbox); controls.addRow(2, noValueCheckBox); return controls; }
Example 13
Source File: StringEditorFactory.java From constellation with Apache License 2.0 | 4 votes |
@Override protected Node createEditorControls() { final GridPane controls = new GridPane(); controls.setAlignment(Pos.CENTER); controls.setVgap(CONTROLS_SPACING); final ColumnConstraints cc = new ColumnConstraints(); cc.setHgrow(Priority.ALWAYS); controls.getColumnConstraints().add(cc); final RowConstraints rc = new RowConstraints(); rc.setVgrow(Priority.ALWAYS); controls.getRowConstraints().add(rc); textArea = new TextArea(); textArea.setWrapText(true); textArea.textProperty().addListener((o, n, v) -> { update(); }); textArea.addEventFilter(KeyEvent.KEY_PRESSED, e -> { if (e.getCode() == KeyCode.DELETE) { IndexRange selection = textArea.getSelection(); if (selection.getLength() == 0) { textArea.deleteNextChar(); } else { textArea.deleteText(selection); } e.consume(); } else if (e.isShortcutDown() && e.isShiftDown() && (e.getCode() == KeyCode.RIGHT)) { textArea.selectNextWord(); e.consume(); } else if (e.isShortcutDown() && e.isShiftDown() && (e.getCode() == KeyCode.LEFT)) { textArea.selectPreviousWord(); e.consume(); } else if (e.isShortcutDown() && (e.getCode() == KeyCode.RIGHT)) { textArea.nextWord(); e.consume(); } else if (e.isShortcutDown() && (e.getCode() == KeyCode.LEFT)) { textArea.previousWord(); e.consume(); } else if (e.isShiftDown() && (e.getCode() == KeyCode.RIGHT)) { textArea.selectForward(); e.consume(); } else if (e.isShiftDown() && (e.getCode() == KeyCode.LEFT)) { textArea.selectBackward(); e.consume(); } else if (e.isShortcutDown() && (e.getCode() == KeyCode.A)) { textArea.selectAll(); e.consume(); } else if (e.getCode() == KeyCode.ESCAPE) { e.consume(); } }); noValueCheckBox = new CheckBox(NO_VALUE_LABEL); noValueCheckBox.setAlignment(Pos.CENTER); noValueCheckBox.selectedProperty().addListener((v, o, n) -> { textArea.setDisable(noValueCheckBox.isSelected()); update(); }); controls.addRow(0, textArea); controls.addRow(1, noValueCheckBox); return controls; }