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


Java RowConstraints.setVgrow方法代码示例

本文整理汇总了Java中javafx.scene.layout.RowConstraints.setVgrow方法的典型用法代码示例。如果您正苦于以下问题:Java RowConstraints.setVgrow方法的具体用法?Java RowConstraints.setVgrow怎么用?Java RowConstraints.setVgrow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javafx.scene.layout.RowConstraints的用法示例。


在下文中一共展示了RowConstraints.setVgrow方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: EventLogger

import javafx.scene.layout.RowConstraints; //导入方法依赖的package包/类
public EventLogger() {
    setVisible(false);
    setPrefHeight(30);
    setPrefWidth(612);

    ColumnConstraints column1 = new ColumnConstraints();
    column1.setPercentWidth(85);
    column1.setHgrow(Priority.SOMETIMES);

    ColumnConstraints column2 = new ColumnConstraints();
    column2.setPercentWidth(15);
    column2.setHgrow(Priority.SOMETIMES);

    getColumnConstraints().clear();
    getColumnConstraints().addAll(column1, column2);

    RowConstraints row = new RowConstraints(10, 40, 40);
    row.setVgrow(Priority.SOMETIMES);

    getRowConstraints().clear();
    getRowConstraints().add(row);

    eventLabel = buildEventLabel();
    setConstraints(eventLabel, 0, 0);
    GridPane.setMargin(eventLabel, new Insets(0, 10, 0, 10));

    serverLabel = new Label();
    setConstraints(serverLabel, 1, 0);
    GridPane.setMargin(serverLabel, new Insets(0, 10, 0, 10));
    getChildren().addAll(eventLabel, serverLabel);
}
 
开发者ID:Kindrat,项目名称:cassandra-client,代码行数:32,代码来源:EventLogger.java

示例2: 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

示例3: 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);
}
 
开发者ID:joakimkistowski,项目名称:HTTP-Load-Generator,代码行数:16,代码来源:ScriptTestWindow.java

示例4: drawCurrentPeriod

import javafx.scene.layout.RowConstraints; //导入方法依赖的package包/类
public void drawCurrentPeriod() {
    ArrayList<LocalDate> days = getCalendarDays(this.year, this.month);
    calendarGrid.getChildren().removeAll(calendarSquares);
    calendarGrid.getRowConstraints().removeAll(squareRowConstraints);
    calendarSquares = new ArrayList<>();

    for (int i = 0; i < days.size() / 7; i++) {
        RowConstraints r = new RowConstraints();
        r.setMinHeight(100);
        r.setVgrow(Priority.ALWAYS);
        squareRowConstraints.add(r);
        calendarGrid.getRowConstraints().add(r);

        for (int j = 0; j < 7; j++) {
            MonthCalendarSquare square = new MonthCalendarSquare(days.get(j + i * 7), this.month);

            if (j == 0) {
                square.getStyleClass().add("first-in-row");
            }

            calendarSquares.add(square);
            calendarGrid.add(square, j, i + 1);
        }
    }
}
 
开发者ID:Fellesprosjekt-27,项目名称:fellesprosjekt,代码行数:26,代码来源:MonthCalendarComponent.java

示例5: addTab

import javafx.scene.layout.RowConstraints; //导入方法依赖的package包/类
/**
 * Adds a tab to the GUI with the specified gridpane information and title.
 * @param gridColumns
 * @param gridRows
 * @param name
 * @return
 */
public Tab addTab(int gridRows, int gridColumns, String name) {
	TimerTab tab = new TimerTab(name);
	tab.setClosable(false);
	GridPane gp = new GridPane();
	gp.setHgap(8);
	gp.setVgap(8);
	gp.getStyleClass().add("gridPane");
	
	for (int i = 0; i < gridColumns; i++) {
		ColumnConstraints cc = new ColumnConstraints();
		cc.setHgrow(Priority.ALWAYS);
		gp.getColumnConstraints().add(cc);
	}
	for (int i = 0; i < gridRows; i++) {
		RowConstraints rc = new RowConstraints();
		rc.setVgrow(Priority.NEVER);
		gp.getRowConstraints().add(rc);
	}
	
	tab.setContent(gp);
	tabPane.getTabs().add(tab);
	gp.getChildren().clear();
	return tab;
}
 
开发者ID:Talkarcabbage,项目名称:rs-timer,代码行数:32,代码来源:MainWindow.java

示例6: addDefaultTab

