[Fixes #424] Respaced FinSetConfig Window:

Resolved some sources of phantom whitespace; Spacing on component configuration
windows is now generally tighter.
This commit is contained in:
Daniel_M_Williams 2018-06-22 17:03:33 -04:00
parent c1d8bfda06
commit 9aa71c94cf
2 changed files with 32 additions and 30 deletions

View File

@ -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;
}

View File

@ -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!");
}