本文整理汇总了Java中javafx.scene.layout.Region.setMaxHeight方法的典型用法代码示例。如果您正苦于以下问题:Java Region.setMaxHeight方法的具体用法?Java Region.setMaxHeight怎么用?Java Region.setMaxHeight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.scene.layout.Region
的用法示例。
在下文中一共展示了Region.setMaxHeight方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createUi
import javafx.scene.layout.Region; //导入方法依赖的package包/类
private void createUi() {
getStyleClass().add(TITLE_BAR_STYLE_CLASS);
setAlignment(Pos.CENTER_RIGHT);
setMaxWidth(Double.MAX_VALUE);
Region selectedBar = new Region();
selectedBar.getStyleClass().add(HIGHLIGHT_STYLE_CLASS);
selectedBar.setMinWidth(Region.USE_PREF_SIZE);
selectedBar.setMaxHeight(Region.USE_PREF_SIZE);
selectedBar.setMaxWidth(Double.MAX_VALUE);
StackPane.setAlignment(selectedBar, Pos.BOTTOM_CENTER);
StackPane labelPane = new StackPane(label, selectedBar);
labelPane.setMaxHeight(Double.MAX_VALUE);
labelPane.setMaxWidth(Region.USE_PREF_SIZE);
Region filler = new Region();
HBox.setHgrow(filler, Priority.ALWAYS);
rightLabel.getStyleClass().setAll(RIGHT_LABEL_STYLE_CLASS);
new FadeInAnimator().apply(expanded, selectedBar);
new FadeInAnimator().apply(expanded, rightLabel);
getChildren().addAll(labelPane, filler, rightLabel);
}
示例2: apply
import javafx.scene.layout.Region; //导入方法依赖的package包/类
public void apply(ObservableBooleanValue expanded, ObservableBooleanValue animate, Region region) {
Rectangle clip = new Rectangle();
clip.widthProperty().bind(region.widthProperty());
clip.heightProperty().bind(region.heightProperty());
region.setClip(clip);
region.setMinHeight(0);
region.setMaxHeight(expanded.get() ? Region.USE_PREF_SIZE : 0);
region.visibleProperty().bind(region.heightProperty().greaterThan(0));
expanded.addListener((v, o, n) -> onExpandedChanged(n, animate.get(), region));
}
示例3: onExpandedChanged
import javafx.scene.layout.Region; //导入方法依赖的package包/类
private void onExpandedChanged(boolean expanded, boolean animate, Region region) {
if (animate && region.getScene() != null) {
animateToTarget(expanded, region);
} else {
region.setMaxHeight(expanded ? Region.USE_PREF_SIZE : 0);
notifyOnFinished();
}
}
示例4: onTimelineFinished
import javafx.scene.layout.Region; //导入方法依赖的package包/类
private void onTimelineFinished(Region region, boolean expanded) {
if (expanded) {
region.setMaxHeight(Region.USE_PREF_SIZE);
}
notifyOnFinished();
}