public final class CC

  1. Object
  2. CC
A simple value holder for one component’s constraint.

Constructors

public CC()

Methods

public CC endGroupX(String s)Specifies that the component should be put in the end group s and will thus share the same ending coordinate as them within the group.
public CC sizeGroupX(String s)Specifies that the component should be put in the size group s and will thus share the same size as them within the group.
public CC minWidth(String size)The minimum size for the component.
public CC width(String size)The size for the component as a min and/or preferred and/or maximum size.
public CC maxWidth(String size)The maximum size for the component.
public CC gapX(String before, String after)The horizontal gap before and/or after the component.
public CC alignX(String align)Same functionality as getHorizontal().setAlign(ConstraintParser.parseUnitValue(unitValue, true)) only this method returns this for chaining multiple calls.
public CC growPrioX(int p)The grow priority compared to other components in the same cell.
public CC growPrio(int... widthHeight)Grow priority for the component horizontally and optionally vertically.
public CC growX()Grow weight for the component horizontally.
public CC growX(float w)Grow weight for the component horizontally.
public CC grow(float... widthHeight)grow weight for the component horizontally and optionally vertically.
public CC shrinkPrioX(int p)The shrink priority compared to other components in the same cell.
public CC shrinkPrio(int... widthHeight)Shrink priority for the component horizontally and optionally vertically.
public CC shrinkX(float w)Shrink weight for the component horizontally.
public CC shrink(float... widthHeight)Shrink weight for the component horizontally and optionally vertically.
public CC endGroupY(String s)The end group that this component should be placed in.
public CC endGroup(String... xy)The end group(s) that this component should be placed in.
public CC sizeGroupY(String s)The size group that this component should be placed in.
public CC sizeGroup(String... xy)The size group(s) that this component should be placed in.
public CC minHeight(String size)The minimum size for the component.
public CC height(String size)The size for the component as a min and/or preferred and/or maximum size.
public CC maxHeight(String size)The maximum size for the component.
public CC gapY(String before, String after)The vertical gap before (normally above) and/or after (normally below) the component.
public CC alignY(String align)Same functionality as getVertical().setAlign(ConstraintParser.parseUnitValue(unitValue, true)) only this method returns this for chaining multiple calls.
public CC growPrioY(int p)The grow priority compared to other components in the same cell.
public CC growY()Grow weight for the component vertically.
public CC growY(Float w)Grow weight for the component vertically.
public CC shrinkPrioY(int p)The shrink priority compared to other components in the same cell.
public CC shrinkY(float w)Shrink weight for the component horizontally.
public CC hideMode(int mode)How this component, if hidden (not visible), should be treated.
public CC id(String s)The id used to reference this component in some constraints.
public CC tag(String tag)Same functionality as tag) only this method returns this for chaining multiple calls.
public CC cell(int... colRowWidthHeight)Set the cell(s) that the component should occupy in the grid.
public CC span(int... cells)Same functionality as spanX(cellsX).spanY(cellsY) which means this cell will span cells in both x and y. This method returns this for chaining multiple calls.
public CC gap(String... args)Corresponds exactly to the “gap left right top bottom” keyword.
public CC gapBefore(String boundsSize)Sets the horizontal gap before the component.
public CC gapAfter(String boundsSize)Sets the horizontal gap after the component.
public CC gapTop(String boundsSize)Sets the gap above the component.
public CC gapLeft(String boundsSize)Sets the gap to the left the component.
public CC gapBottom(String boundsSize)Sets the gap below the component.
public CC gapRight(String boundsSize)Sets the gap to the right of the component.
public CC spanY()Same functionality as calling #setSpanY(int) with LayoutUtil.INF which means this cell will span the rest of the column.
public CC spanY(int cells)Same functionality as #setSpanY(int) only this method returns this for chaining multiple calls.
public CC spanX()Same functionality as #setSpanX(int) which means this cell will span the rest of the row.
public CC spanX(int cells)Same functionality as #setSpanX(int) only this method returns this for chaining multiple calls.
public CC push()Same functionality as pushX().pushY() which means this cell will push in both x and y dimensions.
public CC push(Float weightX, Float weightY)Same functionality as pushX(weightX).pushY(weightY) which means this cell will push in both x and y dimensions.
public CC pushY()Same functionality as #setPushY(Float) which means this cell will push the rest of the column.
public CC pushY(Float weight)Same functionality as weight) only this method returns this for chaining multiple calls.
public CC pushX()Same functionality as #setPushX(Float) which means this cell will push the rest of the row.
public CC pushX(Float weight)Same functionality as weight) only this method returns this for chaining multiple calls.
public CC split(int parts)Same functionality as parts) only this method returns this for chaining multiple calls.
public CC split()Same functionality as split(LayoutUtil.INF), which means split until one of the keywords that breaks the split is found for a component after this one (e.g. wrap, newline and skip).
public CC skip(int cells)Same functionality as #setSkip(int) only this method returns this for chaining multiple calls.
public CC skip()Same functionality as skip(1).
public CC external()Same functionality as calling #setExternal(boolean) with true only this method returns this for chaining multiple calls.
public CC flowX()Same functionality as calling #setFlowX(Boolean) with Boolean.TRUE only this method returns this for chaining multiple calls.
public CC flowY()Same functionality as calling #setFlowX(Boolean) with Boolean.FALSE only this method returns this for chaining multiple calls.
public CC grow()Same functionality as #growX() and #growY().
public CC newline()Same functionality as calling #setNewline(boolean) with true only this method returns this for chaining multiple calls.
public CC newline(String gapSize)Same functionality as #setNewlineGapSize(BoundSize) only this method returns this for chaining multiple calls.
public CC wrap()Same functionality as calling #setWrap(boolean) with true only this method returns this for chaining multiple calls.
public CC wrap(String gapSize)Same functionality as #setWrapGapSize(BoundSize) only this method returns this for chaining multiple calls.
public CC dockNorth()Same functionality as calling #setDockSide(int) with 0 only this method returns this for chaining multiple calls.
public CC dockWest()Same functionality as calling #setDockSide(int) with 1 only this method returns this for chaining multiple calls.
public CC dockSouth()Same functionality as calling #setDockSide(int) with 2 only this method returns this for chaining multiple calls.
public CC dockEast()Same functionality as calling #setDockSide(int) with 3 only this method returns this for chaining multiple calls.
public CC x(String x)Sets the x-coordinate for the component.
public CC y(String y)Sets the y-coordinate for the component.
public CC x2(String x2)Sets the x2-coordinate for the component (right side).
public CC y2(String y2)Sets the y2-coordinate for the component (bottom side).
public CC pos(String x, String y)Same functionality as x) and y) toghether.
public CC pos(String x, String y, String x2, String y2)Same functionality as x), y), y) and y) toghether.
public CC pad(int top, int left, int bottom, int right)Same functionality as #setPadding(UnitValue[]) but the unit values as absolute pixels.
public CC pad(String pad)Same functionality as setPadding(ConstraintParser.parseInsets(pad, false))} only this method returns this for chaining multiple calls.
public DimConstraint getHorizontal()Returns the horizontal dimension constraint for this component constraint.
public void setHorizontal(DimConstraint h)Sets the horizontal dimension constraint for this component constraint.
public DimConstraint getVertical()Returns the vertical dimension constraint for this component constraint.
public void setVertical(DimConstraint v)Sets the vertical dimension constraint for this component constraint.
public DimConstraint getDimConstraint(boolean isHor)Returns the vertical or horizontal dim constraint.
public UnitValue[] getPos()Returns the absolute positioning of one or more of the edges.
public void setPos(UnitValue[] pos)Sets absolute positioning of one or more of the edges.
public boolean isBoundsInGrid()Returns if the absolute pos value should be corrections to the component that is in a normal cell.
public int getCellX()Returns the absolute cell position in the grid or -1 if cell positioning is not used.
public void setCellX(int x)Set an absolute cell x-position in the grid.
public int getCellY()Returns the absolute cell position in the grid or -1 if cell positioning is not used.
public void setCellY(int y)Set an absolute cell x-position in the grid.
public int getDockSide()Sets the docking side.
public void setDockSide(int side)Sets the docking side.
public boolean isExternal()Returns if this component should have its bounds handled by an external source and not this layout manager.
public void setExternal(boolean b)If this boolean is true this component is not handled in any way by the layout manager and the component can have its bounds set by an external handler which is normally by the use of some component.setBounds(x, y, width, height) directly (for Swing).
public Boolean getFlowX()Returns if the flow in the cell is in the horizontal dimension.
public void setFlowX(Boolean b)Sets if the flow in the cell is in the horizontal dimension.
public int getHideMode()Sets how a component that is hidden (not visible) should be treated by default.
public void setHideMode(int mode)Sets how a component that is hidden (not visible) should be treated by default.
public String getId()Returns the id used to reference this component in some constraints.
public void setId(String id)Sets the id used to reference this component in some constraints.
public UnitValue[] getPadding()Returns the absolute resizing in the last stage of the layout cycle.
public void setPadding(UnitValue[] sides)Sets the absolute resizing in the last stage of the layout cycle.
public UnitValue[] getVisualPadding()Returns the visual padding used when laying out this Component.
public void setVisualPadding(UnitValue[] sides)Sets the visual padding used when laying out this Component.
public int getSkip()Returns how many cells in the grid that should be skipped before the component that this constraint belongs to.
public void setSkip(int cells)Sets how many cells in the grid that should be skipped before the component that this constraint belongs to.
public int getSpanX()Returns the number of cells the cell that this constraint’s component will span in the indicated dimension.
public void setSpanX(int cells)Sets the number of cells the cell that this constraint’s component will span in the indicated dimension.
public int getSpanY()Returns the number of cells the cell that this constraint’s component will span in the indicated dimension.
public void setSpanY(int cells)Sets the number of cells the cell that this constraint’s component will span in the indicated dimension.
public Float getPushX()“pushx” indicates that the column that this component is in (this first if the component spans) should default to growing.
public void setPushX(Float weight)“pushx” indicates that the column that this component is in (this first if the component spans) should default to growing.
public Float getPushY()“pushx” indicates that the row that this component is in (this first if the component spans) should default to growing.
public void setPushY(Float weight)“pushx” indicates that the row that this component is in (this first if the component spans) should default to growing.
public int getSplit()Returns in how many parts the current cell (that this constraint’s component will be in) should be split in.
public void setSplit(int parts)Sets in how many parts the current cell (that this constraint’s component will be in) should be split in.
public String getTag()Tags the component with metadata.
public void setTag(String tag)Optinal tag that gives more context to this constraint’s component.
public boolean isWrap()Returns if the flow should wrap to the next line/column after the component that this constraint belongs to.
public void setWrap(boolean b)Sets if the flow should wrap to the next line/column after the component that this constraint belongs to.
public BoundSize getWrapGapSize()Returns the wrap size if it is a custom size.
public void setWrapGapSize(BoundSize s)Set the wrap size and turns wrap on if != null.
public boolean isNewline()Returns if the flow should wrap to the next line/column before the component that this constraint belongs to.
public void setNewline(boolean b)Sets if the flow should wrap to the next line/column before the component that this constraint belongs to.
public BoundSize getNewlineGapSize()Returns the newline size if it is a custom size.
public void setNewlineGapSize(BoundSize s)Set the newline size and turns newline on if != null.

