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


Java HBox.setFillHeight方法代码示例

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


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

示例1: NotificationBarPane

import javafx.scene.layout.HBox; //导入方法依赖的package包/类
public NotificationBarPane(Node content) {
    super(content);
    progressBar = new ProgressBar();
    label = new Label("infobar!");
    bar = new HBox(label);
    bar.setMinHeight(0.0);
    bar.getStyleClass().add("info-bar");
    bar.setFillHeight(true);
    setBottom(bar);
    // Figure out the height of the bar based on the CSS. Must wait until after we've been added to the parent node.
    sceneProperty().addListener(o -> {
        if (getParent() == null) return;
        getParent().applyCss();
        getParent().layout();
        barHeight = bar.getHeight();
        bar.setPrefHeight(0.0);
    });
    items = FXCollections.observableArrayList();
    items.addListener((ListChangeListener<? super Item>) change -> {
        config();
        showOrHide();
    });
}
 
开发者ID:Techsoul192,项目名称:legendary-guide,代码行数:24,代码来源:NotificationBarPane.java

示例2: wrap

import javafx.scene.layout.HBox; //导入方法依赖的package包/类
@Override
protected Node wrap(Node node) {
    HBox box = new HBox();
    box.setMaxWidth(Double.MAX_VALUE);
    box.setAlignment(Pos.CENTER);
    box.setFillHeight(false);

    StackPane stackPane = new StackPane();
    stackPane.setStyle("-fx-background-color: white; -fx-border-color: gray; -fx-border-width: .25px; -fx-padding: 20px;");
    box.getChildren().add(stackPane);

    stackPane.getChildren().add(node);
    stackPane.setEffect(new Reflection());

    return box;
}
 
开发者ID:dlemmermann,项目名称:CalendarFX,代码行数:17,代码来源:HelloWeekDayHeaderView.java

示例3: wrap

import javafx.scene.layout.HBox; //导入方法依赖的package包/类
@Override
public Node wrap(Node node) {

    HBox box = new HBox();
    box.setStyle("-fx-padding: 100px;");
    box.setAlignment(Pos.CENTER);
    box.setFillHeight(false);

    StackPane stackPane = new StackPane();
    stackPane.setStyle(
            "-fx-background-color: white; -fx-border-color: gray; -fx-border-width: .25px; -fx-padding: 0 20 0 20;");
    box.getChildren().add(stackPane);

    stackPane.getChildren().add(node);
    stackPane.setEffect(new Reflection());

    return box;
}
 
开发者ID:dlemmermann,项目名称:CalendarFX,代码行数:19,代码来源:HelloTimeScaleView.java

示例4: createControl

import javafx.scene.layout.HBox; //导入方法依赖的package包/类
@Override
protected Node createControl() {
    Calendar meetings = new Calendar("Meetings");
    Calendar training = new Calendar("Training");
    Calendar customers = new Calendar("Customers");
    Calendar holidays = new Calendar("Holidays");

    meetings.setStyle(Style.STYLE2);
    training.setStyle(Style.STYLE3);
    customers.setStyle(Style.STYLE4);
    holidays.setStyle(Style.STYLE5);

    CalendarSelector view = new CalendarSelector();
    view.getCalendars().addAll(meetings, training, customers, holidays);
    view.setCalendar(meetings);

    Label label = new Label("Selected: " + view.getCalendar().getName());
    label.setMaxHeight(Double.MAX_VALUE);
    view.calendarProperty().addListener(it -> label.setText("Selected: " + view.getCalendar().getName()));

    HBox box = new HBox(20);
    box.setFillHeight(true);
    box.getChildren().addAll(view, label);

    return box;
}
 
开发者ID:dlemmermann,项目名称:CalendarFX,代码行数:27,代码来源:HelloCalendarSelector.java

示例5: wrap

import javafx.scene.layout.HBox; //导入方法依赖的package包/类
@Override
protected Node wrap(Node node) {
    HBox box = new HBox();
    box.setStyle("-fx-padding: 100px;");
    box.setAlignment(Pos.CENTER);
    box.setFillHeight(false);

    StackPane stackPane = new StackPane();
    stackPane.setStyle(
            "-fx-background-color: white; -fx-border-color: gray; -fx-border-width: .25px; -fx-padding: 0 20 0 20;");
    box.getChildren().add(stackPane);

    stackPane.getChildren().add(node);
    stackPane.setEffect(new Reflection());

    return box;
}
 
