當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。