MiG Layout Change Log
Release 3.5.4
- IDEUtil: wmax, hmax, wmin and hmin returned erratic strings.
- IDEUtil: Added option to get which cells in the layout grid the components end up in. Good for IDE Integrators.
Release 3.5.3
- Fixed: If aligny baseline was specified for a textfield component it might get x and w that were wrong. Thanks Konstantin Scheglov - Instantiations, SwingDesigner
- Fixed: TextFields in a baseline does not align the first layout if it has size 0, 0 before. Thanks Konstantin Scheglov - Instantiations, SwingDesigner
Release 3.5.2
- Fixed: A non-Baseline aware component does not get vertically aligned correctly with other baselined components.
Release 3.5.1
- Changed so that the old default row vertical alignment can be set back to CENTER using PlatformDefaults.setDefaultRowAlignmentBaseline(false) instead.
Release 3.5
The release is mainly targeted to improve the reported preferred size of the panel. This is especially important when creating dialogs and when there is components where the
preferred size depends on the width, such as for text components that has auto wrapping text. Functionality has beed added to both do better calculations and where this
is not possible manually specify the reported size in either dimension.
- Improved the panel preferred size calculations when there is absolute positioned components that are linked to the position of other components (absolute or not).
Previously these components did not affect the preferred size since a full layout cycle is needed to calculate this.
It should be noted that it is easy to create situations where the preferred size is impossible to determine in a well defined way. For instance if a component is
liked to be on the right side of a east docked component. Both components are declared to be at the right most pixel in the panel though only one can be there.
- Improved the panel preferred size calculations when there is components where the preferred height depends on the actual width (E.g. TextComponents).
This now also works in Swing. SWT has built in support for this. Panels that have for instance JTextAreas with wrapping text will now get the correct
initial preferred size.
- Added auto packing the parent window (Frame or Dialog) by th introduction of the "pack" keyword. This is more flexible than listening on changes in the indiviual
components since it can be done as a bi-product of the layout process. One can also specify min/max size in all type of usits as well as only packing in on of the
dimensions. Also, it is posible to add ":push" to the BoundSize declaration so that the window will only increase its size but not reduce it if the preferred
size of the panel gets smaller. The alignment arguments can be used to decide in which direction the window should expand.
This functionality is good for creating Mac OS X type of property windows that expands/reduces to the size of its components depending on which panel that is shown.
- Added "width", "wmin", "wmax", "height", "hmin", "hmax" to the Layout Constraint (LC) so that the container being layed out can be restricted better.
They work the same way as in the corresponding Component Constraints and thus accepts a BoundSize (e.g. "10px", "10:20:30" or "10cm!").
Note that the parent layout manager above the one this is set on must respect these values. If you use MigLayout there as well there is no
problem since it adheres to all constraints.
This new fuctionality is good if you do not want to decide the size of the panel/container only depending on its
contained components, but also/only by specifying the size directly on the panel/container.
- Fixed a bug introduced in 3.5 beta that made wrapping components (components where the height depends on the width actually) not get the correct height. It should be noted
that it is always, and will always be, necessary to explicitly set the minimum width for Swing text components. The reason is that they change their minimum width
to be correct with the latest height as a fix for Swing not having a way to ask 'What is your height given xxx width?'. E.g add 'wmin 0' to the component constraint to fix
the problem with Swing text components not reducing their width to the container's width.
- Changed the default row alignment to BASELINE. This will make labels and other component line up better (easier reading and eye tracking) when using the Java 6. The alignment will revert back to CENTER
for pre Java 6 environments. To set the default alignment back to CENTER, if you want the pre v3.5 alignment, use PlatformDefaults.setDefaultRowAlignment(false).
- Fixed a couple of formatting bugs in IDEUtil.
- Fixed a bug that made components spanning multiple columns not set the minimum size on those columns correctly.
- All values interacting with the Toolkit is now guarded for HeadlessExceptions and will return default values if headless.
- Fixed an SWT resize and validation bug.
- Made "nocache" default to make development simpler.
- Fixed a vertical alignent/size bug introduced Release Candidate 1. Thanks Ingo Kegel, ej-technologies.
Release 3.0.3
- Changed the Mac OS X default gaps to compensate for the in-component white space that most Aqua components have. This made the
actual visual gap more correct according to the Mac Style Guide.
- Fixed a bug that threw a NPE if "debug" was set on a component that did not have a parent and then the preferred size was asked for.
Release 3.0.2
- Fixed a bug that HTML enabled baseline aligned JLabels too high under Java 6.
Release 3.0.1
- Fixed a bug that caused the LC.gridGapY(..) not work. This happened only for the API version.
Release 3.0
- Logical pixel sizes (default unit) can now depend on by Java reported DPI value of screen, an explicitly set scale factor or the relative font size of the container. See PlatformDefaults.setLogicalPixelBase(int).
- Default unit changed to logical pixels (UnitValue.LPX and UnitValue.LPY). This means that when no unit is specified (e.g. "width 100") the size will scale with DPI. It can be set to UnitValue.PIXEL in PlatformDefaults to always be actual pixel sizes and thus non-HiDPI compliant.
- Performance improvement when the container's size changes constantly, such as with window resizing. New performance is about 3000 layout cycles per second for a normal dialog on an 1.8GHz laptop.
- Improved resolution independence calculations and added explicit scale factor setting in PlatformDefaults.
- Removed UnitValue.setScreenDPIAdjustmentFactor(..) since it is no longer needed (see above).
- Added "dock center" to simplify docking with a center panel.
- Bugfix: Column/Row constraint's max size was not adhered to in some circumstances.
Release 2.5.5
- Fixed a Swing performance regression bug introduced in v2.3 when using many components in nested MigLayout panels.
Release 2.5.4
- Fixed incorrect debug painting bounds when using Right-to-left or Botton-to-top layout ordering.
Release 2.5.3
- Fixed correct margin (trim) handling for "Scrollable" SWT controls. Visible in Text SWT widgets with SWT.WRAP set.
- Fixed wrapping problem with StyledText SWT widget. Regression from 2.5.2.
Release 2.5.2
- Fixed so that Controls in SWT uses the "width" hint when doing the layout. This will make Text layout not need two layout cycles to get the correct size.
Release 2.5.1
- Compensated for when the minimum width was set below the preferred width when using button bars.
- Fixed a NullPointerException when using "debug" keyword.
Release 2.5
- Added option to specify the row (or column if "flowy") gap size for "wrap" and "newline" in the component constraints. This will decrease the number of times you need to use row/columns constraints to only set the gaps. E.g "wrap 15px" or "wrap push".
- When using docking components the insets are now defaulting to 0 for the layout. This is more logical since a docking component seldom needs insets. If explicitly setting insets in a docking layout the insets will be between the docking components and the normal components in the middle.
- Added option to specify the gaps before the first and after the last row/column the row/column constraints. E.g. "10[][][]20". This will override the insets in that dimension.
- Fixed a problem with new parent size and cached values for SWT.
Release 2.4.1
- Changed so that rows/columns with preferred size set less than the minimum size has its preferred size set to the minimum size.
Release 2.4
- Added the LayoutCallback abstract class that can be extended to dynamically change/affect the size and position of component within the layout cycle.
- Added new demo that shows some of the functionality of the LayoutCallback.
- Renamed isBoundsIsGrid() to isBoundsInGrid() in CC.
- Made "external" also affect the minimum/preferred size of the container.
- Fixed a bug with docking components in certain combinations.
Release 2.3
- Speed improvement in Swing version.
- Massive speed improvement for the SWT version. In nested layouts the speed improvent is approx (max nesting level) exp 7! The nesting slowdown was due to a bug. Thanks Henning.
Release 2.2.6
- Bugfix: If only one button in a "button" tagged cell (with target platform reordering) was used an OK button would be left instead of right aligned.
- Bugfix: When using component constraint "span" without column count (which means to the end of the row) together with "dock east" the spanned cell/component was laid out over/under the docked component. This also happened when using "nogrid" row/layout constraint with the "dock east" constraint.
Release 2.2.5
- Bugfix: When a component's name contained a period (.) the Grid class threw a NPE in some cases.
Release 2.2.4
- Fixed a problem with unstable (jumping) right corners when old-type gap, e.g "gap unrelated:inf" was used.
- Added size hints for the "other" dimension than the asked for. This is supported in SWT but not Swing. Make sure you set the minimum size (e.g. "wmin 100") though.
- Fixed a bug in the SWT Demo that threw an exception when resizing the main window. (If anyone can understand why there's a 0.5 sec lag when selecting a new element from the west list until the panel is shown, plese contact me).
- Fixed an exception in the SWTDemo/Docking that occurs since 2.2.2
- Added option to install an InCellGapProvider on PlatformDefaults. It can dynamically, for instance depending on component type, set default gaps between components within the same cell.
Release 2.2.3
- Improved row/column sizing when a spanning component is pushing rows/colums apart becase is has a larger minimum/preferred size. Now works with "push"ing components and the last row/column will be resized if no specific "grow" row/column exist.
Release 2.2.2
- Fixed a NPE when using identical button tags.
Release 2.2.1
- Fixed a bug that added a gap before and after buttons automatic button handling cells. Thanks Ingo Kegel from ej-technologies.
- Fixed a bug that threw an IndexOutOfBounds in some cases.
- Fixed a bug regarding pushing gaps before first and after last component in a cell.
- Exposed the UnitValue class to "public" so that they are more easily recreated. This is for the automatic layout creators that is currently using MiG Layout.
- Added another constructor that makes sense now that grid and row constaints are not needed as often.
- Added a lot of missing JavaDoc for the SWT version of MiG Layout.
- Fixed a bug where gaps for rows/columns was sligtly off if specified explicitly but less than actuall rows/column count.
- Modified the design time property of LayoutUtil to default to Beans.isDesignTime() if the LayoutUtil.setDesignTime() never been called. This is so that XML persistence will work by default in IDEs.
Release 2.2
- Gap handing has been simplified and made much more flexible through the introduction of the "push" addition to a gap size. Push (eg "gap push", "gap 10:10:100:push" or "gap unrel!:push") means that
the gap should be greedy and get any extra space that is available. It will thus push components within a cell and/or rows/columns away in a similar way as alignment, but with greater flexibility. "push" in pre v2.2
worked by setting a preferred value to a high value but that did not work for insatnce if the container was in a scroll pane. Gap pushes for components in a cell will not force the cell bigger, however push gaps
for columns/rows will.
- The number of times that a grid's rows/columns need to be specified explicitly just to make it "grow" has been reduced. First, if one uses "fill" on the layout constraints will make
the components "grow weight" will now migrate to the column/row it is in, unless that has been set explicitly on any row/column. Also, the introduction of the "push" keyword for
components will make allow a row/column "grow" even if "fill" has not been set on the layout constraints, just by adding a "push(x/y) [weight]" keyword to the component constraints.
- IDEUtil did not produce correct API code for components spanning both rows and columns.
- Minor speed improvements.
Release 2.1.5
- Changed so that max size set will take precendece over minimum and preferred. Rationale being that max is always explicitly set but minimum size is usually implicit.
- Some speed improvements.
- NullPointerException in SWT when using "debug" and the Composite's parent is the Dispaly. Thanks Johan Kannala.
- 1.5 dependency in the SWT 1.4-only version caused a NoSuchMethodException when using the "debug" keyword. Thanks Johan Kannala.
- In SWT the actual current visibility (compare Swing's isShowing) was used rather than the visibility flag (isVisible vs getVisible) when interpreting hidemode. Thanks Johan Kannala.
Release 2.1.4
- Again thanks Karl Tauber from JFormDesigner for the following fixes:
- Made some code improvements for speed and memory footprint.
- Changed the API for design time so that it can be set per container and not just globally.
- Fixed a leftToRight lookup bug and moved if from the component to container interface.
- Changed to a more consistent alignment if multiple alignments are set on a row/column.
- Fixed a bug where "growy" wasn't adhered to if the row had default "baseline" alignment.
- Documentation for "gap" had the arguments wrong.
- Alignment and "fill" are now picked up from the first row/column also if the component is spanning multiple cells.
Release 2.1.3
- Thanks Karl Tauber from JFormDesigner for the following fixes:
- Fixed a bug when there were empty column/row constrains and absolute cell references.
- Made it possible to use "button" size for column sizes as well and not only for component sizes.
- Some IDEUtil code formatting fixes and made IDEUtil Java 1.4 compatible.
Release 2.1.2
- Fixed bugs in Swing Demo and added "use" information for JavaDoc. Thanks Karl Tauber from JFormDesigner
Release 2.1.1
- Fixed a bug that made align keywords (e.g. "top") in the LayoutConstraint not work without the "align" keyword, which it should according to the documentation.
Release 2.1
- Improved the support for "x", "y", "x2" and "y2" absolute positioning/corrections. Thanks Ingo Kegel from ej-technologies.
- Fixed: Preferred size of container is sometimes not correct when using absolute postions.
Release 2.0.7
- Added debug outline paint for the top container as well. Thanks Kuznetsov Alexey.
Release 2.0.6
- Fixed: Alignment using API was not working for the LC (LayoutConstraint).
Release 2.0.5
- Fixed: Java 1.5 dependency removed in 1.4 version.
Release 2.0.4
- Fixed: Documentation discrepency for grow priority. (Thanks Richard West, Advanced Micro Devices)
- Fixed: Setting a specific span value did not wrap to next line if last component. (Thanks Richard West, Advanced Micro Devices)
Release 2.0.3
- Fixed: CC.align("right") did not work.
Release 2.0.2
- IDEUtil enhancements and big fixes.
- Fixed a "Widget already disposed" problem in the SWT version.
- Added "align label" that aligns labels according to platform. Currently right aligned on Mac OS X and left aligned on all other platforms.
Release 2.0.1
- Added so that "cell" can be used to specify spanning as well. E.g. "cell 1 1 2 2" will put the component in column 1 and row 1 spanning 2 columns and 2 rows.
Release 2.0
- Added building of all types of constraints via API. This makes code such as
new XxxConsr().fill().gap("10px").size("100"); possible.
- Added optional IDEUtil class that can produce both API-type source code and constraints Strings from all types of constraints. This helps the
IDE creators to add support for MiG Layout.
- Added a JSE 1.5 version that has varargs for the column/row indexes in the constraints API.
- Added "push" keyword for row/column size that means that the column/row will take all space that is left.
- Added support for empty rows/columns that can be used as gaps.
- Added better docking behavior.
- Numerous Bugs fixed.
Release 1.11
- Fixed revalidation bug.
- Bug fixes.
Release 1.1
- Improved performance a lot.
- Improved gap handling further.
- Fixed up sime API.
- Fixed a few minor bugs.
Release 1.02
- Fixed a bug in the alignement for right-to-left locales.
- Fixed so that the debug painting will always show. Sometimes the Frame needed to be revalidated manually.
- Fixed a bug where a docking component to the west or north was making bugging the column constraints.
- Added support for setting different automatic gaps between different component types.
- Added component type property to ComponentWrapper interface.
- Fixed a few minor bugs.
- Made split cells use the automatic gaps.
- Added better gap handling in many places.
Release 1.01
- Fixed Debug Rectangle placement when using Border with Insets.
- Fixed a bug that made "gap" only set the left gap if used with multiple arguments.
- Fixed a leak in the LinkHandler.
- Fixed a handle leak in the SWT Component Wrapper.
- Made all code, including the demo application, 1.4+ compliant.
- Added keyword "hidemode" which can set how components should behave if visibility is set to false.
Release 1.0