当前位置: 首页>>代码示例>>Java>>正文


Java RowConstraints.setMaxHeight方法代码示例

本文整理汇总了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);
}
 
开发者ID:dlemmermann,项目名称:CalendarFX,代码行数:20,代码来源:MonthSheetViewSkin.java

示例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 );
}
 
开发者ID:DanGrew,项目名称:JttDesktop,代码行数:23,代码来源:FailureDetail.java

示例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);
    });
}
 
开发者ID:speedment,项目名称:speedment,代码行数:17,代码来源:ConnectController.java

示例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);
    }
}
 
开发者ID:dlemmermann,项目名称:CalendarFX,代码行数:32,代码来源:YearMonthViewSkin.java

示例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();
}
 
开发者ID:dlemmermann,项目名称:CalendarFX,代码行数:50,代码来源:YearViewSkin.java

示例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);
    }
}
 
开发者ID:severinkaderli,项目名称:Modul-326-Labyrinth-Editor,代码行数:36,代码来源:EditorController.java

示例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);
}
 
开发者ID:dlemmermann,项目名称:CalendarFX,代码行数:69,代码来源:PrintViewSkin.java

示例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();
		}
		
	}
	
}
 
开发者ID:drivenbyentropy,项目名称:aptasuite,代码行数:50,代码来源:LogoChartPanelController.java


注:本文中的javafx.scene.layout.RowConstraints.setMaxHeight方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。