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


Java HBox.setMaxSize方法代码示例

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


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

示例1: createGrid

import javafx.scene.layout.HBox; //导入方法依赖的package包/类
private void createGrid() {
    
    gridOperator.traverseGrid((i,j)->{
        gridGroup.getChildren().add(createCell(i, j));
        return 0;
    });

    gridGroup.getStyleClass().add("game-grid");
    gridGroup.setManaged(false);
    gridGroup.setLayoutX(BORDER_WIDTH);
    gridGroup.setLayoutY(BORDER_WIDTH);

    HBox hBottom = new HBox();
    hBottom.getStyleClass().add("game-backGrid");
    hBottom.setMinSize(gridWidth, gridWidth);
    hBottom.setPrefSize(gridWidth, gridWidth);
    hBottom.setMaxSize(gridWidth, gridWidth);
    
    // Clip hBottom to keep the dropshadow effects within the hBottom
    Rectangle rect = new Rectangle(gridWidth, gridWidth);
    hBottom.setClip(rect);
    hBottom.getChildren().add(gridGroup);
    
    vGame.getChildren().add(hBottom);
}
 
开发者ID:juebanlin,项目名称:util4j,代码行数:26,代码来源:Board.java

示例2: CalendarToolBar

import javafx.scene.layout.HBox; //导入方法依赖的package包/类
public CalendarToolBar(CalendarView calendarView) {
    this.calendarView = calendarView;

    getStyleClass().addAll("module-toolbar", "calendar-toolbar", "primary-color-calendar");

    ToggleGroup group = new ToggleGroup();

    ToggleButton showDay = new ToggleButton("DAY");
    ToggleButton showWeek = new ToggleButton("WEEK");
    ToggleButton showMonth = new ToggleButton("MONTH");
    ToggleButton showYear = new ToggleButton("YEAR");

    showDay.setOnAction(evt -> showDayPage());
    showWeek.setOnAction(evt -> showWeekPage());
    showMonth.setOnAction(evt -> showMonthPage());
    showYear.setOnAction(evt -> showYearPage());

    showDay.getStyleClass().add("first");
    showYear.getStyleClass().add("last");

    showDay.setSelected(true);
    showDay.setMaxHeight(Double.MAX_VALUE);
    showWeek.setMaxHeight(Double.MAX_VALUE);
    showMonth.setMaxHeight(Double.MAX_VALUE);
    showYear.setMaxHeight(Double.MAX_VALUE);

    group.getToggles().addAll(showDay, showWeek, showMonth, showYear);

    HBox switcher = new HBox(showDay, showWeek, showMonth, showYear);
    switcher.getStyleClass().add("switcher");
    switcher.setFillHeight(true);
    switcher.setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE);
    HBox.setHgrow(switcher, Priority.ALWAYS);

    CustomTextField searchField = new CustomTextField();
    Button clearSearchButton = new Button();
    clearSearchButton.getStyleClass().add("clear-search");
    clearSearchButton.setOnAction(evt -> searchField.setText(""));
    searchField.setRight(clearSearchButton);
    searchField.setPromptText("SEARCH");
    searchField.setPrefColumnCount(30);

    SearchResultView searchResultView = calendarView.getSearchResultView();
    searchResultView.searchTextProperty().bind(searchField.textProperty());

    getChildren().addAll(switcher, searchField);
    setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE);
}
 
开发者ID:dlemmermann,项目名称:JProCalendarFX,代码行数:49,代码来源:CalendarToolBar.java


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