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


Java LabelBuilder类代码示例

本文整理汇总了Java中javafx.scene.control.LabelBuilder的典型用法代码示例。如果您正苦于以下问题:Java LabelBuilder类的具体用法?Java LabelBuilder怎么用?Java LabelBuilder使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: TextFieldEventsCounter

import javafx.scene.control.LabelBuilder; //导入依赖的package包/类
public TextFieldEventsCounter(final String counterName) {
    if (counterName == null) {
        throw new IllegalArgumentException("Counter name cannot be null.");
    }
    try {
        this.counterName = counterName;
        Label label = LabelBuilder.create().text(counterName + " : ").prefWidth((new Text(counterName + " : ")).getBoundsInParent().getWidth() + 30).build();
        final TextField tf = TextFieldBuilder.create().text("0").prefWidth(50).id(counterName.toUpperCase() + COUNTER_SUFFIX).build();
        counter.addListener(new ChangeListener<Number>() {
            public void changed(ObservableValue<? extends Number> ov, Number t, Number t1) {
                log("Counter " + counterName + ": new value : <" + t1 + ">.");
                tf.setText(t1.toString());
            }
        });
        getChildren().addAll(label, tf);
    } catch (Throwable ex) {
        log(ex);
    }
}
 
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:20,代码来源:TextFieldEventsCounter.java

示例2: PropertyValueListener

import javafx.scene.control.LabelBuilder; //导入依赖的package包/类
public <ValueType> PropertyValueListener(String labelDescription, ReadOnlyProperty listenedProperty, String textFieldId, Object owningObject, Boolean showCounters) {
    this.owningObject = owningObject;
    receivedValueTF.setId(textFieldId);
    receivedValueTF.setTooltip(new Tooltip());
    if (listenedProperty.getName().contains("BOUNDS")) {
        //Make text field width, because bounds - big.
        receivedValueTF.setMinWidth(500);
    }
    this.listenedProperty = listenedProperty;
    counter = new PropertyValueCounter(listenedProperty);
    getChildren().add(LabelBuilder.create().text(labelDescription).prefWidth(100).build());
    if (showCounters) {
        getChildren().add(counter.getVisualRepresentation());
    }
    getChildren().add(receivedValueTF);

    listenedProperty.addListener(new ChangeListener() {
        public void changed(ObservableValue ov, Object t, Object t1) {
            processNewValue(t1);
        }
    });
    processNewValue(listenedProperty.getValue());
}
 
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:24,代码来源:PropertyValueListener.java

示例3: initView

import javafx.scene.control.LabelBuilder; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected void initView() {

    this.defaultCommand = new Button("Trigger a default Command into JIT");
    this.uiCommand = new Button("Trigger an UI Command into JAT");
    this.pooledCommand = new Button("Trigger a pooled Command into JTP");

    getRootNode().setCenter(
            LabelBuilder.create()
                    .text("JRebirth Sample")
                    .build()
            );

    getRootNode().setBottom(FlowPaneBuilder.create().children(
            this.defaultCommand,
            this.uiCommand,
            this.pooledCommand
            ).build());
}
 
开发者ID:CompendiumNG,项目名称:fxpoc,代码行数:23,代码来源:SampleView.java

示例4: execute

import javafx.scene.control.LabelBuilder; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected void execute(final Wave wave) {

    LOGGER.info("Display a pop up from JAT");

    final Stage s = StageBuilder.create()
            .title("Sample Ui Command Test")
            .style(StageStyle.DECORATED)
            .scene(SceneBuilder.create()
                    .root(LabelBuilder.create().text("Run into JAT").build())
                    .build())

            .build();

    s.show();
    // Sample for popup => Attach owner !!!
    // getLocalFacade().getGlobalFacade().getApplication().getStage()
}
 
开发者ID:CompendiumNG,项目名称:fxpoc,代码行数:22,代码来源:SampleUICommand.java

示例5: configureTable

