Class MigLayout
A very flexible layout manager.
Read the documentation that came with this layout manager for information on usage.
Deprecated
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor with no constraints.Constructor.Constructor.Constructor.Constructor.Constructor.Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddLayoutCallback(LayoutCallback callback) Adds the callback function that will be called at different stages of the layout cylce.voidaddLayoutComponent(Component comp, Object constraints) voidaddLayoutComponent(Object value, Component comp, Container c) Some layouts can optionally track the addition of elements with meta-data that allows the user to "hint" on object positioning.static <E> EReturns the column layout constraints either as aStringornet.miginfocom.layout.AC.Returns the optional component constraintReturns the component constraints as a String representation.Returns a shallow copy of the constraints map.floatgetLayoutAlignmentX(Container parent) floatgetLayoutAlignmentY(Container parent) Returns layout constraints either as aStringornet.miginfocom.layout.LCdepending what was sent in to the constructor or set with#setLayoutConstraints(Object).getPreferredSize(Container parent) Returns the container preferred sizeReturns the row layout constraints either as aStringornet.miginfocom.layout.AC.voidinvalidateLayout(Container target) booleanIf this method returns true, the addLayoutComponent method will be called when replacing a layout for every component within the containerbooleanReturns if this layout manager is currently managing this component.voidlayoutContainer(Container parent) Layout the given parent container childrenmaximumLayoutSize(Container parent) minimumLayoutSize(Container parent) Checks the parent window/popup if its size is within parameters as set by the LC.preferredLayoutSize(Container parent) voidremoveLayoutCallback(LayoutCallback callback) Removes the callback if it exists.voidRemoves the component from the layout this operation is only useful if the layout maintains references to components within itvoidsetColumnConstraints(Object constr) Sets the column layout constraints for the layout manager instance as a String.voidsetComponentConstraints(Component comp, Object constr) Sets the component constraint for the component that already must be handled by this layout manager.voidsetConstraintMap(Map<Component, Object> map) Sets the constraints map.voidsetLayoutConstraints(Object constr) Sets the layout constraints for the layout manager instance as a String.voidsetRowConstraints(Object constr) Sets the row layout constraints for the layout manager instance as a String.Methods inherited from class Layout
cloneConstraint, equals, getChildrenInTraversalOrder, hashCode, isOverlapSupported, obscuresPotential, overridesTabIndices, updateTabIndices
-
Constructor Details
-
MigLayout
public MigLayout()Constructor with no constraints. -
MigLayout
Constructor.
Parameters
layoutConstraints: @param layoutConstraints The constraints that concern the whole layout.nullwill be treated as "".
-
MigLayout
Constructor.
Parameters
-
layoutConstraints: @param layoutConstraints The constraints that concern the whole layout.nullwill be treated as "". -
colConstraints: @param colConstraints The constraints for the columns in the grid.nullwill be treated as "".
-
-
MigLayout
Constructor.
Parameters
-
layoutConstraints: @param layoutConstraints The constraints that concern the whole layout.nullwill be treated as "". -
colConstraints: @param colConstraints The constraints for the columns in the grid.nullwill be treated as "". -
rowConstraints: @param rowConstraints The constraints for the rows in the grid.nullwill be treated as "".
-
-
MigLayout
Constructor.
Parameters
layoutConstraints: @param layoutConstraints The constraints that concern the whole layout.nullwill be treated as an empty constraint.
-
MigLayout
Constructor.
Parameters
-
layoutConstraints: @param layoutConstraints The constraints that concern the whole layout.nullwill be treated as an empty constraint. -
colConstraints: @param colConstraints The constraints for the columns in the grid.nullwill be treated as an empty constraint.
-
-
MigLayout
Constructor.
Parameters
-
layoutConstraints: @param layoutConstraints The constraints that concern the whole layout.nullwill be treated as an empty constraint. -
colConstraints: @param colConstraints The constraints for the columns in the grid.nullwill be treated as an empty constraint. -
rowConstraints: @param rowConstraints The constraints for the rows in the grid.nullwill be treated as an empty constraint.
-
-
-
Method Details
-
findType
-
getLayoutConstraints
Returns layout constraints either as a
Stringornet.miginfocom.layout.LCdepending what was sent in to the constructor or set with#setLayoutConstraints(Object).Returns
- Returns:
- The layout constraints either as a
Stringornet.miginfocom.layout.LCdepending what was sent in to the constructor or set with#setLayoutConstraints(Object). Nevernull.
-
setLayoutConstraints
Sets the layout constraints for the layout manager instance as a String.
See the class JavaDocs for information on how this string is formatted.
Parameters
constr: @param constr The layout constraints as a String prnet.miginfocom.layout.LCrepresentation.nullis converted to""for storage.
Throws
RuntimeException: if the constraint was not valid.
-
getColumnConstraints
Returns the column layout constraints either as a
Stringornet.miginfocom.layout.AC.Returns
- Returns:
- The column constraints either as a
Stringornet.miginfocom.layout.ACdepending what was sent in to the constructor or set with#setColumnConstraints(Object). Nevernull.
-
setColumnConstraints
Sets the column layout constraints for the layout manager instance as a String.
See the class JavaDocs for information on how this string is formatted.
Parameters
constr: @param constr The column layout constraints as a String ornet.miginfocom.layout.ACrepresentation.nullis converted to""for storage.
Throws
RuntimeException: if the constraint was not valid.
-
getRowConstraints
Returns the row layout constraints either as a
Stringornet.miginfocom.layout.AC.Returns
- Returns:
- The row constraints either as a
Stringornet.miginfocom.layout.ACdepending what was sent in to the constructor or set with#setRowConstraints(Object). Nevernull.
-
setRowConstraints
Sets the row layout constraints for the layout manager instance as a String.
See the class JavaDocs for information on how this string is formatted.
Parameters
constr: @param constr The row layout constraints as a String ornet.miginfocom.layout.ACrepresentation.nullis converted to""for storage.
Throws
RuntimeException: if the constraint was not valid.
-
getConstraintMap
-
setConstraintMap
-
getComponentConstraints
Returns the component constraints as a String representation. This string is the exact string as set with
Object)or set when adding the component to the parent component.See the class JavaDocs for information on how this string is formatted.
Parameters
comp: The component to return the constraints for.
Returns
- Returns:
- The component constraints as a String representation or
nullif the component is not registered with this layout manager. The returned values is either a String or anet.miginfocom.layout.CCdepending on what constraint was sent in when the component was added. May benull.
-
setComponentConstraints
Sets the component constraint for the component that already must be handled by this layout manager.
See the class JavaDocs for information on how this string is formatted.
Parameters
-
constr: @param constr The component constraints as a String ornet.miginfocom.layout.CC.nullis ok. -
comp: The component to set the constraints for.
Throws
-
RuntimeException: if the constraint was not valid. -
IllegalArgumentException: @throws IllegalArgumentException If the component is not handling the component.
-
-
isManagingComponent
Returns if this layout manager is currently managing this component.
Parameters
c: @param c The component to check. Ifnullthenfalsewill be returned.
Returns
If this layout manager is currently managing this component.
-
addLayoutCallback
Adds the callback function that will be called at different stages of the layout cylce.
Parameters
callback: The callback. Notnull.
-
removeLayoutCallback
Removes the callback if it exists.
Parameters
callback: The callback. May benull.
-
layoutContainer
Description copied from class:LayoutLayout the given parent container children
Parameters
parent: the given parent container
- Specified by:
layoutContainerin classLayout
-
minimumLayoutSize
-
preferredLayoutSize
-
maximumLayoutSize
-
getLayoutAlignmentX
-
getLayoutAlignmentY
-
addLayoutComponent
Description copied from class:LayoutSome layouts can optionally track the addition of elements with meta-data that allows the user to "hint" on object positioning.
Parameters
-
value: optional meta data information, like alignment orientation -
comp: the added component to the layout -
c: the parent container
- Overrides:
addLayoutComponentin classLayout
-
-
addLayoutComponent
-
isConstraintTracking
public boolean isConstraintTracking()Description copied from class:LayoutIf this method returns true, the addLayoutComponent method will be called when replacing a layout for every component within the container
Returns
false by default
- Overrides:
isConstraintTrackingin classLayout
-
getComponentConstraint
Description copied from class:LayoutReturns the optional component constraint
Parameters
comp: the component whose constraint should be returned
Returns
the optional component constraint
- Overrides:
getComponentConstraintin classLayout
-
removeLayoutComponent
Description copied from class:LayoutRemoves the component from the layout this operation is only useful if the layout maintains references to components within it
Parameters
comp: the removed component from layout
- Overrides:
removeLayoutComponentin classLayout
-
invalidateLayout
-
getPreferredSize
Description copied from class:LayoutReturns the container preferred size
Parameters
parent: the parent container
Returns
the container preferred size
- Specified by:
getPreferredSizein classLayout
-