Note that LayoutUtil.setDesignTime(ContainerWrapper, boolean) should be set to true for this class'
methods to work.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final UnitValueA direct reference to the corresponding value for predefined UnitValues inUnitValue.static final UnitValueA direct reference to the corresponding value for predefined UnitValues inUnitValue.static final UnitValueA direct reference to the corresponding value for predefined UnitValues inUnitValue.static final UnitValueA direct reference to the corresponding value for predefined UnitValues inUnitValue.static final UnitValueA direct reference to the corresponding value for predefined UnitValues inUnitValue.static final UnitValueA direct reference to the corresponding value for predefined UnitValues inUnitValue.static final UnitValueA direct reference to the corresponding value for predefined UnitValues inUnitValue.static final UnitValueA direct reference to the corresponding value for predefined UnitValues inUnitValue.static final UnitValueA direct reference to the corresponding value for predefined UnitValues inUnitValue.static final UnitValueA direct reference to the corresponding value for predefined UnitValues inUnitValue.static final UnitValueA direct reference to the corresponding value for predefined UnitValues inUnitValue. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic int[][]getColumnSizes(Object parentContainer) Returns the sizes of the columns and gaps for a container.static final StringgetConstraintString(AC ac, boolean asAPI, boolean isCols) Returns the a constraint string that can be re-parsed to be the exact same AxisConstraint.static final StringgetConstraintString(CC cc, boolean asAPI) Returns the a constraint string that can be re-parsed to be the exact same LayoutConstraint.static final StringgetConstraintString(LC lc, boolean asAPI) Returns the a constraint string that can be re-parsed to be the exact same LayoutConstraint.getGridPositions(Object parentContainer) Returns the grid cells that the components inparentContainerhas.Returns the version of IDEUtilstatic int[][]getRowSizes(Object parentContainer) Returns the sizes of the rows and gaps for a container.
-
Field Details
-
ZERO
A direct reference to the corresponding value for predefined UnitValues inUnitValue. -
TOP
A direct reference to the corresponding value for predefined UnitValues inUnitValue. -
LEADING
A direct reference to the corresponding value for predefined UnitValues inUnitValue. -
LEFT
A direct reference to the corresponding value for predefined UnitValues inUnitValue. -
CENTER
A direct reference to the corresponding value for predefined UnitValues inUnitValue. -
TRAILING
A direct reference to the corresponding value for predefined UnitValues inUnitValue. -
RIGHT
A direct reference to the corresponding value for predefined UnitValues inUnitValue. -
BOTTOM
A direct reference to the corresponding value for predefined UnitValues inUnitValue. -
LABEL
A direct reference to the corresponding value for predefined UnitValues inUnitValue. -
INF
A direct reference to the corresponding value for predefined UnitValues inUnitValue. -
BASELINE_IDENTITY
A direct reference to the corresponding value for predefined UnitValues inUnitValue.
-
-
Constructor Details
-
IDEUtil
public IDEUtil()
-
-
Method Details
-
getIDEUtilVersion
Returns the version of IDEUtil- Returns:
- The version.
-
getGridPositions
Returns the grid cells that the components inparentContainerhas.- Parameters:
parentContainer- The parent container. It is an object since MigLayout is GUI toolkit independent.- Returns:
- A new hashmap with the components mapped to an array [x, y, spanx, spany].
Dock components will always have x and y less than -30000 or more than 30000. This is since they are actually part of the grid, but on the outer edges.
Components that span the "rest of the row/column" have really large span values. Actually 30000-x or 30000-y.
Generally, the grid does not need to have the upper left at 0, 0. Though it normally does if you don't set the cells explicitly to other values. Rows and columns that are completely empty and that does not have an explicit row/column constraint will be totally disregarded.
-
getRowSizes
Returns the sizes of the rows and gaps for a container. There will be two arrays returned [0] and [1].The first array will be the indexes of the rows where indexes that are less than 30000 or larger than 30000 is docking rows. There might be extra docking rows that aren't visible but they always have size 0. Non docking indexes will probably always be 0, 1, 2, 3, etc..
The second array is the sizes of the form:
[left inset][row size 1][gap 1][row size 2][gap 2][row size n][right inset].The returned sizes will be the ones calculated in the last layout cycle.
- Parameters:
parentContainer- The container to retuern the row sizes and gaps for. In Swing it will be aContainerand in SWT it will be a.invalid reference
org.eclipse.swt.widgets.Composite- Returns:
- The sizes or
nullifLayoutUtil.isDesignTime(ContainerWrapper)isfalseorparentContainerdoes not have a MigLayout layout manager. The returned sizes will be the ones calculated in the last layout cycle. - See Also:
-
getColumnSizes
Returns the sizes of the columns and gaps for a container. There will be two arrays returned [0] and [1].The first array will be the indexes of the columns where indexes that are less than 30000 or larger than 30000 is docking columns. There might be extra docking columns that aren't visible but they always have size 0. Non docking indexes will probably always be 0, 1, 2, 3, etc..
The second array is the sizes of the form:
[top inset][column size 1][gap 1][column size 2][gap 2][column size n][bottom inset].The returned sizes will be the ones calculated in the last layout cycle.
- Parameters:
parentContainer- The container to retuern the column sizes and gaps for. In Swing it will be aContainerand in SWT it will be a.invalid reference
org.eclipse.swt.widgets.Composite- Returns:
- The sizes and indexes or
nullifLayoutUtil.isDesignTime(ContainerWrapper)isfalseorparentContainerdoes not have a MigLayout layout manager. The returned sizes will be the ones calculated in the last layout cycle. - See Also:
-
getConstraintString
Returns the a constraint string that can be re-parsed to be the exact same AxisConstraint.- Parameters:
ac- The axis constraint to return as a constraint string.asAPI- If the returned string should be of API type (e.g. .flowX().gap("rel").align("right")) or as a String type (e.g. "flowx, gap rel, right").isCols- The the constraint should be returned for columns rather than rows.- Returns:
- A String. Never
null.
-
getConstraintString
Returns the a constraint string that can be re-parsed to be the exact same LayoutConstraint.- Parameters:
cc- The component constraint to return as a constraint string.asAPI- If the returned string should be of API type (e.g. .flowX().gap("rel").align("right")) or as a String type (e.g. "flowx, gap rel, right").- Returns:
- A String. Never
null.
-
getConstraintString
Returns the a constraint string that can be re-parsed to be the exact same LayoutConstraint.- Parameters:
lc- The layout constraint to return as a constraint string.asAPI- If the returned string should be of API type (e.g. .flowX().gap("rel").align("right")) or as a String type (e.g. "flowx, gap rel, right").- Returns:
- A String. Never
null.
-