Change labels and add explicit Edit buttons to all places where the
flight configuration list is presented.
This commit is contained in:
parent
cda4281475
commit
87e968690b
@ -50,7 +50,8 @@ RocketPanel.FigTypeAct.Figure3D = 3D Figure
|
|||||||
RocketPanel.FigTypeAct.Realistic3D = 3D Realistic
|
RocketPanel.FigTypeAct.Realistic3D = 3D Realistic
|
||||||
|
|
||||||
|
|
||||||
RocketPanel.lbl.Motorcfg = Motor configuration:
|
RocketPanel.lbl.Flightcfg = Flight configuration:
|
||||||
|
RocketPanel.but.FlightcfgEdit = Edit
|
||||||
RocketPanel.lbl.infoMessage = <html>Click to select Shift+click to select other Double-click to edit Click+drag to move
|
RocketPanel.lbl.infoMessage = <html>Click to select Shift+click to select other Double-click to edit Click+drag to move
|
||||||
|
|
||||||
|
|
||||||
@ -179,7 +180,7 @@ edtmotorconfdlg.but.Newconfiguration = New
|
|||||||
edtmotorconfdlg.but.Copyconfiguration = Copy
|
edtmotorconfdlg.but.Copyconfiguration = Copy
|
||||||
edtmotorconfdlg.but.Selectignition = Select ignition
|
edtmotorconfdlg.but.Selectignition = Select ignition
|
||||||
edtmotorconfdlg.lbl.Motormounts = <html><b>Motor mounts:</b>
|
edtmotorconfdlg.lbl.Motormounts = <html><b>Motor mounts:</b>
|
||||||
edtmotorconfdlg.title.Editmotorconf = Edit motor configurations
|
edtmotorconfdlg.title.Editmotorconf = Edit Flight configurations
|
||||||
edtmotorconfdlg.selectcomp = <html>Select which components function as motor mounts:
|
edtmotorconfdlg.selectcomp = <html>Select which components function as motor mounts:
|
||||||
edtmotorconfdlg.lbl.Motorconfig = <html><b>Motor configurations:</b>
|
edtmotorconfdlg.lbl.Motorconfig = <html><b>Motor configurations:</b>
|
||||||
edtmotorconfdlg.lbl.Configname = Configuration name:
|
edtmotorconfdlg.lbl.Configname = Configuration name:
|
||||||
@ -306,9 +307,10 @@ simedtdlg.tab.Simopt = Simulation options
|
|||||||
simedtdlg.tab.Plotdata = Plot data
|
simedtdlg.tab.Plotdata = Plot data
|
||||||
simedtdlg.tab.CustomExpressions = Custom expressions
|
simedtdlg.tab.CustomExpressions = Custom expressions
|
||||||
simedtdlg.tab.Exportdata = Export data
|
simedtdlg.tab.Exportdata = Export data
|
||||||
simedtdlg.lbl.Motorcfg = Motor configuration:
|
simedtdlg.lbl.Flightcfg = Flight configuration:
|
||||||
simedtdlg.lbl.ttip.Motorcfg = Select the motor configuration to use.
|
simedtdlg.but.FlightcfgEdit = Edit
|
||||||
simedtdlg.combo.ttip.motorconf = Select the motor configuration to use.
|
simedtdlg.lbl.ttip.Flightcfg = Select the flight configuration to use.
|
||||||
|
simedtdlg.combo.ttip.Flightcfg = Select the flight configuration to use.
|
||||||
simedtdlg.lbl.Wind = Wind
|
simedtdlg.lbl.Wind = Wind
|
||||||
simedtdlg.lbl.Averwindspeed = Average windspeed:
|
simedtdlg.lbl.Averwindspeed = Average windspeed:
|
||||||
simedtdlg.lbl.ttip.Averwindspeed = The average windspeed relative to the ground.
|
simedtdlg.lbl.ttip.Averwindspeed = The average windspeed relative to the ground.
|
||||||
@ -894,8 +896,8 @@ MassComponentCfg.but.Reset = Reset
|
|||||||
|
|
||||||
! MotorConfig
|
! MotorConfig
|
||||||
MotorCfg.checkbox.compmotormount = This component is a motor mount
|
MotorCfg.checkbox.compmotormount = This component is a motor mount
|
||||||
MotorCfg.lbl.Motorcfg = Motor configuration:
|
MotorCfg.lbl.Flightcfg = Flight configuration:
|
||||||
MotorCfg.but.New = New
|
MotorCfg.but.FlightcfgEdit = Edit
|
||||||
MotorCfg.lbl.Currentmotor = Current motor:
|
MotorCfg.lbl.Currentmotor = Current motor:
|
||||||
MotorCfg.lbl.Motoroverhang = Motor overhang:
|
MotorCfg.lbl.Motoroverhang = Motor overhang:
|
||||||
MotorCfg.lbl.Ignitionat = Ignition at:
|
MotorCfg.lbl.Ignitionat = Ignition at:
|
||||||
|
|||||||
@ -10,6 +10,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;
|
||||||
@ -26,13 +27,13 @@ import net.sf.openrocket.gui.adaptors.FlightConfigurationModel;
|
|||||||
import net.sf.openrocket.gui.components.BasicSlider;
|
import net.sf.openrocket.gui.components.BasicSlider;
|
||||||
import net.sf.openrocket.gui.components.StyledLabel;
|
import net.sf.openrocket.gui.components.StyledLabel;
|
||||||
import net.sf.openrocket.gui.components.UnitSelector;
|
import net.sf.openrocket.gui.components.UnitSelector;
|
||||||
|
import net.sf.openrocket.gui.dialogs.flightconfiguration.FlightConfigurationDialog;
|
||||||
import net.sf.openrocket.gui.dialogs.motor.MotorChooserDialog;
|
import net.sf.openrocket.gui.dialogs.motor.MotorChooserDialog;
|
||||||
import net.sf.openrocket.l10n.Translator;
|
import net.sf.openrocket.l10n.Translator;
|
||||||
import net.sf.openrocket.motor.Motor;
|
import net.sf.openrocket.motor.Motor;
|
||||||
import net.sf.openrocket.motor.ThrustCurveMotor;
|
import net.sf.openrocket.motor.ThrustCurveMotor;
|
||||||
import net.sf.openrocket.rocketcomponent.Configuration;
|
import net.sf.openrocket.rocketcomponent.Configuration;
|
||||||
import net.sf.openrocket.rocketcomponent.MotorConfiguration;
|
import net.sf.openrocket.rocketcomponent.MotorConfiguration;
|
||||||
import net.sf.openrocket.rocketcomponent.MotorConfiguration.IgnitionEvent;
|
|
||||||
import net.sf.openrocket.rocketcomponent.MotorMount;
|
import net.sf.openrocket.rocketcomponent.MotorMount;
|
||||||
import net.sf.openrocket.rocketcomponent.Rocket;
|
import net.sf.openrocket.rocketcomponent.Rocket;
|
||||||
import net.sf.openrocket.rocketcomponent.RocketComponent;
|
import net.sf.openrocket.rocketcomponent.RocketComponent;
|
||||||
@ -40,115 +41,115 @@ import net.sf.openrocket.startup.Application;
|
|||||||
import net.sf.openrocket.unit.UnitGroup;
|
import net.sf.openrocket.unit.UnitGroup;
|
||||||
|
|
||||||
public class MotorConfig extends JPanel {
|
public class MotorConfig extends JPanel {
|
||||||
|
|
||||||
private final Rocket rocket;
|
private final Rocket rocket;
|
||||||
private final MotorMount mount;
|
private final MotorMount mount;
|
||||||
private final Configuration configuration;
|
private final Configuration configuration;
|
||||||
private JPanel panel;
|
private JPanel panel;
|
||||||
private JLabel motorLabel;
|
private JLabel motorLabel;
|
||||||
private static final Translator trans = Application.getTranslator();
|
private static final Translator trans = Application.getTranslator();
|
||||||
|
|
||||||
public MotorConfig(MotorMount motorMount) {
|
public MotorConfig(MotorMount motorMount) {
|
||||||
super(new MigLayout("fill"));
|
super(new MigLayout("fill"));
|
||||||
|
|
||||||
this.rocket = ((RocketComponent) motorMount).getRocket();
|
this.rocket = ((RocketComponent) motorMount).getRocket();
|
||||||
this.mount = motorMount;
|
this.mount = motorMount;
|
||||||
this.configuration = ((RocketComponent) motorMount).getRocket().getDefaultConfiguration();
|
this.configuration = ((RocketComponent) motorMount).getRocket().getDefaultConfiguration();
|
||||||
|
|
||||||
BooleanModel model;
|
BooleanModel model;
|
||||||
|
|
||||||
model = new BooleanModel(motorMount, "MotorMount");
|
model = new BooleanModel(motorMount, "MotorMount");
|
||||||
JCheckBox check = new JCheckBox(model);
|
JCheckBox check = new JCheckBox(model);
|
||||||
////This component is a motor mount
|
////This component is a motor mount
|
||||||
check.setText(trans.get("MotorCfg.checkbox.compmotormount"));
|
check.setText(trans.get("MotorCfg.checkbox.compmotormount"));
|
||||||
this.add(check, "wrap");
|
this.add(check, "wrap");
|
||||||
|
|
||||||
|
|
||||||
panel = new JPanel(new MigLayout("fill"));
|
panel = new JPanel(new MigLayout("fill"));
|
||||||
this.add(panel, "grow, wrap");
|
this.add(panel, "grow, wrap");
|
||||||
|
|
||||||
|
|
||||||
// Motor configuration selector
|
// Motor configuration selector
|
||||||
//// Motor configuration:
|
//// Motor configuration:
|
||||||
panel.add(new JLabel(trans.get("MotorCfg.lbl.Motorcfg")), "shrink");
|
panel.add(new JLabel(trans.get("MotorCfg.lbl.Flightcfg")), "shrink");
|
||||||
|
|
||||||
JComboBox combo = new JComboBox(new FlightConfigurationModel(configuration));
|
JComboBox combo = new JComboBox(new FlightConfigurationModel(configuration));
|
||||||
panel.add(combo, "growx");
|
panel.add(combo, "growx");
|
||||||
|
|
||||||
configuration.addChangeListener(new ChangeListener() {
|
configuration.addChangeListener(new ChangeListener() {
|
||||||
@Override
|
@Override
|
||||||
public void stateChanged(ChangeEvent e) {
|
public void stateChanged(ChangeEvent e) {
|
||||||
updateFields();
|
updateFields();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
//// New button
|
//// Edit button
|
||||||
JButton button = new JButton(trans.get("MotorCfg.but.New"));
|
JButton button = new JButton(trans.get("MotorCfg.but.FlightcfgEdit"));
|
||||||
button.addActionListener(new ActionListener() {
|
button.addActionListener(new ActionListener() {
|
||||||
@Override
|
@Override
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
String id = rocket.newFlightConfigurationID();
|
JDialog configDialog = new FlightConfigurationDialog(rocket,SwingUtilities.windowForComponent(MotorConfig.this));
|
||||||
configuration.setFlightConfigurationID(id);
|
configDialog.show();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
panel.add(button, "wrap unrel");
|
panel.add(button, "wrap unrel");
|
||||||
|
|
||||||
|
|
||||||
// Current motor:
|
// Current motor:
|
||||||
panel.add(new JLabel(trans.get("MotorCfg.lbl.Currentmotor")), "shrink");
|
panel.add(new JLabel(trans.get("MotorCfg.lbl.Currentmotor")), "shrink");
|
||||||
|
|
||||||
motorLabel = new JLabel();
|
motorLabel = new JLabel();
|
||||||
motorLabel.setFont(motorLabel.getFont().deriveFont(Font.BOLD));
|
motorLabel.setFont(motorLabel.getFont().deriveFont(Font.BOLD));
|
||||||
updateFields();
|
updateFields();
|
||||||
panel.add(motorLabel, "wrap unrel");
|
panel.add(motorLabel, "wrap unrel");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Overhang
|
// Overhang
|
||||||
//// Motor overhang:
|
//// Motor overhang:
|
||||||
panel.add(new JLabel(trans.get("MotorCfg.lbl.Motoroverhang")));
|
panel.add(new JLabel(trans.get("MotorCfg.lbl.Motoroverhang")));
|
||||||
|
|
||||||
DoubleModel dm = new DoubleModel(motorMount, "MotorOverhang", UnitGroup.UNITS_LENGTH);
|
DoubleModel dm = new DoubleModel(motorMount, "MotorOverhang", UnitGroup.UNITS_LENGTH);
|
||||||
|
|
||||||
JSpinner spin = new JSpinner(dm.getSpinnerModel());
|
JSpinner spin = new JSpinner(dm.getSpinnerModel());
|
||||||
spin.setEditor(new SpinnerEditor(spin));
|
spin.setEditor(new SpinnerEditor(spin));
|
||||||
panel.add(spin, "span, split, width :65lp:");
|
panel.add(spin, "span, split, width :65lp:");
|
||||||
|
|
||||||
panel.add(new UnitSelector(dm), "width :30lp:");
|
panel.add(new UnitSelector(dm), "width :30lp:");
|
||||||
panel.add(new BasicSlider(dm.getSliderModel(-0.02, 0.06)), "w 100lp, wrap unrel");
|
panel.add(new BasicSlider(dm.getSliderModel(-0.02, 0.06)), "w 100lp, wrap unrel");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Select ignition event
|
// Select ignition event
|
||||||
//// Ignition at:
|
//// Ignition at:
|
||||||
panel.add(new JLabel(trans.get("MotorCfg.lbl.Ignitionat")), "");
|
panel.add(new JLabel(trans.get("MotorCfg.lbl.Ignitionat")), "");
|
||||||
|
|
||||||
combo = new JComboBox(new EnumModel<MotorConfiguration.IgnitionEvent>(mount, "DefaultIgnitionEvent"));
|
combo = new JComboBox(new EnumModel<MotorConfiguration.IgnitionEvent>(mount, "DefaultIgnitionEvent"));
|
||||||
panel.add(combo, "growx, wrap");
|
panel.add(combo, "growx, wrap");
|
||||||
|
|
||||||
// ... and delay
|
// ... and delay
|
||||||
//// plus
|
//// plus
|
||||||
panel.add(new JLabel(trans.get("MotorCfg.lbl.plus")), "gap indent, skip 1, span, split");
|
panel.add(new JLabel(trans.get("MotorCfg.lbl.plus")), "gap indent, skip 1, span, split");
|
||||||
|
|
||||||
dm = new DoubleModel(mount, "DefaultIgnitionDelay", 0);
|
dm = new DoubleModel(mount, "DefaultIgnitionDelay", 0);
|
||||||
spin = new JSpinner(dm.getSpinnerModel());
|
spin = new JSpinner(dm.getSpinnerModel());
|
||||||
spin.setEditor(new SpinnerEditor(spin,3));
|
spin.setEditor(new SpinnerEditor(spin,3));
|
||||||
panel.add(spin, "gap rel rel");
|
panel.add(spin, "gap rel rel");
|
||||||
|
|
||||||
//// seconds
|
//// seconds
|
||||||
panel.add(new JLabel(trans.get("MotorCfg.lbl.seconds")), "wrap unrel");
|
panel.add(new JLabel(trans.get("MotorCfg.lbl.seconds")), "wrap unrel");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Check stage count
|
// Check stage count
|
||||||
RocketComponent c = (RocketComponent) mount;
|
RocketComponent c = (RocketComponent) mount;
|
||||||
c = c.getRocket();
|
c = c.getRocket();
|
||||||
int stages = c.getChildCount();
|
int stages = c.getChildCount();
|
||||||
|
|
||||||
if (stages == 1) {
|
if (stages == 1) {
|
||||||
//// The current design has only one stage.
|
//// The current design has only one stage.
|
||||||
//// Stages can be added by clicking \"New stage\".
|
//// Stages can be added by clicking \"New stage\".
|
||||||
|
|
||||||
panel.add(new StyledLabel(trans.get("MotorCfg.lbl.longA1") + " " +
|
panel.add(new StyledLabel(trans.get("MotorCfg.lbl.longA1") + " " +
|
||||||
trans.get("MotorCfg.lbl.longA2"), -1),
|
trans.get("MotorCfg.lbl.longA2"), -1),
|
||||||
"spanx, right, wrap para");
|
"spanx, right, wrap para");
|
||||||
@ -159,7 +160,7 @@ public class MotorConfig extends JPanel {
|
|||||||
trans.get("MotorCfg.lbl.longB2"), -1),
|
trans.get("MotorCfg.lbl.longB2"), -1),
|
||||||
"skip 1, spanx, wrap para");
|
"skip 1, spanx, wrap para");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Select etc. buttons
|
// Select etc. buttons
|
||||||
//// Select motor
|
//// Select motor
|
||||||
@ -168,14 +169,14 @@ public class MotorConfig extends JPanel {
|
|||||||
@Override
|
@Override
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
String id = configuration.getFlightConfigurationID();
|
String id = configuration.getFlightConfigurationID();
|
||||||
|
|
||||||
MotorChooserDialog dialog = new MotorChooserDialog(mount.getMotor(id),
|
MotorChooserDialog dialog = new MotorChooserDialog(mount.getMotor(id),
|
||||||
mount.getMotorDelay(id), mount.getMotorMountDiameter(),
|
mount.getMotorDelay(id), mount.getMotorMountDiameter(),
|
||||||
SwingUtilities.getWindowAncestor(MotorConfig.this));
|
SwingUtilities.getWindowAncestor(MotorConfig.this));
|
||||||
dialog.setVisible(true);
|
dialog.setVisible(true);
|
||||||
Motor m = dialog.getSelectedMotor();
|
Motor m = dialog.getSelectedMotor();
|
||||||
double d = dialog.getSelectedDelay();
|
double d = dialog.getSelectedDelay();
|
||||||
|
|
||||||
if (m != null) {
|
if (m != null) {
|
||||||
if (id == null) {
|
if (id == null) {
|
||||||
id = rocket.newFlightConfigurationID();
|
id = rocket.newFlightConfigurationID();
|
||||||
@ -188,7 +189,7 @@ public class MotorConfig extends JPanel {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
panel.add(button, "span, split, growx");
|
panel.add(button, "span, split, growx");
|
||||||
|
|
||||||
//// Remove motor
|
//// Remove motor
|
||||||
button = new JButton(trans.get("MotorCfg.but.Removemotor"));
|
button = new JButton(trans.get("MotorCfg.but.Removemotor"));
|
||||||
button.addActionListener(new ActionListener() {
|
button.addActionListener(new ActionListener() {
|
||||||
@ -199,13 +200,13 @@ public class MotorConfig extends JPanel {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
panel.add(button, "growx, wrap");
|
panel.add(button, "growx, wrap");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Set enabled status
|
// Set enabled status
|
||||||
|
|
||||||
setDeepEnabled(panel, motorMount.isMotorMount());
|
setDeepEnabled(panel, motorMount.isMotorMount());
|
||||||
check.addChangeListener(new ChangeListener() {
|
check.addChangeListener(new ChangeListener() {
|
||||||
@Override
|
@Override
|
||||||
@ -213,9 +214,9 @@ public class MotorConfig extends JPanel {
|
|||||||
setDeepEnabled(panel, mount.isMotorMount());
|
setDeepEnabled(panel, mount.isMotorMount());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateFields() {
|
public void updateFields() {
|
||||||
String id = configuration.getFlightConfigurationID();
|
String id = configuration.getFlightConfigurationID();
|
||||||
Motor m = mount.getMotor(id);
|
Motor m = mount.getMotor(id);
|
||||||
@ -230,8 +231,8 @@ public class MotorConfig extends JPanel {
|
|||||||
motorLabel.setText(str);
|
motorLabel.setText(str);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private static void setDeepEnabled(Component component, boolean enabled) {
|
private static void setDeepEnabled(Component component, boolean enabled) {
|
||||||
component.setEnabled(enabled);
|
component.setEnabled(enabled);
|
||||||
if (component instanceof Container) {
|
if (component instanceof Container) {
|
||||||
@ -240,5 +241,5 @@ public class MotorConfig extends JPanel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -24,6 +24,7 @@ import javax.swing.JSpinner;
|
|||||||
import javax.swing.JTabbedPane;
|
import javax.swing.JTabbedPane;
|
||||||
import javax.swing.JTextField;
|
import javax.swing.JTextField;
|
||||||
import javax.swing.ListCellRenderer;
|
import javax.swing.ListCellRenderer;
|
||||||
|
import javax.swing.SwingUtilities;
|
||||||
import javax.swing.event.ChangeEvent;
|
import javax.swing.event.ChangeEvent;
|
||||||
import javax.swing.event.ChangeListener;
|
import javax.swing.event.ChangeListener;
|
||||||
import javax.swing.event.DocumentEvent;
|
import javax.swing.event.DocumentEvent;
|
||||||
@ -41,9 +42,11 @@ import net.sf.openrocket.gui.components.BasicSlider;
|
|||||||
import net.sf.openrocket.gui.components.DescriptionArea;
|
import net.sf.openrocket.gui.components.DescriptionArea;
|
||||||
import net.sf.openrocket.gui.components.SimulationExportPanel;
|
import net.sf.openrocket.gui.components.SimulationExportPanel;
|
||||||
import net.sf.openrocket.gui.components.UnitSelector;
|
import net.sf.openrocket.gui.components.UnitSelector;
|
||||||
|
import net.sf.openrocket.gui.dialogs.flightconfiguration.FlightConfigurationDialog;
|
||||||
import net.sf.openrocket.gui.plot.Axis;
|
import net.sf.openrocket.gui.plot.Axis;
|
||||||
import net.sf.openrocket.gui.plot.PlotConfiguration;
|
import net.sf.openrocket.gui.plot.PlotConfiguration;
|
||||||
import net.sf.openrocket.gui.plot.SimulationPlotPanel;
|
import net.sf.openrocket.gui.plot.SimulationPlotPanel;
|
||||||
|
import net.sf.openrocket.gui.scalefigure.RocketPanel;
|
||||||
import net.sf.openrocket.gui.util.GUIUtil;
|
import net.sf.openrocket.gui.util.GUIUtil;
|
||||||
import net.sf.openrocket.gui.util.Icons;
|
import net.sf.openrocket.gui.util.Icons;
|
||||||
import net.sf.openrocket.l10n.Translator;
|
import net.sf.openrocket.l10n.Translator;
|
||||||
@ -208,24 +211,34 @@ public class SimulationEditDialog extends JDialog {
|
|||||||
DoubleModel m;
|
DoubleModel m;
|
||||||
JSpinner spin;
|
JSpinner spin;
|
||||||
|
|
||||||
//// Motor selector
|
//// Flight selector
|
||||||
//// Motor configuration:
|
//// Flight configuration:
|
||||||
JLabel label = new JLabel(trans.get("simedtdlg.lbl.Motorcfg"));
|
JLabel label = new JLabel(trans.get("simedtdlg.lbl.Flightcfg"));
|
||||||
//// Select the motor configuration to use.
|
//// Select the motor configuration to use.
|
||||||
label.setToolTipText(trans.get("simedtdlg.lbl.ttip.Motorcfg"));
|
label.setToolTipText(trans.get("simedtdlg.lbl.ttip.Flightcfg"));
|
||||||
panel.add(label, "shrinkx, spanx, split 2");
|
panel.add(label, "shrinkx, spanx, split 2");
|
||||||
|
|
||||||
JComboBox combo = new JComboBox(new FlightConfigurationModel(configuration));
|
JComboBox combo = new JComboBox(new FlightConfigurationModel(configuration));
|
||||||
//// Select the motor configuration to use.
|
//// Select the motor configuration to use.
|
||||||
combo.setToolTipText(trans.get("simedtdlg.combo.ttip.motorconf"));
|
combo.setToolTipText(trans.get("simedtdlg.combo.ttip.Flightcfg"));
|
||||||
combo.addActionListener(new ActionListener() {
|
combo.addActionListener(new ActionListener() {
|
||||||
@Override
|
@Override
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
conditions.setMotorConfigurationID(configuration.getFlightConfigurationID());
|
conditions.setMotorConfigurationID(configuration.getFlightConfigurationID());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
panel.add(combo, "growx, wrap para");
|
panel.add(combo, "");
|
||||||
|
|
||||||
|
//// Edit button
|
||||||
|
JButton button = new JButton(trans.get("simedtdlg.but.FlightcfgEdit"));
|
||||||
|
button.addActionListener(new ActionListener() {
|
||||||
|
@Override
|
||||||
|
public void actionPerformed(ActionEvent e) {
|
||||||
|
JDialog configDialog = new FlightConfigurationDialog(document.getRocket(),SwingUtilities.windowForComponent(SimulationEditDialog.this));
|
||||||
|
configDialog.show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
panel.add(button, "wrap");
|
||||||
|
|
||||||
//// Wind settings: Average wind speed, turbulence intensity, std. deviation
|
//// Wind settings: Average wind speed, turbulence intensity, std. deviation
|
||||||
sub = new JPanel(new MigLayout("fill, gap rel unrel",
|
sub = new JPanel(new MigLayout("fill, gap rel unrel",
|
||||||
|
|||||||
@ -6,6 +6,7 @@ import java.awt.Dimension;
|
|||||||
import java.awt.Font;
|
import java.awt.Font;
|
||||||
import java.awt.Point;
|
import java.awt.Point;
|
||||||
import java.awt.event.ActionEvent;
|
import java.awt.event.ActionEvent;
|
||||||
|
import java.awt.event.ActionListener;
|
||||||
import java.awt.event.InputEvent;
|
import java.awt.event.InputEvent;
|
||||||
import java.awt.event.MouseEvent;
|
import java.awt.event.MouseEvent;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -21,7 +22,9 @@ import javax.swing.AbstractAction;
|
|||||||
import javax.swing.Action;
|
import javax.swing.Action;
|
||||||
import javax.swing.ComboBoxModel;
|
import javax.swing.ComboBoxModel;
|
||||||
import javax.swing.DefaultComboBoxModel;
|
import javax.swing.DefaultComboBoxModel;
|
||||||
|
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.JSlider;
|
import javax.swing.JSlider;
|
||||||
@ -45,6 +48,8 @@ import net.sf.openrocket.gui.components.BasicSlider;
|
|||||||
import net.sf.openrocket.gui.components.StageSelector;
|
import net.sf.openrocket.gui.components.StageSelector;
|
||||||
import net.sf.openrocket.gui.components.UnitSelector;
|
import net.sf.openrocket.gui.components.UnitSelector;
|
||||||
import net.sf.openrocket.gui.configdialog.ComponentConfigDialog;
|
import net.sf.openrocket.gui.configdialog.ComponentConfigDialog;
|
||||||
|
import net.sf.openrocket.gui.configdialog.MotorConfig;
|
||||||
|
import net.sf.openrocket.gui.dialogs.flightconfiguration.FlightConfigurationDialog;
|
||||||
import net.sf.openrocket.gui.figure3d.RocketFigure3d;
|
import net.sf.openrocket.gui.figure3d.RocketFigure3d;
|
||||||
import net.sf.openrocket.gui.figureelements.CGCaret;
|
import net.sf.openrocket.gui.figureelements.CGCaret;
|
||||||
import net.sf.openrocket.gui.figureelements.CPCaret;
|
import net.sf.openrocket.gui.figureelements.CPCaret;
|
||||||
@ -304,13 +309,23 @@ public class RocketPanel extends JPanel implements TreeSelectionListener, Change
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Motor configuration selector
|
// Flight configuration selector
|
||||||
//// Motor configuration:
|
//// Flight configuration:
|
||||||
JLabel label = new JLabel(trans.get("RocketPanel.lbl.Motorcfg"));
|
JLabel label = new JLabel(trans.get("RocketPanel.lbl.Flightcfg"));
|
||||||
label.setHorizontalAlignment(JLabel.RIGHT);
|
label.setHorizontalAlignment(JLabel.RIGHT);
|
||||||
add(label, "growx, right");
|
add(label, "growx, right");
|
||||||
add(new JComboBox(new FlightConfigurationModel(configuration)), "wrap");
|
add(new JComboBox(new FlightConfigurationModel(configuration)), "");
|
||||||
|
|
||||||
|
//// Edit button
|
||||||
|
JButton button = new JButton(trans.get("RocketPanel.but.FlightcfgEdit"));
|
||||||
|
button.addActionListener(new ActionListener() {
|
||||||
|
@Override
|
||||||
|
public void actionPerformed(ActionEvent e) {
|
||||||
|
JDialog configDialog = new FlightConfigurationDialog(document.getRocket(),SwingUtilities.windowForComponent(RocketPanel.this));
|
||||||
|
configDialog.show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
add(button, "wrap");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user