本文整理汇总了Java中javafx.scene.layout.ColumnConstraints.setMaxWidth方法的典型用法代码示例。如果您正苦于以下问题:Java ColumnConstraints.setMaxWidth方法的具体用法?Java ColumnConstraints.setMaxWidth怎么用?Java ColumnConstraints.setMaxWidth使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.scene.layout.ColumnConstraints
的用法示例。
在下文中一共展示了ColumnConstraints.setMaxWidth方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: loadGridData
import javafx.scene.layout.ColumnConstraints; //导入方法依赖的package包/类
public static void loadGridData(GridPane grid,Main main, DescriptionEntretien d){
// Grid initialisation ( reset )
grid.getColumnConstraints().clear();
// Grid Creation
// for each moment of the interview we add a collumn
for (int j = 0; j < d.getNumberCols(); j++) {
ColumnConstraints c = new ColumnConstraints();
c.setMinWidth(180);
c.setPrefWidth(Control.USE_COMPUTED_SIZE);
c.setMaxWidth(Control.USE_COMPUTED_SIZE);
grid.getColumnConstraints().add(c);
}
for (int i = 0; i < 1; i++) {
for (int j = 0; j < d.getNumberCols(); j++) {
// Creation of the Moment box
MomentExpVBox mp = new MomentExpVBox(main);
addMomentExpBorderPaneListener(mp, main);
MomentExperience mom;
boolean hasMoment = false;
if (main.getCurrentDescription() != null) {
for (MomentExperience m : d.getMoments()) {
if(m.getGridCol() == j){
mom = m;
mp.setMoment(mom);
hasMoment = true;
}
}
}
if (hasMoment) {
mp.showMoment();
mp.LoadMomentData();
loadTypes(mp, main);
loadSousMoment(mp,main);
}
grid.add(mp,j,i);
}
}
}
示例2: execute
import javafx.scene.layout.ColumnConstraints; //导入方法依赖的package包/类
@Override
public void execute() {
momentExpPane.showMoment();
main.getCurrentDescription().addMomentExp(momentExpPane.getMoment());
if(momentExpPane.getCol() == main.getCurrentDescription().getNumberCols()-1){
MomentExpVBox mb = new MomentExpVBox(main, true);
MainViewTransformations.addMomentExpBorderPaneListener(mb, main);
ColumnConstraints c = new ColumnConstraints();
c.setMinWidth(180);
c.setPrefWidth(Control.USE_COMPUTED_SIZE);
c.setMaxWidth(Control.USE_COMPUTED_SIZE);
// add a new col and the borderPane
main.getGrid().getColumnConstraints().add(c);
main.getGrid().add(mb,main.getCurrentDescription().getNumberCols(), 0);
// increase the number of col by one
main.getCurrentDescription().setNumberCols(main.getCurrentDescription().getNumberCols()+1);
}
main.needToSave();
}
示例3: buildCells
import javafx.scene.layout.ColumnConstraints; //导入方法依赖的package包/类
private void buildCells() {
positionToDateCellMap.clear();
dateToPositionMap.clear();
cellMap.clear();
YearMonth start = getSkinnable().getExtendedStartMonth();
YearMonth end = getSkinnable().getExtendedEndMonth();
int colIndex = 0;
grid.getColumnConstraints().clear();
grid.getChildren().clear();
while (!start.isAfter(end)) {
ColumnConstraints columnConstraints = new ColumnConstraints();
columnConstraints.setFillWidth(true);
columnConstraints.setMinWidth(Region.USE_PREF_SIZE);
columnConstraints.setMaxWidth(Double.MAX_VALUE);
grid.getColumnConstraints().add(columnConstraints);
buildCells(start, colIndex);
start = start.plusMonths(1);
colIndex++;
}
grid.getColumnConstraints().forEach(con -> con.setPercentWidth(100d / (double) grid.getColumnConstraints().size()));
updateEntries("cells were rebuild");
updateToday();
updateSelected();
}
示例4: updateVisibility
import javafx.scene.layout.ColumnConstraints; //导入方法依赖的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.ColumnConstraints; //导入方法依赖的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: createContent
import javafx.scene.layout.ColumnConstraints; //导入方法依赖的package包/类
@Override
protected Node createContent() {
leftSide = createLeftHandSide();
rightSide = createRightHandSide();
leftColumn = new ColumnConstraints();
leftColumn.setPercentWidth(50);
leftColumn.setMinWidth(Region.USE_COMPUTED_SIZE);
leftColumn.setPrefWidth(Region.USE_COMPUTED_SIZE);
leftColumn.setMaxWidth(Double.MAX_VALUE);
leftColumn.setFillWidth(true);
rightColumn = new ColumnConstraints();
rightColumn.setPercentWidth(50);
rightColumn.setMinWidth(Region.USE_COMPUTED_SIZE);
rightColumn.setPrefWidth(Region.USE_COMPUTED_SIZE);
rightColumn.setMaxWidth(Double.MAX_VALUE);
rightColumn.setFillWidth(true);
RowConstraints rowConstraints = new RowConstraints();
rowConstraints.setPercentHeight(100);
rowConstraints.setFillHeight(true);
// no need to assign a style class, will be auto-assigned by superclass ("content")
gridPane = new GridPane();
gridPane.setHgap(20);
gridPane.getColumnConstraints().addAll(leftColumn, rightColumn);
gridPane.getRowConstraints().addAll(rowConstraints);
gridPane.add(leftSide, 0, 0);
gridPane.add(rightSide, 1, 0);
getSkinnable().widthProperty().addListener(it -> updateLayout());
return gridPane;
}
示例7: newColumn
import javafx.scene.layout.ColumnConstraints; //导入方法依赖的package包/类
public static ColumnConstraints newColumn(int value, String unit, HPos position) {
ColumnConstraints col = new ColumnConstraints();
if (unit.equals("%")) {
col.setPercentWidth(value);
}
if (unit.equals("px")) {
col.setMaxWidth(value);
col.setMinWidth(value);
}
if (position != null) {
col.setHalignment(position);
}
return col;
}
示例8: initializeEditorCanvas
import javafx.scene.layout.ColumnConstraints; //导入方法依赖的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);
}
}
示例9: loadClientProfile
import javafx.scene.layout.ColumnConstraints; //导入方法依赖的package包/类
private void loadClientProfile() {
// preliminary values
final double width = avatarImage.getFitWidth();
final double height = avatarImage.getFitHeight();
final String user = client().getUserData().getUserName();
final String status = client().getUserData().getStatus();
final String about = client().getUserData().getAboutMe();
final Image avatar = client().getUserData().getAvatar(width, height);
// display all data
userName.setText(user + " ");
statusText.setText(status + " ");
aboutMe.setText(about + " ");
avatarImage.setImage(avatar);
// make things appear
ColumnConstraints cc = aboutGridPane.getColumnConstraints().get(1);
cc.setMinWidth(initialGridWidth);
cc.setMaxWidth(initialGridWidth);
messageButton.setVisible(true);
videoCallButton.setVisible(true);
// set edit states of each controls
aboutMe.setEditable(false);
userName.setEditable(false);
statusText.setEditable(false);
userName.setCursor(Cursor.DEFAULT);
statusText.setCursor(Cursor.DEFAULT);
aboutMe.setCursor(Cursor.DEFAULT);
userName.setId("user-name");
statusText.setId("user-status");
aboutMe.setId("user-about");
}
示例10: loadDefaultProfile
import javafx.scene.layout.ColumnConstraints; //导入方法依赖的package包/类
private void loadDefaultProfile() {
// preliminary values
final double width = avatarImage.getFitWidth();
final double height = avatarImage.getFitHeight();
final String user = Core.instance().user().getName();
final String status = Core.instance().user().getStatus();
final String about = Core.instance().user().getAboutMe();
final Image avatar = Core.instance().user().getAvatarImage(width, height);
// display all data
userName.setText(user);
statusText.setText(status);
aboutMe.setText(about);
avatarImage.setImage(avatar);
// make things appear
ColumnConstraints cc = aboutGridPane.getColumnConstraints().get(1);
cc.setMinWidth(0);
cc.setMaxWidth(0);
messageButton.setVisible(false);
videoCallButton.setVisible(false);
// set edit states of each controls
aboutMe.setEditable(true);
userName.setEditable(true);
statusText.setEditable(true);
userName.setCursor(Cursor.TEXT);
statusText.setCursor(Cursor.TEXT);
aboutMe.setCursor(Cursor.TEXT);
userName.setId("my-name");
statusText.setId("my-status");
aboutMe.setId("my-about");
}
示例11: drawColumn
import javafx.scene.layout.ColumnConstraints; //导入方法依赖的package包/类
public void drawColumn() {
// Remove any previous constraints
columnGridPane.getRowConstraints().clear();
columnGridPane.getColumnConstraints().clear();
// Set the column Constraints
ColumnConstraints col0 = new ColumnConstraints();
col0.setMinWidth(5);
col0.setPrefWidth(Control.USE_COMPUTED_SIZE);
col0.setMaxWidth(Control.USE_COMPUTED_SIZE);
col0.setFillWidth(true);
col0.setHgrow(Priority.ALWAYS);
this.columnGridPane.getColumnConstraints().add(col0);
// Add the Y-Axis
// this.yAxisCenterStackPane.getChildren().add(axisCenter);
// this.axisCenterAnchorPane.widthProperty().addListener( stageSizeListener );
// this.axisCenterAnchorPane.heightProperty().addListener( stageSizeListener );
// Now add the X-Axis
axisLeftStackPane.getChildren().add(axisLeft);
this.axisLeftAnchorPane.widthProperty().addListener( stageSizeListener );
this.axisLeftAnchorPane.heightProperty().addListener( stageSizeListener );
axisCenterStackPane.getChildren().add(axisCenter);
this.axisCenterAnchorPane.widthProperty().addListener( stageSizeListener );
this.axisCenterAnchorPane.heightProperty().addListener( stageSizeListener );
axisRightStackPane.getChildren().add(axisRight);
this.axisRightAnchorPane.widthProperty().addListener( stageSizeListener );
this.axisRightAnchorPane.heightProperty().addListener( stageSizeListener );
}
示例12: buildTorrentOptionsPane
import javafx.scene.layout.ColumnConstraints; //导入方法依赖的package包/类
private Node buildTorrentOptionsPane() {
final HBox labelPane = new HBox(5);
labelPane.getChildren().addAll(new Label("Label: "), labelCombo);
labelPane.setAlignment(Pos.CENTER);
HBox.setHgrow(labelCombo, Priority.ALWAYS);
labelCombo.setMaxWidth(Double.MAX_VALUE);
final GridPane torrentOptionsPane = new GridPane();
torrentOptionsPane.setVgap(5);
final ColumnConstraints nameColumnConstraints = new ColumnConstraints(200);
final ColumnConstraints valueColumnConstraints = new ColumnConstraints();
valueColumnConstraints.setFillWidth(true);
valueColumnConstraints.setMaxWidth(Double.MAX_VALUE);
valueColumnConstraints.setHalignment(HPos.LEFT);
torrentOptionsPane.getColumnConstraints().addAll(nameColumnConstraints, valueColumnConstraints);
torrentOptionsPane.add(skipHashCheckbox, 0, 0);
torrentOptionsPane.add(labelPane, 1, 0);
torrentOptionsPane.add(startTorrentCheckbox, 0, 1);
torrentOptionsPane.add(addToTopQueueCheckbox, 1, 1);
GridPane.setHgrow(labelPane, Priority.ALWAYS);
final TitledBorderPane borderedTorrentOptionsPane = new TitledBorderPane("Torrent Options",
torrentOptionsPane, BorderStyle.AMPLE, TitledBorderPane.PRIMARY_BORDER_COLOR_STYLE);
return borderedTorrentOptionsPane;
}
示例13: PrintViewSkin
import javafx.scene.layout.ColumnConstraints; //导入方法依赖的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);
}
示例14: Actions
import javafx.scene.layout.ColumnConstraints; //导入方法依赖的package包/类
public Actions() {
columnConstraints = new ColumnConstraints();
columnConstraints0 = new ColumnConstraints();
columnConstraints1 = new ColumnConstraints();
rowConstraints = new RowConstraints();
button = new Button();
button0 = new Button();
button1 = new Button();
setPrefHeight(32.0);
setPrefWidth(186.0);
setStyle("-fx-background-color: none;");
getStylesheets().add("/view/common/../../css/main.css");
columnConstraints.setHgrow(javafx.scene.layout.Priority.SOMETIMES);
columnConstraints.setMaxWidth(120.0);
columnConstraints.setMinWidth(10.0);
columnConstraints.setPrefWidth(95.0);
columnConstraints0.setHgrow(javafx.scene.layout.Priority.SOMETIMES);
columnConstraints0.setMaxWidth(150.0);
columnConstraints0.setMinWidth(10.0);
columnConstraints0.setPrefWidth(100.0);
columnConstraints1.setHgrow(javafx.scene.layout.Priority.SOMETIMES);
columnConstraints1.setMaxWidth(192.0);
columnConstraints1.setMinWidth(10.0);
columnConstraints1.setPrefWidth(110.0);
rowConstraints.setMinHeight(10.0);
rowConstraints.setPrefHeight(30.0);
rowConstraints.setVgrow(javafx.scene.layout.Priority.SOMETIMES);
button.setDefaultButton(true);
button.setMnemonicParsing(false);
button.setOnAction(this::handleEditButton);
button.setText("Edit");
GridPane.setColumnIndex(button0, 1);
button0.setMnemonicParsing(false);
button0.setOnAction(this::handleViewButton);
button0.getStyleClass().add("btn-primary");
button0.setText("View");
GridPane.setColumnIndex(button1, 2);
button1.setCancelButton(true);
button1.setMnemonicParsing(false);
button1.setOnAction(this::handleDeleteButton);
button1.setText("Delete");
getColumnConstraints().add(columnConstraints);
getColumnConstraints().add(columnConstraints0);
getColumnConstraints().add(columnConstraints1);
getRowConstraints().add(rowConstraints);
getChildren().add(button);
getChildren().add(button0);
getChildren().add(button1);
}
示例15: createChart
import javafx.scene.layout.ColumnConstraints; //导入方法依赖的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();
}
}
}