import javafx.scene.control.LabelBuilder; //导入依赖的package包/类
private void configureTable(VBox root) {
    
    final ObservableList<MyDomain> data = FXCollections.observableArrayList(
             new MyDomain("Apple","This is a fruit.","Red"),
             new MyDomain("Orange","This is also a fruit.","Orange"),
             new MyDomain("Potato","This is a vegetable.","Brown")
             );
    
    TableView<MyDomain> table1 = getTableView(data);
    table1.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
    
    TableView<MyDomain> table2 = getTableView(data);
    table2.setColumnResizePolicy(TableView.UNCONSTRAINED_RESIZE_POLICY);
    
    root.setSpacing(15);
    root.getChildren().addAll(LabelBuilder.create().text("CONSTRAINED_RESIZE_POLICY").style("-fx-font-weight:bold;").build(),table1,
                              LabelBuilder.create().text("UNCONSTRAINED_RESIZE_POLICY").style("-fx-font-weight:bold;").build(),table2);
}
 
开发者ID:SaiPradeepDandem,项目名称:javafx-demos,代码行数:19,代码来源:TableViewColumnResizePolicyDemo.java

示例6: configureTable

import javafx.scene.control.LabelBuilder; //导入依赖的package包/类
private void configureTable(VBox root) {
    
    final ObservableList<MyDomain> data = FXCollections.observableArrayList(
             new MyDomain("Apple","This is a fruit.","Red"),
             new MyDomain("Orange","This is also a fruit.","Orange"),
             new MyDomain("Potato","This is a vegetable.","Brown")
             );
    
    CustomTableView<MyDomain> table1 = getTableView(data);
    table1.getTableView().setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
    
    CustomTableView<MyDomain> table2 = getTableView(data);
    table2.getTableView().setColumnResizePolicy(TableView.UNCONSTRAINED_RESIZE_POLICY);
    
    root.setSpacing(15);
    root.getChildren().addAll(LabelBuilder.create().text("CONSTRAINED_RESIZE_POLICY").style("-fx-font-weight:bold;").build(),table1,
                              LabelBuilder.create().text("UNCONSTRAINED_RESIZE_POLICY").style("-fx-font-weight:bold;").build(),table2);
}
 
开发者ID:SaiPradeepDandem,项目名称:javafx-demos,代码行数:19,代码来源:CustomTableViewColumnResizePolicyDemo.java

示例7: LockingTableCell

import javafx.scene.control.LabelBuilder; //导入依赖的package包/类
/**
 * Constructor for Header Cell
 * @param c -  LockingTableColumn<T, ?>
 */
public LockingTableCell(LockingTableColumn<T, ?> c){
    super();
    super.getStyleClass().add("locktable-cell");
    super.setAlignment(Pos.CENTER);
    super.minWidthProperty().bind(c.widthProperty());
    super.maxWidthProperty().bind(c.widthProperty());
    if(c.getGraphic()==null){
        String str = c.getColumnTitle();
        label = LabelBuilder.create().text(str).build();
        label.setAlignment(Pos.CENTER);
        getChildren().add(label);
    }else{
        getChildren().add(c.getGraphic());
    }
}
 
开发者ID:SaiPradeepDandem,项目名称:javafx-demos,代码行数:20,代码来源:LockingTableCell.java

示例8: getFooterPanel

import javafx.scene.control.LabelBuilder; //导入依赖的package包/类
/**
 * Build and return the footer panel.
 *
 * @return the footer panel
 */
protected Node getFooterPanel() {
    this.pageLabel = LabelBuilder.create()
                                 .text(String.valueOf(model().getSlide().getPage()))
                                 .font(PrezFonts.PAGE.get())
                                 .build();

    final AnchorPane ap = AnchorPaneBuilder.create()
                                           .children(this.pageLabel)
                                           .build();
    AnchorPane.setRightAnchor(this.pageLabel, 20.0);

    final StackPane sp = StackPaneBuilder.create()
                                         .styleClass("footer")
                                         .prefHeight(35.0)
                                         .minHeight(Region.USE_PREF_SIZE)
                                         .maxHeight(Region.USE_PREF_SIZE)
                                         .children(ap)
                                         .build();

    StackPane.setAlignment(ap, Pos.CENTER_RIGHT);

    return sp;
}
 