import javafx.scene.layout.RowConstraints; //导入方法依赖的package包/类
public Tab addDefaultTab() {
	TimerTab tab = new TimerTab(ConfigManager.getInstance().getDefaultTabName());
	tab.setClosable(false);
	GridPane gp = new GridPane();
	gp.setHgap(8);
	gp.setVgap(8);
	gp.getStyleClass().add("gridPane");
	
	for (int i = 0; i < ConfigManager.getInstance().getDefaultTabColumns(); i++) {
		ColumnConstraints cc = new ColumnConstraints();
		cc.setHgrow(Priority.ALWAYS);
		gp.getColumnConstraints().add(cc);
	}
	for (int i = 0; i < ConfigManager.getInstance().getDefaultTabRows(); i++) {
		RowConstraints rc = new RowConstraints();
		rc.setVgrow(Priority.NEVER);
		gp.getRowConstraints().add(rc);
	}
	
	tab.setContent(gp);
	tabPane.getTabs().add(tab);
	gp.getChildren().clear();
	return tab;
}
 
开发者ID:Talkarcabbage,项目名称:rs-timer,代码行数:25,代码来源:MainWindow.java

示例7: setConstraints

import javafx.scene.layout.RowConstraints; //导入方法依赖的package包/类
/**
 * Sets the FX constraints.
 */
private void setConstraints() {

  // Column 1 has empty constraints.
  this.getColumnConstraints().add(new ColumnConstraints());

  // Column 2 should grow to fill space.
  ColumnConstraints column2 = new ColumnConstraints();
  column2.setHgrow(Priority.ALWAYS);
  this.getColumnConstraints().add(column2);

  // Rows 1-4 have empty constraints.
  this.getRowConstraints().add(new RowConstraints());
  this.getRowConstraints().add(new RowConstraints());
  this.getRowConstraints().add(new RowConstraints());
  this.getRowConstraints().add(new RowConstraints());

  // Row 5 should
  RowConstraints row5 = new RowConstraints();
  row5.setVgrow(Priority.ALWAYS);
  this.getRowConstraints().add(row5);
}
 
开发者ID:Apelon-VA,项目名称:ISAAC,代码行数:25,代码来源:ImportView.java

示例8: start

import javafx.scene.layout.RowConstraints; //导入方法依赖的package包/类
@Override
public void start(Stage stage) {
	Matcher.init();

	env = new ClassEnvironment();
	matcher = new Matcher(env);

	GridPane border = new GridPane();

	ColumnConstraints colConstraint = new ColumnConstraints();
	colConstraint.setPercentWidth(50);
	border.getColumnConstraints().addAll(colConstraint, colConstraint);

	RowConstraints defaultRowConstraints = new RowConstraints();
	RowConstraints contentRowConstraints = new RowConstraints();
	contentRowConstraints.setVgrow(Priority.ALWAYS);
	border.getRowConstraints().addAll(defaultRowConstraints, contentRowConstraints, defaultRowConstraints);

	MainMenuBar menu = new MainMenuBar(this);
	components.add(menu);
	border.add(menu, 0, 0, 2, 1);

	MatchPaneSrc srcPane = new MatchPaneSrc(this);
	components.add(srcPane);
	border.add(srcPane, 0, 1);

	MatchPaneDst dstPane = new MatchPaneDst(this, srcPane);
	components.add(dstPane);
	border.add(dstPane, 1, 1);

	BottomPane bottomPane = new BottomPane(this, srcPane, dstPane);
	components.add(bottomPane);
	border.add(bottomPane, 0, 2, 2, 1);

	scene = new Scene(border);
	stage.setScene(scene);
	stage.setTitle("Matcher");
	stage.show();
}
 
开发者ID:sfPlayer1,项目名称:Matcher,代码行数:40,代码来源:Gui.java

示例9: 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);
}
 
开发者ID:mikelaud,项目名称:fx-dialogs,代码行数:12,代码来源:FxDialog.java

示例10: 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

示例11: 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

示例12: addPathTile

import javafx.scene.layout.RowConstraints; //导入方法依赖的package包/类
/**
 * Function name:   addPathTile
 * Usage:   This method would add a new PathTile with relevant data into the grid
 * @param path path to be added
 */
private void addPathTile(String path) {
    PathTile pathTile = new PathTile(path);
    pathTile.setOnMouseClicked(event -> showRemovePathTileDialog(pathTile));
    pathsGrid.add(pathTile, item % 2, item / 2);
    if (item % 2 == 0) {
        RowConstraints newRow = new RowConstraints(100.0);
        newRow.setVgrow(Priority.NEVER);
        pathsGrid.getRowConstraints().add(newRow);
    }
    item++;
}
 
开发者ID:daothanhduy305,项目名称:MusicHub,代码行数:17,代码来源:SettingsController.java

