[#1458] Pack component config dialog after inside/outside checkbox change
This commit is contained in:
parent
c39003a842
commit
0a904bf7d4
@ -199,8 +199,7 @@ public class AppearancePanel extends JPanel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public AppearancePanel(final OpenRocketDocument document,
|
public AppearancePanel(final OpenRocketDocument document, final RocketComponent c, final JDialog parent) {
|
||||||
final RocketComponent c) {
|
|
||||||
super(new MigLayout("fill", "[150][grow][150][grow]"));
|
super(new MigLayout("fill", "[150][grow][150][grow]"));
|
||||||
|
|
||||||
defaultAppearance = DefaultAppearance.getDefaultAppearance(c);
|
defaultAppearance = DefaultAppearance.getDefaultAppearance(c);
|
||||||
@ -408,8 +407,6 @@ public class AppearancePanel extends JPanel {
|
|||||||
handler.setSeparateInsideOutside(customInside.isSelected());
|
handler.setSeparateInsideOutside(customInside.isSelected());
|
||||||
edgesText.setEnabled(customInside.isSelected());
|
edgesText.setEnabled(customInside.isSelected());
|
||||||
edgesComboBox.setEnabled(customInside.isSelected());
|
edgesComboBox.setEnabled(customInside.isSelected());
|
||||||
if (e == null) return; // When e == null, you just want an update of the UI components, not a component change
|
|
||||||
c.fireComponentChangeEvent(ComponentChangeEvent.NONFUNCTIONAL_CHANGE);
|
|
||||||
if (customInside.isSelected()) {
|
if (customInside.isSelected()) {
|
||||||
remove(outsidePanel);
|
remove(outsidePanel);
|
||||||
outsideInsidePane.insertTab(trans.get(tr_outside), null, outsidePanel,
|
outsideInsidePane.insertTab(trans.get(tr_outside), null, outsidePanel,
|
||||||
@ -421,8 +418,15 @@ public class AppearancePanel extends JPanel {
|
|||||||
remove(outsideInsidePane);
|
remove(outsideInsidePane);
|
||||||
add(outsidePanel, "span 4, growx, wrap");
|
add(outsidePanel, "span 4, growx, wrap");
|
||||||
}
|
}
|
||||||
|
if (parent != null) {
|
||||||
|
parent.pack();
|
||||||
|
} else {
|
||||||
updateUI();
|
updateUI();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (e == null) return; // When e == null, you just want an update of the UI components, not a component change
|
||||||
|
c.fireComponentChangeEvent(ComponentChangeEvent.NONFUNCTIONAL_CHANGE);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Change the edge appearance upon item selection
|
// Change the edge appearance upon item selection
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package net.sf.openrocket.gui.configdialog;
|
package net.sf.openrocket.gui.configdialog;
|
||||||
|
|
||||||
import javax.swing.JComboBox;
|
import javax.swing.JComboBox;
|
||||||
|
import javax.swing.JDialog;
|
||||||
import javax.swing.JLabel;
|
import javax.swing.JLabel;
|
||||||
import javax.swing.JPanel;
|
import javax.swing.JPanel;
|
||||||
import javax.swing.JSpinner;
|
import javax.swing.JSpinner;
|
||||||
@ -24,8 +25,8 @@ public class AxialStageConfig extends ComponentAssemblyConfig {
|
|||||||
private static final long serialVersionUID = -944969957186522471L;
|
private static final long serialVersionUID = -944969957186522471L;
|
||||||
private static final Translator trans = Application.getTranslator();
|
private static final Translator trans = Application.getTranslator();
|
||||||
|
|
||||||
public AxialStageConfig(OpenRocketDocument document, RocketComponent component) {
|
public AxialStageConfig(OpenRocketDocument document, RocketComponent component, JDialog parent) {
|
||||||
super(document, component);
|
super(document, component, parent);
|
||||||
|
|
||||||
// Stage separation config (for non-first stage)
|
// Stage separation config (for non-first stage)
|
||||||
if (component.getStageNumber() > 0) {
|
if (component.getStageNumber() > 0) {
|
||||||
|
@ -2,6 +2,7 @@ package net.sf.openrocket.gui.configdialog;
|
|||||||
|
|
||||||
|
|
||||||
import javax.swing.JCheckBox;
|
import javax.swing.JCheckBox;
|
||||||
|
import javax.swing.JDialog;
|
||||||
import javax.swing.JLabel;
|
import javax.swing.JLabel;
|
||||||
import javax.swing.JPanel;
|
import javax.swing.JPanel;
|
||||||
import javax.swing.JSpinner;
|
import javax.swing.JSpinner;
|
||||||
@ -29,8 +30,8 @@ public class BodyTubeConfig extends RocketComponentConfig {
|
|||||||
private final JCheckBox checkAutoOuterRadius;
|
private final JCheckBox checkAutoOuterRadius;
|
||||||
private static final Translator trans = Application.getTranslator();
|
private static final Translator trans = Application.getTranslator();
|
||||||
|
|
||||||
public BodyTubeConfig(OpenRocketDocument d, RocketComponent c) {
|
public BodyTubeConfig(OpenRocketDocument d, RocketComponent c, JDialog parent) {
|
||||||
super(d, c);
|
super(d, c, parent);
|
||||||
|
|
||||||
JPanel panel = new JPanel(new MigLayout("gap rel unrel", "[][65lp::][30lp::][]", ""));
|
JPanel panel = new JPanel(new MigLayout("gap rel unrel", "[][65lp::][30lp::][]", ""));
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package net.sf.openrocket.gui.configdialog;
|
package net.sf.openrocket.gui.configdialog;
|
||||||
|
|
||||||
|
|
||||||
|
import javax.swing.JDialog;
|
||||||
import javax.swing.JPanel;
|
import javax.swing.JPanel;
|
||||||
|
|
||||||
import net.sf.openrocket.document.OpenRocketDocument;
|
import net.sf.openrocket.document.OpenRocketDocument;
|
||||||
@ -14,8 +15,8 @@ import net.sf.openrocket.startup.Application;
|
|||||||
public class BulkheadConfig extends RingComponentConfig {
|
public class BulkheadConfig extends RingComponentConfig {
|
||||||
private static final Translator trans = Application.getTranslator();
|
private static final Translator trans = Application.getTranslator();
|
||||||
|
|
||||||
public BulkheadConfig(OpenRocketDocument d, RocketComponent c) {
|
public BulkheadConfig(OpenRocketDocument d, RocketComponent c, JDialog parent) {
|
||||||
super(d, c);
|
super(d, c, parent);
|
||||||
|
|
||||||
JPanel tab;
|
JPanel tab;
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package net.sf.openrocket.gui.configdialog;
|
package net.sf.openrocket.gui.configdialog;
|
||||||
|
|
||||||
|
|
||||||
|
import javax.swing.JDialog;
|
||||||
import javax.swing.JPanel;
|
import javax.swing.JPanel;
|
||||||
|
|
||||||
import net.sf.openrocket.document.OpenRocketDocument;
|
import net.sf.openrocket.document.OpenRocketDocument;
|
||||||
@ -14,8 +15,8 @@ import net.sf.openrocket.startup.Application;
|
|||||||
public class CenteringRingConfig extends RingComponentConfig {
|
public class CenteringRingConfig extends RingComponentConfig {
|
||||||
private static final Translator trans = Application.getTranslator();
|
private static final Translator trans = Application.getTranslator();
|
||||||
|
|
||||||
public CenteringRingConfig(OpenRocketDocument d, RocketComponent c) {
|
public CenteringRingConfig(OpenRocketDocument d, RocketComponent c, JDialog parent) {
|
||||||
super(d, c);
|
super(d, c, parent);
|
||||||
|
|
||||||
JPanel tab;
|
JPanel tab;
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@ package net.sf.openrocket.gui.configdialog;
|
|||||||
|
|
||||||
import javax.swing.ComboBoxModel;
|
import javax.swing.ComboBoxModel;
|
||||||
import javax.swing.JComboBox;
|
import javax.swing.JComboBox;
|
||||||
|
import javax.swing.JDialog;
|
||||||
import javax.swing.JLabel;
|
import javax.swing.JLabel;
|
||||||
import javax.swing.JPanel;
|
import javax.swing.JPanel;
|
||||||
import javax.swing.JSpinner;
|
import javax.swing.JSpinner;
|
||||||
@ -36,8 +37,8 @@ public class ComponentAssemblyConfig extends RocketComponentConfig {
|
|||||||
private static final Translator trans = Application.getTranslator();
|
private static final Translator trans = Application.getTranslator();
|
||||||
private final RocketComponent component;
|
private final RocketComponent component;
|
||||||
|
|
||||||
public ComponentAssemblyConfig(OpenRocketDocument document, RocketComponent component) {
|
public ComponentAssemblyConfig(OpenRocketDocument document, RocketComponent component, JDialog parent) {
|
||||||
super(document, component);
|
super(document, component, parent);
|
||||||
this.component = component;
|
this.component = component;
|
||||||
|
|
||||||
// only stages which are actually off-centerline will get the dialog here:
|
// only stages which are actually off-centerline will get the dialog here:
|
||||||
|
@ -143,14 +143,14 @@ public class ComponentConfigDialog extends JDialog implements ComponentChangeLis
|
|||||||
List<RocketComponent> listeners = component.getConfigListeners();
|
List<RocketComponent> listeners = component.getConfigListeners();
|
||||||
boolean isSameClass = component.checkAllClassesEqual(listeners);
|
boolean isSameClass = component.checkAllClassesEqual(listeners);
|
||||||
if (!isSameClass) {
|
if (!isSameClass) {
|
||||||
return new RocketComponentConfig(document, component);
|
return new RocketComponentConfig(document, component, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
Constructor<? extends RocketComponentConfig> constructor =
|
Constructor<? extends RocketComponentConfig> constructor =
|
||||||
findDialogContentsConstructor(component);
|
findDialogContentsConstructor(component);
|
||||||
if (constructor != null) {
|
if (constructor != null) {
|
||||||
try {
|
try {
|
||||||
return constructor.newInstance(document, component);
|
return constructor.newInstance(document, component, this);
|
||||||
} catch (InstantiationException | IllegalAccessException e) {
|
} catch (InstantiationException | IllegalAccessException e) {
|
||||||
throw new BugException("BUG in constructor reflection", e);
|
throw new BugException("BUG in constructor reflection", e);
|
||||||
} catch (InvocationTargetException e) {
|
} catch (InvocationTargetException e) {
|
||||||
@ -208,7 +208,7 @@ public class ComponentConfigDialog extends JDialog implements ComponentChangeLis
|
|||||||
try {
|
try {
|
||||||
configclass = Class.forName(configclassname);
|
configclass = Class.forName(configclassname);
|
||||||
c = (Constructor<? extends RocketComponentConfig>)
|
c = (Constructor<? extends RocketComponentConfig>)
|
||||||
configclass.getConstructor(OpenRocketDocument.class, RocketComponent.class);
|
configclass.getConstructor(OpenRocketDocument.class, RocketComponent.class, JDialog.class);
|
||||||
return c;
|
return c;
|
||||||
} catch (Exception ignore) {
|
} catch (Exception ignore) {
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,7 @@ import java.awt.event.ActionEvent;
|
|||||||
import java.awt.event.ActionListener;
|
import java.awt.event.ActionListener;
|
||||||
import java.util.EventObject;
|
import java.util.EventObject;
|
||||||
import javax.swing.JComboBox;
|
import javax.swing.JComboBox;
|
||||||
|
import javax.swing.JDialog;
|
||||||
import javax.swing.JLabel;
|
import javax.swing.JLabel;
|
||||||
import javax.swing.JPanel;
|
import javax.swing.JPanel;
|
||||||
import javax.swing.JSeparator;
|
import javax.swing.JSeparator;
|
||||||
@ -31,8 +32,8 @@ import net.sf.openrocket.unit.UnitGroup;
|
|||||||
public class EllipticalFinSetConfig extends FinSetConfig {
|
public class EllipticalFinSetConfig extends FinSetConfig {
|
||||||
private static final Translator trans = Application.getTranslator();
|
private static final Translator trans = Application.getTranslator();
|
||||||
|
|
||||||
public EllipticalFinSetConfig(OpenRocketDocument d, final RocketComponent component) {
|
public EllipticalFinSetConfig(OpenRocketDocument d, final RocketComponent component, JDialog parent) {
|
||||||
super(d, component);
|
super(d, component, parent);
|
||||||
|
|
||||||
DoubleModel m;
|
DoubleModel m;
|
||||||
JSpinner spin;
|
JSpinner spin;
|
||||||
|
@ -11,6 +11,7 @@ import java.util.List;
|
|||||||
import javax.swing.BorderFactory;
|
import javax.swing.BorderFactory;
|
||||||
import javax.swing.JButton;
|
import javax.swing.JButton;
|
||||||
import javax.swing.JComboBox;
|
import javax.swing.JComboBox;
|
||||||
|
import javax.swing.JDialog;
|
||||||
import javax.swing.JLabel;
|
import javax.swing.JLabel;
|
||||||
import javax.swing.JPanel;
|
import javax.swing.JPanel;
|
||||||
import javax.swing.JSpinner;
|
import javax.swing.JSpinner;
|
||||||
@ -52,8 +53,8 @@ public abstract class FinSetConfig extends RocketComponentConfig {
|
|||||||
|
|
||||||
private JButton split = null;
|
private JButton split = null;
|
||||||
|
|
||||||
public FinSetConfig(OpenRocketDocument d, RocketComponent component) {
|
public FinSetConfig(OpenRocketDocument d, RocketComponent component, JDialog parent) {
|
||||||
super(d, component);
|
super(d, component, parent);
|
||||||
|
|
||||||
//// Fin tabs and Through-the-wall fin tabs
|
//// Fin tabs and Through-the-wall fin tabs
|
||||||
tabbedPane.insertTab(trans.get("FinSetConfig.tab.Fintabs"), null, finTabPanel(),
|
tabbedPane.insertTab(trans.get("FinSetConfig.tab.Fintabs"), null, finTabPanel(),
|
||||||
|
@ -21,6 +21,7 @@ import java.util.List;
|
|||||||
|
|
||||||
import javax.swing.JButton;
|
import javax.swing.JButton;
|
||||||
import javax.swing.JComboBox;
|
import javax.swing.JComboBox;
|
||||||
|
import javax.swing.JDialog;
|
||||||
import javax.swing.JFileChooser;
|
import javax.swing.JFileChooser;
|
||||||
import javax.swing.JLabel;
|
import javax.swing.JLabel;
|
||||||
import javax.swing.JOptionPane;
|
import javax.swing.JOptionPane;
|
||||||
@ -82,8 +83,8 @@ public class FreeformFinSetConfig extends FinSetConfig {
|
|||||||
private FinPointFigure figure = null;
|
private FinPointFigure figure = null;
|
||||||
private ScaleSelector selector;
|
private ScaleSelector selector;
|
||||||
|
|
||||||
public FreeformFinSetConfig(OpenRocketDocument d, RocketComponent component) {
|
public FreeformFinSetConfig(OpenRocketDocument d, RocketComponent component, JDialog parent) {
|
||||||
super(d, component);
|
super(d, component, parent);
|
||||||
|
|
||||||
//// General and General properties
|
//// General and General properties
|
||||||
tabbedPane.insertTab(trans.get("FreeformFinSetCfg.tab.General"), null, generalPane(), trans.get("FreeformFinSetCfg.tab.ttip.General"), 0);
|
tabbedPane.insertTab(trans.get("FreeformFinSetCfg.tab.General"), null, generalPane(), trans.get("FreeformFinSetCfg.tab.ttip.General"), 0);
|
||||||
|
@ -21,6 +21,7 @@ import javax.swing.JButton;
|
|||||||
import javax.swing.JCheckBox;
|
import javax.swing.JCheckBox;
|
||||||
import javax.swing.JComboBox;
|
import javax.swing.JComboBox;
|
||||||
import javax.swing.JComponent;
|
import javax.swing.JComponent;
|
||||||
|
import javax.swing.JDialog;
|
||||||
import javax.swing.JLabel;
|
import javax.swing.JLabel;
|
||||||
import javax.swing.JPanel;
|
import javax.swing.JPanel;
|
||||||
import javax.swing.JSpinner;
|
import javax.swing.JSpinner;
|
||||||
@ -59,8 +60,8 @@ public class InnerTubeConfig extends RocketComponentConfig {
|
|||||||
private static final Translator trans = Application.getTranslator();
|
private static final Translator trans = Application.getTranslator();
|
||||||
|
|
||||||
|
|
||||||
public InnerTubeConfig(OpenRocketDocument d, RocketComponent c) {
|
public InnerTubeConfig(OpenRocketDocument d, RocketComponent c, JDialog parent) {
|
||||||
super(d, c);
|
super(d, c, parent);
|
||||||
|
|
||||||
//// General and General properties
|
//// General and General properties
|
||||||
JPanel rightPanel = new JPanel(new MigLayout());
|
JPanel rightPanel = new JPanel(new MigLayout());
|
||||||
|
@ -2,6 +2,7 @@ package net.sf.openrocket.gui.configdialog;
|
|||||||
|
|
||||||
|
|
||||||
import javax.swing.JComboBox;
|
import javax.swing.JComboBox;
|
||||||
|
import javax.swing.JDialog;
|
||||||
import javax.swing.JLabel;
|
import javax.swing.JLabel;
|
||||||
import javax.swing.JPanel;
|
import javax.swing.JPanel;
|
||||||
import javax.swing.JSpinner;
|
import javax.swing.JSpinner;
|
||||||
@ -28,8 +29,8 @@ public class LaunchLugConfig extends RocketComponentConfig {
|
|||||||
|
|
||||||
private static final Translator trans = Application.getTranslator();
|
private static final Translator trans = Application.getTranslator();
|
||||||
|
|
||||||
public LaunchLugConfig(OpenRocketDocument d, RocketComponent c) {
|
public LaunchLugConfig(OpenRocketDocument d, RocketComponent c, JDialog parent) {
|
||||||
super(d, c);
|
super(d, c, parent);
|
||||||
|
|
||||||
JPanel primary = new JPanel(new MigLayout("fill"));
|
JPanel primary = new JPanel(new MigLayout("fill"));
|
||||||
|
|
||||||
|
@ -6,6 +6,7 @@ import java.awt.event.ActionListener;
|
|||||||
import javax.swing.JButton;
|
import javax.swing.JButton;
|
||||||
import javax.swing.JCheckBox;
|
import javax.swing.JCheckBox;
|
||||||
import javax.swing.JComboBox;
|
import javax.swing.JComboBox;
|
||||||
|
import javax.swing.JDialog;
|
||||||
import javax.swing.JLabel;
|
import javax.swing.JLabel;
|
||||||
import javax.swing.JPanel;
|
import javax.swing.JPanel;
|
||||||
import javax.swing.JSpinner;
|
import javax.swing.JSpinner;
|
||||||
@ -31,8 +32,8 @@ import net.sf.openrocket.gui.widgets.SelectColorButton;
|
|||||||
public class MassComponentConfig extends RocketComponentConfig {
|
public class MassComponentConfig extends RocketComponentConfig {
|
||||||
private static final Translator trans = Application.getTranslator();
|
private static final Translator trans = Application.getTranslator();
|
||||||
|
|
||||||
public MassComponentConfig(OpenRocketDocument d, RocketComponent component) {
|
public MassComponentConfig(OpenRocketDocument d, RocketComponent component, JDialog parent) {
|
||||||
super(d, component);
|
super(d, component, parent);
|
||||||
|
|
||||||
//// Left side
|
//// Left side
|
||||||
JPanel panel = new JPanel(new MigLayout("gap rel unrel", "[][65lp::][30lp::]", ""));
|
JPanel panel = new JPanel(new MigLayout("gap rel unrel", "[][65lp::][30lp::]", ""));
|
||||||
|
@ -6,6 +6,7 @@ import java.awt.event.ActionListener;
|
|||||||
|
|
||||||
import javax.swing.JCheckBox;
|
import javax.swing.JCheckBox;
|
||||||
import javax.swing.JComboBox;
|
import javax.swing.JComboBox;
|
||||||
|
import javax.swing.JDialog;
|
||||||
import javax.swing.JLabel;
|
import javax.swing.JLabel;
|
||||||
import javax.swing.JPanel;
|
import javax.swing.JPanel;
|
||||||
import javax.swing.JSlider;
|
import javax.swing.JSlider;
|
||||||
@ -44,8 +45,8 @@ public class NoseConeConfig extends RocketComponentConfig {
|
|||||||
// Prepended to the description from NoseCone.DESCRIPTIONS
|
// Prepended to the description from NoseCone.DESCRIPTIONS
|
||||||
private static final String PREDESC = "<html>";
|
private static final String PREDESC = "<html>";
|
||||||
|
|
||||||
public NoseConeConfig(OpenRocketDocument d, RocketComponent c) {
|
public NoseConeConfig(OpenRocketDocument d, RocketComponent c, JDialog parent) {
|
||||||
super(d, c);
|
super(d, c, parent);
|
||||||
|
|
||||||
final JPanel panel = new JPanel(new MigLayout("", "[][65lp::][30lp::]"));
|
final JPanel panel = new JPanel(new MigLayout("", "[][65lp::][30lp::]"));
|
||||||
|
|
||||||
|
@ -8,6 +8,7 @@ import javax.swing.ComboBoxModel;
|
|||||||
import javax.swing.JButton;
|
import javax.swing.JButton;
|
||||||
import javax.swing.JCheckBox;
|
import javax.swing.JCheckBox;
|
||||||
import javax.swing.JComboBox;
|
import javax.swing.JComboBox;
|
||||||
|
import javax.swing.JDialog;
|
||||||
import javax.swing.JLabel;
|
import javax.swing.JLabel;
|
||||||
import javax.swing.JPanel;
|
import javax.swing.JPanel;
|
||||||
import javax.swing.JSpinner;
|
import javax.swing.JSpinner;
|
||||||
@ -40,8 +41,8 @@ public class ParachuteConfig extends RecoveryDeviceConfig {
|
|||||||
private static final long serialVersionUID = 6108892447949958115L;
|
private static final long serialVersionUID = 6108892447949958115L;
|
||||||
private static final Translator trans = Application.getTranslator();
|
private static final Translator trans = Application.getTranslator();
|
||||||
|
|
||||||
public ParachuteConfig(OpenRocketDocument d, final RocketComponent component) {
|
public ParachuteConfig(OpenRocketDocument d, final RocketComponent component, JDialog parent) {
|
||||||
super(d, component);
|
super(d, component, parent);
|
||||||
Parachute parachute = (Parachute) component;
|
Parachute parachute = (Parachute) component;
|
||||||
|
|
||||||
// Left Side
|
// Left Side
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package net.sf.openrocket.gui.configdialog;
|
package net.sf.openrocket.gui.configdialog;
|
||||||
|
|
||||||
import javax.swing.JComboBox;
|
import javax.swing.JComboBox;
|
||||||
|
import javax.swing.JDialog;
|
||||||
import javax.swing.JLabel;
|
import javax.swing.JLabel;
|
||||||
import javax.swing.JPanel;
|
import javax.swing.JPanel;
|
||||||
import javax.swing.JSpinner;
|
import javax.swing.JSpinner;
|
||||||
@ -26,8 +27,8 @@ public class RailButtonConfig extends RocketComponentConfig {
|
|||||||
|
|
||||||
private static final Translator trans = Application.getTranslator();
|
private static final Translator trans = Application.getTranslator();
|
||||||
|
|
||||||
public RailButtonConfig( OpenRocketDocument document, RocketComponent component) {
|
public RailButtonConfig( OpenRocketDocument document, RocketComponent component, JDialog parent) {
|
||||||
super(document, component);
|
super(document, component, parent);
|
||||||
|
|
||||||
// For DEBUG purposes
|
// For DEBUG purposes
|
||||||
// if( component instanceof AxialStage ){
|
// if( component instanceof AxialStage ){
|
||||||
|
@ -4,6 +4,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import javax.swing.JComponent;
|
import javax.swing.JComponent;
|
||||||
|
import javax.swing.JDialog;
|
||||||
|
|
||||||
import net.sf.openrocket.document.OpenRocketDocument;
|
import net.sf.openrocket.document.OpenRocketDocument;
|
||||||
import net.sf.openrocket.rocketcomponent.DeploymentConfiguration.DeployEvent;
|
import net.sf.openrocket.rocketcomponent.DeploymentConfiguration.DeployEvent;
|
||||||
@ -17,8 +18,8 @@ public abstract class RecoveryDeviceConfig extends RocketComponentConfig {
|
|||||||
|
|
||||||
protected final List<JComponent> altitudeComponents = new ArrayList<JComponent>();
|
protected final List<JComponent> altitudeComponents = new ArrayList<JComponent>();
|
||||||
|
|
||||||
public RecoveryDeviceConfig(OpenRocketDocument d, RocketComponent component) {
|
public RecoveryDeviceConfig(OpenRocketDocument d, RocketComponent component, JDialog parent) {
|
||||||
super(d, component);
|
super(d, component, parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@ package net.sf.openrocket.gui.configdialog;
|
|||||||
|
|
||||||
import javax.swing.JCheckBox;
|
import javax.swing.JCheckBox;
|
||||||
import javax.swing.JComboBox;
|
import javax.swing.JComboBox;
|
||||||
|
import javax.swing.JDialog;
|
||||||
import javax.swing.JLabel;
|
import javax.swing.JLabel;
|
||||||
import javax.swing.JPanel;
|
import javax.swing.JPanel;
|
||||||
import javax.swing.JSpinner;
|
import javax.swing.JSpinner;
|
||||||
@ -27,8 +28,8 @@ import net.sf.openrocket.unit.UnitGroup;
|
|||||||
public class RingComponentConfig extends RocketComponentConfig {
|
public class RingComponentConfig extends RocketComponentConfig {
|
||||||
private static final Translator trans = Application.getTranslator();
|
private static final Translator trans = Application.getTranslator();
|
||||||
|
|
||||||
public RingComponentConfig(OpenRocketDocument d, RocketComponent component) {
|
public RingComponentConfig(OpenRocketDocument d, RocketComponent component, JDialog parent) {
|
||||||
super(d, component);
|
super(d, component, parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -14,6 +14,7 @@ import javax.swing.BorderFactory;
|
|||||||
import javax.swing.JButton;
|
import javax.swing.JButton;
|
||||||
import javax.swing.JCheckBox;
|
import javax.swing.JCheckBox;
|
||||||
import javax.swing.JComboBox;
|
import javax.swing.JComboBox;
|
||||||
|
import javax.swing.JDialog;
|
||||||
import javax.swing.JLabel;
|
import javax.swing.JLabel;
|
||||||
import javax.swing.JPanel;
|
import javax.swing.JPanel;
|
||||||
import javax.swing.JScrollPane;
|
import javax.swing.JScrollPane;
|
||||||
@ -74,7 +75,7 @@ public class RocketComponentConfig extends JPanel {
|
|||||||
private boolean allSameType; // Checks whether all listener components are of the same type as <component>
|
private boolean allSameType; // Checks whether all listener components are of the same type as <component>
|
||||||
private boolean allMassive; // Checks whether all listener components, and this component, are massive
|
private boolean allMassive; // Checks whether all listener components, and this component, are massive
|
||||||
|
|
||||||
public RocketComponentConfig(OpenRocketDocument document, RocketComponent component) {
|
public RocketComponentConfig(OpenRocketDocument document, RocketComponent component, JDialog parent) {
|
||||||
setLayout(new MigLayout("fill, gap 4!, ins panel", "[]:5[]", "[growprio 5]5![fill, grow, growprio 500]5![growprio 5]"));
|
setLayout(new MigLayout("fill, gap 4!, ins panel", "[]:5[]", "[growprio 5]5![fill, grow, growprio 500]5![growprio 5]"));
|
||||||
|
|
||||||
this.document = document;
|
this.document = document;
|
||||||
@ -126,7 +127,7 @@ public class RocketComponentConfig extends JPanel {
|
|||||||
trans.get("RocketCompCfg.tab.MassandCGoverride"));
|
trans.get("RocketCompCfg.tab.MassandCGoverride"));
|
||||||
if (allMassive) {
|
if (allMassive) {
|
||||||
//// Appearance options
|
//// Appearance options
|
||||||
appearancePanel = new AppearancePanel(document, component);
|
appearancePanel = new AppearancePanel(document, component, parent);
|
||||||
tabbedPane.addTab(trans.get("RocketCompCfg.tab.Appearance"), null, appearancePanel,
|
tabbedPane.addTab(trans.get("RocketCompCfg.tab.Appearance"), null, appearancePanel,
|
||||||
"Appearance Tool Tip");
|
"Appearance Tool Tip");
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,7 @@ import java.awt.event.ActionListener;
|
|||||||
import java.awt.event.FocusEvent;
|
import java.awt.event.FocusEvent;
|
||||||
import java.awt.event.FocusListener;
|
import java.awt.event.FocusListener;
|
||||||
|
|
||||||
|
import javax.swing.JDialog;
|
||||||
import javax.swing.JLabel;
|
import javax.swing.JLabel;
|
||||||
import javax.swing.JScrollPane;
|
import javax.swing.JScrollPane;
|
||||||
import javax.swing.JTextArea;
|
import javax.swing.JTextArea;
|
||||||
@ -28,8 +29,8 @@ public class RocketConfig extends RocketComponentConfig {
|
|||||||
|
|
||||||
private final Rocket rocket;
|
private final Rocket rocket;
|
||||||
|
|
||||||
public RocketConfig(OpenRocketDocument d, RocketComponent c) {
|
public RocketConfig(OpenRocketDocument d, RocketComponent c, JDialog parent) {
|
||||||
super(d, c);
|
super(d, c, parent);
|
||||||
|
|
||||||
rocket = (Rocket) c;
|
rocket = (Rocket) c;
|
||||||
|
|
||||||
|
@ -27,8 +27,8 @@ import java.awt.event.ActionListener;
|
|||||||
public class ShockCordConfig extends RocketComponentConfig {
|
public class ShockCordConfig extends RocketComponentConfig {
|
||||||
private static final Translator trans = Application.getTranslator();
|
private static final Translator trans = Application.getTranslator();
|
||||||
|
|
||||||
public ShockCordConfig(OpenRocketDocument d, RocketComponent component) {
|
public ShockCordConfig(OpenRocketDocument d, RocketComponent component, JDialog parent) {
|
||||||
super(d, component);
|
super(d, component, parent);
|
||||||
|
|
||||||
JLabel label;
|
JLabel label;
|
||||||
DoubleModel m;
|
DoubleModel m;
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package net.sf.openrocket.gui.configdialog;
|
package net.sf.openrocket.gui.configdialog;
|
||||||
|
|
||||||
|
|
||||||
|
import javax.swing.JDialog;
|
||||||
import javax.swing.JPanel;
|
import javax.swing.JPanel;
|
||||||
|
|
||||||
import net.sf.openrocket.document.OpenRocketDocument;
|
import net.sf.openrocket.document.OpenRocketDocument;
|
||||||
@ -13,8 +14,8 @@ import net.sf.openrocket.startup.Application;
|
|||||||
public class SleeveConfig extends RingComponentConfig {
|
public class SleeveConfig extends RingComponentConfig {
|
||||||
private static final Translator trans = Application.getTranslator();
|
private static final Translator trans = Application.getTranslator();
|
||||||
|
|
||||||
public SleeveConfig(OpenRocketDocument d, RocketComponent c) {
|
public SleeveConfig(OpenRocketDocument d, RocketComponent c, JDialog parent) {
|
||||||
super(d, c);
|
super(d, c, parent);
|
||||||
|
|
||||||
JPanel tab;
|
JPanel tab;
|
||||||
//// Outer diameter:
|
//// Outer diameter:
|
||||||
|
@ -7,6 +7,7 @@ import java.awt.event.ActionListener;
|
|||||||
import javax.swing.JButton;
|
import javax.swing.JButton;
|
||||||
import javax.swing.JCheckBox;
|
import javax.swing.JCheckBox;
|
||||||
import javax.swing.JComboBox;
|
import javax.swing.JComboBox;
|
||||||
|
import javax.swing.JDialog;
|
||||||
import javax.swing.JLabel;
|
import javax.swing.JLabel;
|
||||||
import javax.swing.JPanel;
|
import javax.swing.JPanel;
|
||||||
import javax.swing.JSpinner;
|
import javax.swing.JSpinner;
|
||||||
@ -36,8 +37,8 @@ public class StreamerConfig extends RecoveryDeviceConfig {
|
|||||||
private static final long serialVersionUID = -4445736703470494588L;
|
private static final long serialVersionUID = -4445736703470494588L;
|
||||||
private static final Translator trans = Application.getTranslator();
|
private static final Translator trans = Application.getTranslator();
|
||||||
|
|
||||||
public StreamerConfig(OpenRocketDocument d, final RocketComponent component) {
|
public StreamerConfig(OpenRocketDocument d, final RocketComponent component, JDialog parent) {
|
||||||
super(d, component);
|
super(d, component, parent);
|
||||||
Streamer streamer = (Streamer) component;
|
Streamer streamer = (Streamer) component;
|
||||||
|
|
||||||
// Left side
|
// Left side
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package net.sf.openrocket.gui.configdialog;
|
package net.sf.openrocket.gui.configdialog;
|
||||||
|
|
||||||
|
|
||||||
|
import javax.swing.JDialog;
|
||||||
import javax.swing.JPanel;
|
import javax.swing.JPanel;
|
||||||
|
|
||||||
import net.sf.openrocket.document.OpenRocketDocument;
|
import net.sf.openrocket.document.OpenRocketDocument;
|
||||||
@ -13,8 +14,8 @@ import net.sf.openrocket.startup.Application;
|
|||||||
public class ThicknessRingComponentConfig extends RingComponentConfig {
|
public class ThicknessRingComponentConfig extends RingComponentConfig {
|
||||||
private static final Translator trans = Application.getTranslator();
|
private static final Translator trans = Application.getTranslator();
|
||||||
|
|
||||||
public ThicknessRingComponentConfig(OpenRocketDocument d, RocketComponent c) {
|
public ThicknessRingComponentConfig(OpenRocketDocument d, RocketComponent c, JDialog parent) {
|
||||||
super(d, c);
|
super(d, c, parent);
|
||||||
|
|
||||||
JPanel tab;
|
JPanel tab;
|
||||||
|
|
||||||
|
@ -6,6 +6,7 @@ import java.awt.event.ActionListener;
|
|||||||
|
|
||||||
import javax.swing.JCheckBox;
|
import javax.swing.JCheckBox;
|
||||||
import javax.swing.JComboBox;
|
import javax.swing.JComboBox;
|
||||||
|
import javax.swing.JDialog;
|
||||||
import javax.swing.JLabel;
|
import javax.swing.JLabel;
|
||||||
import javax.swing.JPanel;
|
import javax.swing.JPanel;
|
||||||
import javax.swing.JSpinner;
|
import javax.swing.JSpinner;
|
||||||
@ -46,8 +47,8 @@ public class TransitionConfig extends RocketComponentConfig {
|
|||||||
private static final String PREDESC = "<html>";
|
private static final String PREDESC = "<html>";
|
||||||
|
|
||||||
|
|
||||||
public TransitionConfig(OpenRocketDocument d, RocketComponent c) {
|
public TransitionConfig(OpenRocketDocument d, RocketComponent c, JDialog parent) {
|
||||||
super(d, c);
|
super(d, c, parent);
|
||||||
|
|
||||||
final JPanel panel = new JPanel(new MigLayout("gap rel unrel, fillx", "[][65lp::][30lp::]", ""));
|
final JPanel panel = new JPanel(new MigLayout("gap rel unrel, fillx", "[][65lp::][30lp::]", ""));
|
||||||
|
|
||||||
|
@ -5,6 +5,7 @@ import java.awt.event.ActionEvent;
|
|||||||
import java.awt.event.ActionListener;
|
import java.awt.event.ActionListener;
|
||||||
import java.util.EventObject;
|
import java.util.EventObject;
|
||||||
import javax.swing.JComboBox;
|
import javax.swing.JComboBox;
|
||||||
|
import javax.swing.JDialog;
|
||||||
import javax.swing.JLabel;
|
import javax.swing.JLabel;
|
||||||
import javax.swing.JPanel;
|
import javax.swing.JPanel;
|
||||||
import javax.swing.JSeparator;
|
import javax.swing.JSeparator;
|
||||||
@ -33,8 +34,8 @@ public class TrapezoidFinSetConfig extends FinSetConfig {
|
|||||||
private static final long serialVersionUID = -4870745241749769842L;
|
private static final long serialVersionUID = -4870745241749769842L;
|
||||||
private static final Translator trans = Application.getTranslator();
|
private static final Translator trans = Application.getTranslator();
|
||||||
|
|
||||||
public TrapezoidFinSetConfig(OpenRocketDocument d, final RocketComponent component) {
|
public TrapezoidFinSetConfig(OpenRocketDocument d, final RocketComponent component, JDialog parent) {
|
||||||
super(d, component);
|
super(d, component, parent);
|
||||||
|
|
||||||
JPanel mainPanel = new JPanel(new MigLayout());
|
JPanel mainPanel = new JPanel(new MigLayout());
|
||||||
|
|
||||||
|
@ -6,6 +6,7 @@ import java.awt.event.ActionListener;
|
|||||||
import java.util.EventObject;
|
import java.util.EventObject;
|
||||||
import javax.swing.JCheckBox;
|
import javax.swing.JCheckBox;
|
||||||
import javax.swing.JComboBox;
|
import javax.swing.JComboBox;
|
||||||
|
import javax.swing.JDialog;
|
||||||
import javax.swing.JLabel;
|
import javax.swing.JLabel;
|
||||||
import javax.swing.JPanel;
|
import javax.swing.JPanel;
|
||||||
import javax.swing.JSpinner;
|
import javax.swing.JSpinner;
|
||||||
@ -29,8 +30,8 @@ public class TubeFinSetConfig extends RocketComponentConfig {
|
|||||||
private static final long serialVersionUID = 508482875624928676L;
|
private static final long serialVersionUID = 508482875624928676L;
|
||||||
private static final Translator trans = Application.getTranslator();
|
private static final Translator trans = Application.getTranslator();
|
||||||
|
|
||||||
public TubeFinSetConfig(OpenRocketDocument d, RocketComponent c) {
|
public TubeFinSetConfig(OpenRocketDocument d, RocketComponent c, JDialog parent) {
|
||||||
super(d, c);
|
super(d, c, parent);
|
||||||
|
|
||||||
JPanel primary = new JPanel(new MigLayout("fill"));
|
JPanel primary = new JPanel(new MigLayout("fill"));
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user