Package com.jogamp.graph.ui.layout
Class GridLayout
- java.lang.Object
-
- com.jogamp.graph.ui.layout.GridLayout
-
- All Implemented Interfaces:
Group.Layout
public class GridLayout extends Object implements Group.Layout
GraphUI GridGroup.Layout.A grid of
Shapes- Optionally centered
horizontally,verticallyorboth. - Optionally scaled to cell-size if given and
Alignment.Fill - Unscaled
Paddingis applied to each viaShape.setPaddding(Padding)if passed in constructor and is scaled ifAlignment.Bit.Fill - Without cell-size behaves like a grid bag using individual shape sizes including
Padding - Scaled
Gapis applied unscaled if used. - Can be filled in
GridLayout.Order.COLUMNorGridLayout.Order.ROWmajor-order. - Not implemented
Alignment:Top,Right,Bottom,Left - ..
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classGridLayout.OrderLayout order forGroup.getShapes()} after population.
-
Constructor Summary
Constructors Constructor Description GridLayout(float cellWidth, float cellHeight, Alignment alignment, int row_limit)Default layout order ofGroup.getShapes()} isGridLayout.Order.ROW.GridLayout(float cellWidth, float cellHeight, Alignment alignment, Gap gap, int row_limit)Default layout order ofGroup.getShapes()} isGridLayout.Order.ROW.GridLayout(float cellWidth, float cellHeight, Alignment alignment, Gap gap, Padding padding, int row_limit)Default layout order ofGroup.getShapes()} isGridLayout.Order.ROW.GridLayout(int column_limit, float cellWidth, float cellHeight, Alignment alignment)Default layout order ofGroup.getShapes()} isGridLayout.Order.COLUMN.GridLayout(int column_limit, float cellWidth, float cellHeight, Alignment alignment, Gap gap)Default layout order ofGroup.getShapes()} isGridLayout.Order.COLUMN.GridLayout(int column_limit, float cellWidth, float cellHeight, Alignment alignment, Gap gap, Padding padding)Default layout order ofGroup.getShapes()} isGridLayout.Order.COLUMN.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AlignmentgetAlignment()Returns givenAlignment.com.jogamp.math.Vec2fgetCellSize()Returns the preset cell sizeintgetColumnCount()Returns column count afterlayout(Group, AABBox, PMVMatrix4f).GapgetGap()Returns given scaledGap.GridLayout.OrdergetOrder()Returns givenGridLayout.Order.PaddinggetPadding()Returns given unscaledPadding, may benullif not given via constructor.intgetRowCount()Returns row count afterlayout(Group, AABBox, PMVMatrix4f).voidlayout(Group g, com.jogamp.math.geom.AABBox box, com.jogamp.math.util.PMVMatrix4f pmv)Performing the layout ofGroup.getShapes(), called @Shape.validate(GL2ES2)orShape.validate(GLProfile).voidpreValidate(Shape s)Prepare givenShapebeforevalidation, e.g.StringtoString()
-
-
-
Constructor Detail
-
GridLayout
public GridLayout(int column_limit, float cellWidth, float cellHeight, Alignment alignment)Default layout order ofGroup.getShapes()} isGridLayout.Order.COLUMN.- Parameters:
column_limit- [1..inf)cellWidth-cellHeight-alignment- TODO
-
GridLayout
public GridLayout(int column_limit, float cellWidth, float cellHeight, Alignment alignment, Gap gap)Default layout order ofGroup.getShapes()} isGridLayout.Order.COLUMN.- Parameters:
column_limit- [1..inf)cellWidth-cellHeight-alignment- TODOgap- scaledGapvalue is applied w/o additional scaling
-
GridLayout
public GridLayout(int column_limit, float cellWidth, float cellHeight, Alignment alignment, Gap gap, Padding padding)Default layout order ofGroup.getShapes()} isGridLayout.Order.COLUMN.- Parameters:
column_limit- [1..inf)cellWidth-cellHeight-alignment- TODOgap- scaledGapvalue is applied w/o additional scalingpadding- unscaledPaddingapplied to each viaShape.setPaddding(Padding)and is scaled ifAlignment.Bit.Fill
-
GridLayout
public GridLayout(float cellWidth, float cellHeight, Alignment alignment, int row_limit)Default layout order ofGroup.getShapes()} isGridLayout.Order.ROW.- Parameters:
cellWidth-cellHeight-alignment- TODOrow_limit- [1..inf)
-
GridLayout
public GridLayout(float cellWidth, float cellHeight, Alignment alignment, Gap gap, int row_limit)Default layout order ofGroup.getShapes()} isGridLayout.Order.ROW.- Parameters:
cellWidth-cellHeight-alignment- TODOgap- scaledGapvalue is applied w/o additional scalingrow_limit- [1..inf)
-
GridLayout
public GridLayout(float cellWidth, float cellHeight, Alignment alignment, Gap gap, Padding padding, int row_limit)Default layout order ofGroup.getShapes()} isGridLayout.Order.ROW.- Parameters:
cellWidth-cellHeight-alignment- TODOgap- scaledGapvalue is applied w/o additional scalingpadding- unscaledPaddingapplied to each viaShape.setPaddding(Padding)and is scaled ifAlignment.Bit.Fillrow_limit- [1..inf)
-
-
Method Detail
-
getOrder
public GridLayout.Order getOrder()
Returns givenGridLayout.Order.
-
getColumnCount
public int getColumnCount()
Returns column count afterlayout(Group, AABBox, PMVMatrix4f).
-
getRowCount
public int getRowCount()
Returns row count afterlayout(Group, AABBox, PMVMatrix4f).
-
getCellSize
public com.jogamp.math.Vec2f getCellSize()
Returns the preset cell size
-
getPadding
public Padding getPadding()
Returns given unscaledPadding, may benullif not given via constructor.
-
preValidate
public void preValidate(Shape s)
Description copied from interface:Group.Layout- Specified by:
preValidatein interfaceGroup.Layout
-
layout
public void layout(Group g, com.jogamp.math.geom.AABBox box, com.jogamp.math.util.PMVMatrix4f pmv)
Description copied from interface:Group.LayoutPerforming the layout ofGroup.getShapes(), called @Shape.validate(GL2ES2)orShape.validate(GLProfile).According to the implemented layout, method - may scale the s - may move the s - may reuse the given
PMVMatrix4f`pmv` - must update the givenAABBox`box`- Specified by:
layoutin interfaceGroup.Layout- Parameters:
g- theGroupto layoutbox- the bounding box ofGroupto be updated by this method.pmv- aPMVMatrix4fwhich can be reused.
-
-