本文整理汇总了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);
}
}
示例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());
}
示例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());
}
示例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()
}
示例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);
}
示例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);
}
示例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());
}
}
示例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;
}
示例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);
}
示例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);
}
示例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;
}
示例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();
}
示例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;
}
示例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;
}
示例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);
}