本文整理汇总了Java中javafx.scene.layout.BorderPane.setPrefHeight方法的典型用法代码示例。如果您正苦于以下问题:Java BorderPane.setPrefHeight方法的具体用法?Java BorderPane.setPrefHeight怎么用?Java BorderPane.setPrefHeight使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.scene.layout.BorderPane
的用法示例。
在下文中一共展示了BorderPane.setPrefHeight方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getContentPane
import javafx.scene.layout.BorderPane; //导入方法依赖的package包/类
@Override protected Parent getContentPane() {
BorderPane root = new BorderPane();
root.getStyleClass().add("MarathonFileChooser");
root.setId("marathon-file-chooser");
if (doesAllowChildren) {
if (!fileChooserInfo.isFileCreation()) {
propertiesView = new AddPropertiesView(new TestPropertiesInfo(fileChooserInfo.getFileToSave()));
TitledPane titledPane = new TitledPane("Properties", propertiesView);
centerPane.getChildren().addAll(splitPane, titledPane);
root.setPrefWidth(540);
root.setPrefHeight(580);
} else {
root.setPrefWidth(540);
root.setPrefHeight(380);
centerPane.getChildren().addAll(splitPane);
}
} else {
root.setPrefWidth(540);
root.setPrefHeight(380);
centerPane.getChildren().add(childrenListView);
}
root.setCenter(centerPane);
root.setBottom(buttonBar);
return root;
}
示例2: setupArchitectureManagementVisuals
import javafx.scene.layout.BorderPane; //导入方法依赖的package包/类
/**
* Create the different buttons for the architecture management and add the desired actions to them
*/
private void setupArchitectureManagementVisuals() {
HBox buttons = new HBox();
Button configButton = new Button("Config");
Button startButton = new Button("Start");
Button pauseButton = new Button("Pause");
Button resumeButton = new Button("Resume");
Button stopButton = new Button("Stop");
buttons.getChildren().addAll(configButton, startButton, pauseButton, resumeButton, stopButton);
BorderPane borderPane = new BorderPane();
borderPane.setPrefHeight(canvas.getScene().getHeight());
borderPane.setPrefWidth(canvas.getScene().getWidth());
Pane space = new Pane();
space.setMinSize(1, 1);
HBox.setHgrow(space, Priority.ALWAYS);
HBox container = new HBox();
container.setPrefWidth(canvas.getScene().getWidth());
container.getChildren().addAll(space, buttons);
borderPane.setBottom(container);
root.getChildren().add(borderPane);
configButton.setOnMouseClicked(new ArchitectureButtonEventHandler(SimulationAction.CONFIG, publisher));
startButton.setOnMouseClicked(new ArchitectureButtonEventHandler(SimulationAction.START, publisher));
stopButton.setOnMouseClicked(new ArchitectureButtonEventHandler(SimulationAction.STOP, publisher));
pauseButton.setOnMouseClicked(new ArchitectureButtonEventHandler(SimulationAction.PAUSE, publisher));
resumeButton.setOnMouseClicked(new ArchitectureButtonEventHandler(SimulationAction.RESUME, publisher));
}