List of usage examples for javafx.scene.layout Priority ALWAYS
Priority ALWAYS
To view the source code for javafx.scene.layout Priority ALWAYS.
Click Source Link
From source file:org.pdfsam.rotate.RotateModule.java
@Override protected Pane getInnerPanel() { VBox pane = new VBox(); pane.setAlignment(Pos.TOP_CENTER);/*from w ww . j ava 2 s.c o m*/ VBox.setVgrow(selectionPane, Priority.ALWAYS); TitledPane prefixTitled = Views.titledPane(DefaultI18nContext.getInstance().i18n("File names settings"), prefix); prefix.addMenuItemFor(Prefix.FILENUMBER); TitledPane options = Views.titledPane(DefaultI18nContext.getInstance().i18n("Rotate settings"), rotateOptions); pane.getChildren().addAll(selectionPane, options, Views.titledPane(DefaultI18nContext.getInstance().i18n("Destination directory"), destinationPane), prefixTitled); return pane; }
From source file:com.github.drbookings.ui.controller.BookingDetailsController.java
private static void addRow0(final Pane content, final BookingBean be) { final HBox box = new HBox(); final HBox boxName = new HBox(); final HBox boxDates = new HBox(); final HBox boxNights = new HBox(); box.setAlignment(Pos.CENTER);//from w w w. ja v a 2 s .c o m boxName.getStyleClass().add("first-line"); boxDates.getStyleClass().add("first-line"); boxNights.getStyleClass().add("first-line"); boxName.setPadding(boxPadding); boxDates.setPadding(boxPadding); boxNights.setPadding(boxPadding); boxName.setAlignment(Pos.CENTER); boxDates.setAlignment(Pos.CENTER); boxNights.setAlignment(Pos.CENTER); HBox.setHgrow(boxName, Priority.ALWAYS); HBox.setHgrow(boxDates, Priority.ALWAYS); HBox.setHgrow(boxNights, Priority.ALWAYS); addName(boxName, be); // box.getChildren().add(new Separator(Orientation.VERTICAL)); addDates(boxDates, be); // box.getChildren().add(new Separator(Orientation.VERTICAL)); addNights(boxNights, be); box.getChildren().addAll(boxName, boxDates, boxNights); box.getStyleClass().add(Styles.getBackgroundStyleSource(be.getBookingOrigin().getName())); content.getChildren().add(box); }
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXScopeAttrPane.java
public CFBamJavaFXScopeAttrPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamScopeObj argFocus) {/*from ww w . j av a 2 s . c om*/ super(); Control ctrl; CFLabel label; CFReferenceEditor reference; final String S_ProcName = "construct-schema-focus"; if (formManager == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1, "formManager"); } cfFormManager = formManager; if (argSchema == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 2, "argSchema"); } // argFocus is optional; focus may be set later during execution as // conditions of the runtime change. javafxSchema = argSchema; setJavaFXFocusAsScope(argFocus); setPadding(new Insets(5)); setHgap(5); setVgap(5); setAlignment(Pos.CENTER); ColumnConstraints column1 = new ColumnConstraints(125); ColumnConstraints column2 = new ColumnConstraints(125, 300, 500); column2.setHgrow(Priority.ALWAYS); getColumnConstraints().addAll(column1, column2); int gridRow = 0; label = getJavaFXLabelId(); setHalignment(label, HPos.LEFT); add(label, 0, gridRow); ctrl = getJavaFXEditorId(); setHalignment(ctrl, HPos.LEFT); add(ctrl, 1, gridRow); gridRow++; populateFields(); adjustComponentEnableStates(); javafxIsInitializing = false; }
From source file:poe.trade.assist.SearchPane.java
public SearchPane(List<Search> searchList) { data = new SimpleListProperty<>(FXCollections.observableArrayList(searchList)); website.setOnAction(e -> SwingUtil.openUrlViaBrowser(website.getText())); setupSearchTable();// www. j a va 2 s . c om setupFilterTextField(); info.setWrapText(true); // setupColumns(); setupAddFields(); setupTableClickListener(); addButton.setOnAction((ActionEvent e) -> { data.add(new Search(addName.getText(), addTags.getText(), addURL.getText(), addAuto.isSelected(), "price_in_chaos")); addName.clear(); addTags.clear(); addURL.clear(); addAuto.setSelected(false); }); remButton.setOnAction((ActionEvent e) -> { int index = searchTable.getSelectionModel().getSelectedIndex(); // if (index != -1) { // searchTable.getItems().remove(index); // } searchTable.remove(index); }); final HBox hb = new HBox(3); hb.getChildren().addAll(addAuto, addButton, remButton); final VBox vb = new VBox(3, addName, addTags, addURL, hb); setSpacing(5); setPadding(new Insets(10, 0, 0, 10)); getChildren().addAll(tagFilterField, nameFilterField, showOnlyNew, searchTable, vb, info); VBox.setVgrow(searchTable, Priority.ALWAYS); setMaxWidth(Double.MAX_VALUE); }
From source file:gov.va.isaac.gui.preferences.plugins.properties.PreferencesPluginTextFieldProperty.java
public PreferencesPluginTextFieldProperty(Label label, boolean emptyStringAllowed) { super(label, new TextField(), new SimpleStringProperty(), null, // validator handled below new StringConverter<String>() { @Override/* w w w .j a v a 2s . com*/ public String convertToString(String value) { return value != null ? value.toString() : null; } }, new PropertyAction<String, TextField>() { @Override public void apply(PreferencesPluginProperty<String, TextField> property) { property.getProperty().bind(property.getControl().textProperty()); } }, new PropertyAction<String, TextField>() { @Override public void apply(PreferencesPluginProperty<String, TextField> property) { property.getControl().textProperty().set(property.readFromPersistedPreferences()); } }, new PropertyAction<String, TextField>() { @Override public void apply(PreferencesPluginProperty<String, TextField> property) { GridPane.setHgrow(property.getLabel(), Priority.NEVER); GridPane.setFillWidth(property.getControl(), true); GridPane.setHgrow(property.getControl(), Priority.ALWAYS); } }); validator = new ValidBooleanBinding() { { bind(getProperty()); setComputeOnInvalidate(true); } @Override protected boolean computeValue() { if (!emptyStringAllowed && StringUtils.isBlank(getProperty().getValue())) { this.setInvalidReason("unspecified value for " + name); logger.debug(getReasonWhyInvalid().get()); TextErrorColorHelper.setTextErrorColor(label); return false; } else { TextErrorColorHelper.clearTextErrorColor(label); } this.clearInvalidReason(); return true; } }; }
From source file:Main.java
HBox getButtons() { Region spring = new Region(); HBox.setHgrow(spring, Priority.ALWAYS); HBox buttonBar = new HBox(5); cancelButton.setCancelButton(true);/*from w w w . j av a 2s . co m*/ finishButton.setDefaultButton(true); buttonBar.getChildren().addAll(spring, priorButton, nextButton, cancelButton, finishButton); return buttonBar; }
From source file:org.jacp.demo.components.ContactChartViewComponent.java
protected BarChart<String, Number> createChart() { this.xAxis = new CategoryAxis(); this.yAxis = new NumberAxis(); this.yAxis.setTickLabelFormatter(new NumberAxis.DefaultFormatter(this.yAxis, "$", null)); this.bc = new BarChart<String, Number>(this.xAxis, this.yAxis); this.bc.setAnimated(true); this.bc.setTitle(" "); this.xAxis.getStyleClass().add("jacp-bar"); this.yAxis.getStyleClass().add("jacp-bar"); this.xAxis.setLabel("Year"); this.yAxis.setLabel("Price"); this.series1 = new XYChart.Series<String, Number>(); this.series1.setName("electronic"); this.series2 = new XYChart.Series<String, Number>(); this.series2.setName("clothes"); this.series3 = new XYChart.Series<String, Number>(); this.series3.setName("hardware"); this.series4 = new XYChart.Series<String, Number>(); this.series4.setName("books"); GridPane.setHalignment(this.bc, HPos.CENTER); GridPane.setVgrow(this.bc, Priority.ALWAYS); GridPane.setHgrow(this.bc, Priority.ALWAYS); GridPane.setMargin(this.bc, new Insets(0, 6, 0, 0)); return this.bc; }
From source file:se.trixon.mapollage.ui.config.FoldersTab.java
private void createUI() { VBox leftBox = new VBox(); VBox rightBox = new VBox(); setContent(leftBox);//from w w w .j a va 2s. com //Left Pane Label rootNameLabel = new Label(mBundle.getString("FoldersTab.rootNameLabel")); Label rootDescLabel = new Label(mBundle.getString("FoldersTab.rootDescriptionLabel")); Label regexLabel = new Label(Dict.DEFAULT_VALUE.toString()); leftBox.getChildren().addAll(rootNameLabel, mRootNameTextField, rootDescLabel, mRootDescTextArea, rightBox); VBox.setVgrow(mRootDescTextArea, Priority.ALWAYS); //Right Pane mFolderByDirectoryRadioButton.setToggleGroup(mToggleGroup); mFolderByDateRadioButton.setToggleGroup(mToggleGroup); mFolderByRegexRadioButton.setToggleGroup(mToggleGroup); mFolderByNoneRadioButton.setToggleGroup(mToggleGroup); mDatePatternComboBox.setMaxWidth(Double.MAX_VALUE); mDatePatternComboBox.setEditable(true); mDatePatternComboBox .setItems(FXCollections.observableList(Arrays.asList(mBundle.getString("dateFormats").split(";")))); Label label = new Label(mBundle.getString("FoldersTab.folderByLabel")); rightBox.getChildren().addAll(label, mFolderByDirectoryRadioButton, mFolderByDateRadioButton, mDatePatternComboBox, mFolderByRegexRadioButton, mRegexTextField, regexLabel, mRegexDefaultTextField, mFolderByNoneRadioButton); addTopPadding(rootDescLabel, mFolderByDirectoryRadioButton, mFolderByDateRadioButton, mFolderByRegexRadioButton, regexLabel, mFolderByNoneRadioButton, rightBox); Insets leftInsets = new Insets(0, 0, 0, 24); VBox.setMargin(mDatePatternComboBox, leftInsets); VBox.setMargin(mRegexTextField, leftInsets); VBox.setMargin(mRegexDefaultTextField, leftInsets); VBox.setMargin(regexLabel, leftInsets); mDatePatternComboBox.disableProperty().bind(mFolderByDateRadioButton.selectedProperty().not()); mRegexTextField.disableProperty().bind(mFolderByRegexRadioButton.selectedProperty().not()); mRegexDefaultTextField.disableProperty().bind(mFolderByRegexRadioButton.selectedProperty().not()); // EventHandler eventHandler = (EventHandler) (Event event) -> { //// sValidationSupport.initInitialDecoration(); // sValidationSupport.getValidationDecorator().removeDecorations(mDatePatternComboBox); // // sValidationSupport.redecorate(); // System.out.println(event); // }; // // mFolderByDateRadioButton.setOnAction(eventHandler); // mFolderByDirectoryRadioButton.setOnAction(eventHandler); // mFolderByNoneRadioButton.setOnAction(eventHandler); // mFolderByRegexRadioButton.setOnAction(eventHandler); }
From source file:webviewsample.Main.java
private Node createSpacer() { Region spacer = new Region(); HBox.setHgrow(spacer, Priority.ALWAYS); return spacer; }
From source file:gov.va.isaac.sync.view.SyncView.java
private void initGui() { root_ = new BorderPane(); root_.setPrefWidth(550);/* w w w . j a v a 2 s . c o m*/ VBox titleBox = new VBox(); Label title = new Label("Datastore Synchronization"); title.getStyleClass().add("titleLabel"); title.setAlignment(Pos.CENTER); title.setMaxWidth(Double.MAX_VALUE); title.setPadding(new Insets(10)); titleBox.getChildren().add(title); titleBox.getStyleClass().add("headerBackground"); url_ = AppContext.getAppConfiguration().getCurrentChangeSetUrl(); String urlType = AppContext.getAppConfiguration().getChangeSetUrlTypeName(); String syncUsername = ExtendedAppContext.getCurrentlyLoggedInUserProfile().getSyncUsername(); if (StringUtils.isBlank(syncUsername)) { syncUsername = ExtendedAppContext.getCurrentlyLoggedInUser(); } url_ = syncService_.substituteURL(url_, syncUsername); Label info = new CopyableLabel("Sync using " + urlType + ": " + url_); info.setTooltip(new Tooltip(url_)); titleBox.getChildren().add(info); titleBox.setPadding(new Insets(5, 5, 5, 5)); root_.setTop(titleBox); VBox centerContent = new VBox(); centerContent.setFillWidth(true); centerContent.setPrefWidth(Double.MAX_VALUE); centerContent.setPadding(new Insets(10)); centerContent.getStyleClass().add("itemBorder"); centerContent.setSpacing(10.0); centerContent.getChildren().add(new Label("Status:")); summary_ = new TextArea(); summary_.setWrapText(true); summary_.setEditable(false); summary_.setMaxWidth(Double.MAX_VALUE); summary_.setMaxHeight(Double.MAX_VALUE); summary_.setPrefHeight(150.0); centerContent.getChildren().add(summary_); VBox.setVgrow(summary_, Priority.ALWAYS); pb_ = new ProgressBar(0.0); pb_.setPrefHeight(20); pb_.setMaxWidth(Double.MAX_VALUE); centerContent.getChildren().add(pb_); root_.setCenter(centerContent); //Bottom buttons HBox buttons = new HBox(); buttons.setMaxWidth(Double.MAX_VALUE); buttons.setAlignment(Pos.CENTER); buttons.setPadding(new Insets(5)); buttons.setSpacing(30); Button cancel = new Button("Close"); cancel.setOnAction((action) -> { if (running_.get()) { addLine("Cancelling..."); cancel.setDisable(true); cancelRequested_ = true; } else { cancel.getScene().getWindow().hide(); root_ = null; } }); buttons.getChildren().add(cancel); Button action = new Button("Synchronize"); action.disableProperty().bind(running_); action.setOnAction((theAction) -> { summary_.setText(""); pb_.setProgress(-1.0); running_.set(true); Utility.execute(() -> sync()); }); buttons.getChildren().add(action); cancel.minWidthProperty().bind(action.widthProperty()); running_.addListener(change -> { if (running_.get()) { cancel.setText("Cancel"); } else { cancel.setText("Close"); } cancel.setDisable(false); }); root_.setBottom(buttons); }