开发者ID:JRebirth,项目名称:JRebirth-Tour,代码行数:29,代码来源:AbstractBaseView.java

示例9: InsetTextSample

import javafx.scene.control.LabelBuilder; //导入依赖的package包/类
public InsetTextSample() {

        String insetTextCss = InsetTextSample.class.getResource("InsetText.css").toExternalForm();
        Label label = LabelBuilder.create().text("Label styled as a bar").id("label1").build();
        label.getStylesheets().add(insetTextCss);
        getChildren().add(label);
    }
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:8,代码来源:InsetTextSample.java

示例10: showHelpContent

import javafx.scene.control.LabelBuilder; //导入依赖的package包/类
/**
 * Help content of XpanderFX
 */
@SuppressWarnings("deprecation")
private void showHelpContent() {
    try {
        Node content = FXMLLoader.load(getClass().getResource("/com/shekkar/xpanderfx/top/popup/HelpFXML.fxml"));
        help_box = new VBox();
        help_box.getChildren().addAll(content,
                HBoxBuilder.create().alignment(Pos.CENTER_LEFT)
                .padding(new Insets(0,3,0,0))
                .children(
                        VBoxBuilder.create().minWidth(720).alignment(Pos.CENTER_LEFT).padding(new Insets(0,0,0,10))
                                .children(
                                        HyperlinkBuilder.create().text("open-source on GitHub [ShekkarRaee/XpanderFX]")
                                                .onAction(e -> this.browse("https://github.com/ShekkarRaee/XpanderFX-2048-Game-JavaFX")).build(),
                                        LabelBuilder.create().text("[email protected]").build()
                                )
                        .build(),
                        ButtonBuilder.create().text("OK")
                        .minHeight(40)
                        .minWidth(70)
                        .style("-fx-base:black;"
                        + "-fx-border-radius: 7;"
                        + "-fx-background-radius: 7;")
                        .onAction(e -> this.popupCloser(help, help_box))
                        .font(Font.font("System", FontWeight.MEDIUM, FontPosture.REGULAR, 20))
                        .build()
                ).style("-fx-background-color:white")
                .build()
             );
        help_box.setStyle("-fx-background-color: linear-gradient(lightgrey, white, lightgrey);"
             + "-fx-border-color: white;"
             + "-fx-border-width: 1;");
        help.getContent().add(help_box);
    } catch (IOException ex) {
        Logger.getLogger(MainFXMLDocumentController.class.getName()).log(Level.SEVERE, null, ex);
    }
    help.show(this.ICON.getScene().getWindow(), this.getNodeMaxX() + 20, this.getNodeMaxY() + 40);
    this.popupOpener(help_box);				
}
 
开发者ID:ShekkarRaee,项目名称:xpanderfx,代码行数:42,代码来源:MainFXMLDocumentController.java

示例11: getCenterBox

import javafx.scene.control.LabelBuilder; //导入依赖的package包/类
/**
 * 
 * @return center_box
 */
private HBox getCenterBox() {
    @SuppressWarnings("deprecation")
    HBox center = HBoxBuilder.create()
         .children(LabelBuilder.create().text("Game Over!!")
            .textFill(Color.BLACK)
             .font(Font.font("System", FontWeight.MEDIUM, FontPosture.REGULAR, 30))
             .build())
         .alignment(Pos.CENTER)
         .build();
    return center;
}
 
开发者ID:ShekkarRaee,项目名称:xpanderfx,代码行数:16,代码来源:GameOver.java

示例12: getBody

import javafx.scene.control.LabelBuilder; //导入依赖的package包/类
/**
 * 
 * @return root-node
 */
