GridPane

open class GridPane<T : ComponentView>(    posX: Number = 0,     posY: Number = 0,     columns: Int,     rows: Int,     spacing: Number = DEFAULT_GRID_SPACING,     layoutFromCenter: Boolean = true,     visual: Visual = Visual.EMPTY) : LayoutView<T> , Iterable<GridIteratorElement<T>>

Defines a LayoutView that orders components in a grid structure.

Parameters

T

Generic ComponentView.

posX

Horizontal coordinate for this GridPane. Default: 0.

posY

Vertical coordinate for this GridPane. Default: 0.

columns

Initial column count.

rows

Initial row count.

spacing

Spacing between rows and columns. Default: DEFAULT_GRID_SPACING.

layoutFromCenter

Whether the GridPane should anchor in the center (true) or top-Left (false). Default: true.

visual

Initial visual for this GridPane. Default: Visual.EMPTY.

Constructors

Link copied to clipboard
fun GridPane(    posX: Number = 0,     posY: Number = 0,     columns: Int,     rows: Int,     spacing: Number = DEFAULT_GRID_SPACING,     layoutFromCenter: Boolean = true,     visual: Visual = Visual.EMPTY)

Creates a GridPane with given rows and columns.

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
fun addColumns(columnIndex: Int, count: Int = 1)

Adds the desired amount of columns between column columnIndex - 1 and columnIndex. New columns get null-initialized.

Link copied to clipboard
fun addRows(rowIndex: Int, count: Int = 1)

Adds the desired amount of rows between row rowIndex and rowIndex + 1. New rows get null-initialized.

Link copied to clipboard
open fun forEach(p0: Consumer<in GridIteratorElement<T>>)
Link copied to clipboard
operator fun get(columnIndex: Int, rowIndex: Int): T?

Returns ComponentView in specified cell. Returns null if there was no component.

Link copied to clipboard
fun getCellCenterMode(columnIndex: Int, rowIndex: Int): Alignment

Returns centering mode as an Alignment of the specified cell.

Link copied to clipboard
fun getColumnWidth(columnIndex: Int): Double

Returns the set column width for the given column.

Link copied to clipboard
fun getRowHeight(rowIndex: Int): Double

Returns the set row height for the given row.

Link copied to clipboard
fun grow(    left: Int = 0,     right: Int = 0,     top: Int = 0,     bottom: Int = 0): Boolean

Grows grid by specified dimensions, filling new cells with null values.

Link copied to clipboard
open operator override fun iterator(): Iterator<GridIteratorElement<T>>

Returns an Iterator over the grid components.

Link copied to clipboard
fun offset(offsetX: Number, offsetY: Number)

Adds an offset to this ComponentView's Position.

Link copied to clipboard
fun removeColumn(columnIndex: Int)

Removes the desired column in the grid. Removes all, views in the column. If there is no column left in the grid, it gets trimmed to size 0x0.

Link copied to clipboard
fun removeEmptyColumns()

Removes all empty columns e.g. all rows that have no views in their cells.

Link copied to clipboard
fun removeEmptyRows()

Removes all empty rows e.g. all rows that have no views in their cells.

Link copied to clipboard
fun removeFromParent(): ComponentView

Removes this component from its parent.

Link copied to clipboard
fun removeRow(rowIndex: Int)

Removes the desired row in the grid. Removes all, views in the row.

Link copied to clipboard
fun reposition(posX: Number, posY: Number)

Repositions this ComponentView to the specified coordinates.

Link copied to clipboard
fun resize(width: Number, height: Number)

Resizes this ComponentView to the specified width and height.

Link copied to clipboard
fun rotate(degrees: Number)

Rotates this ComponentView by the given number of degrees.

Link copied to clipboard
fun scale(scalar: Number)

Scales this ComponentView by the given scalar.

Link copied to clipboard
fun scaleX(scalar: Number)

Scales this ComponentView's width by the given scalar.

Link copied to clipboard
fun scaleY(scalar: Number)

Scales this ComponentView's height by the given scalar.

Link copied to clipboard
operator fun set(    columnIndex: Int,     rowIndex: Int,     component: T?)

Sets content of desired grid cell. Overrides existing component in this cell. Pass null to remove a component.

