本文整理匯總了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));
}