@SuppressWarnings("deprecation")
private BorderPane getBody() {
    return BorderPaneBuilder.create().minHeight(200).minWidth(440).center(
            VBoxBuilder.create().alignment(Pos.CENTER).children(
                    LabelBuilder.create()
                            .minHeight(10).build(),
                    LabelBuilder.create().text("Congratulation !! You won the game.")
                        .font(Font.font("", FontWeight.BOLD, FontPosture.ITALIC, 20))
                            .textFill(Color.WHITE).build(),
                    LabelBuilder.create()
                            .minHeight(30).build(),
                    HBoxBuilder.create().alignment(Pos.CENTER).spacing(20).children(
                            ButtonBuilder.create().text("Continue").font(Font.font("", FontWeight.SEMI_BOLD, FontPosture.REGULAR, 18))
                                    .minWidth(140).textFill(Color.WHITE).style("-fx-base:darkslategrey")
                                    .onAction(e -> this.close()).build(),
                            ButtonBuilder.create().text("Try Again").font(Font.font("", FontWeight.SEMI_BOLD, FontPosture.REGULAR, 18))
                                    .minWidth(140).textFill(Color.WHITE).style("-fx-base:darkslategrey")
                                    .onAction(e -> {
                                        controller.restart();	
                                        this.close();
                                    }).build()
                    ).build()
            )
            .build()
    ).style("-fx-background-color: linear-gradient(#000000cc, darkslategrey); -fx-background-radius: 15; -fx-border-radius:15;"
            + "-fx-border-width:1; -fx-border-color:lightgrey").build();
}
 
开发者ID:ShekkarRaee,项目名称:xpanderfx,代码行数:32,代码来源:Completion.java

示例13: getGraphicNode

import javafx.scene.control.LabelBuilder; //导入依赖的package包/类
public HBox getGraphicNode(final Date dt){
    CheckBox cb = new CheckBox();
    cb.selectedProperty().addListener(new ChangeListener<Boolean>() {
        @Override
        public void changed(
                ObservableValue<? extends Boolean> paramObservableValue,
                Boolean paramT1, Boolean paramT2) {
            if(paramT2){
                colSelectList.add(dt);
            }else{
                colSelectList.remove(dt);
            }
        }
    });
    String str1 = getDatetoString(dt);
    String str2 = getTimetoString(dt);
    VBox vb = new VBox();
    vb.setAlignment(Pos.CENTER);
    vb.getChildren().addAll(LabelBuilder.create().text(str1).build(),
                            LabelBuilder.create().text(str2).build());
    HBox hb = new HBox();
    hb.getChildren().addAll(cb,vb);
    hb.setAlignment(Pos.CENTER);
    hb.setSpacing(5);
    hb.setPadding(new Insets(0,5,0,5));
    return hb;
}
 
开发者ID:SaiPradeepDandem,项目名称:javafx-demos,代码行数:28,代码来源:LockingTableDemo.java

示例14: configureMemoryAnalyzer

import javafx.scene.control.LabelBuilder; //导入依赖的package包/类
private GridPane configureMemoryAnalyzer() {
    GridPane gp = GridPaneBuilder.create().vgap(8).hgap(8).build();
    Label usedLbl = LabelBuilder.create().build();
    Label freeLbl = LabelBuilder.create().build();
    Label totalLbl = LabelBuilder.create().build();
    Label maxLbl = LabelBuilder.create().build();

    gp.addRow(0, new Label("Used  :"), usedLbl);
    gp.addRow(1, new Label("Free  :"), freeLbl);
    gp.addRow(2, new Label("Total :"), totalLbl);
    gp.addRow(3, new Label("Max   :"), maxLbl);
    read(usedLbl, freeLbl, totalLbl, maxLbl);
    return gp;
}
 
开发者ID:SaiPradeepDandem,项目名称:javafx-demos,代码行数:15,代码来源:TableViewMemoryLeakFix.java

示例15: CustomTextField

import javafx.scene.control.LabelBuilder; //导入依赖的package包/类
public CustomTextField(){
    super();
    addListener();
    
    VBox vb = new VBox();
    vb.getChildren().add(new Label("Hello dude"));
    vb.getChildren().add(LabelBuilder.create().text("Last line").style("-fx-font-weight:bold;").build());
    Tooltip tp = new Tooltip();
    tp.setGraphic(vb);
    
    setTooltip(tp);
}
 
开发者ID:SaiPradeepDandem,项目名称:javafx-demos,代码行数:13,代码来源:TextFieldDemo.java


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