Inherited methods

Constructor details

CC

public CC()

Method details

endGroupX

public CC endGroupX(String s)

Specifies that the component should be put in the end group s and will thus share the same ending coordinate as them within the group.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Parameters

s String
A name to associate on the group that should be the same for other rows/columns in the same group.

Returns

this so it is possible to chain calls. E.g. new ComponentConstraint().noGrid().gap().fill().

sizeGroupX

public CC sizeGroupX(String s)

Specifies that the component should be put in the size group s and will thus share the same size as them within the group.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Parameters

s String
A name to associate on the group that should be the same for other rows/columns in the same group.

Returns

this so it is possible to chain calls. E.g. new ComponentConstraint().noGrid().gap().fill().

minWidth

public CC minWidth(String size)

The minimum size for the component. The value will override any value that is set on the component itself.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Parameters

size String
The size expressed as a UnitValue. E.g. “100px” or “200mm”.

Returns

this so it is possible to chain calls. E.g. new ComponentConstraint().noGrid().gap().fill().

width

public CC width(String size)

The size for the component as a min and/or preferred and/or maximum size. The value will override any value that is set on the component itself.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Parameters

size String
The size expressed as a BoundSize. E.g. “50:100px:200mm” or “100px”.

Returns

this so it is possible to chain calls. E.g. new ComponentConstraint().noGrid().gap().fill().

