本文整理汇总了Java中javafx.scene.layout.GridPaneBuilder类的典型用法代码示例。如果您正苦于以下问题:Java GridPaneBuilder类的具体用法?Java GridPaneBuilder怎么用?Java GridPaneBuilder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GridPaneBuilder类属于javafx.scene.layout包,在下文中一共展示了GridPaneBuilder类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ViewingArea
import javafx.scene.layout.GridPaneBuilder; //导入依赖的package包/类
/**
* Instantiates a new ViewingArea with a given focus.
*
* @param ljgm
* The ljgm
* @param g
* The default focus of this {@link ViewingArea}.
*/
public ViewingArea(LJGM ljgm, Gallery g) {
this.focus = g;
this.imageQueue = new ImageLoaderQueue();
this.grid = GridPaneBuilder.create().padding(new Insets(PADDING)).hgap(PADDING).vgap(PADDING).build();
LJGM.instance().getStatusBar().bindProgress(imageQueue.progressProperty());
if (g == null) {
setCenter(getBlankDisplay("There are no galleries!"));
return;
} else {
setFocus(g);
return;
}
}
示例2: createTitleBar
import javafx.scene.layout.GridPaneBuilder; //导入依赖的package包/类
private void createTitleBar(Pane parent, JfxStyleHolder style) {
Integer height = ThemeTypeHelper.toDimension(Handler.tbHeightAttr.getRawValue(getTheme()));
if (height == null || height < MIN_TITLE_HEIGHT) {
height = MIN_TITLE_HEIGHT;
}
title = GridPaneBuilder.create().layoutX(border.width).layoutY(border.width)
.prefHeight(height).build();
title.getStyleClass().add(TITLE_BAR_CLASS);
title.prefWidthProperty().bind(parent.widthProperty().subtract(border.width * 2));
createTitleDragHandlers(title);
parent.getChildren().add(title);
// create real contents
createTitleLabel(title);
createTitleButtons(title, style);
}
示例3: configureMemoryAnalyzer
import javafx.scene.layout.GridPaneBuilder; //导入依赖的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;
}
示例4: start
import javafx.scene.layout.GridPaneBuilder; //导入依赖的package包/类
@Override
public void start(Stage stage) throws Exception {
this.stage = stage;
configureScene();
configureStage();
// Logic starts
propScroll = ScrollPaneBuilder.create().fitToHeight(true).fitToWidth(true).build();
dock.getChildren().add(image);
SplitPane sp = new SplitPane();
sp.getItems().addAll(dock,propScroll);
GridPane gp = GridPaneBuilder.create().vgap(10).hgap(10).padding(new Insets(10)).build();
propScroll.setContent(gp);
root.getChildren().add(sp);
gp.addRow(0, new Label("X : "),getBindedTextField(image.xProperty()));
gp.addRow(1, new Label("Y : "),getBindedTextField(image.yProperty()));
gp.addRow(2, new Label("Layout-X : "),getBindedTextField(image.layoutXProperty()));
gp.addRow(3, new Label("Layout-Y : "),getBindedTextField(image.layoutYProperty()));
gp.addRow(4, new Label("Translate-X : "),getBindedTextField(image.translateXProperty()));
gp.addRow(5, new Label("Translate-Y : "),getBindedTextField(image.translateYProperty()));
gp.addRow(6, new Label("Fit Width : "),getBindedTextField(image.fitWidthProperty()));
gp.addRow(7, new Label("Fit Height : "),getBindedTextField(image.fitHeightProperty()));
gp.addRow(8, new Label("Scale-X : "),getBindedTextField(image.scaleXProperty()));
gp.addRow(9, new Label("Scale-Y : "),getBindedTextField(image.scaleYProperty()));
CheckBox cb = new CheckBox();
image.preserveRatioProperty().bindBidirectional(cb.selectedProperty());
gp.addRow(10, new Label("Preserve ratio : "),cb);
}
示例5: start
import javafx.scene.layout.GridPaneBuilder; //导入依赖的package包/类
@Override
public void start(Stage stage) throws Exception {
this.stage = stage;
configureScene();
configureStage();
// Logic starts
VBox vb = new VBox();
vb.setSpacing(10);
final VBox layout = VBoxBuilder.create().build();
layout.getChildren().add(new DynamicTextArea());
Button btn = ButtonBuilder.create().text("Add").onAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent arg0) {
layout.getChildren().add(new DynamicTextArea());
}
}).build();
final GridPane gridPane = GridPaneBuilder.create()
.styleClass("contact-details-gridpane")
// [ARE] Further modification for CAEMR-2098. Setting minimum width to show labels even if application width is changed.
.columnConstraints(ColumnConstraintsBuilder.create().hgrow(Priority.NEVER).minWidth(80).build(),
ColumnConstraintsBuilder.create().hgrow(Priority.ALWAYS).build(),
ColumnConstraintsBuilder.create().hgrow(Priority.NEVER).minWidth(100).build()).build();
gridPane.addRow(0, new Label("hi"), layout, btn);
root.getChildren().add(ScrollPaneBuilder.create().styleClass("contact-details-pane").hbarPolicy(ScrollBarPolicy.NEVER)
.fitToWidth(true).content(gridPane).build());
}
示例6: handlePerspective
import javafx.scene.layout.GridPaneBuilder; //导入依赖的package包/类
@Override
public void handlePerspective(final IAction<Event, Object> action,
final PerspectiveLayout perspectiveLayout) {
if (action.getLastMessage().equals(MessageUtil.INIT)) {
final SplitPane mainLayout = SplitPaneBuilder.create()
.styleClass("vsplitpane").orientation(Orientation.VERTICAL)
.prefHeight(600).prefWidth(800).build();
mainLayout.setDividerPosition(0, 0.50f);
// create left button menu
final GridPane top = GridPaneBuilder.create()
.alignment(Pos.TOP_CENTER).build();
GridPane.setHgrow(top, Priority.ALWAYS);
GridPane.setVgrow(top, Priority.ALWAYS);
// create main content Top
final GridPane bottom = GridPaneBuilder.create()
.alignment(Pos.BOTTOM_CENTER).build();
GridPane.setHgrow(bottom, Priority.ALWAYS);
GridPane.setVgrow(bottom, Priority.ALWAYS);
GridPane.setVgrow(mainLayout, Priority.ALWAYS);
GridPane.setHgrow(mainLayout, Priority.ALWAYS);
mainLayout.getItems().addAll(top, bottom);
// Register root component
perspectiveLayout.registerRootComponent(mainLayout);
// register left menu
perspectiveLayout.registerTargetLayoutComponent("PTop", top);
// register main content
perspectiveLayout.registerTargetLayoutComponent("PBottom", bottom);
}
}