Add motor mount selection table to the Flight Configuration tab.

This commit is contained in:
kruland2607 2013-10-09 13:53:05 -05:00
parent e091f3341a
commit d6b19eb4b6

View File

@ -1,6 +1,5 @@
package net.sf.openrocket.gui.main.flightconfigpanel;
import java.awt.Component;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
@ -8,13 +7,17 @@ import java.awt.event.MouseEvent;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.ListSelectionModel;
import javax.swing.SwingUtilities;
import javax.swing.table.DefaultTableCellRenderer;
import net.miginfocom.swing.MigLayout;
import net.sf.openrocket.gui.components.StyledLabel;
import net.sf.openrocket.gui.components.StyledLabel.Style;
import net.sf.openrocket.gui.dialogs.flightconfiguration.IgnitionSelectionDialog;
import net.sf.openrocket.gui.dialogs.flightconfiguration.MotorMountConfigurationPanel;
import net.sf.openrocket.gui.dialogs.motor.MotorChooserDialog;
import net.sf.openrocket.motor.Motor;
import net.sf.openrocket.rocketcomponent.IgnitionConfiguration;
@ -25,7 +28,6 @@ import net.sf.openrocket.rocketcomponent.RocketComponent;
import net.sf.openrocket.unit.UnitGroup;
import net.sf.openrocket.util.Chars;
import net.sf.openrocket.util.Coordinate;
import net.sf.openrocket.util.Pair;
public class MotorConfigurationPanel extends FlightConfigurablePanel<MotorMount> {
@ -38,6 +40,23 @@ public class MotorConfigurationPanel extends FlightConfigurablePanel<MotorMount>
MotorConfigurationPanel(final FlightConfigurationPanel flightConfigurationPanel, Rocket rocket) {
super(flightConfigurationPanel,rocket);
{
//// Select motor mounts
JPanel subpanel = new JPanel(new MigLayout(""));
JLabel label = new StyledLabel(trans.get("lbl.motorMounts"), Style.BOLD);
subpanel.add(label, "wrap");
MotorMountConfigurationPanel mountConfigPanel = new MotorMountConfigurationPanel(this,rocket) {
@Override
public void onDataChanged() {
MotorConfigurationPanel.this.fireTableDataChanged();
}
};
subpanel.add(mountConfigPanel, "grow");
this.add(subpanel, "split, w 200lp, growy");
}
JScrollPane scroll = new JScrollPane(table);
this.add(scroll, "grow, wrap");