maxWidth

public CC maxWidth(String size)

The maximum size for the component. The value will override any value that is set on the component itself.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Parameters

size String
The size expressed as a UnitValue. E.g. “100px” or “200mm”.

Returns

this so it is possible to chain calls. E.g. new ComponentConstraint().noGrid().gap().fill().

gapX

public CC gapX(String before, String after)

The horizontal gap before and/or after the component. The gap is towards cell bounds and/or other component bounds.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Parameters

before String
The size of the gap expressed as a BoundSize. E.g. “50:100px:200mm” or “100px!”.
after String
The size of the gap expressed as a BoundSize. E.g. “50:100px:200mm” or “100px!”.

Returns

this so it is possible to chain calls. E.g. new ComponentConstraint().noGrid().gap().fill().

alignX

public CC alignX(String align)

Same functionality as getHorizontal().setAlign(ConstraintParser.parseUnitValue(unitValue, true)) only this method returns this for chaining multiple calls.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Parameters

align String
The align keyword or for instance “100px”. E.g “left”, “right”, “leading” or “trailing”.

Returns

this so it is possible to chain calls. E.g. new ComponentConstraint().noGrid().gap().fill().

growPrioX

public CC growPrioX(int p)

The grow priority compared to other components in the same cell.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Parameters

p int
The grow priority.

Returns

this so it is possible to chain calls. E.g. new ComponentConstraint().noGrid().gap().fill().

growPrio

public CC growPrio(int... widthHeight)

Grow priority for the component horizontally and optionally vertically.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Parameters

widthHeight int...
The new shrink weight and height. 1-2 arguments, never null.

Returns

this so it is possible to chain calls. E.g. new ComponentConstraint().noGrid().gap().fill().

growX

public CC growX()

Grow weight for the component horizontally. It default to weight 100.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Returns

this so it is possible to chain calls. E.g. new ComponentConstraint().noGrid().gap().fill().

growX

public CC growX(float w)

Grow weight for the component horizontally.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Parameters

w float
The new grow weight.

Returns

this so it is possible to chain calls. E.g. new ComponentConstraint().noGrid().gap().fill().

grow

public CC grow(float... widthHeight)

grow weight for the component horizontally and optionally vertically.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Parameters

widthHeight float...
The new shrink weight and height. 1-2 arguments, never null.

Returns

this so it is possible to chain calls. E.g. new ComponentConstraint().noGrid().gap().fill().

shrinkPrioX

public CC shrinkPrioX(int p)

The shrink priority compared to other components in the same cell.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Parameters

p int
The shrink priority.

Returns

this so it is possible to chain calls. E.g. new ComponentConstraint().noGrid().gap().fill().

shrinkPrio

public CC shrinkPrio(int... widthHeight)

Shrink priority for the component horizontally and optionally vertically.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Parameters

widthHeight int...
The new shrink weight and height. 1-2 arguments, never null.

Returns

this so it is possible to chain calls. E.g. new ComponentConstraint().noGrid().gap().fill().

shrinkX

public CC shrinkX(float w)

Shrink weight for the component horizontally.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Parameters

w float
The new shrink weight.

Returns

this so it is possible to chain calls. E.g. new ComponentConstraint().noGrid().gap().fill().

shrink

public CC shrink(float... widthHeight)

Shrink weight for the component horizontally and optionally vertically.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Parameters

widthHeight float...
The new shrink weight and height. 1-2 arguments, never null.

Returns

this so it is possible to chain calls. E.g. new ComponentConstraint().noGrid().gap().fill().

endGroupY

public CC endGroupY(String s)

The end group that this component should be placed in.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Parameters

s String
The name of the group. If null that means no group (default)

Returns

this so it is possible to chain calls. E.g. new ComponentConstraint().noGrid().gap().fill().

endGroup

public CC endGroup(String... xy)

The end group(s) that this component should be placed in.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Parameters

xy String...
The end group for x and y respectively. 1-2 arguments, not null.

Returns

this so it is possible to chain calls. E.g. new ComponentConstraint().noGrid().gap().fill().

sizeGroupY

public CC sizeGroupY(String s)

The size group that this component should be placed in.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Parameters

s String
The name of the group. If null that means no group (default)

Returns

this so it is possible to chain calls. E.g. new ComponentConstraint().noGrid().gap().fill().

sizeGroup

public CC sizeGroup(String... xy)

The size group(s) that this component should be placed in.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Parameters

xy String...
The size group for x and y respectively. 1-2 arguments, not null.

Returns

this so it is possible to chain calls. E.g. new ComponentConstraint().noGrid().gap().fill().

minHeight

public CC minHeight(String size)

The minimum size for the component. The value will override any value that is set on the component itself.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Parameters

size String
The size expressed as a UnitValue. E.g. “100px” or “200mm”.

Returns

this so it is possible to chain calls. E.g. new ComponentConstraint().noGrid().gap().fill().

height

public CC height(String size)

The size for the component as a min and/or preferred and/or maximum size. The value will override any value that is set on the component itself.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Parameters

size String
The size expressed as a BoundSize. E.g. “50:100px:200mm” or “100px”.

Returns

this so it is possible to chain calls. E.g. new ComponentConstraint().noGrid().gap().fill().

maxHeight

public CC maxHeight(String size)

The maximum size for the component. The value will override any value that is set on the component itself.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Parameters

size String
The size expressed as a UnitValue. E.g. “100px” or “200mm”.

Returns

this so it is possible to chain calls. E.g. new ComponentConstraint().noGrid().gap().fill().

gapY

public CC gapY(String before, String after)

The vertical gap before (normally above) and/or after (normally below) the component. The gap is towards cell bounds and/or other component bounds.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Parameters

