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


Java StackPane.setMaxWidth方法代码示例

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


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

示例1: createUi

import javafx.scene.layout.StackPane; //导入方法依赖的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);
}
 
开发者ID:rmfisher,项目名称:fx-animation-editor,代码行数:26,代码来源:TitleBarComponent.java

示例2: createStackPane

import javafx.scene.layout.StackPane; //导入方法依赖的package包/类
public static StackPane createStackPane(double width, double height)
{
	StackPane pane = new StackPane();
	pane.setMinWidth(width);
	pane.setMaxWidth(width);
	pane.setMinHeight(height);
	pane.setMaxHeight(height);
	return pane;
}
 
开发者ID:PolyphasicDevTeam,项目名称:NoMoreOversleeps,代码行数:10,代码来源:JavaFxHelper.java

示例3: initialize

import javafx.scene.layout.StackPane; //导入方法依赖的package包/类
@Override
public void initialize(URL location, ResourceBundle resources) {
    backgroundImageView.setMouseTransparent(true);

    movieList.setCellFactory(c -> new MovieListCell());
    movieList.setItems(model.getMovies());
    movieList.setCacheHint(CacheHint.SPEED);

    model.selectedMovieProperty().bind(movieList.getSelectionModel().selectedItemProperty());
    model.selectedMovieProperty().addListener((obs, oldVal, newVal) -> updateDetailArea());
    detailView.visibleProperty().bind(model.selectedMovieProperty().isNotNull());

    maximizeAppIconView.setOnMouseClicked(e -> ((Stage) rootPane.getScene().getWindow()).setFullScreen(!((Stage) rootPane.getScene().getWindow()).isFullScreen()));
    closeAppIconView.setOnMouseClicked(e -> rootPane.getScene().getWindow().hide());

    moviePosterWrapper.setRotationAxis(new Point3D(0, 1, 0));
    moviePosterWrapper.setCache(true);
    moviePosterWrapper.setCacheShape(true);
    moviePosterWrapper.setCacheHint(CacheHint.SPEED);
    posterImageView.setCache(true);
    posterImageView.setCacheHint(CacheHint.SPEED);

    Util.installWindowDragListener(rootPane);

    final ChangeListener backgroundImageResizeListener = (obs, oldVal, newVal) -> {
        final Image image = backgroundImageView.getImage();
        if (backgroundImageView.getImage() != null) {
            Dimension2D backgroundDimension = shouldFitIn(image.getWidth(), image.getHeight(), rootPane.getWidth(), rootPane.getHeight());
            backgroundImageView.setFitWidth(backgroundDimension.getWidth());
            backgroundImageView.setFitHeight(backgroundDimension.getHeight());
        }
    };
    rootPane.widthProperty().addListener(backgroundImageResizeListener);
    rootPane.heightProperty().addListener(backgroundImageResizeListener);
    backgroundImageView.imageProperty().addListener(backgroundImageResizeListener);

    addFeatureSupport();

    updateDetailArea();


    watchTrailerButton.setOnAction(e -> playTrailer());
    mediaView.fitWidthProperty().bind(rootPane.widthProperty().subtract(64.0));

    mediaStateIcon = new AnimatedIcon();
    mediaStateIcon.setOpacity(0.6);
    mediaStateIcon.setScaleX(4.0);
    mediaStateIcon.setScaleY(4.0);
    mediaStateIcon.setMouseTransparent(true);
    mediaStateIcon.toPause();

    Circle circle = new Circle();
    circle.setMouseTransparent(true);
    circle.setRadius(76);
    circle.setStroke(Color.ORANGE);
    circle.setStrokeWidth(8);
    circle.setOpacity(0.6);

    StackPane mediaControl = new StackPane(circle, mediaStateIcon);
    mediaControl.setMouseTransparent(true);
    mediaControl.setMinWidth(USE_PREF_SIZE);
    mediaControl.setMinHeight(USE_PREF_SIZE);
    mediaControl.setMaxWidth(USE_PREF_SIZE);
    mediaControl.setMaxHeight(USE_PREF_SIZE);
    mediaControl.setVisible(false);

    mediaPane.getChildren().addAll(mediaControl);

    //TODO: Animation
    mediaView.setOnMouseEntered(e -> mediaControl.setVisible(true));
    mediaView.setOnMouseExited(e -> mediaControl.setVisible(false));

    movieList.getSelectionModel().select(0);

    rootPane.setOnKeyPressed(evt -> {
        if (evt.getCode().equals(KeyCode.ESCAPE)) {
            stopTrailer();
        }
    });
}
 
开发者ID:hendrikebbers,项目名称:ExtremeGuiMakeover,代码行数:81,代码来源:MasterDetailViewController.java


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