/** * Constructs a new JFXMasonryPane */ public JFXMasonryPane() { getChildren().addListener(new WeakListChangeListener<>(childrenListener)); }
/** * sets the cell height of the masonry pane grid * * @param cellHeight of the grid */ public final void setCellHeight(final double cellHeight) { this.cellHeightProperty().set(cellHeight); }
/** * @return the cell width of the masonry pane grid */ public final double getCellWidth() { return this.cellWidthProperty().get(); }
@Override protected double computePrefWidth(double height) { return snappedLeftInset() + getCellWidth() + snappedRightInset() + 2 * getHSpacing(); }
col = (int) Math.floor((getWidth() + getHSpacing() - snappedLeftInset() - snappedRightInset()) / (getCellWidth() + getHSpacing())); col = getLimitColumn() != -1 && col > getLimitColumn() ? getLimitColumn() : col; row = getLimitRow(); List<Region> managedChildren = getManagedChildren(); getCellWidth(), getCellHeight(), row, col, getHSpacing(), getVSpacing()); double blockHeight; if (boundingBox != null) { blockX = boundingBox.getMinY() * getCellWidth() + boundingBox.getMinY() * getHSpacing() + snappedLeftInset(); blockY = boundingBox.getMinX() * getCellHeight() + boundingBox.getMinX() * getVSpacing() + snappedTopInset(); blockWidth = boundingBox.getWidth() * getCellWidth() + (boundingBox.getWidth() - 1) * getHSpacing(); blockHeight = boundingBox.getHeight() * getCellHeight() + (boundingBox.getHeight() - 1) * getVSpacing(); } else { blockX = child.getLayoutX(); minHeight += snappedBottomInset(); setPrefHeight(minHeight);
col = (int) Math.floor((getWidth() + getHSpacing() - snappedLeftInset() - snappedRightInset()) / (getCellWidth() + getHSpacing())); col = getLimitColumn() != -1 && col > getLimitColumn() ? getLimitColumn() : col; row = getLimitRow(); List<Region> managedChildren = getManagedChildren(); getCellWidth(), getCellHeight(), row, col, getHSpacing(), getVSpacing()); double blockHeight; if (boundingBox != null) { blockX = boundingBox.getMinY() * getCellWidth() + boundingBox.getMinY() * getHSpacing() + snappedLeftInset(); blockY = boundingBox.getMinX() * getCellHeight() + boundingBox.getMinX() * getVSpacing() + snappedTopInset(); blockWidth = boundingBox.getWidth() * getCellWidth() + (boundingBox.getWidth() - 1) * getHSpacing(); blockHeight = boundingBox.getHeight() * getCellHeight() + (boundingBox.getHeight() - 1) * getVSpacing(); } else { blockX = child.getLayoutX(); minHeight += snappedBottomInset(); setPrefHeight(minHeight);
@Override protected double computePrefWidth(double height) { return snappedLeftInset() + getCellWidth() + snappedRightInset() + 2 * getHSpacing(); }
child.getChildren().addAll(content, button); masonryPane.getChildren().addAll(children); Platform.runLater(() -> scrollPane.requestLayout());
/** * @return the cell height of the masonry pane grid */ public final double getCellHeight() { return this.cellHeightProperty().get(); }
/** * sets the cell width of the masonry pane grid * * @param cellWidth of the grid */ public final void setCellWidth(final double cellWidth) { this.cellWidthProperty().set(cellWidth); }
/** * Constructs a new JFXMasonryPane */ public JFXMasonryPane() { getChildren().addListener(new WeakListChangeListener<>(childrenListener)); }
/** * @return the cell height of the masonry pane grid */ public final double getCellHeight() { return this.cellHeightProperty().get(); }
/** * sets the cell width of the masonry pane grid * * @param cellWidth of the grid */ public final void setCellWidth(final double cellWidth) { this.cellWidthProperty().set(cellWidth); }
/** * sets the cell height of the masonry pane grid * * @param cellHeight of the grid */ public final void setCellHeight(final double cellHeight) { this.cellHeightProperty().set(cellHeight); }
/** * @return the cell width of the masonry pane grid */ public final double getCellWidth() { return this.cellWidthProperty().get(); }