before String
The size of the gap expressed as a BoundSize. E.g. “50:100px:200mm” or “100px!”.
after String
The size of the gap expressed as a BoundSize. E.g. “50:100px:200mm” or “100px!”.

Returns

this so it is possible to chain calls. E.g. new ComponentConstraint().noGrid().gap().fill().

alignY

public CC alignY(String align)

Same functionality as getVertical().setAlign(ConstraintParser.parseUnitValue(unitValue, true)) only this method returns this for chaining multiple calls.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Parameters

align String
The align keyword or for instance “100px”. E.g “top” or “bottom”.

Returns

this so it is possible to chain calls. E.g. new ComponentConstraint().noGrid().gap().fill().

growPrioY

public CC growPrioY(int p)

The grow priority compared to other components in the same cell.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Parameters

p int
The grow priority.

Returns

this so it is possible to chain calls. E.g. new ComponentConstraint().noGrid().gap().fill().

growY

public CC growY()

Grow weight for the component vertically. Defaults to 100.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Returns

this so it is possible to chain calls. E.g. new ComponentConstraint().noGrid().gap().fill().

growY

public CC growY(Float w)

Grow weight for the component vertically.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Parameters

w Float
The new grow weight.

Returns

this so it is possible to chain calls. E.g. new ComponentConstraint().noGrid().gap().fill().

shrinkPrioY

public CC shrinkPrioY(int p)

The shrink priority compared to other components in the same cell.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Parameters

p int
The shrink priority.

Returns

this so it is possible to chain calls. E.g. new ComponentConstraint().noGrid().gap().fill().

shrinkY

public CC shrinkY(float w)

Shrink weight for the component horizontally.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Parameters

w float
The new shrink weight.

Returns

this so it is possible to chain calls. E.g. new ComponentConstraint().noGrid().gap().fill().

hideMode

public CC hideMode(int mode)

How this component, if hidden (not visible), should be treated.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Parameters

mode int

The mode. Default to the mode in the net.miginfocom.layout.LC. 0 == Normal. Bounds will be calculated as if the component was visible.

1 == If hidden the size will be 0, 0 but the gaps remain.

2 == If hidden the size will be 0, 0 and gaps set to zero.

3 == If hidden the component will be disregarded completely and not take up a cell in the grid..

Returns

this so it is possible to chain calls. E.g. new ComponentConstraint().noGrid().gap().fill().

id

public CC id(String s)

The id used to reference this component in some constraints.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Parameters

s String
The id or null. May consist of a groupID and a componentID which are separated by a dot: “.”. E.g. “grp1.id1”. The dot should never be first or last if present.

Returns

this so it is possible to chain calls. E.g. new ComponentConstraint().noGrid().gap().fill().

tag

public CC tag(String tag)

Same functionality as tag) only this method returns this for chaining multiple calls.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Parameters

tag String
The new tag. May be null.

Returns

this so it is possible to chain calls. E.g. new LayoutConstraint().noGrid().gap().fill().

cell

public CC cell(int... colRowWidthHeight)

Set the cell(s) that the component should occupy in the grid. Same functionality as col) and row) together with width) and height). This method returns this for chaining multiple calls.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Parameters

colRowWidthHeight int...
cellX, cellY, spanX, spanY repectively. 1-4 arguments, not null.

Returns

this so it is possible to chain calls. E.g. new LayoutConstraint().noGrid().gap().fill().

span

public CC span(int... cells)

Same functionality as spanX(cellsX).spanY(cellsY) which means this cell will span cells in both x and y. This method returns this for chaining multiple calls.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com. Since 3.7.2 this takes an array/vararg whereas it previously only took two specific values, xSpan and ySpan.

Parameters

cells int...
spanX and spanY, when present, and in that order.

Returns

this so it is possible to chain calls. E.g. new LayoutConstraint().noGrid().gap().fill().

gap

public CC gap(String... args)
Corresponds exactly to the “gap left right top bottom” keyword.

Parameters

args String...
Same as for the “gap” keyword. Length 1-4, never null buf elements can be null.

Returns

this so it is possible to chain calls. E.g. new LayoutConstraint().noGrid().gap().fill().

gapBefore

public CC gapBefore(String boundsSize)

Sets the horizontal gap before the component.

Note! This is currently same as gapLeft(). This might change in 4.x.

Parameters

boundsSize String
The size of the gap expressed as a BoundSize. E.g. “50:100px:200mm” or “100px!”.

Returns

this so it is possible to chain calls. E.g. new LayoutConstraint().noGrid().gap().fill().

gapAfter

public CC gapAfter(String boundsSize)

Sets the horizontal gap after the component.

Note! This is currently same as gapLeft(). This might change in 4.x.

Parameters

boundsSize String
The size of the gap expressed as a BoundSize. E.g. “50:100px:200mm” or “100px!”.

Returns

this so it is possible to chain calls. E.g. new LayoutConstraint().noGrid().gap().fill().

gapTop

public CC gapTop(String boundsSize)
Sets the gap above the component.

Parameters

boundsSize String
The size of the gap expressed as a BoundSize. E.g. “50:100px:200mm” or “100px!”.

Returns

this so it is possible to chain calls. E.g. new LayoutConstraint().noGrid().gap().fill().

gapLeft

public CC gapLeft(String boundsSize)
Sets the gap to the left the component.

Parameters

boundsSize String
The size of the gap expressed as a BoundSize. E.g. “50:100px:200mm” or “100px!”.

Returns

this so it is possible to chain calls. E.g. new LayoutConstraint().noGrid().gap().fill().

gapBottom

public CC gapBottom(String boundsSize)
Sets the gap below the component.

Parameters

boundsSize String
The size of the gap expressed as a BoundSize. E.g. “50:100px:200mm” or “100px!”.

Returns

this so it is possible to chain calls. E.g. new LayoutConstraint().noGrid().gap().fill().

gapRight

public CC gapRight(String boundsSize)
Sets the gap to the right of the component.

Parameters

boundsSize String
The size of the gap expressed as a BoundSize. E.g. “50:100px:200mm” or “100px!”.

Returns

this so it is possible to chain calls. E.g. new LayoutConstraint().noGrid().gap().fill().

