本文整理汇总了Java中javafx.scene.layout.GridPane.setRowSpan方法的典型用法代码示例。如果您正苦于以下问题:Java GridPane.setRowSpan方法的具体用法?Java GridPane.setRowSpan怎么用?Java GridPane.setRowSpan使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.scene.layout.GridPane
的用法示例。
在下文中一共展示了GridPane.setRowSpan方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: mouseReleased
import javafx.scene.layout.GridPane; //导入方法依赖的package包/类
private void mouseReleased(MouseEvent event) {
if (!dragging) {
return;
}
dragging = false;
tile.setCursor(Cursor.DEFAULT);
resizeLocation = ResizeLocation.NONE;
TileSize size = finalSize();
tile.setSize(size);
GridPane.setColumnSpan(tile, size.getWidth());
GridPane.setRowSpan(tile, size.getHeight());
tilePane.setHighlight(false);
ResizeUtils.setCurrentTile(null);
}
示例2: addEditLabelsPane
import javafx.scene.layout.GridPane; //导入方法依赖的package包/类
/**
* Sets up the editable ListView to edit the labels/items we want to see in
* the comboboxes on the main screen.
*/
private void addEditLabelsPane() {
labelsList = new ListView<>();
// first set up the listview with empty labels in order to allow editing
ObservableList<String> itemsLabelsList = FXCollections
.observableArrayList("", "", "", "", "");
// get the labels from the database and store them in the listview
ArrayList<String> labelStrings = getLabels();
// add items starting at the top
for (int i = 0; i < labelStrings.size(); i++) {
itemsLabelsList.set(i, labelStrings.get(i));
}
// set a CellFactory on the listview to be able make the cells editable
// using setEditable(true) isn't enough
labelsList.setCellFactory(TextFieldListCell.forListView());
labelsList.setEditable(true);
// give the listview an id (FXML) so we can look it up by its id, and
// toggle the visibility
labelsList.setId("labelsListView");
labelsList.setItems(itemsLabelsList);
labelsList.setVisible(false);
// "magik numbers" are figured out by observations
labelsList.setPrefWidth(120);
labelsList
.setPrefHeight((LISTVIEW_ROW_HEIGHT * MAX_NUMBER_LABELS) + 18);
// position the listview in the settings pane
GridPane.setColumnIndex(labelsList, 1);
GridPane.setRowIndex(labelsList, 0);
GridPane.setRowSpan(labelsList, 2);
// when editing a label in the listview, update the value
// in the database and setup the main gridpane with the new items in the
// comboboxes
labelsList.setOnEditCommit(event -> {
labelsList.getItems().set(event.getIndex(), event.getNewValue());
updateLabel(event.getIndex(), event.getNewValue());
controller.setupGridPane(controller.focusDay);
});
editLabelsPane.getChildren().add(labelsList);
}
示例3: PrintViewSkin
import javafx.scene.layout.GridPane; //导入方法依赖的package包/类
public PrintViewSkin(PrintView control) {
super(control);
GridPane gridPane = new GridPane();
gridPane.getStyleClass().add("container");
gridPane.setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE);
RowConstraints row1 = new RowConstraints();
RowConstraints row2 = new RowConstraints();
ColumnConstraints col1 = new ColumnConstraints();
ColumnConstraints col2 = new ColumnConstraints();
ColumnConstraints col3 = new ColumnConstraints();
row1.setVgrow(Priority.ALWAYS);
row2.setVgrow(Priority.NEVER);
col1.setHgrow(Priority.ALWAYS);
col2.setHgrow(Priority.NEVER);
col3.setHgrow(Priority.NEVER);
row1.setFillHeight(true);
row2.setFillHeight(true);
col1.setFillWidth(true);
col2.setFillWidth(true);
col3.setFillWidth(true);
col1.setMaxWidth(Double.MAX_VALUE);
col3.setMaxWidth(Region.USE_PREF_SIZE);
col3.setMinWidth(Region.USE_PREF_SIZE);
row1.setMaxHeight(Double.MAX_VALUE);
row2.setMinHeight(Region.USE_PREF_SIZE);
gridPane.getRowConstraints().setAll(row1, row2);
gridPane.getColumnConstraints().setAll(col1, col2, col3);
// preview pane
PreviewPane previewPane = control.getPreviewPane();
gridPane.add(previewPane, 0, 0);
GridPane.setRowSpan(previewPane, 2);
// settings
SettingsView settingsView = control.getSettingsView();
gridPane.add(settingsView, 2, 0);
// separator
Separator separator = new Separator();
separator.setOrientation(Orientation.VERTICAL);
GridPane.setRowSpan(separator, 2);
gridPane.add(separator, 1, 0);
// button bar
Button cancelBtn = new Button(Messages.getString("PrintView.CANCEL_BUTTON"));
cancelBtn.onActionProperty().bind(control.onCancelProperty());
Button continueBtn = new Button(Messages.getString("PrintView.CONTINUE_BUTTON"));
continueBtn.onActionProperty().bind(control.onContinueProperty());
HBox buttonsBar = new HBox();
buttonsBar.getStyleClass().add("button-bar");
buttonsBar.getChildren().addAll(cancelBtn, continueBtn);
gridPane.add(buttonsBar, 2, 1);
getChildren().add(gridPane);
}
示例4: MovieCell
import javafx.scene.layout.GridPane; //导入方法依赖的package包/类
public MovieCell(MovieView movieView) {
this.movieView = movieView;
GridPane gridPane = new GridPane();
ColumnConstraints col1 = new ColumnConstraints();
ColumnConstraints col2 = new ColumnConstraints();
ColumnConstraints col3 = new ColumnConstraints();
ColumnConstraints col4 = new ColumnConstraints();
ColumnConstraints col5 = new ColumnConstraints();
col4.setHgrow(Priority.ALWAYS);
gridPane.getColumnConstraints().setAll(col1, col2, col3, col4, col5);
gridPane.setHgap(10);
// director image
directorImage = new ImageView();
directorImage.setFitWidth(60);
directorImage.setFitHeight(60);
directorImage.setEffect(new InnerShadow());
gridPane.add(directorImage, 0, 0);
GridPane.setRowSpan(directorImage, 2);
GridPane.setValignment(directorImage, VPos.TOP);
// title and year
titleLabel = new Label();
titleLabel.getStyleClass().add("title-label");
gridPane.add(titleLabel, 1, 0);
GridPane.setColumnSpan(titleLabel, 2);
GridPane.setValignment(titleLabel, VPos.TOP);
// director label
directorLabel = new Label();
directorLabel.getStyleClass().add("director-label");
gridPane.add(directorLabel, 1, 1);
GridPane.setValignment(directorLabel, VPos.TOP);
// genre label
genreLabel = new Label();
genreLabel.getStyleClass().add("genre-label");
gridPane.add(genreLabel, 4, 0);
// trailer label
trailerLabel = FontAwesomeIconFactory.get().createIconLabel(FontAwesomeIcon.FILM, "", "14px", "14px", ContentDisplay.GRAPHIC_ONLY);
trailerLabel.getStyleClass().add("trailer-label");
gridPane.add(trailerLabel, 3, 0);
GridPane.setHalignment(trailerLabel, HPos.LEFT);
GridPane.setValignment(trailerLabel, VPos.TOP);
trailerLabel.setOnMouseClicked(evt -> {
try {
Movie movie = getItem();
movieView.setSelectedTrailer(MovieApp.class.getResource("/trailers/" + movie.getTrailer()).toExternalForm());
} catch (NullPointerException e) {
movieView.setSelectedTrailer(MovieApp.class.getResource("/TrailerMissing.mp4").toExternalForm());
}
});
setGraphic(gridPane);
setContentDisplay(ContentDisplay.GRAPHIC_ONLY);
movieView.useClippingProperty().addListener(it -> updateClipping());
updateClipping();
}