From 9aa71c94cf53bd7efa5a5ee8882c347b83c1a453 Mon Sep 17 00:00:00 2001 From: Daniel_M_Williams Date: Fri, 22 Jun 2018 17:03:33 -0400 Subject: [PATCH] [Fixes #424] Respaced FinSetConfig Window: Resolved some sources of phantom whitespace; Spacing on component configuration windows is now generally tighter. --- .../configdialog/FreeformFinSetConfig.java | 52 ++++++++++--------- .../configdialog/RocketComponentConfig.java | 10 ++-- 2 files changed, 32 insertions(+), 30 deletions(-) diff --git a/swing/src/net/sf/openrocket/gui/configdialog/FreeformFinSetConfig.java b/swing/src/net/sf/openrocket/gui/configdialog/FreeformFinSetConfig.java index 0f989e526..cc25c704c 100644 --- a/swing/src/net/sf/openrocket/gui/configdialog/FreeformFinSetConfig.java +++ b/swing/src/net/sf/openrocket/gui/configdialog/FreeformFinSetConfig.java @@ -1,6 +1,5 @@ package net.sf.openrocket.gui.configdialog; - import java.awt.Point; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -199,9 +198,9 @@ public class FreeformFinSetConfig extends FinSetConfig { } - + // edit fin points directly here private JPanel shapePane() { - JPanel panel = new JPanel(new MigLayout("fill")); + JPanel panel = new JPanel(null); // Create the figure @@ -247,30 +246,33 @@ public class FreeformFinSetConfig extends FinSetConfig { } } }); - - panel.add(tablePane, "growy, width 100lp:100lp:, height 100lp:250lp:"); - panel.add(figurePane, "gap unrel, spanx, spany 3, growx, growy 1000, height 100lp:250lp:, wrap"); - - panel.add(new StyledLabel(trans.get("lbl.doubleClick1"), -2), "alignx 50%, wrap"); - panel.add(new StyledLabel(trans.get("FreeformFinSetConfig.lbl.doubleClick2"), -2), "alignx 50%, wrap"); - - panel.add(scaleButton, "spany 2, alignx 50%, aligny 50%"); - panel.add(exportCsvButton, "spany 2, alignx 50%, aligny 50%"); - ScaleSelector selector = new ScaleSelector(figurePane); - panel.add( selector, "spany 2, aligny 50%"); - - JButton importButton = new JButton(trans.get("CustomFinImport.button.label")); - importButton.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - importImage(); - } - }); - panel.add(importButton, "spany 2, bottom"); + JButton importButton = new JButton(trans.get("CustomFinImport.button.label")); + importButton.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + importImage(); + } + }); + ScaleSelector selector = new ScaleSelector(figurePane); + + panel.setLayout(new MigLayout("fill, gap 5!","", "[nogrid, fill, sizegroup display, growprio 200]5![sizegroup text, growprio 5]5![sizegroup buttons, align top, growprio 5]0!")); + + // first row: main display + panel.add(tablePane, "width 100lp:100lp:, growy"); + panel.add(figurePane, "width 200lp:400lp:, gap unrel, grow, height 100lp:250lp:, wrap"); + + // row of text directly below figure + panel.add(new StyledLabel(trans.get("lbl.doubleClick1")+" "+trans.get("FreeformFinSetConfig.lbl.doubleClick2"), -2), "spanx 3"); + panel.add(new StyledLabel(trans.get("FreeformFinSetConfig.lbl.clickDrag"), -2), "spanx 3"); + panel.add(new StyledLabel(trans.get("FreeformFinSetConfig.lbl.ctrlClick"), -2), "spanx 3, wrap"); + + // row of controls at the bottom of the tab: + panel.add(selector, "aligny bottom, gap unrel"); + panel.add(scaleButton, ""); + panel.add(importButton, ""); + panel.add(exportCsvButton, ""); // panel.add(new CustomFinBmpImporter(finset), "spany 2, bottom"); - panel.add(new StyledLabel(trans.get("FreeformFinSetConfig.lbl.clickDrag"), -2), "right, wrap"); - panel.add(new StyledLabel(trans.get("FreeformFinSetConfig.lbl.ctrlClick"), -2), "right"); return panel; } diff --git a/swing/src/net/sf/openrocket/gui/configdialog/RocketComponentConfig.java b/swing/src/net/sf/openrocket/gui/configdialog/RocketComponentConfig.java index 9de060940..6321ed099 100644 --- a/swing/src/net/sf/openrocket/gui/configdialog/RocketComponentConfig.java +++ b/swing/src/net/sf/openrocket/gui/configdialog/RocketComponentConfig.java @@ -77,7 +77,7 @@ public class RocketComponentConfig extends JPanel { public RocketComponentConfig(OpenRocketDocument document, RocketComponent component) { - setLayout(new MigLayout("fill", "[min,align right]:10[fill, grow]")); + setLayout(new MigLayout("fill, gap 5!", "[]:5[]", "[growprio 10]10![fill, grow, growprio 500]10![growprio 10]")); this.document = document; this.component = component; @@ -85,7 +85,7 @@ public class RocketComponentConfig extends JPanel { JLabel label = new JLabel(trans.get("RocketCompCfg.lbl.Componentname")); //// The component name. label.setToolTipText(trans.get("RocketCompCfg.ttip.Thecomponentname")); - this.add(label, "spanx, split"); + this.add(label, "spanx, height 50!, split"); componentNameField = new JTextField(15); textFieldListener = new TextFieldListener(); @@ -106,7 +106,7 @@ public class RocketComponentConfig extends JPanel { tabbedPane = new JTabbedPane(); - this.add(tabbedPane, "newline, span, growx, growy 1, wrap"); + this.add(tabbedPane, "newline, span, growx, growy 100, wrap"); //// Override and Mass and CG override options tabbedPane.addTab(trans.get("RocketCompCfg.tab.Override"), null, overrideTab(), @@ -132,7 +132,7 @@ public class RocketComponentConfig extends JPanel { this.remove(buttonPanel); } - buttonPanel = new JPanel(new MigLayout("fill, ins 0")); + buttonPanel = new JPanel(new MigLayout("fillx, ins 0")); //// Mass: infoLabel = new StyledLabel(" ", -1); @@ -154,7 +154,7 @@ public class RocketComponentConfig extends JPanel { updateFields(); - this.add(buttonPanel, "spanx, growx"); + this.add(buttonPanel, "dock south, spanx, growx, height 50!"); }