spanY

public CC spanY()

Same functionality as calling #setSpanY(int) with LayoutUtil.INF which means this cell will span the rest of the column. This method returns this for chaining multiple calls.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Returns

this so it is possible to chain calls. E.g. new LayoutConstraint().noGrid().gap().fill().

spanY

public CC spanY(int cells)

Same functionality as #setSpanY(int) only this method returns this for chaining multiple calls.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Parameters

cells int
The number of cells to span (i.e. merge).

Returns

this so it is possible to chain calls. E.g. new LayoutConstraint().noGrid().gap().fill().

spanX

public CC spanX()

Same functionality as #setSpanX(int) which means this cell will span the rest of the row. This method returns this for chaining multiple calls.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Returns

this so it is possible to chain calls. E.g. new LayoutConstraint().noGrid().gap().fill().

spanX

public CC spanX(int cells)

Same functionality as #setSpanX(int) only this method returns this for chaining multiple calls.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Parameters

cells int
The number of cells to span (i.e. merge).

Returns

this so it is possible to chain calls. E.g. new LayoutConstraint().noGrid().gap().fill().

push

public CC push()

Same functionality as pushX().pushY() which means this cell will push in both x and y dimensions. This method returns this for chaining multiple calls.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Returns

this so it is possible to chain calls. E.g. new LayoutConstraint().noGrid().gap().fill().

push

public CC push(Float weightX, Float weightY)

Same functionality as pushX(weightX).pushY(weightY) which means this cell will push in both x and y dimensions. This method returns this for chaining multiple calls.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Parameters

weightX Float
The weight used in the push.
weightY Float
The weight used in the push.

Returns

this so it is possible to chain calls. E.g. new LayoutConstraint().noGrid().gap().fill().

pushY

public CC pushY()

Same functionality as #setPushY(Float) which means this cell will push the rest of the column. This method returns this for chaining multiple calls.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Returns

this so it is possible to chain calls. E.g. new LayoutConstraint().noGrid().gap().fill().

pushY

public CC pushY(Float weight)

Same functionality as weight) only this method returns this for chaining multiple calls.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Parameters

weight Float
The weight used in the push.

Returns

this so it is possible to chain calls. E.g. new LayoutConstraint().noGrid().gap().fill().

pushX

public CC pushX()

Same functionality as #setPushX(Float) which means this cell will push the rest of the row. This method returns this for chaining multiple calls.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Returns

this so it is possible to chain calls. E.g. new LayoutConstraint().noGrid().gap().fill().

pushX

public CC pushX(Float weight)

Same functionality as weight) only this method returns this for chaining multiple calls.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Parameters

weight Float
The weight used in the push.

Returns

this so it is possible to chain calls. E.g. new LayoutConstraint().noGrid().gap().fill().

split

public CC split(int parts)

Same functionality as parts) only this method returns this for chaining multiple calls.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Parameters

parts int
The number of parts (i.e. component slots) the cell should be divided into.

Returns

this so it is possible to chain calls. E.g. new ComponentConstraint().noGrid().gap().fill().

split

public CC split()

Same functionality as split(LayoutUtil.INF), which means split until one of the keywords that breaks the split is found for a component after this one (e.g. wrap, newline and skip).

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Returns

this so it is possible to chain calls. E.g. new ComponentConstraint().noGrid().gap().fill().

skip

public CC skip(int cells)

Same functionality as #setSkip(int) only this method returns this for chaining multiple calls.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Parameters

cells int
How many cells in the grid that should be skipped before the component that this constraint belongs to

Returns

this so it is possible to chain calls. E.g. new ComponentConstraint().noGrid().gap().fill().

skip

public CC skip()

Same functionality as skip(1).

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Returns

this so it is possible to chain calls. E.g. new ComponentConstraint().noGrid().gap().fill().

external

public CC external()

Same functionality as calling #setExternal(boolean) with true only this method returns this for chaining multiple calls.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Returns

this so it is possible to chain calls. E.g. new ComponentConstraint().noGrid().gap().fill().

flowX

public CC flowX()

Same functionality as calling #setFlowX(Boolean) with Boolean.TRUE only this method returns this for chaining multiple calls.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Returns

this so it is possible to chain calls. E.g. new ComponentConstraint().noGrid().gap().fill().

flowY

public CC flowY()

Same functionality as calling #setFlowX(Boolean) with Boolean.FALSE only this method returns this for chaining multiple calls.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Returns

this so it is possible to chain calls. E.g. new ComponentConstraint().noGrid().gap().fill().

grow

public CC grow()

Same functionality as #growX() and #growY().

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Returns

this so it is possible to chain calls. E.g. new ComponentConstraint().noGrid().gap().fill().

newline

public CC newline()

Same functionality as calling #setNewline(boolean) with true only this method returns this for chaining multiple calls.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Returns

this so it is possible to chain calls. E.g. new ComponentConstraint().noGrid().gap().fill().

newline

public CC newline(String gapSize)

Same functionality as #setNewlineGapSize(BoundSize) only this method returns this for chaining multiple calls.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Parameters

gapSize String
The gap size that will override the gap size in the row/colum constraints if != null. E.g. “5px” or “unrel”. If null or "" the newline size will be set to the default size and turned on. This is different compared to #setNewlineGapSize(BoundSize).

Returns

this so it is possible to chain calls. E.g. new ComponentConstraint().noGrid().gap().fill().

wrap

public CC wrap()

Same functionality as calling #setWrap(boolean) with true only this method returns this for chaining multiple calls.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Returns

this so it is possible to chain calls. E.g. new ComponentConstraint().noGrid().gap().fill().

wrap

public CC wrap(String gapSize)

Same functionality as #setWrapGapSize(BoundSize) only this method returns this for chaining multiple calls.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Parameters

gapSize String
The gap size that will override the gap size in the row/colum constraints if != null. E.g. “5px” or “unrel”. If null or "" the wrap size will be set to the default size and turned on. This is different compared to #setWrapGapSize(BoundSize).

Returns

this so it is possible to chain calls. E.g. new ComponentConstraint().noGrid().gap().fill().

dockNorth

public CC dockNorth()