Link copied to clipboard
fun setAutoColumnWidth(columnIndex: Int)

Restores automatic resizing behavior for desired column.

Link copied to clipboard
fun setAutoColumnWidths()

Restores automatic resizing behavior for all columns.

Link copied to clipboard
fun setAutoRowHeight(rowIndex: Int)

Restores automatic resizing behavior for desired row.

Link copied to clipboard
fun setAutoRowHeights()

Restores automatic resizing behavior for all rows.

Link copied to clipboard
fun setCellCenterMode(    columnIndex: Int,     rowIndex: Int,     value: Alignment)

Sets centering mode of desired grid cell with given Alignment. Overrides existing mode in this cell.

Link copied to clipboard
fun setCenterMode(value: Alignment)

Sets centering mode of all cells in the grid with given Alignment. Overrides existing modes of all cells.

Link copied to clipboard
fun setColumnCenterMode(columnIndex: Int, value: Alignment)

Sets centering mode of desired column in grid with given Alignment. Overrides existing mode in the whole column.

Link copied to clipboard
fun setColumnWidth(columnIndex: Int, columnWidth: Number)

Manually set column width of one column. Overrides automatic resizing based on content from this column.

Link copied to clipboard
fun setColumnWidths(columnWidths: DoubleArray)
fun setColumnWidths(columnWidth: Number)

Manually set column width of all columns. Overrides automatic resizing based on content from this column.

Link copied to clipboard
fun setRowCenterMode(rowIndex: Int, value: Alignment)

Sets centering mode of desired row in grid with given Alignment. Overrides existing mode in the whole row.

Link copied to clipboard
fun setRowHeight(rowIndex: Int, rowHeight: Number)

Manually set row height of one row. Overrides automatic resizing based on content from this row.

Link copied to clipboard
fun setRowHeights(rowHeights: DoubleArray)
fun setRowHeights(rowHeight: Number)

Manually set row height of all rows. Overrides automatic resizing based on content from this row.

Link copied to clipboard
open fun spliterator(): Spliterator<GridIteratorElement<T>>
Link copied to clipboard
fun toBack()

Puts the ComponentView to the back inside its parent and Changes its zIndex accordingly.

Link copied to clipboard
fun toFront()

Puts the ComponentView to the front inside its parent and Changes its zIndex accordingly.

Link copied to clipboard
fun trim(): Boolean

Removes all empty outer rows and columns e.g. all rows and columns counted from left, right, top and bottom that have no views in their cells.

Properties

Link copied to clipboard
var actualHeight: Double

The actual height for this ComponentView considering scale.

Link copied to clipboard
var actualPosX: Double

Horizontal position of this ComponentView considering scale.

Link copied to clipboard
var actualPosY: Double

Vertical position of this ComponentView considering scale.

Link copied to clipboard
var actualWidth: Double

The actual width for this ComponentView considering scale.

Link copied to clipboard
val columns: Int

Current column count.

Link copied to clipboard
var dropAcceptor: (DragEvent) -> Boolean?

Returns whether this ComponentView is a valid drop target for the dragged component in the given DragEvent or not.

Link copied to clipboard
var height: Double

The height for this ComponentView.

Link copied to clipboard
val heightProperty: DoubleProperty

Property for the height of this ComponentView.

Link copied to clipboard
var isDisabled: Boolean

Controls if user input events cause input functions of this ComponentView to get invoked.

Link copied to clipboard
val isDisabledProperty: BooleanProperty

Property that controls if user input events cause input functions of this ComponentView to get invoked.

Link copied to clipboard
var isFocusable: Boolean

Controls whether this ComponentView is focusable or not.

Link copied to clipboard
val isFocusableProperty: BooleanProperty

Property that controls whether this ComponentView is focusable or not.

Link copied to clipboard
var isVisible: Boolean

Visibility of this ComponentView.

Link copied to clipboard
val isVisibleProperty: BooleanProperty

Property for the visibility of this ComponentView.

Link copied to clipboard
var layoutBounds: CoordinatePlain

Returns a CoordinatePlain containing the component's corner Coordinates and its layout bounds.

Link copied to clipboard
var name: String

