Package com.jogamp.graph.ui.layout
Class BoxLayout
- java.lang.Object
-
- com.jogamp.graph.ui.layout.BoxLayout
-
- All Implemented Interfaces:
Group.Layout
public class BoxLayout extends Object implements Group.Layout
GraphUI StackGroup.Layout
.A stack 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
- Scaled
Margin
is applied unscaled if used and ignored with only centerAlignment
w/o additional scaling - Not implemented
Alignment
:Top
,Right
,Bottom
,Left
-
-
Constructor Summary
Constructors Constructor Description BoxLayout()
BoxLayout(float cellWidth, float cellHeight, Alignment alignment)
BoxLayout(float cellWidth, float cellHeight, Alignment alignment, Margin margin)
BoxLayout(float cellWidth, float cellHeight, Alignment alignment, Margin margin, Padding padding)
BoxLayout(float cellWidth, float cellHeight, Alignment alignment, Padding padding)
BoxLayout(float cellWidth, float cellHeight, Margin margin)
BoxLayout(float cellWidth, float cellHeight, Margin margin, Padding padding)
BoxLayout(float cellWidth, float cellHeight, Padding padding)
BoxLayout(Padding padding)
-
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 sizeMargin
getMargin()
Returns given scaledMargin
.Padding
getPadding()
Returns given unscaledPadding
, may benull
if not given via constructor.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
-
BoxLayout
public BoxLayout()
-
BoxLayout
public BoxLayout(Padding padding)
- Parameters:
padding
- unscaledPadding
applied to each viaShape.setPaddding(Padding)
and is scaled ifAlignment.Bit.Fill
-
BoxLayout
public BoxLayout(float cellWidth, float cellHeight, Alignment alignment)
- Parameters:
cellWidth
- optional cell width, zero for nonecellHeight
- optional cell height, zero for nonealignment
-
-
BoxLayout
public BoxLayout(float cellWidth, float cellHeight, Margin margin)
-
BoxLayout
public BoxLayout(float cellWidth, float cellHeight, Padding padding)
- Parameters:
cellWidth
- optional cell width, zero for nonecellHeight
- optional cell height, zero for nonepadding
- unscaledPadding
applied to each viaShape.setPaddding(Padding)
and is scaled ifAlignment.Bit.Fill
-
BoxLayout
public BoxLayout(float cellWidth, float cellHeight, Margin margin, Padding padding)
- Parameters:
cellWidth
- optional cell width, zero for nonecellHeight
- optional cell height, zero for nonemargin
- scaledMargin
is applied unscaled and ignored with only centerAlignment
w/o additional scalingpadding
- unscaledPadding
applied to each viaShape.setPaddding(Padding)
and is scaled ifAlignment.Bit.Fill
-
BoxLayout
public BoxLayout(float cellWidth, float cellHeight, Alignment alignment, Margin margin)
- Parameters:
cellWidth
- optional cell width, zero for nonecellHeight
- optional cell height, zero for nonemargin
- scaledMargin
is applied unscaled
-
BoxLayout
public BoxLayout(float cellWidth, float cellHeight, Alignment alignment, Padding padding)
- Parameters:
cellWidth
- optional cell width, zero for nonecellHeight
- optional cell height, zero for nonealignment
-padding
- unscaledPadding
applied to each viaShape.setPaddding(Padding)
and is scaled ifAlignment.Bit.Fill
-
BoxLayout
public BoxLayout(float cellWidth, float cellHeight, Alignment alignment, Margin margin, Padding padding)
- Parameters:
cellWidth
- optional cell width, zero for nonecellHeight
- optional cell height, zero for nonealignment
-margin
- scaledMargin
is applied unscaled and ignored with only centerAlignment
w/o additional scalingpadding
- unscaledPadding
applied to each viaShape.setPaddding(Padding)
and is scaled ifAlignment.Bit.Fill
-
-
Method Detail
-
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.
-
-