Same functionality as calling #setDockSide(int) with 0 only this method returns this for chaining multiple calls.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Returns

this so it is possible to chain calls. E.g. new ComponentConstraint().noGrid().gap().fill().

dockWest

public CC dockWest()

Same functionality as calling #setDockSide(int) with 1 only this method returns this for chaining multiple calls.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Returns

this so it is possible to chain calls. E.g. new ComponentConstraint().noGrid().gap().fill().

dockSouth

public CC dockSouth()

Same functionality as calling #setDockSide(int) with 2 only this method returns this for chaining multiple calls.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Returns

this so it is possible to chain calls. E.g. new ComponentConstraint().noGrid().gap().fill().

dockEast

public CC dockEast()

Same functionality as calling #setDockSide(int) with 3 only this method returns this for chaining multiple calls.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Returns

this so it is possible to chain calls. E.g. new ComponentConstraint().noGrid().gap().fill().

x

public CC x(String x)

Sets the x-coordinate for the component. This is used to set the x coordinate position to a specific value. The component bounds is still precalculated to the grid cell and this method should be seen as a way to correct the x position.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Parameters

x String
The x position as a UnitValue. E.g. “10” or “40mm” or “container.x+10”.

Returns

this so it is possible to chain calls. E.g. new ComponentConstraint().noGrid().gap().fill().

See also

y

public CC y(String y)

Sets the y-coordinate for the component. This is used to set the y coordinate position to a specific value. The component bounds is still precalculated to the grid cell and this method should be seen as a way to correct the y position.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Parameters

y String
The y position as a UnitValue. E.g. “10” or “40mm” or “container.x+10”.

Returns

this so it is possible to chain calls. E.g. new ComponentConstraint().noGrid().gap().fill().

See also

x2

public CC x2(String x2)

Sets the x2-coordinate for the component (right side). This is used to set the x2 coordinate position to a specific value. The component bounds is still precalculated to the grid cell and this method should be seen as a way to correct the x position.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Parameters

x2 String
The x2 side’s position as a UnitValue. E.g. “10” or “40mm” or “container.x2 - 10”.

Returns

this so it is possible to chain calls. E.g. new ComponentConstraint().noGrid().gap().fill().

See also

y2

public CC y2(String y2)

Sets the y2-coordinate for the component (bottom side). This is used to set the y2 coordinate position to a specific value. The component bounds is still precalculated to the grid cell and this method should be seen as a way to correct the y position.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Parameters

y2 String
The y2 side’s position as a UnitValue. E.g. “10” or “40mm” or “container.x2 - 10”.

Returns

this so it is possible to chain calls. E.g. new ComponentConstraint().noGrid().gap().fill().

See also

pos

public CC pos(String x, String y)

Same functionality as x) and y) toghether.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Parameters

x String
The x position as a UnitValue. E.g. “10” or “40mm” or “container.x+10”.
y String
The y position as a UnitValue. E.g. “10” or “40mm” or “container.x+10”.

Returns

this so it is possible to chain calls. E.g. new ComponentConstraint().noGrid().gap().fill().

pos

public CC pos(String x, String y, String x2, String y2)

Same functionality as x), y), y) and y) toghether.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Parameters

x String
The x position as a UnitValue. E.g. “10” or “40mm” or “container.x+10”.
y String
The y position as a UnitValue. E.g. “10” or “40mm” or “container.x+10”.
x2 String
The x2 side’s position as a UnitValue. E.g. “10” or “40mm” or “container.x2 - 10”.
y2 String
The y2 side’s position as a UnitValue. E.g. “10” or “40mm” or “container.x2 - 10”.

Returns

this so it is possible to chain calls. E.g. new ComponentConstraint().noGrid().gap().fill().

pad

public CC pad(int top, int left, int bottom, int right)

Same functionality as #setPadding(UnitValue[]) but the unit values as absolute pixels. This method returns this for chaining multiple calls.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Parameters

top int
The top padding that will be added to the y coordinate at the last stage in the layout.
left int
The top padding that will be added to the x coordinate at the last stage in the layout.
bottom int
The top padding that will be added to the y2 coordinate at the last stage in the layout.
right int
The top padding that will be added to the x2 coordinate at the last stage in the layout.

Returns

this so it is possible to chain calls. E.g. new ComponentConstraint().noGrid().gap().fill().

pad

public CC pad(String pad)

Same functionality as setPadding(ConstraintParser.parseInsets(pad, false))} only this method returns this for chaining multiple calls.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Parameters

pad String
The string to parse. E.g. “10 10 10 10” or “20”. If less than 4 groups the last will be used for the missing.

Returns

this so it is possible to chain calls. E.g. new ComponentConstraint().noGrid().gap().fill().

getHorizontal

public DimConstraint getHorizontal()

Returns the horizontal dimension constraint for this component constraint. It has constraints for the horizontal size and grow/shink priorities and weights.

Note! If any changes is to be made it must be made direct when the object is returned. It is not allowed to save the constraint for later use.

Returns

The current dimension constraint. Never null.

setHorizontal

public void setHorizontal(DimConstraint h)
Sets the horizontal dimension constraint for this component constraint. It has constraints for the horizontal size and grow/shrink priorities and weights.

Parameters

h DimConstraint
The new dimension constraint. If null it will be reset to new DimConstraint();

getVertical

public DimConstraint getVertical()

Returns the vertical dimension constraint for this component constraint. It has constraints for the vertical size and grow/shrink priorities and weights.

Note! If any changes is to be made it must be made direct when the object is returned. It is not allowed to save the constraint for later use.

Returns

The current dimension constraint. Never null.

setVertical

public void setVertical(DimConstraint v)
Sets the vertical dimension constraint for this component constraint. It has constraints for the vertical size and grow/shrink priorities and weights.

Parameters

v DimConstraint
The new dimension constraint. If null it will be reset to new DimConstraint();

getDimConstraint

public DimConstraint getDimConstraint(boolean isHor)

Returns the vertical or horizontal dim constraint.

Note! If any changes is to be made it must be made direct when the object is returned. It is not allowed to save the constraint for later use.

Parameters

isHor boolean
If the horizontal constraint should be returned.

