本文整理匯總了Java中javafx.scene.layout.RowConstraints.setMaxHeight方法的典型用法代碼示例。如果您正苦於以下問題:Java RowConstraints.setMaxHeight方法的具體用法?Java RowConstraints.setMaxHeight怎麽用?Java RowConstraints.setMaxHeight使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javafx.scene.layout.RowConstraints
的用法示例。
在下文中一共展示了RowConstraints.setMaxHeight方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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: applyRowConstraints
import javafx.scene.layout.RowConstraints; //導入方法依賴的package包/類
/**
* Method to apply the {@link RowConstraints} needed.
*/
private void applyRowConstraints() {
RowConstraints sinceFailureRow = new RowConstraints();
sinceFailureRow.setPercentHeight( SINCE_FAILURE_COMMITTERS_ROW_PERCENT );
sinceFailureRow.setMaxHeight( Double.MAX_VALUE );
RowConstraints newCommittersRow = new RowConstraints();
newCommittersRow.setPercentHeight( NEW_COMMITTERS_ROW_PERCENT );
newCommittersRow.setMaxHeight( Double.MAX_VALUE );
RowConstraints builtOnRow = new RowConstraints();
builtOnRow.setPercentHeight( BUILT_ON_ROW_PERCENT );
builtOnRow.setMaxHeight( Double.MAX_VALUE );
RowConstraints failuresRow = new RowConstraints();
failuresRow.setPercentHeight( FAILURES_ROW_PERCENT );
failuresRow.setMaxHeight( Double.MAX_VALUE );
getRowConstraints().addAll( sinceFailureRow, newCommittersRow, builtOnRow, failuresRow );
}
示例3: toggleVisibility
import javafx.scene.layout.RowConstraints; //導入方法依賴的package包/類
private void toggleVisibility(RowConstraints row,
FilteredList<Node> children,
boolean show) {
if (show) {
row.setMaxHeight(USE_COMPUTED_SIZE);
row.setMinHeight(10);
} else {
row.setMaxHeight(0);
row.setMinHeight(0);
}
children.forEach(n -> {
n.setVisible(show);
n.setManaged(show);
});
}
示例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: 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();
}
示例6: 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);
}
}
示例7: 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);
}
示例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();
}
}
}