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


Java FlowPane.setPrefWrapLength方法代码示例

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


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

示例1: FlowPaneSample

import javafx.scene.layout.FlowPane; //导入方法依赖的package包/类
public FlowPaneSample() {
    super(400, 400);

    FlowPane flowPane = new FlowPane(2, 4);
    flowPane.setPrefWrapLength(200); //preferred wraplength
    Label[] shortLabels = new Label[ITEMS];
    Label[] longLabels = new Label[ITEMS];
    ImageView[] imageViews = new ImageView[ITEMS];

    for (int i = 0; i < ITEMS; i++) {
        shortLabels[i] = new Label("Short label.");
        longLabels[i] = new Label("I am a slightly longer label.");
        imageViews[i] = new ImageView(ICON_48);
        flowPane.getChildren().addAll(shortLabels[i], longLabels[i], imageViews[i]);
    }
    getChildren().add(flowPane);
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:18,代码来源:FlowPaneSample.java

示例2: createStad

import javafx.scene.layout.FlowPane; //导入方法依赖的package包/类
/**
 * FlowPane met GebouwKaartViews
 */
private void createStad() {
    stadPane = new FlowPane();
    stadPane.setPadding(new Insets(125, 0, 5, 50));
    stadPane.setVgap(-40);
    stadPane.setHgap(-15);
    stadPane.setPrefWrapLength(360);
    // Loop  door gebouwKaartViews en voeg ze toe aan het FlowPane
    for (GebouwKaartView gebouwKaartView: gebouwKaartViews) {
        stadPane.getChildren().add(gebouwKaartView.view()); // Voeg view to aan Pane
    }
}
 
开发者ID:Badmuts,项目名称:Machiavelli,代码行数:15,代码来源:StadView.java

示例3: createDetailsPane

import javafx.scene.layout.FlowPane; //导入方法依赖的package包/类
private FlowPane createDetailsPane() {
    FlowPane detailsPane = new FlowPane();
    detailsPane.setMaxWidth(CARD_WIDTH);
    detailsPane.setPrefWrapLength(CARD_WIDTH);
    detailsPane.setHgap(3);
    detailsPane.setVgap(3);
    return detailsPane;
}
 
开发者ID:HubTurbo,项目名称:HubTurbo,代码行数:9,代码来源:IssueCard.java

示例4: UnitButtonGrouped

import javafx.scene.layout.FlowPane; //导入方法依赖的package包/类
/**
 * Constructor for the grouped button.
 */
public UnitButtonGrouped() {
    locationId = new String();
    expanded = false;
    groupingPane = new FlowPane();
    groupingPane.setPrefWrapLength(2 * (Constants.SMALL_ICON + (2 * Constants.INSETS)));
    iconPane = new GridPane();
    stackPane = new StackPane();
    unitCount = new Text("0");
    unitCount.setTextAlignment(TextAlignment.LEFT);
    unitCount.setStyle("-fx-font: 10pt Tahoma; -fx-fill: black; -fx-stroke: white; -fx-stroke-width: 0.2px;");
    unitCount.textProperty().bind(Bindings.size(groupingPane.getChildren()).asString());

    iconPane.getChildren().add(unitCount);
    stackPane.getChildren().add(iconPane);
    stackPane.getChildren().add(groupingPane);
    this.getChildren().add(stackPane);

    clipRectangle1 = new Rectangle(Constants.SMALL_ICON, Constants.SMALL_ICON);
    this.setClip(clipRectangle1);

    groupingPane.layoutBoundsProperty().addListener((ov, oldValue, newValue) -> {
        clipRectangle1.setWidth(newValue.getWidth());
        clipRectangle1.setHeight(newValue.getHeight());
    });

    final EventHandler<MouseEvent> mouseEventHandler = (event) -> {
        event.consume();
        if (!expanded) {
            expand();
            expanded = true;
        }
    };

    final EventHandler<MouseEvent> mouseExitedHandler = (event) -> {
        event.consume();
        if (expanded) {
            shrink();
            expanded = false;
        }
    };
    stackPane.setOnMouseClicked(mouseEventHandler);
    stackPane.setOnMouseExited(mouseExitedHandler);

    this.getStyleClass().clear();
    this.getStyleClass().addAll("units-button");
}
 
开发者ID:openbase,项目名称:bco.bcozy,代码行数:50,代码来源:UnitButtonGrouped.java


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