Returns

The dim constraint. Never null.

getPos

public UnitValue[] getPos()

Returns the absolute positioning of one or more of the edges. This will be applied last in the layout cycle and will not affect the flow or grid positions. The positioning is relative to the parent and can not (as padding) be used to adjust the edges relative to the old value. May be null and elements may be null. null value(s) for the x2 and y2 will be interpreted as to keep the preferred size and thus the x1 and x2 will just absolutely positions the component.

Note that #setBoundsInGrid(boolean) changes the interpretation of thisproperty slightly.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Returns

The current value as a new array, free to modify.

setPos

public void setPos(UnitValue[] pos)

Sets absolute positioning of one or more of the edges. This will be applied last in the layout cycle and will not affect the flow or grid positions. The positioning is relative to the parent and can not (as padding) be used to adjust the edges relative to the old value. May be null and elements may be null. null value(s) for the x2 and y2 will be interpreted as to keep the preferred size and thus the x1 and x2 will just absolutely positions the component.

Note that #setBoundsInGrid(boolean) changes the interpretation of thisproperty slightly.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Parameters

pos UnitValue[]
UnitValue[] {x, y, x2, y2}. Must be null or of length 4. Elements can be null.

isBoundsInGrid

public boolean isBoundsInGrid()

Returns if the absolute pos value should be corrections to the component that is in a normal cell. If false the value of pos is truly absolute in that it will not affect the grid or have a default bounds in the grid.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Returns

The current value.

See also

getCellX

public int getCellX()

Returns the absolute cell position in the grid or -1 if cell positioning is not used.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Returns

The current value.

setCellX

public void setCellX(int x)

Set an absolute cell x-position in the grid. If >= 0 this point points to the absolute cell that this constaint’s component should occupy. If there’s already a component in that cell they will split the cell. The flow will then continue after this cell.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Parameters

x int
The x-position or -1 to disable cell positioning.

getCellY

public int getCellY()

Returns the absolute cell position in the grid or -1 if cell positioning is not used.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Returns

The current value.

setCellY

public void setCellY(int y)

Set an absolute cell x-position in the grid. If >= 0 this point points to the absolute cell that this constaint’s component should occupy. If there’s already a component in that cell they will split the cell. The flow will then continue after this cell.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Parameters

y int
The y-position or -1 to disable cell positioning.

getDockSide

public int getDockSide()

Sets the docking side. -1 means no docking.

Valid sides are: north = 0, west = 1, south = 2, east = 3.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Returns

The current side.

setDockSide

public void setDockSide(int side)

Sets the docking side. -1 means no docking.

Valid sides are: north = 0, west = 1, south = 2, east = 3.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Parameters

side int
-1 or 0-3.

isExternal

public boolean isExternal()

Returns if this component should have its bounds handled by an external source and not this layout manager.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Returns

The current value.

setExternal

public void setExternal(boolean b)

If this boolean is true this component is not handled in any way by the layout manager and the component can have its bounds set by an external handler which is normally by the use of some component.setBounds(x, y, width, height) directly (for Swing).

The bounds will not affect the minimum and preferred size of the container.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Parameters

b boolean
true means that the bounds are not changed.

getFlowX

public Boolean getFlowX()

Returns if the flow in the cell is in the horizontal dimension. Vertical if false. Only the first component is a cell can set the flow.

If null the flow direction is inherited by from the net.miginfocom.layout.LC.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Returns

The current value.

setFlowX

public void setFlowX(Boolean b)

Sets if the flow in the cell is in the horizontal dimension. Vertical if false. Only the first component is a cell can set the flow.

If null the flow direction is inherited by from the net.miginfocom.layout.LC.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Parameters

b Boolean
Boolean.TRUE means horizontal flow in the cell.

getHideMode

public int getHideMode()
Sets how a component that is hidden (not visible) should be treated by default. For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Returns

The mode:

0 == Normal. Bounds will be calculated as if the component was visible.

1 == If hidden the size will be 0, 0 but the gaps remain.

2 == If hidden the size will be 0, 0 and gaps set to zero.

3 == If hidden the component will be disregarded completely and not take up a cell in the grid..

setHideMode

public void setHideMode(int mode)
Sets how a component that is hidden (not visible) should be treated by default.

Parameters

mode int

The mode:

0 == Normal. Bounds will be calculated as if the component was visible.

1 == If hidden the size will be 0, 0 but the gaps remain.

2 == If hidden the size will be 0, 0 and gaps set to zero.

3 == If hidden the component will be disregarded completely and not take up a cell in the grid..

getId

public String getId()

Returns the id used to reference this component in some constraints.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Returns

The id or null. May consist of a groupID and a componentID which are separated by a dot: “.”. E.g. “grp1.id1”. The dot should never be first or last if present.

setId

public void setId(String id)

Sets the id used to reference this component in some constraints.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Parameters

id String
The id or null. May consist of a groupID and a componentID which are separated by a dot: “.”. E.g. “grp1.id1”. The dot should never be first or last if present.

getPadding

public UnitValue[] getPadding()

Returns the absolute resizing in the last stage of the layout cycle. May be null and elements may be null.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Returns

The current value. null or of length 4.

setPadding

public void setPadding(UnitValue[] sides)

Sets the absolute resizing in the last stage of the layout cycle. These values are added to the edges and can thus for instance be used to grow or reduce the size or move the component an absolute number of pixels. May be null and elements may be null.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Parameters

sides UnitValue[]
top, left, bottom right. Must be null or of length 4.

getVisualPadding

public UnitValue[] getVisualPadding()

Returns the visual padding used when laying out this Component. May be null and elements may be null.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Returns

The current value. null or of length 4.

setVisualPadding

public void setVisualPadding(UnitValue[] sides)

Sets the visual padding used when laying out this Component.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Parameters

sides UnitValue[]
top, left, bottom right. Must be null or of length 4.

getSkip

public int getSkip()

Returns how many cells in the grid that should be skipped before the component that this constraint belongs to.

Note that only the first component will be checked for this property.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Returns

The current value. 0 if no skip.

setSkip

public void setSkip(int cells)

Sets how many cells in the grid that should be skipped before the component that this constraint belongs to.

