updates for 0.9.3
[debian/openrocket] / src / net / sf / openrocket / gui / configdialog / EllipticalFinSetConfig.java
index 51f45318f6958b1436b58583c178bc4671419b2d..e0939146c8089c4db4f3cadf54b078a1a4516e95 100644 (file)
@@ -1,17 +1,12 @@
 package net.sf.openrocket.gui.configdialog;
 
 
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-
-import javax.swing.JButton;
 import javax.swing.JComboBox;
 import javax.swing.JLabel;
 import javax.swing.JPanel;
 import javax.swing.JSeparator;
 import javax.swing.JSpinner;
 import javax.swing.SwingConstants;
-import javax.swing.SwingUtilities;
 
 import net.miginfocom.swing.MigLayout;
 import net.sf.openrocket.gui.SpinnerEditor;
@@ -22,7 +17,6 @@ import net.sf.openrocket.gui.components.BasicSlider;
 import net.sf.openrocket.gui.components.UnitSelector;
 import net.sf.openrocket.material.Material;
 import net.sf.openrocket.rocketcomponent.FinSet;
-import net.sf.openrocket.rocketcomponent.FreeformFinSet;
 import net.sf.openrocket.rocketcomponent.RocketComponent;
 import net.sf.openrocket.unit.UnitGroup;
 
@@ -64,6 +58,25 @@ public class EllipticalFinSetConfig extends FinSetConfig {
                panel.add(new BasicSlider(m.getSliderModel(-Math.PI,Math.PI)),"w 100lp, wrap");
                
                
+               ////  Fin cant
+               JLabel label = new JLabel("Fin cant:");
+               label.setToolTipText("The angle that the fins are canted with respect to the rocket " +
+                               "body.");
+               panel.add(label);
+               
+               m = new DoubleModel(component, "CantAngle", UnitGroup.UNITS_ANGLE,
+                               -FinSet.MAX_CANT, FinSet.MAX_CANT);
+               
+               spin = new JSpinner(m.getSpinnerModel());
+               spin.setEditor(new SpinnerEditor(spin));
+               panel.add(spin,"growx");
+               
+               panel.add(new UnitSelector(m),"growx");
+               panel.add(new BasicSlider(m.getSliderModel(-FinSet.MAX_CANT,FinSet.MAX_CANT)),
+                               "w 100lp, wrap");
+               
+
+               
                ////  Root chord
                panel.add(new JLabel("Root chord:"));
                
@@ -155,32 +168,6 @@ public class EllipticalFinSetConfig extends FinSetConfig {
                
                
                
-               //// Convert button
-               
-               JButton button = new JButton("Convert to freeform fin set");
-               button.addActionListener(new ActionListener() {
-                       @Override
-                       public void actionPerformed(ActionEvent e) {
-                               // Do change in future for overall safety
-                               SwingUtilities.invokeLater(new Runnable() {
-                                       @Override
-                                       public void run() {
-                                               FreeformFinSet freeform = new FreeformFinSet((FinSet)component);
-                                               RocketComponent parent = component.getParent();
-                                               int index = parent.getChildPosition(component);
-                                               
-                                               ComponentConfigDialog.addUndoPosition("Convert fin set");
-                                               parent.removeChild(index);
-                                               parent.addChild(freeform, index);
-                                               ComponentConfigDialog.showDialog(freeform);
-                                       }
-                               });
-
-                               ComponentConfigDialog.hideDialog();
-                       }
-               });
-               panel.add(button,"span, growx, gaptop paragraph");
-               
                
                
                mainPanel.add(panel,"aligny 20%");