开发者ID:dlemmermann,项目名称:CalendarFX,代码行数:18,代码来源:HelloWeekTimeScaleView.java

示例6: wrap

import javafx.scene.layout.HBox; //导入方法依赖的package包/类
@Override
protected Node wrap(Node node) {
    TimeRangeView field = (TimeRangeView) node;

    Label label = new Label("Range:   " + field.getStartDate() + "    to    " + field.getEndDate());
    label.setMaxHeight(Double.MAX_VALUE);
    field.startDateProperty().addListener(it -> label.setText("Range:   " + field.getStartDate() + "    to    " + field.getEndDate()));
    field.endDateProperty().addListener(it -> label.setText("Range:   " + field.getStartDate() + "    to    " + field.getEndDate()));

    VBox box2 = new VBox(20, field, label);
    box2.setFillWidth(false);

    StackPane stackPane = new StackPane();
    stackPane.setStyle("-fx-background-color: white; -fx-border-color: gray; -fx-border-width: .25px; -fx-padding: 20px;");
    stackPane.getChildren().add(box2);

    HBox box = new HBox(stackPane);
    box.setStyle("-fx-padding: 100px;");
    box.setAlignment(Pos.CENTER);
    box.setFillHeight(false);

    return box;
}
 
开发者ID:dlemmermann,项目名称:CalendarFX,代码行数:24,代码来源:HelloTimeRangeView.java

示例7: wrap

import javafx.scene.layout.HBox; //导入方法依赖的package包/类
protected Node wrap(Node node) {
    StackPane stackPane = new StackPane();
    stackPane.setStyle("-fx-background-color: white; -fx-border-color: gray; -fx-border-width: .25px; -fx-padding: 20px;");
    stackPane.getChildren().add(node);

    HBox box = new HBox();
    box.setAlignment(Pos.CENTER);
    box.setFillHeight(false);
    box.getChildren().add(stackPane);

    return box;
}
 
开发者ID:dlemmermann,项目名称:CalendarFX,代码行数:13,代码来源:CalendarFXSample.java

示例8: createLeftHandSide

import javafx.scene.layout.HBox; //导入方法依赖的package包/类
protected Node createLeftHandSide() {
    DayPage dayPage = getSkinnable();

    // today label
    todayLabel = new Label();
    todayLabel.getStyleClass().add("today-label"); //$NON-NLS-1$
    todayLabel.setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE);
    todayLabel.setAlignment(Pos.TOP_LEFT);
    todayLabel.setTextOverrun(OverrunStyle.CLIP);
    todayLabel.setMinWidth(Region.USE_PREF_SIZE);
    HBox.setHgrow(todayLabel, Priority.ALWAYS);

    // year month view
    yearMonthView = dayPage.getYearMonthView();
    yearMonthView.setSelectionMode(SelectionMode.SINGLE);
    yearMonthView.setShowMonth(false);
    yearMonthView.setShowYear(false);
    yearMonthView.setShowTodayButton(false);
    HBox.setHgrow(yearMonthView, Priority.NEVER);
    getSkinnable().bind(yearMonthView, true);

    HBox header = new HBox(10);
    header.setFillHeight(true);
    header.getChildren().addAll(todayLabel, yearMonthView);
    header.getStyleClass().add("header");

    AgendaView agendaView = dayPage.getAgendaView();
    getSkinnable().bind(agendaView, true);
    HBox.setMargin(agendaView, new Insets(10, 0, 0, 0));

    BorderPane leftHandSide = new BorderPane();
    leftHandSide.getStyleClass().add("left-side");
    leftHandSide.setTop(header);
    leftHandSide.setCenter(agendaView);
    HBox.setHgrow(leftHandSide, Priority.ALWAYS);
    return leftHandSide;
}
 
开发者ID:dlemmermann,项目名称:CalendarFX,代码行数:38,代码来源:DayPageSkin.java

示例9: FeaturesPane

