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
Shape
s- Optionally centered
horizontally
,vertically
orboth
. - Optionally scaled to cell-size if given and
Alignment.Fill
- Unscaled
Padding
is 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
Gap
is applied unscaled if used. - Can be filled in
GridLayout.Order.COLUMN
orGridLayout.Order.ROW
major-order. - Not implemented
Alignment
:Top
,Right
,Bottom
,Left
- ..
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
GridLayout.Order
Layout 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 Alignment
getAlignment()
Returns givenAlignment
.com.jogamp.math.Vec2f
getCellSize()
Returns the preset cell sizeint
getColumnCount()
Returns column count afterlayout(Group, AABBox, PMVMatrix4f)
.Gap
getGap()
Returns given scaledGap
.GridLayout.Order
getOrder()
Returns givenGridLayout.Order
.Padding
getPadding()
Returns given unscaledPadding
, may benull
if not given via constructor.int
getRowCount()
Returns row count afterlayout(Group, AABBox, PMVMatrix4f)
.void
layout(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)
.void
preValidate(Shape s)
Prepare givenShape
beforevalidation
, e.g.String
toString()
-
-
-
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
- scaledGap
value 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
- scaledGap
value is applied w/o additional scalingpadding
- unscaledPadding
applied 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
- scaledGap
value 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
- scaledGap
value is applied w/o additional scalingpadding
- unscaledPadding
applied to each viaShape.setPaddding(Padding)
and is scaled ifAlignment.Bit.Fill
row_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 benull
if not given via constructor.
-
preValidate
public void preValidate(Shape s)
Description copied from interface:Group.Layout
- Specified by:
preValidate
in 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.Layout
Performing 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:
layout
in interfaceGroup.Layout
- Parameters:
g
- theGroup
to layoutbox
- the bounding box ofGroup
to be updated by this method.pmv
- aPMVMatrix4f
which can be reused.
-
-