]> git.gag.com Git - debian/openrocket/blobdiff - src/net/sf/openrocket/rocketcomponent/FinSet.java
bug fixes and rocket optimization
[debian/openrocket] / src / net / sf / openrocket / rocketcomponent / FinSet.java
index ea60d417c0c956848b9db166dff5341e04416614..e388b4a6f00579dc397b8e8b8c97a47a8e704732 100644 (file)
@@ -5,12 +5,17 @@ import java.util.Arrays;
 import java.util.Collection;
 import java.util.List;
 
+import net.sf.openrocket.l10n.Translator;
+import net.sf.openrocket.startup.Application;
 import net.sf.openrocket.util.Coordinate;
 import net.sf.openrocket.util.MathUtil;
 import net.sf.openrocket.util.Transformation;
 
 
 public abstract class FinSet extends ExternalComponent {
+       private static final Translator trans = Application.getTranslator();
+       
+       // FIXME:  converting triangular fins to freeform fails
        
        /**
         * Maximum allowed cant of fins.
@@ -19,9 +24,12 @@ public abstract class FinSet extends ExternalComponent {
        
        
        public enum CrossSection {
-               SQUARE("Square", 1.00),
-               ROUNDED("Rounded", 0.99),
-               AIRFOIL("Airfoil", 0.85);
+               //// Square
+               SQUARE(trans.get("FinSet.CrossSection.SQUARE"), 1.00),
+               //// Rounded
+               ROUNDED(trans.get("FinSet.CrossSection.ROUNDED"), 0.99),
+               //// Airfoil
+               AIRFOIL(trans.get("FinSet.CrossSection.AIRFOIL"), 0.85);
                
                private final String name;
                private final double volume;
@@ -42,9 +50,12 @@ public abstract class FinSet extends ExternalComponent {
        }
        
        public enum TabRelativePosition {
-               FRONT("Root chord leading edge"),
-               CENTER("Root chord midpoint"),
-               END("Root chord trailing edge");
+               //// Root chord leading edge
+               FRONT(trans.get("FinSet.TabRelativePosition.FRONT")),
+               //// Root chord midpoint
+               CENTER(trans.get("FinSet.TabRelativePosition.CENTER")),
+               //// Root chord trailing edge
+               END(trans.get("FinSet.TabRelativePosition.END"));
                
                private final String name;
                
@@ -465,7 +476,7 @@ public abstract class FinSet extends ExternalComponent {
        
        
        /*
-        * Return an approximation of the longitudal unitary inertia of the fin set.
+        * Return an approximation of the longitudinal unitary inertia of the fin set.
         * The process is the following:
         * 
         * 1. Approximate the fin with a rectangular fin
@@ -478,7 +489,7 @@ public abstract class FinSet extends ExternalComponent {
         *    set and multiplied by the number of fins.
         */
        @Override
-       public double getLongitudalUnitInertia() {
+       public double getLongitudinalUnitInertia() {
                double area = getFinArea();
                if (MathUtil.equals(area, 0))
                        return 0;
@@ -684,9 +695,7 @@ public abstract class FinSet extends ExternalComponent {
        
        
        @Override
-       protected void copyFrom(RocketComponent c) {
-               super.copyFrom(c);
-               
+       protected List<RocketComponent> copyFrom(RocketComponent c) {
                FinSet src = (FinSet) c;
                this.fins = src.fins;
                this.finRotation = src.finRotation;
@@ -700,5 +709,7 @@ public abstract class FinSet extends ExternalComponent {
                this.tabLength = src.tabLength;
                this.tabRelativePosition = src.tabRelativePosition;
                this.tabShift = src.tabShift;
+               
+               return super.copyFrom(c);
        }
 }