示例13: setRegularRowLayout

import javafx.scene.layout.RowConstraints; //导入方法依赖的package包/类
private void setRegularRowLayout(GridPane gridPane, int rows) {
    List<RowConstraints> constraints = new ArrayList<>(rows);
    for (String field : fields) {
        RowConstraints rowExpand = new RowConstraints();
        rowExpand.setVgrow(Priority.ALWAYS);
        rowExpand.setValignment(VPos.TOP);
        if (rows == 0) {
            rowExpand.setPercentHeight(100);
        } else {
            rowExpand.setPercentHeight(100 / rows * editors.get(field).getWeight());
        }
        constraints.add(rowExpand);
    }
    gridPane.getRowConstraints().addAll(constraints);
}
 
开发者ID:JabRef,项目名称:jabref,代码行数:16,代码来源:FieldsEditorTab.java

示例14: setCompressedRowLayout

import javafx.scene.layout.RowConstraints; //导入方法依赖的package包/类
private void setCompressedRowLayout(GridPane gridPane, int rows) {
    RowConstraints rowExpand = new RowConstraints();
    rowExpand.setVgrow(Priority.ALWAYS);
    rowExpand.setValignment(VPos.TOP);
    if (rows == 0) {
        rowExpand.setPercentHeight(100);
    } else {
        rowExpand.setPercentHeight(100 / rows);
    }
    for (int i = 0; i < rows; i++) {
        gridPane.getRowConstraints().add(rowExpand);
    }
}
 
开发者ID:JabRef,项目名称:jabref,代码行数:14,代码来源:FieldsEditorTab.java

示例15: init

import javafx.scene.layout.RowConstraints; //导入方法依赖的package包/类
private void init() {
	setHgap(4 * GuiConstants.padding);
	setVgap(4 * GuiConstants.padding);

	ColumnConstraints colConstraint = new ColumnConstraints();
	colConstraint.setPercentWidth(50);
	getColumnConstraints().addAll(colConstraint, colConstraint);

	RowConstraints rowConstraintInput = new RowConstraints();
	RowConstraints rowConstraintClassPath = new RowConstraints();
	rowConstraintClassPath.setVgrow(Priority.SOMETIMES);
	RowConstraints rowConstraintButtons = new RowConstraints();
	RowConstraints rowConstraintShared = new RowConstraints();
	rowConstraintShared.setVgrow(Priority.SOMETIMES);
	getRowConstraints().addAll(rowConstraintInput, rowConstraintClassPath, rowConstraintButtons, rowConstraintShared);

	ObservableList<Path> pathsA = FXCollections.observableList(config.getPathsA());
	ObservableList<Path> pathsB = FXCollections.observableList(config.getPathsB());
	classPathA = FXCollections.observableList(config.getClassPathA());
	classPathB = FXCollections.observableList(config.getClassPathB());
	sharedClassPath = FXCollections.observableList(config.getSharedClassPath());

	add(createFilesSelectionPane("Inputs A", pathsA, window, false, false), 0, 0);
	add(createFilesSelectionPane("Inputs B", pathsB, window, false, false), 1, 0);
	add(createFilesSelectionPane("Class path A", classPathA, window, true, false), 0, 1);
	add(createFilesSelectionPane("Class path B", classPathB, window, true, false), 1, 1);

	HBox hbox = new HBox(GuiConstants.padding);
	Button swapButton = new Button("swap A ⇄ B");
	hbox.getChildren().add(swapButton);
	swapButton.setOnAction(event -> {
		List<Path> paths = new ArrayList<>(pathsA);
		pathsA.clear();
		pathsA.addAll(pathsB);
		pathsB.setAll(paths);

		paths.clear();
		paths.addAll(classPathA);
		classPathA.clear();
		classPathA.addAll(classPathB);
		classPathB.setAll(paths);
	});
	add(hbox, 0, 2, 2, 1);

	add(createFilesSelectionPane("Shared class path", sharedClassPath, window, true, true), 0, 3, 2, 1);
	// TODO: config.inputsBeforeClassPath

	ListChangeListener<Path> listChangeListener = change -> okButton.setDisable(!config.isValid());

	pathsA.addListener(listChangeListener);
	pathsB.addListener(listChangeListener);
	classPathA.addListener(listChangeListener);
	classPathB.addListener(listChangeListener);
	sharedClassPath.addListener(listChangeListener);
	listChangeListener.onChanged(null);
}
 
开发者ID:sfPlayer1,项目名称:Matcher,代码行数:57,代码来源:NewProjectPane.java


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