Merged l10n branch to trunk
[debian/openrocket] / src / net / sf / openrocket / rocketcomponent / Transition.java
index 098183596bd976a0c0eb0552fc4ca5fd06c17a0c..1c2adb36cbdb1ccb8e9a7aa38d8ce123dd3bf294 100644 (file)
@@ -1,21 +1,18 @@
 package net.sf.openrocket.rocketcomponent;
 
+import static java.lang.Math.*;
+import static net.sf.openrocket.util.MathUtil.*;
+
+import java.util.Collection;
+
 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 java.util.Collection;
-
-import static java.lang.Math.sin;
-import static java.lang.Math.sqrt;
-import static net.sf.openrocket.util.Chars.FRAC12;
-import static net.sf.openrocket.util.Chars.FRAC34;
-import static net.sf.openrocket.util.MathUtil.pow2;
-import static net.sf.openrocket.util.MathUtil.pow3;
-
 
 public class Transition extends SymmetricComponent {
+       private static final Translator trans = Application.getTranslator();
        private static final double CLIP_PRECISION = 0.0001;
        
 
@@ -35,7 +32,7 @@ public class Transition extends SymmetricComponent {
        private double aftShoulderThickness;
        private double aftShoulderLength;
        private boolean aftShoulderCapped;
-       private static final Translator trans = Application.getTranslator();
+       
 
        // Used to cache the clip length
        private double clipLength = -1;
@@ -503,26 +500,16 @@ public class Transition extends SymmetricComponent {
                clipLength = -1;
        }
        
-    /**
-     * Accept a visitor to this Transition in the component hierarchy.
-     * 
-     * @param theVisitor  the visitor that will be called back with a reference to this Transition
-     */
-    @Override 
-    public void accept (final ComponentVisitor theVisitor) {
-        theVisitor.visit(this);
-    }
-       
        /**
         * Check whether the given type can be added to this component.  Transitions allow any
         * InternalComponents to be added.
-        * 
-        * @param type  The RocketComponent class type to add.
+        *
+        * @param ctype  The RocketComponent class type to add.
         * @return      Whether such a component can be added.
         */
        @Override
-       public boolean isCompatible(Class<? extends RocketComponent> type) {
-               if (InternalComponent.class.isAssignableFrom(type))
+       public boolean isCompatible(Class<? extends RocketComponent> ctype) {
+               if (InternalComponent.class.isAssignableFrom(ctype))
                        return true;
                return false;
        }
@@ -531,7 +518,7 @@ public class Transition extends SymmetricComponent {
 
        /**
         * An enumeration listing the possible shapes of transitions.
-        * 
+        *
         * @author Sampo Niskanen <sampo.niskanen@iki.fi>
         */
        public static enum Shape {
@@ -621,20 +608,11 @@ public class Transition extends SymmetricComponent {
                                return sqrt(2 * radius * x - x * x); // radius/length * sphere
                        }
                },
+               
                //// Power series
                POWER(trans.get("Shape.Powerseries"),
-                               //// A power series nose cone has a profile of <i>Radius</i>&nbsp;&times;&nbsp;(<i>x</i>&nbsp;/&nbsp;<i>Length</i>)<sup><i>k</i></sup> where <i>k</i> is the shape parameter.  For <i>k</i>=0.5 this is a <b>
-                               trans.get("Shape.Powerseries.descA1") + FRAC12 + 
-                               //// -power</b> or <b>parabolic</b> nose cone, for <i>k</i>=0.75 a <b>
-                               trans.get("Shape.Powerseries.descA2") + FRAC34 + 
-                               //// -power</b>, and for <i>k</i>=1 a <b>conical</b> nose cone.
-                               trans.get("Shape.Powerseries.descA3"),
-                               //// A power series transition has a profile of <i>Radius</i>&nbsp;&times;&nbsp;(<i>x</i>&nbsp;/&nbsp;<i>Length</i>)<sup><i>k</i></sup> where <i>k</i> is the shape parameter.  For <i>k</i>=0.5 the transition is <b>
-                               trans.get("Shape.Powerseries.descB1") + FRAC12 + 
-                                               //// -power</b> or <b>parabolic</b>, for <i>k</i>=0.75 a <b>
-                               trans.get("Shape.Powerseries.descB2") + FRAC34 + 
-                                               //// -power</b>, and for <i>k</i>=1 <b>conical</b>.
-                               trans.get("Shape.Powerseries.descB3"), true) {
+                               trans.get("Shape.Powerseries.desc1"),
+                               trans.get("Shape.Powerseries.desc2"), true) {
                        @Override
                        public boolean usesParameter() { // Range 0...1
                                return true;
@@ -662,6 +640,7 @@ public class Transition extends SymmetricComponent {
                        }
                        
                },
+               
                //// Parabolic series
                PARABOLIC(trans.get("Shape.Parabolicseries"),
                                ////A parabolic series nose cone has a profile of a parabola.  The shape parameter defines the segment of the parabola to utilize.  The shape parameter 1.0 produces a <b>full parabola</b> which is tangent to the body tube, 0.75 produces a <b>3/4 parabola</b>, 0.5 procudes a <b>1/2 parabola</b> and 0 produces a <b>conical</b> nose cone.
@@ -671,7 +650,7 @@ public class Transition extends SymmetricComponent {
                        
                        // In principle a parabolic transition is clippable, but the difference is
                        // negligible.
-               
+                       
                        @Override
                        public boolean usesParameter() { // Range 0...1
                                return true;
@@ -694,13 +673,13 @@ public class Transition extends SymmetricComponent {
                        }
                },
                
-
                //// Haack series
                HAACK(trans.get("Shape.Haackseries"),
                                //// The Haack series nose cones are designed to minimize drag.  The shape parameter 0 produces an <b>LD-Haack</b> or <b>Von Karman</b> nose cone, which minimizes drag for fixed length and diameter, while a value of 0.333 produces an <b>LV-Haack</b> nose cone, which minimizes drag for fixed length and volume.
                                trans.get("Shape.Haackseries.desc1"),
                                //// The Haack series <i>nose cones</i> are designed to minimize drag.  These transition shapes are their equivalents, but do not necessarily produce optimal drag for transitions.  The shape parameter 0 produces an <b>LD-Haack</b> or <b>Von Karman</b> shape, while a value of 0.333 produces an <b>LV-Haack</b> shape.            
                                trans.get("Shape.Haackseries.desc2"), true) {
+                       
                        @Override
                        public boolean usesParameter() {
                                return true;
@@ -841,7 +820,7 @@ public class Transition extends SymmetricComponent {
                 * shape parameter at the point x from the tip of the component.  It is assumed
                 * that the fore radius if zero and the aft radius is <code>radius >= 0</code>.
                 * Boattails are achieved by reversing the component.
-                * 
+                *
                 * @param x      Position from the tip of the component.
                 * @param radius Aft end radius >= 0.
                 * @param length Length of the transition >= 0.