Layout#

public class Layout#

Arranges the elements of a panel automatically, so that they do not have to be positioned one by one. See Panel.addHorizontalLayout(), Panel.addVerticalLayout() and Panel.addGridLayout().

float getSpacing()#
void setSpacing(float value)#

The gap left between the elements, in pixels. A grid layout uses it in both directions.

Padding getPadding()#
void setPadding(Padding value)#

The gap left inside the edges of the panel.

TextAnchor getChildAlignment()#
void setChildAlignment(TextAnchor value)#

Where the elements are placed within the space the layout has to fill.

org.javatuples.Pair<Double, Double> getCellSize()#
void setCellSize(org.javatuples.Pair<Double, Double> value)#

The size of each cell of a grid layout, in pixels.

Note

Only applies to a grid layout. Throws an exception for the other layouts, whose elements are sized individually using their layout elements.

GridConstraint getConstraint()#
void setConstraint(GridConstraint value)#

What fixes the shape of a grid layout.

Note

Only applies to a grid layout. Throws an exception for the other layouts.

int getConstraintCount()#
void setConstraintCount(int value)#

The number of columns or rows that Layout.getConstraint() fixes, ignored when the constraint is GridConstraint.FLEXIBLE.

Note

Only applies to a grid layout. Throws an exception for the other layouts.

public class Padding#

The gap left inside each edge of a layout, in whole pixels.

public Padding(int left, int right, int top, int bottom)#

Construct a Padding from the values of its fields.

int getLeft()#

The gap inside the left edge.

int getRight()#

The gap inside the right edge.

int getTop()#

The gap inside the top edge.

int getBottom()#

The gap inside the bottom edge.

public enum GridConstraint#

What fixes the shape of a grid layout.

public GridConstraint FLEXIBLE#

Fit as many columns and rows as the size of the panel allows.

public GridConstraint FIXED_COLUMN_COUNT#

Use a fixed number of columns, and as many rows as are needed.

public GridConstraint FIXED_ROW_COUNT#

Use a fixed number of rows, and as many columns as are needed.