本文整理匯總了Java中javafx.scene.layout.RowConstraints.setFillHeight方法的典型用法代碼示例。如果您正苦於以下問題:Java RowConstraints.setFillHeight方法的具體用法?Java RowConstraints.setFillHeight怎麽用?Java RowConstraints.setFillHeight使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javafx.scene.layout.RowConstraints
的用法示例。
在下文中一共展示了RowConstraints.setFillHeight方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: updateRowConstraints
import javafx.scene.layout.RowConstraints; //導入方法依賴的package包/類
private void updateRowConstraints() {
int rowCount = 32; // header + 31 days
if (getSkinnable().getWeekDayLayout() == WeekDayLayoutStrategy.ALIGNED) {
rowCount += 6; // 6 = max number of empty slots / cells at the top
}
List<RowConstraints> rowConstraints = new ArrayList<>();
for (int i = 0; i <= rowCount; i++) {
RowConstraints con = new RowConstraints();
con.setFillHeight(true);
con.setPrefHeight(Region.USE_COMPUTED_SIZE);
con.setMinHeight(Region.USE_PREF_SIZE);
con.setMaxHeight(Double.MAX_VALUE);
con.setVgrow(i == 0 ? Priority.NEVER : Priority.ALWAYS);
rowConstraints.add(con);
}
grid.getRowConstraints().setAll(rowConstraints);
}
示例2: initializeGrid
import javafx.scene.layout.RowConstraints; //導入方法依賴的package包/類
private void initializeGrid() {
grid = new GridPane();
//grid.setAlignment(Pos.CENTER);
grid.setHgap(10);
grid.setVgap(10);
grid.setPadding(new Insets(25, 25, 25, 25));
grid.setMaxSize(Region.USE_COMPUTED_SIZE, Region.USE_COMPUTED_SIZE);
ColumnConstraints c1 = new ColumnConstraints();
c1.setFillWidth(true);
c1.setHgrow(Priority.ALWAYS);
grid.getColumnConstraints().addAll(new ColumnConstraints(), c1, new ColumnConstraints());
RowConstraints r2 = new RowConstraints();
r2.setFillHeight(true);
r2.setVgrow(Priority.ALWAYS);
}
示例3: createGridRow
import javafx.scene.layout.RowConstraints; //導入方法依賴的package包/類
private void createGridRow(Label label, TextField textField, Field field) {
final int gridShift = MODEL.getFields().size();
GRID.add(label, 0, gridShift);
GridPane.setHalignment(label, HPos.RIGHT);
GRID.add(textField, 1, gridShift);
//
final RowConstraints row = new RowConstraints();
row.setFillHeight(true);
row.setVgrow(Priority.NEVER);
GRID.getRowConstraints().add(row);
}
示例4: updateVisibility
import javafx.scene.layout.RowConstraints; //導入方法依賴的package包/類
private void updateVisibility() {
for (int row = 0; row < 6; row++) {
RowConstraints rowConstraints = new RowConstraints();
rowConstraints.setFillHeight(true);
rowConstraints.setMinHeight(Region.USE_PREF_SIZE);
rowConstraints.setMaxHeight(Region.USE_COMPUTED_SIZE);
rowConstraints.setPrefHeight(Region.USE_COMPUTED_SIZE);
rowConstraints.setVgrow(Priority.ALWAYS);
gridPane.getRowConstraints().add(rowConstraints);
}
ColumnConstraints weekColumn = new ColumnConstraints();
weekColumn.setHalignment(HPos.RIGHT);
weekColumn.setMaxWidth(Region.USE_COMPUTED_SIZE);
weekColumn.setMinWidth(Region.USE_PREF_SIZE);
weekColumn.setPrefWidth(Region.USE_COMPUTED_SIZE);
weekColumn.setFillWidth(true);
weekColumn.setHgrow(Priority.NEVER);
gridPane.getColumnConstraints().add(weekColumn);
for (int col = 0; col < 7; col++) {
ColumnConstraints columnConstraints = new ColumnConstraints();
columnConstraints.setHalignment(HPos.CENTER);
columnConstraints.setMaxWidth(Region.USE_COMPUTED_SIZE);
columnConstraints.setMinWidth(Region.USE_PREF_SIZE);
columnConstraints.setPrefWidth(Region.USE_COMPUTED_SIZE);
columnConstraints.setFillWidth(true);
columnConstraints.setHgrow(Priority.ALWAYS);
gridPane.getColumnConstraints().add(columnConstraints);
}
}
示例5: createContent
import javafx.scene.layout.RowConstraints; //導入方法依賴的package包/類
@Override
protected Node createContent() {
leftSide = createLeftHandSide();
rightSide = createRightHandSide();
leftColumn = new ColumnConstraints();
leftColumn.setPercentWidth(50);
leftColumn.setMinWidth(Region.USE_COMPUTED_SIZE);
leftColumn.setPrefWidth(Region.USE_COMPUTED_SIZE);
leftColumn.setMaxWidth(Double.MAX_VALUE);
leftColumn.setFillWidth(true);
rightColumn = new ColumnConstraints();
rightColumn.setPercentWidth(50);
rightColumn.setMinWidth(Region.USE_COMPUTED_SIZE);
rightColumn.setPrefWidth(Region.USE_COMPUTED_SIZE);
rightColumn.setMaxWidth(Double.MAX_VALUE);
rightColumn.setFillWidth(true);
RowConstraints rowConstraints = new RowConstraints();
rowConstraints.setPercentHeight(100);
rowConstraints.setFillHeight(true);
// no need to assign a style class, will be auto-assigned by superclass ("content")
gridPane = new GridPane();
gridPane.setHgap(20);
gridPane.getColumnConstraints().addAll(leftColumn, rightColumn);
gridPane.getRowConstraints().addAll(rowConstraints);
gridPane.add(leftSide, 0, 0);
gridPane.add(rightSide, 1, 0);
getSkinnable().widthProperty().addListener(it -> updateLayout());
return gridPane;
}
示例6: drawNode
import javafx.scene.layout.RowConstraints; //導入方法依賴的package包/類
@Override
public Node drawNode() {
pane = new GridPane();
if (withStyle) {
pane.setStyle("-fx-border-color: darkgray;");
}
pane.setPrefSize(130, 130);
pane.setGridLinesVisible(false);
RowConstraints rc1 = new RowConstraints();
rc1.setFillHeight(false);
pane.getRowConstraints().add(rc1);
Circle c1 = new Circle(8);
GridPane.setConstraints(c1, 0, 0);
c1.setFill(Color.RED);
StackPane sp2 = new StackPane();
sp2.setPadding(new Insets(2, 2, 2, 2));
sp2.setPrefSize(10,10);
sp2.setMaxSize(50,50);
sp2.setStyle("-fx-border-color: red;");
GridPane.setHalignment(sp2,HPos.CENTER);
GridPane.setValignment(sp2,VPos.CENTER);
Rectangle r1 = new Rectangle(12,110);
GridPane.setConstraints(r1, 1, 0);
r1.setFill(Color.BLUE);
Rectangle r2 = new Rectangle(110,12);
GridPane.setConstraints(r2, 0, 1);
r2.setFill(Color.GREEN);
pane.getChildren().addAll(sp2, r1, r2);
return pane;
}
示例7: EntryHeaderView
import javafx.scene.layout.RowConstraints; //導入方法依賴的package包/類
public EntryHeaderView(Entry<?> entry, List<Calendar> calendars) {
this.entry = requireNonNull(entry);
requireNonNull(calendars);
getStylesheets().add(CalendarView.class.getResource("calendar.css").toExternalForm());
TextField titleField = new TextField(entry.getTitle());
Bindings.bindBidirectional(titleField.textProperty(), entry.titleProperty());
titleField.disableProperty().bind(entry.getCalendar().readOnlyProperty());
TextField locationField = new TextField(entry.getLocation());
Bindings.bindBidirectional(locationField.textProperty(), entry.locationProperty());
locationField.getStyleClass().add("location"); //$NON-NLS-1$
locationField.setEditable(true);
locationField.setPromptText(Messages.getString("EntryHeaderView.PROMPT_LOCATION")); //$NON-NLS-1$
locationField.setMaxWidth(500);
locationField.disableProperty().bind(entry.getCalendar().readOnlyProperty());
calendarSelector = new CalendarSelector();
calendarSelector.disableProperty().bind(entry.getCalendar().readOnlyProperty());
calendarSelector.getCalendars().setAll(calendars);
calendarSelector.setCalendar(entry.getCalendar());
Bindings.bindBidirectional(calendarSelector.calendarProperty(), entry.calendarProperty());
titleField.getStyleClass().add("default-style-entry-popover-title"); //$NON-NLS-1$
add(titleField, 0, 0);
add(calendarSelector, 1, 0, 1, 2);
add(locationField, 0, 1);
RowConstraints row1 = new RowConstraints();
row1.setValignment(VPos.TOP);
row1.setFillHeight(true);
RowConstraints row2 = new RowConstraints();
row2.setValignment(VPos.TOP);
row2.setFillHeight(true);
getRowConstraints().addAll(row1, row2);
ColumnConstraints col1 = new ColumnConstraints();
col1.setFillWidth(true);
col1.setHgrow(Priority.ALWAYS);
ColumnConstraints col2 = new ColumnConstraints();
col2.setFillWidth(true);
col2.setHgrow(Priority.NEVER);
getColumnConstraints().addAll(col1, col2);
getStyleClass().add("popover-header"); //$NON-NLS-1$
titleField.getStyleClass().add("title"); //$NON-NLS-1$
titleField.setPromptText(Messages.getString("EntryHeaderView.PROMPT_TITLE")); //$NON-NLS-1$
titleField.setMaxWidth(500);
Calendar calendar = entry.getCalendar();
titleField.getStyleClass().add(calendar.getStyle() + "-entry-popover-title"); //$NON-NLS-1$
entry.calendarProperty()
.addListener((observable, oldCalendar, newCalendar) -> {
if (oldCalendar != null) {
titleField.getStyleClass().remove(oldCalendar.getStyle() + "-entry-popover-title"); //$NON-NLS-1$
}
if (newCalendar != null) {
titleField.getStyleClass().add(newCalendar.getStyle() + "-entry-popover-title"); //$NON-NLS-1$
}
});
}
示例8: PrintViewSkin
import javafx.scene.layout.RowConstraints; //導入方法依賴的package包/類
public PrintViewSkin(PrintView control) {
super(control);
GridPane gridPane = new GridPane();
gridPane.getStyleClass().add("container");
gridPane.setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE);
RowConstraints row1 = new RowConstraints();
RowConstraints row2 = new RowConstraints();
ColumnConstraints col1 = new ColumnConstraints();
ColumnConstraints col2 = new ColumnConstraints();
ColumnConstraints col3 = new ColumnConstraints();
row1.setVgrow(Priority.ALWAYS);
row2.setVgrow(Priority.NEVER);
col1.setHgrow(Priority.ALWAYS);
col2.setHgrow(Priority.NEVER);
col3.setHgrow(Priority.NEVER);
row1.setFillHeight(true);
row2.setFillHeight(true);
col1.setFillWidth(true);
col2.setFillWidth(true);
col3.setFillWidth(true);
col1.setMaxWidth(Double.MAX_VALUE);
col3.setMaxWidth(Region.USE_PREF_SIZE);
col3.setMinWidth(Region.USE_PREF_SIZE);
row1.setMaxHeight(Double.MAX_VALUE);
row2.setMinHeight(Region.USE_PREF_SIZE);
gridPane.getRowConstraints().setAll(row1, row2);
gridPane.getColumnConstraints().setAll(col1, col2, col3);
// preview pane
PreviewPane previewPane = control.getPreviewPane();
gridPane.add(previewPane, 0, 0);
GridPane.setRowSpan(previewPane, 2);
// settings
SettingsView settingsView = control.getSettingsView();
gridPane.add(settingsView, 2, 0);
// separator
Separator separator = new Separator();
separator.setOrientation(Orientation.VERTICAL);
GridPane.setRowSpan(separator, 2);
gridPane.add(separator, 1, 0);
// button bar
Button cancelBtn = new Button(Messages.getString("PrintView.CANCEL_BUTTON"));
cancelBtn.onActionProperty().bind(control.onCancelProperty());
Button continueBtn = new Button(Messages.getString("PrintView.CONTINUE_BUTTON"));
continueBtn.onActionProperty().bind(control.onContinueProperty());
HBox buttonsBar = new HBox();
buttonsBar.getStyleClass().add("button-bar");
buttonsBar.getChildren().addAll(cancelBtn, continueBtn);
gridPane.add(buttonsBar, 2, 1);
getChildren().add(gridPane);
}
示例9: createPredefinedTagsGrid
import javafx.scene.layout.RowConstraints; //導入方法依賴的package包/類
private GridPane createPredefinedTagsGrid() {
final GridPane grid = new GridPane();
grid.setHgap(GRID_GAP);
grid.setVgap(GRID_GAP);
grid.setPadding(new Insets(GRID_GAP));
grid.setGridLinesVisible(false);
//-------------------------------------------------------------------- Column #0
//
final Label idLabel = new Label("ID");
grid.add(idLabel, 0, 0);
GridPane.setHalignment(idLabel, HPos.RIGHT);
//
final Label nameLabel = new Label("Name");
grid.add(nameLabel, 0, 1);
GridPane.setHalignment(nameLabel, HPos.RIGHT);
//
final Label titleLabel = new Label("Title");
grid.add(titleLabel, 0, 2);
GridPane.setHalignment(titleLabel, HPos.RIGHT);
//
//-------------------------------------------------------------------- Column #1
//
grid.add(ID_TAG_FIELD, 1, 0);
grid.add(NAME_TAG_FIELD, 1, 1);
grid.add(TITLE_TAG_FIELD, 1, 2);
//
//-------------------------------------------------------------------- Constraints
//
for (int i = 0; i < 2; i++) {
final ColumnConstraints column = new ColumnConstraints();
column.setFillWidth(true);
column.setHgrow(Priority.NEVER);
grid.getColumnConstraints().add(column);
}
for (int i = 0; i < 3; i++) {
final RowConstraints row = new RowConstraints();
row.setFillHeight(true);
row.setVgrow(Priority.NEVER);
grid.getRowConstraints().add(row);
}
//
grid.getColumnConstraints().get(1).setHgrow(Priority.SOMETIMES);
//
//-------------------------------------------------------------------- Style
//
ID_TAG_FIELD.setStyle(READ_ONLY_STYLE);
NAME_TAG_FIELD.setStyle(READ_ONLY_STYLE);
TITLE_TAG_FIELD.setStyle(READ_ONLY_STYLE);
//
//-------------------------------------------------------------------- Editable
//
ID_TAG_FIELD.setEditable(false);
NAME_TAG_FIELD.setEditable(false);
TITLE_TAG_FIELD.setEditable(false);
//
return grid;
}
示例10: createForm
import javafx.scene.layout.RowConstraints; //導入方法依賴的package包/類
private Pane createForm() {
final GridPane grid = new GridPane();
grid.setHgap(SMALL_GRID_GAP);
grid.setVgap(SMALL_GRID_GAP);
grid.setPadding(new Insets(GRID_GAP));
grid.setGridLinesVisible(false);
//-------------------------------------------------------------------- Row #0
//
grid.add(CONTENT_PROGRESS, 0, 0);
CONTENT_PROGRESS.setMaxWidth(Double.MAX_VALUE);
CONTENT_PROGRESS.setMinHeight(0);
CONTENT_PROGRESS.setMinWidth(0);
CONTENT_PROGRESS.setProgress(0);
//
grid.add(CONTENT_VOLUME, 1, 0);
CONTENT_VOLUME.setMaxWidth(Double.MAX_VALUE);
CONTENT_PROGRESS.prefHeightProperty().bind(CONTENT_VOLUME.heightProperty());
CONTENT_VOLUME.setMin(0);
CONTENT_VOLUME.setMax(1);
CONTENT_VOLUME.setValue(0);
//
//-------------------------------------------------------------------- Row #1
//
grid.add(CONTENT_VIEWER, 0, 1);
CONTENT_VIEWER.volumeProperty().bindBidirectional(CONTENT_VOLUME.valueProperty());
grid.add(createCatalogPane(), 1, 1, 1, 2);
//
//-------------------------------------------------------------------- Row #2
//
grid.add(createDescriptionPane(), 0, 2);
//
//-------------------------------------------------------------------- Constraints
//
for (int i = 0; i < 2; i++) {
final ColumnConstraints column = new ColumnConstraints();
column.setFillWidth(true);
column.setHgrow(Priority.NEVER);
grid.getColumnConstraints().add(column);
}
for (int i = 0; i < 3; i++) {
final RowConstraints row = new RowConstraints();
row.setFillHeight(true);
row.setVgrow(Priority.NEVER);
grid.getRowConstraints().add(row);
}
//
grid.getColumnConstraints().get(0).setPrefWidth(RESOLUTION.getWidth());
grid.getColumnConstraints().get(0).setMinWidth(RESOLUTION.getWidth());
grid.getColumnConstraints().get(0).setMaxWidth(RESOLUTION.getWidth());
grid.getColumnConstraints().get(1).setHgrow(Priority.SOMETIMES);
//
grid.getRowConstraints().get(1).setPrefHeight(RESOLUTION.getHeight());
grid.getRowConstraints().get(1).setMinHeight(RESOLUTION.getHeight());
grid.getRowConstraints().get(1).setMaxHeight(RESOLUTION.getHeight());
grid.getRowConstraints().get(2).setVgrow(Priority.SOMETIMES);
//
//-------------------------------------------------------------------- Style
//
CONTENT_VIEWER.setStyle(READ_ONLY_STYLE);
SNAPSHOTS_GALLERY.setStyle(READ_ONLY_STYLE);
SNAPSHOTS_GALLERY2.setStyle(READ_ONLY_STYLE);
//
//-------------------------------------------------------------------- Editable
//
CATALOG_TREE.setEditable(false);
CONTENT_TAGS_TABLE.setEditable(false);
DESCRIPTION_AREA.setEditable(false);
//
return grid;
}
示例11: createChart
import javafx.scene.layout.RowConstraints; //導入方法依賴的package包/類
/**
*
*/
public void createChart() {
// Add the row constraint (we only have one row)
RowConstraints row = new RowConstraints();
row.setMinHeight(5);
row.setPrefHeight(Control.USE_COMPUTED_SIZE);
row.setMaxHeight(Control.USE_COMPUTED_SIZE);
row.setFillHeight(true);
row.setVgrow(Priority.ALWAYS);
this.chartGridPane.getRowConstraints().add(row);
for(int column_index=0; column_index<data[0].length; column_index++) {
FXMLLoader loader = new FXMLLoader(getClass().getResource("BarColumn.fxml"));
try {
VBox barColumn = (VBox) loader.load();
BarColumnController barColumnController = loader.getController();
barColumnController.setData(data);
barColumnController.setColumnIndex(column_index);
barColumnController.setAlphabet("dna");
barColumnController.setLabels(labels);
barColumnController.drawColumn();
this.chartGridPane.add(barColumn, column_index, 0);
// Set the column constraints
ColumnConstraints col = new ColumnConstraints();
col.setMinWidth(5);
col.setPrefWidth(Control.USE_COMPUTED_SIZE);
col.setMaxWidth(Control.USE_COMPUTED_SIZE);
col.setFillWidth(true);
col.setHgrow(Priority.ALWAYS);
this.chartGridPane.getColumnConstraints().add(col);
} catch (IOException e) {
e.printStackTrace();
}
}
}