本文整理汇总了Java中javafx.scene.layout.RowConstraints.setPrefHeight方法的典型用法代码示例。如果您正苦于以下问题:Java RowConstraints.setPrefHeight方法的具体用法?Java RowConstraints.setPrefHeight怎么用?Java RowConstraints.setPrefHeight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.scene.layout.RowConstraints
的用法示例。
在下文中一共展示了RowConstraints.setPrefHeight方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: initLayout
import javafx.scene.layout.RowConstraints; //导入方法依赖的package包/类
@Override
public Parent initLayout()
{
GridPane grid = new GridPane();
grid.setHgap(10);
grid.setHgap(10);
grid.setPadding(new Insets(10));
int row = 0;
grid.add(this.projectRepoLabel, 0, row); grid.add(this.projectRepoValue, 1, row); row++;
grid.add(this.versionLabel, 0, row); grid.add(this.versionValue, 1, row); row++;
grid.add(this.compatVersionLabel, 0, row); grid.add(this.compatVersionValue, 1, row); row++;
grid.add(this.gitCommitDateLabel, 0, row); grid.add(this.gitCommitDateValue, 1, row); row++;
grid.add(this.gitCommitHashLabel, 0, row); grid.add(this.gitCommitHashValue, 1, row); row++;
grid.add(this.buildDateLabel, 0, row); grid.add(this.buildDateValue, 1, row); row++;
for (int i = 0; i < row; i++)
{
RowConstraints rc = new RowConstraints();
rc.setPrefHeight(22);
grid.getRowConstraints().add(rc);
}
return grid;
}
示例3: 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);
}
}
示例4: YearViewSkin
import javafx.scene.layout.RowConstraints; //导入方法依赖的package包/类
public YearViewSkin(YearView view) {
super(view);
view.dateProperty().addListener(evt -> updateMonths());
GridPane gridPane = new GridPane();
gridPane.getStyleClass().add("container");
gridPane.setMaxSize(MAX_VALUE, MAX_VALUE);
for (int row = 0; row < 3; row++) {
RowConstraints rowConstraints = new RowConstraints();
rowConstraints.setMinHeight(Region.USE_PREF_SIZE);
rowConstraints.setPrefHeight(Region.USE_COMPUTED_SIZE);
rowConstraints.setMaxHeight(Region.USE_COMPUTED_SIZE);
rowConstraints.setVgrow(Priority.ALWAYS);
rowConstraints.setValignment(VPos.CENTER);
gridPane.getRowConstraints().add(rowConstraints);
}
for (int col = 0; col < 4; col++) {
ColumnConstraints colConstraints = new ColumnConstraints();
colConstraints.setMinWidth(Region.USE_PREF_SIZE);
colConstraints.setPrefWidth(Region.USE_COMPUTED_SIZE);
colConstraints.setMaxWidth(Region.USE_COMPUTED_SIZE);
colConstraints.setHgrow(Priority.ALWAYS);
colConstraints.setHalignment(HPos.CENTER);
gridPane.getColumnConstraints().add(colConstraints);
}
for (int row = 0; row < 3; row++) {
for (int col = 0; col < 4; col++) {
Month month = Month.of(row * 4 + col + 1);
YearMonthView yearMonthView = view.getMonthView(month);
yearMonthView.setShowMonthArrows(false);
yearMonthView.setShowTodayButton(false);
yearMonthView.setShowUsageColors(true);
yearMonthView.setClickBehaviour(YearMonthView.ClickBehaviour.SHOW_DETAILS);
gridPane.add(yearMonthView, col, row);
// do not bind date, we manage it manually
view.bind(yearMonthView, false);
}
}
getChildren().add(gridPane);
updateMonths();
}
示例5: initializeEditorCanvas
import javafx.scene.layout.RowConstraints; //导入方法依赖的package包/类
private void initializeEditorCanvas() {
//reset canvas from eventual previous labyrinths
resetCanvas();
//make sure we know the current size
updateCanvasSize();
//calculate the TILE_SIZE appropriate for the window size and size of the Labyrinth
int smallerCanvasDimension = Integer.min(CANVAS_HEIGHT, CANVAS_WIDTH) - 2 * MARGIN;
int largerLabyrinthDimension = Integer.max(labyrinth.getHeight(), labyrinth.getWidth());
TILE_SIZE = smallerCanvasDimension / largerLabyrinthDimension;
//set size of the GridView
RowConstraints rowConstraints = new RowConstraints();
rowConstraints.setPrefHeight(TILE_SIZE);
rowConstraints.setMinHeight(TILE_SIZE);
rowConstraints.setMaxHeight(TILE_SIZE);
for (int rowIndex = 0; rowIndex < labyrinth.getHeight(); rowIndex++) {
canvasGridPane.addRow(rowIndex);
canvasGridPane.getRowConstraints().add(rowConstraints);
}
ColumnConstraints columnConstraints = new ColumnConstraints();
columnConstraints.setPrefWidth(TILE_SIZE);
columnConstraints.setMinWidth(TILE_SIZE);
columnConstraints.setMaxWidth(TILE_SIZE);
for (int colIndex = 0; colIndex < labyrinth.getWidth(); colIndex++) {
canvasGridPane.addRow(colIndex);
canvasGridPane.getColumnConstraints().add(columnConstraints);
}
}
示例6: prepareRatioGrid
import javafx.scene.layout.RowConstraints; //导入方法依赖的package包/类
/**
* Note that JavaFx GridPane uses (col, row) instead of (row, col)
*/
private void prepareRatioGrid() {
squidSpeciesList = squidProject.getTask().getSquidSpeciesModelList();
indexOfBackgroundSpecies = -1;
ratiosGridPane.getRowConstraints().clear();
RowConstraints rowCon = new RowConstraints();
rowCon.setPrefHeight(BUTTON_HEIGHT);
ratiosGridPane.getRowConstraints().add(rowCon);
ratiosGridPane.getColumnConstraints().clear();
ColumnConstraints colcon = new ColumnConstraints(BUTTON_WIDTH);
colcon.setPrefWidth(BUTTON_WIDTH);
colcon.setHalignment(HPos.CENTER);
ratiosGridPane.getColumnConstraints().add(colcon);
for (int i = 0; i < squidSpeciesList.size(); i++) {
if (squidSpeciesList.get(i).getIsBackground()) {
indexOfBackgroundSpecies = squidSpeciesList.get(i).getMassStationIndex();
squidProject.getTask().setIndexOfBackgroundSpecies(indexOfBackgroundSpecies);
Text colText = new Text(squidSpeciesList.get(i).getIsotopeName());
colText.setFont(Font.font("Courier New", FontWeight.BOLD, 12));
ratiosGridPane.add(colText, 0, i + 1);
Text rowText = new Text(squidSpeciesList.get(i).getIsotopeName());
rowText.setFont(Font.font("Courier New", FontWeight.BOLD, 12));
ratiosGridPane.add(rowText, i + 1, 0);
} else {
Button colButton = new SquidRowColButton(i, -1, squidSpeciesList.get(i).getIsotopeName());
ratiosGridPane.add(colButton, 0, i + 1);
Button rowButton = new SquidRowColButton(-1, i, squidSpeciesList.get(i).getIsotopeName());
ratiosGridPane.add(rowButton, i + 1, 0);
}
Label corLabel = new Label("ROW /\n COL");
corLabel.setFont(Font.font("Courier New", FontWeight.BOLD, 2));
corLabel.setStyle(
" -fx-font-family: \"Courier New\", \"Lucida Sans\", \"Segoe UI\", Helvetica, Arial, sans-serif;\n"
+ " -fx-font-weight: bold;\n"
+ " -fx-font-size: 7pt;\n"
);
corLabel.setWrapText(true);
ratiosGridPane.add(corLabel, 0, 0);
ratiosGridPane.getRowConstraints().add(rowCon);
ratiosGridPane.getColumnConstraints().add(colcon);
}
populateRatioGrid();
// center in window
double width = primaryStageWindow.getScene().getWidth();
ratiosGridPane.setLayoutX((width - (squidSpeciesList.size() + 1) * BUTTON_WIDTH) / 2.0);
ratiosGridPane.setLayoutY(15);
}
示例7: Actions
import javafx.scene.layout.RowConstraints; //导入方法依赖的package包/类
public Actions() {
columnConstraints = new ColumnConstraints();
columnConstraints0 = new ColumnConstraints();
columnConstraints1 = new ColumnConstraints();
rowConstraints = new RowConstraints();
button = new Button();
button0 = new Button();
button1 = new Button();
setPrefHeight(32.0);
setPrefWidth(186.0);
setStyle("-fx-background-color: none;");
getStylesheets().add("/view/common/../../css/main.css");
columnConstraints.setHgrow(javafx.scene.layout.Priority.SOMETIMES);
columnConstraints.setMaxWidth(120.0);
columnConstraints.setMinWidth(10.0);
columnConstraints.setPrefWidth(95.0);
columnConstraints0.setHgrow(javafx.scene.layout.Priority.SOMETIMES);
columnConstraints0.setMaxWidth(150.0);
columnConstraints0.setMinWidth(10.0);
columnConstraints0.setPrefWidth(100.0);
columnConstraints1.setHgrow(javafx.scene.layout.Priority.SOMETIMES);
columnConstraints1.setMaxWidth(192.0);
columnConstraints1.setMinWidth(10.0);
columnConstraints1.setPrefWidth(110.0);
rowConstraints.setMinHeight(10.0);
rowConstraints.setPrefHeight(30.0);
rowConstraints.setVgrow(javafx.scene.layout.Priority.SOMETIMES);
button.setDefaultButton(true);
button.setMnemonicParsing(false);
button.setOnAction(this::handleEditButton);
button.setText("Edit");
GridPane.setColumnIndex(button0, 1);
button0.setMnemonicParsing(false);
button0.setOnAction(this::handleViewButton);
button0.getStyleClass().add("btn-primary");
button0.setText("View");
GridPane.setColumnIndex(button1, 2);
button1.setCancelButton(true);
button1.setMnemonicParsing(false);
button1.setOnAction(this::handleDeleteButton);
button1.setText("Delete");
getColumnConstraints().add(columnConstraints);
getColumnConstraints().add(columnConstraints0);
getColumnConstraints().add(columnConstraints1);
getRowConstraints().add(rowConstraints);
getChildren().add(button);
getChildren().add(button0);
getChildren().add(button1);
}
示例8: 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();
}
}
}
示例9: MonthCalendarComponent
import javafx.scene.layout.RowConstraints; //导入方法依赖的package包/类
public MonthCalendarComponent() {
calendarGrid = new GridPane();
calendarSquares = new ArrayList<>();
squareRowConstraints = new ArrayList<>();
events = FXCollections.observableArrayList();
events.addListener(this::eventsUpdated);
header = new Pane();
header.setPadding(new Insets(0, 0, 30, 0));
this.addPeriodInfo();
this.setTop(header);
this.setCenter(calendarGrid);
this.setPadding(new Insets(20));
RowConstraints dayDescriptors = new RowConstraints();
dayDescriptors.setPrefHeight(30);
calendarGrid.getRowConstraints().add(dayDescriptors);
for (int i = 0; i < 7; i++) {
Pane pane = new Pane();
pane.getStyleClass().add("label");
String day = DayOfWeek.of(i + 1).getDisplayName(TextStyle.SHORT_STANDALONE, new Locale("no"));
Text dayLabel = new Text(day);
dayLabel.setFill(Color.valueOf("#e67e22"));
dayLabel.setFont(Font.font("Helvetica", 18));
dayLabel.setLayoutX(130);
dayLabel.setLayoutY(15);
pane.getChildren().add(dayLabel);
calendarGrid.add(pane, i, 0);
ColumnConstraints c = new ColumnConstraints();
c.setMinWidth(130);
c.setHgrow(Priority.ALWAYS);
calendarGrid.getColumnConstraints().add(c);
}
this.year = LocalDate.now().getYear();
this.month = LocalDate.now().getMonthValue();
drawCurrentPeriod();
}
示例10: create
import javafx.scene.layout.RowConstraints; //导入方法依赖的package包/类
public AnchorPane create() throws Exception {
AnchorPane anchorPane37 = new AnchorPane();
anchorPane37.setId("AnchorPane");
anchorPane37.setMinHeight(Control.USE_PREF_SIZE);
anchorPane37.setMinWidth(Control.USE_PREF_SIZE);
anchorPane37.setPrefHeight(Control.USE_COMPUTED_SIZE);
anchorPane37.setPrefWidth(Control.USE_COMPUTED_SIZE);
TitledPane titledPane33 = new TitledPane();
titledPane33.setAnimated(false);
titledPane33.setCollapsible(false);
titledPane33.setExpanded(true);
titledPane33.setPrefHeight(Control.USE_COMPUTED_SIZE);
titledPane33.setPrefWidth(Control.USE_COMPUTED_SIZE);
titledPane33.setText(bundle.getString("SOYStyleSection"));
AnchorPane.setBottomAnchor(titledPane33, 0.0);
AnchorPane.setLeftAnchor(titledPane33, 0.0);
AnchorPane.setRightAnchor(titledPane33, 0.0);
AnchorPane.setTopAnchor(titledPane33, 0.0);
VBox vBox65 = new VBox();
vBox65.setPrefHeight(Control.USE_COMPUTED_SIZE);
vBox65.setPrefWidth(Control.USE_COMPUTED_SIZE);
Label label80 = new Label();
label80.setMinWidth(100.0);
label80.setText(bundle.getString("SOYStyleSection_Desc"));
label80.setWrapText(true);
vBox65.getChildren().add(label80);
GridPane gridPane74 = new GridPane();
gridPane74.setHgap(5.0);
controlCodeStyleBuilder = new RadioButton();
controlCodeStyleBuilder.setMnemonicParsing(false);
controlCodeStyleBuilder.setText(bundle.getString("SOYStyleSection_String"));
GridPane.setColumnIndex(controlCodeStyleBuilder, 0);
GridPane.setRowIndex(controlCodeStyleBuilder, 0);
styleGroup = new ToggleGroup();
controlCodeStyleBuilder.setToggleGroup(styleGroup);
gridPane74.getChildren().add(controlCodeStyleBuilder);
controlCodeStyleConcat = new RadioButton();
controlCodeStyleConcat.setMnemonicParsing(false);
controlCodeStyleConcat.setText(bundle.getString("SOYStyleSection_Concatenation"));
controlCodeStyleConcat.setToggleGroup(styleGroup);
GridPane.setColumnIndex(controlCodeStyleConcat, 1);
GridPane.setRowIndex(controlCodeStyleConcat, 0);
gridPane74.getChildren().add(controlCodeStyleConcat);
ColumnConstraints columnConstraints168 = new ColumnConstraints();
columnConstraints168.setHgrow(Priority.NEVER);
columnConstraints168.setMinWidth(Control.USE_COMPUTED_SIZE);
columnConstraints168.setPrefWidth(Control.USE_COMPUTED_SIZE);
gridPane74.getColumnConstraints().add(columnConstraints168);
ColumnConstraints columnConstraints169 = new ColumnConstraints();
columnConstraints169.setHgrow(Priority.NEVER);
columnConstraints169.setMinWidth(Control.USE_COMPUTED_SIZE);
columnConstraints169.setPrefWidth(Control.USE_COMPUTED_SIZE);
gridPane74.getColumnConstraints().add(columnConstraints169);
RowConstraints rowConstraints147 = new RowConstraints();
rowConstraints147.setMinHeight(10.0);
rowConstraints147.setPrefHeight(30.0);
rowConstraints147.setVgrow(Priority.SOMETIMES);
gridPane74.getRowConstraints().add(rowConstraints147);
vBox65.getChildren().add(gridPane74);
Insets insets100 = new Insets(10.0, 10.0, 10.0, 10.0);
vBox65.setPadding(insets100);
titledPane33.setContent(vBox65);
anchorPane37.getChildren().add(titledPane33);
initialize(null, bundle);
return anchorPane37;
}