From 1c966b424636f8418b54a84075995005216a31ec Mon Sep 17 00:00:00 2001 From: "[Bios]Marcel" Date: Sat, 8 Apr 2017 12:49:05 +0200 Subject: [PATCH] Updated MigLayout - Updated MigLayout from 3.7.4 to 5.0 (changed Maven repository) - Fixed Choice-TaskDialog Layout (cherry picked from commit c1c39668340a68713fb84861e453d10cf9334a68) --- swingbits/pom.xml | 10 ++++---- .../swingbits/dialog/task/TaskDialogs.java | 23 +++++++++++-------- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/swingbits/pom.xml b/swingbits/pom.xml index d4f8725..3456b20 100644 --- a/swingbits/pom.xml +++ b/swingbits/pom.xml @@ -64,11 +64,11 @@ - - com.miglayout - miglayout - 3.7.4 - + + com.miglayout + miglayout-swing + 5.0 + org.slf4j slf4j-api diff --git a/swingbits/src/main/java/org/oxbow/swingbits/dialog/task/TaskDialogs.java b/swingbits/src/main/java/org/oxbow/swingbits/dialog/task/TaskDialogs.java index a7c1e8d..b3e9716 100644 --- a/swingbits/src/main/java/org/oxbow/swingbits/dialog/task/TaskDialogs.java +++ b/swingbits/src/main/java/org/oxbow/swingbits/dialog/task/TaskDialogs.java @@ -62,6 +62,10 @@ import net.miginfocom.swing.MigLayout; +import net.miginfocom.layout.CC; +import net.miginfocom.layout.LC; +import net.miginfocom.swing.MigLayout; + /** * * A set of methods to simplify creation of task dialogs @@ -421,15 +425,16 @@ public int choice(final int defaultChoice, List choices) { final List buttons = new ArrayList(); CommandLinkButton btn; - JPanel p = new JPanel(new MigLayout("")); - p.setOpaque(false); - for (CommandLink link : choices) { - btn = new CommandLinkButton(link, TaskDialog.getDesign().getCommandLinkPainter()); - models.add(btn.getModel()); - buttons.add(btn); - bGroup.add(btn); - p.add(btn, "dock north, gapbottom 8"); - } + final JPanel p = new JPanel(new MigLayout(new LC().flowY().noGrid())); + p.setOpaque(false); + for (final CommandLink link : choices) + { + btn = new CommandLinkButton(link, TaskDialog.getDesign().getCommandLinkPainter()); + models.add(btn.getModel()); + buttons.add(btn); + bGroup.add(btn); + p.add(btn, new CC().gapBottom("8")); + } if (defaultChoice >= 0 && defaultChoice < choices.size()) { bGroup.setSelected(models.get(defaultChoice), true);