Name field only for debugging purposes. Has no effect on rendering.

Link copied to clipboard
var onDragDropped: (DragEvent) -> Unit?

Gets invoked with a DragEvent whenever a drag and drop gesture finishes over this ComponentView and the dropAcceptor returns true for the given DragEvent.

Link copied to clipboard
var onDragGestureEntered: (DragEvent) -> Unit?

Gets invoked with a DragEvent whenever the mouse enters this ComponentView while performing a drag gesture.

Link copied to clipboard
var onDragGestureExited: (DragEvent) -> Unit?

Gets invoked with a DragEvent whenever the mouse leaves this ComponentView while performing a drag gesture.

Link copied to clipboard
var onKeyPressed: (KeyEvent) -> Unit?

Gets invoked with a KeyEvent whenever a key is pressed while this ComponentView has focus.

Link copied to clipboard
var onKeyReleased: (KeyEvent) -> Unit?

Gets invoked with a KeyEvent whenever a key is released while this ComponentView has focus.

Link copied to clipboard
var onKeyTyped: (KeyEvent) -> Unit?

Gets invoked with a KeyEvent whenever a Character is typed while this ComponentView has focus. Gets invoked after onKeyPressed.

Link copied to clipboard
var onMouseClicked: (MouseEvent) -> Unit?

Gets invoked with a MouseEvent whenever the mouse is clicked inside this ComponentView. Gets invoked after onMousePressed and onMouseReleased.

Link copied to clipboard
var onMouseEntered: (MouseEvent) -> Unit?

Gets invoked with a MouseEvent whenever the mouse enters this ComponentView.

Link copied to clipboard
var onMouseExited: (MouseEvent) -> Unit?

Gets invoked with a MouseEvent whenever the mouse leaves this ComponentView.

Link copied to clipboard
var onMousePressed: (MouseEvent) -> Unit?

Gets invoked with a MouseEvent whenever the mouse is pressed inside this ComponentView.

Link copied to clipboard
var onMouseReleased: (MouseEvent) -> Unit?

Gets invoked with a MouseEvent whenever the mouse is released inside this ComponentView.

Link copied to clipboard
var onScroll: (ScrollEvent) -> Unit?

Gets invoked with a ScrollEvent whenever the mouse wheel is turned while the mouse is inside this ComponentView.

Link copied to clipboard
var opacity: Double

Opacity of this ComponentView.

Link copied to clipboard
val opacityProperty: LimitedDoubleProperty

Property for the opacity of this ComponentView.

Link copied to clipboard
var parent: ComponentView?

The parent of this ComponentView.

Link copied to clipboard
var posX: Double

Horizontal position of this ComponentView.

Link copied to clipboard
val posXProperty: DoubleProperty

Property for the horizontal position of this ComponentView.

Link copied to clipboard
var posY: Double

Vertical position of this ComponentView.

Link copied to clipboard
val posYProperty: DoubleProperty

Property for the vertical position of this ComponentView.

Link copied to clipboard
var rotation: Double

Rotation of this ComponentView in degrees.

Link copied to clipboard
val rotationProperty: DoubleProperty

Property for the rotation of this ComponentView in degrees.

Link copied to clipboard
val rows: Int

Current row count.

Link copied to clipboard
var scale: Double

Scale of this ComponentView.

Link copied to clipboard
var scaleX: Double

Horizontal scale of this ComponentView.

Link copied to clipboard
val scaleXProperty: DoubleProperty

Property for the horizontal scale of this ComponentView.

Link copied to clipboard
var scaleY: Double

Vertical scale of this ComponentView.

Link copied to clipboard
val scaleYProperty: DoubleProperty

Property for the vertical scale of this ComponentView.

Link copied to clipboard
var spacing: Double

Current spacing.

Link copied to clipboard
open var visual: Visual

Current Visual.

Link copied to clipboard
var width: Double

The width for this ComponentView.

Link copied to clipboard
val widthProperty: DoubleProperty

Property for the width of this ComponentView.

Link copied to clipboard
var zIndex: Int

for the order of ComponentView inside of parent.#

Link copied to clipboard
val zIndexProperty: IntegerProperty

Property for the order of ComponentView inside of parent.#