public class BoxLayoutAlgorithm extends GridLayoutAlgorithm
| Modifier and Type | Field and Description |
|---|---|
static int |
HORIZONTAL
Constant representing a horizontal orientation.
|
static int |
VERTICAL
Constant representing a vertical orientation.
|
| Constructor and Description |
|---|
BoxLayoutAlgorithm()
Constructs a new
BoxLayoutAlgorithm with horizontal orientation. |
BoxLayoutAlgorithm(int orientation)
Constructs a new
BoxLayoutAlgorithm with the given orientation. |
| Modifier and Type | Method and Description |
|---|---|
protected int[] |
calculateNumberOfRowsAndCols(int numChildren,
double boundX,
double boundY,
double boundWidth,
double boundHeight)
Calculates and returns an array containing the number of columns and the
number of rows.
|
int |
getOrientation()
|
void |
setOrientation(int orientation)
Changes the orientation of this
BoxLayoutAlgorithm to the given
value, which may either be HORIZONTAL or VERTICAL. |
applyLayout, calculateGrid, calculateNodeSize, calculateNumberOfRowsAndCols_rectangular, calculateNumberOfRowsAndCols_square, getLayoutContext, isResizing, setAspectRatio, setLayoutContext, setResizing, setRowPaddingpublic static final int HORIZONTAL
public static final int VERTICAL
public BoxLayoutAlgorithm()
BoxLayoutAlgorithm with horizontal orientation.public BoxLayoutAlgorithm(int orientation)
BoxLayoutAlgorithm with the given orientation.orientation - Either HORIZONTAL or VERTICAL.java.lang.RuntimeException - when the given orientation is neither
HORIZONTAL nor VERTICAL.public int getOrientation()
BoxLayoutAlgorithm.public void setOrientation(int orientation)
BoxLayoutAlgorithm to the given
value, which may either be HORIZONTAL or VERTICAL.orientation - The new orientation for this BoxLayoutAlgorithm.java.lang.RuntimeException - when the given orientation is neither
HORIZONTAL nor VERTICAL.protected int[] calculateNumberOfRowsAndCols(int numChildren,
double boundX,
double boundY,
double boundWidth,
double boundHeight)
GridLayoutAlgorithmaspect ratio is
set to 1, then the
GridLayoutAlgorithm.calculateNumberOfRowsAndCols_square(int, double, double, double, double)
method is used for the computation. Otherwise, the
GridLayoutAlgorithm.calculateNumberOfRowsAndCols_rectangular(int) is used for the
computation.calculateNumberOfRowsAndCols in class GridLayoutAlgorithmnumChildren - The number of nodes.boundX - The horizontal offset.boundY - The vertical offset.boundWidth - The bounds' width.boundHeight - The bounds' height.Copyright (c) 2014 itemis AG and others. All rights reserved.