Merged l10n branch to trunk
[debian/openrocket] / src / net / sf / openrocket / rocketcomponent / FreeformFinSet.java
index cdbb7c3e607c833bab72f92c1440539314558933..ffa44be37b0bc04e1130afdaec234e064f007aa0 100644 (file)
@@ -15,7 +15,7 @@ import net.sf.openrocket.util.Coordinate;
 public class FreeformFinSet extends FinSet {
        private static final LogHelper log = Application.getLogger();
        private static final Translator trans = Application.getTranslator();
-
+       
        private ArrayList<Coordinate> points = new ArrayList<Coordinate>();
        
        public FreeformFinSet() {
@@ -36,7 +36,7 @@ public class FreeformFinSet extends FinSet {
        public FreeformFinSet(FinSet finset) {
                Coordinate[] finpoints = finset.getFinPoints();
                this.copyFrom(finset);
-               
+
                points.clear();
                for (Coordinate c: finpoints) {
                        points.add(c);
@@ -52,7 +52,7 @@ public class FreeformFinSet extends FinSet {
         * inserted in its stead.
         * <p>
         * The specified fin set should not be used after the call!
-        * 
+        *
         * @param finset        the fin set to convert.
         * @return                      the new freeform fin set.
         */
@@ -122,7 +122,7 @@ public class FreeformFinSet extends FinSet {
        /**
         * Add a fin point between indices <code>index-1</code> and <code>index</code>.
         * The point is placed at the midpoint of the current segment.
-        * 
+        *
         * @param index   the fin point before which to add the new point.
         */
        public void addPoint(int index) {
@@ -143,7 +143,7 @@ public class FreeformFinSet extends FinSet {
         * Remove the fin point with the given index.  The first and last fin points
         * cannot be removed, and will cause an <code>IllegalFinPointException</code>
         * if attempted.
-        * 
+        *
         * @param index   the fin point index to remove
         * @throws IllegalFinPointException if removing would result in invalid fin planform
         */
@@ -182,13 +182,13 @@ public class FreeformFinSet extends FinSet {
         * Set the point at position <code>i</code> to coordinates (x,y).
         * <p>
         * Note that this method enforces basic fin shape restrictions (non-negative y,
-        * first and last point locations) silently, but throws an 
+        * first and last point locations) silently, but throws an
         * <code>IllegalFinPointException</code> if the point causes fin segments to
         * intersect.
         * <p>
         * Moving of the first point in the X-axis is allowed, but this actually moves
         * all of the other points the corresponding distance back.
-        * 
+        *
         * @param index the point index to modify.
         * @param x             the x-coordinate.
         * @param y             the y-coordinate.
@@ -317,30 +317,20 @@ public class FreeformFinSet extends FinSet {
                return c;
        }
        
-       /**
-        * Accept a visitor to this FreeformFinSet in the component hierarchy.
-        * 
-        * @param theVisitor  the visitor that will be called back with a reference to this FreeformFinSet
-        */
-       @Override
-       public void accept(ComponentVisitor theVisitor) {
-               theVisitor.visit(this);
-       }
-       
-       private void validate(ArrayList<Coordinate> points) throws IllegalFinPointException {
-               final int n = points.size();
-               if (points.get(0).x != 0 || points.get(0).y != 0 ||
-                               points.get(n - 1).x < 0 || points.get(n - 1).y != 0) {
+       private void validate(ArrayList<Coordinate> pts) throws IllegalFinPointException {
+               final int n = pts.size();
+               if (pts.get(0).x != 0 || pts.get(0).y != 0 ||
+                               pts.get(n - 1).x < 0 || pts.get(n - 1).y != 0) {
                        throw new IllegalFinPointException("Start or end point illegal.");
                }
                for (int i = 0; i < n - 1; i++) {
                        for (int j = i + 2; j < n - 1; j++) {
-                               if (intersects(points.get(i).x, points.get(i).y, points.get(i + 1).x, points.get(i + 1).y,
-                                                               points.get(j).x, points.get(j).y, points.get(j + 1).x, points.get(j + 1).y)) {
+                               if (intersects(pts.get(i).x, pts.get(i).y, pts.get(i + 1).x, pts.get(i + 1).y,
+                                                               pts.get(j).x, pts.get(j).y, pts.get(j + 1).x, pts.get(j + 1).y)) {
                                        throw new IllegalFinPointException("segments intersect");
                                }
                        }
-                       if (points.get(i).z != 0) {
+                       if (pts.get(i).z != 0) {
                                throw new IllegalFinPointException("z-coordinate not zero");
                        }
                }