Note that only the first component will be checked for this property.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Parameters

cells int
How many cells in the grid that should be skipped before the component that this constraint belongs to

getSpanX

public int getSpanX()

Returns the number of cells the cell that this constraint’s component will span in the indicated dimension. 1 is default and means that it only spans the current cell. LayoutUtil.INF is used to indicate a span to the end of the column/row.

Note that only the first component will be checked for this property.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Returns

The current value.

setSpanX

public void setSpanX(int cells)

Sets the number of cells the cell that this constraint’s component will span in the indicated dimension. 1 is default and means that it only spans the current cell. LayoutUtil.INF is used to indicate a span to the end of the column/row.

Note that only the first component will be checked for this property.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Parameters

cells int
The number of cells to span (i.e. merge).

getSpanY

public int getSpanY()

Returns the number of cells the cell that this constraint’s component will span in the indicated dimension. 1 is default and means that it only spans the current cell. LayoutUtil.INF is used to indicate a span to the end of the column/row.

Note that only the first component will be checked for this property.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Returns

The current value.

setSpanY

public void setSpanY(int cells)

Sets the number of cells the cell that this constraint’s component will span in the indicated dimension. 1 is default and means that it only spans the current cell. LayoutUtil.INF is used to indicate a span to the end of the column/row.

Note that only the first component will be checked for this property.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Parameters

cells int
The number of cells to span (i.e. merge).

getPushX

public Float getPushX()

“pushx” indicates that the column that this component is in (this first if the component spans) should default to growing. If any other column has been set to grow this push value on the component does nothing as the column’s explicit grow weight will take precedence. Push is normally used when the grid has not been defined in the layout.

If multiple components in a column has push weights set the largest one will be used for the column.

Returns

The current push value. Default is null.

setPushX

public void setPushX(Float weight)

“pushx” indicates that the column that this component is in (this first if the component spans) should default to growing. If any other column has been set to grow this push value on the component does nothing as the column’s explicit grow weight will take precedence. Push is normally used when the grid has not been defined in the layout.

If multiple components in a column has push weights set the largest one will be used for the column.

Parameters

weight Float
The new push value. Default is null.

getPushY

public Float getPushY()

“pushx” indicates that the row that this component is in (this first if the component spans) should default to growing. If any other row has been set to grow this push value on the component does nothing as the row’s explicit grow weight will take precedence. Push is normally used when the grid has not been defined in the layout.

If multiple components in a row has push weights set the largest one will be used for the row.

Returns

The current push value. Default is null.

setPushY

public void setPushY(Float weight)

“pushx” indicates that the row that this component is in (this first if the component spans) should default to growing. If any other row has been set to grow this push value on the component does nothing as the row’s explicit grow weight will take precedence. Push is normally used when the grid has not been defined in the layout.

If multiple components in a row has push weights set the largest one will be used for the row.

Parameters

weight Float
The new push value. Default is null.

getSplit

public int getSplit()

Returns in how many parts the current cell (that this constraint’s component will be in) should be split in. If for instance it is split in two, the next component will also share the same cell. Note that the cell can also span a number of cells, which means that you can for instance span three cells and split that big cell for two components. Split can be set to a very high value to make all components in the same row/column share the same cell (e.g. LayoutUtil.INF).

Note that only the first component will be checked for this property.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Returns

The current value.

setSplit

public void setSplit(int parts)

Sets in how many parts the current cell (that this constraint’s component will be in) should be split in. If for instance it is split in two, the next component will also share the same cell. Note that the cell can also span a number of cells, which means that you can for instance span three cells and split that big cell for two components. Split can be set to a very high value to make all components in the same row/column share the same cell (e.g. LayoutUtil.INF).

Note that only the first component will be checked for this property.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Parameters

parts int
The number of parts (i.e. component slots) the cell should be divided into.

getTag

public String getTag()

Tags the component with metadata. Currently only used to tag buttons with for instance “cancel” or “ok” to make them show up in the correct order depending on platform. See PlatformDefaults#setButtonOrder(String) for information.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Returns

The current value. May be null.

setTag

public void setTag(String tag)

Optinal tag that gives more context to this constraint’s component. It is for instance used to tag buttons in a button bar with the button type such as “ok”, “help” or “cancel”.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Parameters

tag String
The new tag. May be null.

isWrap

public boolean isWrap()

Returns if the flow should wrap to the next line/column after the component that this constraint belongs to.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Returns

The current value.

setWrap

public void setWrap(boolean b)

Sets if the flow should wrap to the next line/column after the component that this constraint belongs to.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Parameters

b boolean
true means wrap after.

getWrapGapSize

public BoundSize getWrapGapSize()
Returns the wrap size if it is a custom size. If wrap was set to true with #setWrap(boolean) then this method will return null since that means that the gap size should be the default one as defined in the rows spec.

Returns

The custom gap size. NOTE! Will return null for both no wrap and default wrap.

setWrapGapSize

public void setWrapGapSize(BoundSize s)
Set the wrap size and turns wrap on if != null.

Parameters

s BoundSize
The custom gap size. NOTE! null will not turn on or off wrap, it will only set the wrap gap size to “default”. A non-null value will turn on wrap though.

isNewline

public boolean isNewline()

Returns if the flow should wrap to the next line/column before the component that this constraint belongs to.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Returns

The current value.

setNewline

public void setNewline(boolean b)

Sets if the flow should wrap to the next line/column before the component that this constraint belongs to.

For a more thorough explanation of what this constraint does see the white paper or cheat Sheet at www.migcomponents.com.

Parameters

b boolean
true means wrap before.

getNewlineGapSize

public BoundSize getNewlineGapSize()
Returns the newline size if it is a custom size. If newline was set to true with #setNewline(boolean) then this method will return null since that means that the gap size should be the default one as defined in the rows spec.

Returns

The custom gap size. NOTE! Will return null for both no newline and default newline.

setNewlineGapSize

public void setNewlineGapSize(BoundSize s)
Set the newline size and turns newline on if != null.

Parameters

s BoundSize
The custom gap size. NOTE! null will not turn on or off newline, it will only set the newline gap size to “default”. A non-null value will turn on newline though.