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
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 - Scaled
Marginis applied unscaled if used and ignored with only centerAlignmentw/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 AlignmentgetAlignment()Returns givenAlignment.com.jogamp.math.Vec2fgetCellSize()Returns the preset cell sizeMargingetMargin()Returns given scaledMargin.PaddinggetPadding()Returns given unscaledPadding, may benullif not given via constructor.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
-
BoxLayout
public BoxLayout()
-
BoxLayout
public BoxLayout(Padding padding)
- Parameters:
padding- unscaledPaddingapplied 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- unscaledPaddingapplied 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- scaledMarginis applied unscaled and ignored with only centerAlignmentw/o additional scalingpadding- unscaledPaddingapplied 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- scaledMarginis 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- unscaledPaddingapplied 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- scaledMarginis applied unscaled and ignored with only centerAlignmentw/o additional scalingpadding- unscaledPaddingapplied 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 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.
-
-