import javafx.scene.layout.HBox; //导入方法依赖的package包/类
public FeaturesPane() {
    super();

    getStylesheets().add(FeaturesPane.class.getResource("/options-pane.css").toExternalForm());

    getStyleClass().add("options-pane");

    Button all = new Button("All");
    all.setOnAction(evt -> features.forEach(f -> f.setActive(true)));
    all.setMaxWidth(Double.MAX_VALUE);
    all.setId("all-button");
    Util.installWindowDragListener(all);

    Button reset = new Button("Reset");
    reset.setOnAction(evt -> features.forEach(f -> f.setActive(false)));
    reset.setMaxWidth(Double.MAX_VALUE);
    reset.setId("reset-button");
    Util.installWindowDragListener(reset);

    HBox top = new HBox(all, reset);
    top.getStyleClass().add("toolbar");
    top.setFillHeight(true);
    HBox.setHgrow(all, Priority.ALWAYS);
    HBox.setHgrow(reset, Priority.ALWAYS);

    getChildren().add(top);
}
 
开发者ID:hendrikebbers,项目名称:ExtremeGuiMakeover,代码行数:28,代码来源:FeaturesPane.java

示例10: populateMenu

import javafx.scene.layout.HBox; //导入方法依赖的package包/类
private void populateMenu(Map<DocumentType, List<SearchResult>> results) {
    contextMenu.getItems().clear();
    for (Map.Entry<DocumentType, List<SearchResult>> entry : results.entrySet()) {
        boolean first = true;
        for(SearchResult result: entry.getValue()) {
            final SearchResult sr = result;
            final HBox hBox = new HBox();
            hBox.setFillHeight(true);
            Label itemLabel = new Label(result.getName());
            itemLabel.getStyleClass().add("item-label");
            if (first) {
                first = false;
                Label groupLabel = new Label(result.getDocumentType().getPluralDisplayName());
                groupLabel.getStyleClass().add("group-label");
                groupLabel.setAlignment(Pos.CENTER_RIGHT);
                groupLabel.setMinWidth(USE_PREF_SIZE);
                groupLabel.setPrefWidth(70);
                hBox.getChildren().addAll(groupLabel,itemLabel);
            } else {
                Region spacer = new Region();
                spacer.setMinWidth(USE_PREF_SIZE);
                spacer.setPrefWidth(70);
                hBox.getChildren().addAll(spacer,itemLabel);
            }
            // create a special node for hiding/showing popup content
            final Region popRegion = new Region();
            popRegion.getStyleClass().add("search-menu-item-popup-region");
            popRegion.setPrefSize(10, 10);
            hBox.getChildren().add(popRegion);
            final String name = (result.getDocumentType() == DocumentType.SAMPLE) ? result.getName() :
                    result.getPackageName()+
                            ((result.getClassName() != null) ? "."+result.getClassName() : "") +
                            ((result.getName() != null) ? "."+result.getName() : "");
            final String shortDescription = (result.getShortDescription().length() == 160) ? result.getShortDescription() +"..." : result.getShortDescription();
            popRegion.opacityProperty().addListener(new ChangeListener<Number>() {
                @Override public void changed(ObservableValue<? extends Number> observable, Number oldValue, Number newValue) {
                    Platform.runLater( new Runnable() { // TODO runLater used here as a workaround for RT-14396
                        @Override public void run() {
                            if (popRegion.getOpacity() == 1) {
                                infoName.setText(name);
                                infoDescription.setText(shortDescription);
                                Point2D hBoxPos = hBox.localToScene(0, 0);
                                extraInfoPopup.show(getScene().getWindow(),
                                    hBoxPos.getX() + contextMenu.getScene().getX() + contextMenu.getX() - infoBox.getPrefWidth() - 10,
                                    hBoxPos.getY() + contextMenu.getScene().getY() + contextMenu.getY() - 27
                                );
                            }
                        }
                    });
                }
            });
            // create menu item
            CustomMenuItem menuItem = new CustomMenuItem(hBox, true);
            menuItem.getStyleClass().add("search-menu-item");
            contextMenu.getItems().add(menuItem);
            // handle item selection
            menuItem.setOnAction(new EventHandler<ActionEvent>() {
                @Override public void handle(ActionEvent actionEvent) {
                    ///System.out.println("SearchBox.handle menuItem.setOnAction");
                    Ensemble2.getEnsemble2().goToPage(sr.getEnsemblePath(),true);
                }
            });
        }
    }
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:66,代码来源:SearchBox.java

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