本文整理汇总了Java中javafx.scene.layout.ColumnConstraints.setHgrow方法的典型用法代码示例。如果您正苦于以下问题:Java ColumnConstraints.setHgrow方法的具体用法?Java ColumnConstraints.setHgrow怎么用?Java ColumnConstraints.setHgrow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.scene.layout.ColumnConstraints
的用法示例。
在下文中一共展示了ColumnConstraints.setHgrow方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: EventLogger
import javafx.scene.layout.ColumnConstraints; //导入方法依赖的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);
}
示例2: createGrid
import javafx.scene.layout.ColumnConstraints; //导入方法依赖的package包/类
private GridPane createGrid() {
//-------------------------------------------------------------------- Grid
GRID.setHgap(GRID_GAP);
GRID.setVgap(GRID_GAP);
GRID.setPadding(new Insets(GRID_GAP));
GRID.setGridLinesVisible(false);
//-------------------------------------------------------------------- Constraints
for (int i = 0; i < 2; i++) {
final ColumnConstraints column = new ColumnConstraints();
column.setFillWidth(true);
column.setHgrow(Priority.NEVER);
GRID.getColumnConstraints().add(column);
}
GRID.getColumnConstraints().get(1).setHgrow(Priority.SOMETIMES);
//-------------------------------------------------------------------- End
return GRID;
}
示例3: createBody
import javafx.scene.layout.ColumnConstraints; //导入方法依赖的package包/类
/**
* Creates the node used for the body part of each cell.
*
* In this default implementation the body consists of a grid pane with
* three columns. The middle column is used for showing the title of
* calendar entries. This column will get whatever space is left after
* the icon and the time column have used what they need. This means
* that a very long title will automatically be truncated.
*
* @return the body node
*/
protected Node createBody() {
// icon column
ColumnConstraints iconColumn = new ColumnConstraints();
// title column
ColumnConstraints descriptionColumn = new ColumnConstraints();
descriptionColumn.setFillWidth(true);
descriptionColumn.setHgrow(Priority.SOMETIMES);
descriptionColumn.setMinWidth(0);
descriptionColumn.setPrefWidth(0);
// time column
ColumnConstraints timeColumn = new ColumnConstraints();
timeColumn.setHalignment(HPos.RIGHT);
gridPane = new GridPane();
gridPane.setGridLinesVisible(true);
gridPane.setMinWidth(0);
gridPane.setPrefWidth(0);
gridPane.getStyleClass().add(AGENDA_VIEW_BODY);
gridPane.getColumnConstraints().addAll(iconColumn, descriptionColumn, timeColumn);
return gridPane;
}
示例4: initializeGrid
import javafx.scene.layout.ColumnConstraints; //导入方法依赖的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);
}
示例5: BuildWallConfigurationPanelImpl
import javafx.scene.layout.ColumnConstraints; //导入方法依赖的package包/类
/**
* Constructs a new {@link BuildWallConfigurationPanelImpl}.
* @param configuration the {@link BuildWallConfiguration} to configure.
* @param title the title of the panel.
*/
public BuildWallConfigurationPanelImpl( String title, BuildWallConfiguration configuration ) {
this.configuration = configuration;
this.styling = new JavaFxStyle();
constructTitle( title );
constructDimensions();
constructJobPoliciesPane();
constructFontItemPane();
constructColourItemPane();
ColumnConstraints width = new ColumnConstraints();
width.setPercentWidth( 100 );
width.setHgrow( Priority.ALWAYS );
getColumnConstraints().addAll( width );
}
示例6: configureGrid
import javafx.scene.layout.ColumnConstraints; //导入方法依赖的package包/类
private void configureGrid() {
grid.setHgap(10);
grid.setVgap(4);
grid.setPadding(new Insets(0, 10, 0, 10));
ColumnConstraints column1 = new ColumnConstraints(32);
ColumnConstraints column2 = new ColumnConstraints(USE_COMPUTED_SIZE , USE_COMPUTED_SIZE, Double.MAX_VALUE);
column2.setHgrow(Priority.NEVER);
ColumnConstraints column3 = new ColumnConstraints(30 , 50 , Double.MAX_VALUE);
column3.setHgrow(Priority.ALWAYS);
column3.setFillWidth(true);
ColumnConstraints column4 = new ColumnConstraints(USE_COMPUTED_SIZE , USE_COMPUTED_SIZE , Double.MAX_VALUE);
column4.setHgrow(Priority.NEVER);
ColumnConstraints column5 = new ColumnConstraints(30 , 50 , Double.MAX_VALUE);
column5.setHgrow(Priority.ALWAYS);
column5.setFillWidth(true);
ColumnConstraints column6 = new ColumnConstraints(10, 12, 16);
column6.setHgrow(Priority.NEVER);
column6.setFillWidth(false);
grid.getColumnConstraints().addAll(column1, column2, column3, column4, column5, column6);
}
示例7: createPane
import javafx.scene.layout.ColumnConstraints; //导入方法依赖的package包/类
@Override
public void createPane() {
this.setHgap(10);
this.setVgap(10);
ColumnConstraints firstColumnConstrains = new ColumnConstraints();
ColumnConstraints secondColumnConstrains = new ColumnConstraints();
firstColumnConstrains.setPercentWidth(FIRST_COLUMN_PERCENT_WIDTH);
secondColumnConstrains.setPercentWidth(SECOND_COLUMN_PERCENT_WIDTH);
secondColumnConstrains.setHgrow(Priority.ALWAYS);
this.getColumnConstraints().addAll(firstColumnConstrains, secondColumnConstrains);
this.addRow(0, projectNameLabel, projectNameField);
this.addRow(1, projectPathLabel, new HBox(projectPathField, pathChooserButton));
this.addRow(2, startDateLabel, startDatePicker);
this.addRow(3, finishDateLabel, finishDatePicker);
this.addRow(4, descriptionLabel, descriptionTextArea);
HBox.setHgrow(projectPathField, Priority.ALWAYS);
GridPane.setMargin(descriptionTextArea, new Insets(0, 0, 10, 0));
GridPane.setValignment(descriptionLabel, VPos.TOP);
startDatePicker.setPrefWidth(350);
finishDatePicker.setPrefWidth(350);
descriptionTextArea.setPrefHeight(200);
}
示例8: createPane
import javafx.scene.layout.ColumnConstraints; //导入方法依赖的package包/类
@Override
public void createPane() {
ColumnConstraints firstColumnConstrains = new ColumnConstraints();
ColumnConstraints secondColumnConstrains = new ColumnConstraints();
firstColumnConstrains.setPercentWidth(FIRST_COLUMN_PERCENT_WIDTH);
secondColumnConstrains.setPercentWidth(SECOND_COLUMN_PERCENT_WIDTH);
secondColumnConstrains.setHgrow(Priority.ALWAYS);
this.getColumnConstraints().addAll(firstColumnConstrains, secondColumnConstrains);
this.addRow(0, nameLabel, nameField);
this.addRow(1, startDateLabel, startDatePicker);
this.addRow(2, finishDateLabel, finishDatePicker);
this.addRow(3, donePercentLabel, donePercentSlider);
this.addRow(4, costLabel, costField);
this.addRow(5, descriptionLabel, descriptionTextArea);
this.setVgap(10);
this.setHgap(10);
this.setPadding(new Insets(10));
startDatePicker.setPrefWidth(350);
finishDatePicker.setPrefWidth(350);
GridPane.setValignment(descriptionLabel, VPos.TOP);
}
示例9: createPane
import javafx.scene.layout.ColumnConstraints; //导入方法依赖的package包/类
@Override
public void createPane() {
ColumnConstraints firstColumnConstrains = new ColumnConstraints();
ColumnConstraints secondColumnConstrains = new ColumnConstraints();
firstColumnConstrains.setPercentWidth(FIRST_COLUMN_PERCENT_WIDTH);
secondColumnConstrains.setPercentWidth(SECOND_COLUMN_PERCENT_WIDTH);
secondColumnConstrains.setHgrow(Priority.ALWAYS);
this.getColumnConstraints().addAll(firstColumnConstrains, secondColumnConstrains);
this.addRow(0, nameLabel, nameField);
this.addRow(1, emailLabel, emailField);
this.addRow(2, resourceTypeLabel, resourceTypeComboBox);
this.addRow(3, descriptionLabel, descriptionTextArea);
this.setVgap(10);
this.setHgap(10);
this.setPadding(new Insets(10));
emailField.setPrefWidth(350);
resourceTypeComboBox.setPrefWidth(350);
GridPane.setValignment(descriptionLabel, VPos.TOP);
}
示例10: createPane
import javafx.scene.layout.ColumnConstraints; //导入方法依赖的package包/类
@Override
public void createPane() {
ColumnConstraints firstColumnConstrains = new ColumnConstraints();
ColumnConstraints secondColumnConstrains = new ColumnConstraints();
firstColumnConstrains.setPercentWidth(FIRST_COLUMN_PERCENT_WIDTH);
secondColumnConstrains.setPercentWidth(SECOND_COLUMN_PERCENT_WIDTH);
secondColumnConstrains.setHgrow(Priority.ALWAYS);
this.getColumnConstraints().addAll(firstColumnConstrains, secondColumnConstrains);
this.addRow(0, nameLabel, nameField);
this.addRow(1, startDateLabel, startDatePicker);
this.addRow(2, finishDateLabel, finishDatePicker);
this.addRow(3, descriptionLabel, descriptionTextArea);
this.setVgap(10);
this.setHgap(10);
this.setPadding(new Insets(10));
startDatePicker.setPrefWidth(350);
finishDatePicker.setPrefWidth(350);
GridPane.setValignment(descriptionLabel, VPos.TOP);
}
示例11: buildQueueSettingsPane
import javafx.scene.layout.ColumnConstraints; //导入方法依赖的package包/类
private Node buildQueueSettingsPane() {
final GridPane queueSettingsPane = new GridPane();
queueSettingsPane.add(new Label("Maximum number of active torrents (upload or download): "), 0, 0);
queueSettingsPane.add(activeTorrentsLimitField, 1, 0);
queueSettingsPane.add(new Label("Maximum number of active downloads: "), 0, 1);
queueSettingsPane.add(activeDownloadsLimitField, 1, 1);
queueSettingsPane.add(new Label("Maximum number of active uploads: "), 0, 2);
queueSettingsPane.add(activeUploadsLimitField, 1, 2);
final ColumnConstraints firstColumn = new ColumnConstraints();
firstColumn.setHgrow(Priority.ALWAYS);
final ColumnConstraints secondColumn = new ColumnConstraints();
secondColumn.setPrefWidth(60);
secondColumn.setMinWidth(60);
queueSettingsPane.getColumnConstraints().addAll(firstColumn, secondColumn);
queueSettingsPane.setVgap(5);
return queueSettingsPane;
}
示例12: addTab
import javafx.scene.layout.ColumnConstraints; //导入方法依赖的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;
}
示例13: addDefaultTab
import javafx.scene.layout.ColumnConstraints; //导入方法依赖的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;
}
示例14: setConstraints
import javafx.scene.layout.ColumnConstraints; //导入方法依赖的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);
}
示例15: initializeGrid
import javafx.scene.layout.ColumnConstraints; //导入方法依赖的package包/类
private void initializeGrid() {
grid.setHgap(10);
grid.setVgap(5);
grid.setPadding(new Insets(0, 10, 0, 10));
// icon column
ColumnConstraints col1 = new ColumnConstraints();
col1.setFillWidth(false);
col1.setHgrow(Priority.NEVER);
grid.getColumnConstraints().add(col1);
// title column: grows
ColumnConstraints col2 = new ColumnConstraints();
col2.setFillWidth(true);
col2.setHgrow(Priority.ALWAYS);
grid.getColumnConstraints().add(col2);
// date column
ColumnConstraints col3 = new ColumnConstraints();
col3.setFillWidth(false);
col3.setHgrow(Priority.NEVER);
grid.getColumnConstraints().add(col3);
}