sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1466650 - in /sis/branches/JDK7/sis-referencing/src: main/java/org/apache/sis/geometry/ test/java/org/apache/sis/geometry/
Date Wed, 10 Apr 2013 19:54:20 GMT
Author: desruisseaux
Date: Wed Apr 10 19:54:19 2013
New Revision: 1466650

URL: http://svn.apache.org/r1466650
Log:
Move back the CRS as the first parameter for consistency with current practice.

Modified:
    sis/branches/JDK7/sis-referencing/src/main/java/org/apache/sis/geometry/DirectPosition2D.java
    sis/branches/JDK7/sis-referencing/src/main/java/org/apache/sis/geometry/Envelope2D.java
    sis/branches/JDK7/sis-referencing/src/main/java/org/apache/sis/geometry/ImmutableEnvelope.java
    sis/branches/JDK7/sis-referencing/src/test/java/org/apache/sis/geometry/AbstractEnvelopeTest.java
    sis/branches/JDK7/sis-referencing/src/test/java/org/apache/sis/geometry/Envelope2DTest.java

Modified: sis/branches/JDK7/sis-referencing/src/main/java/org/apache/sis/geometry/DirectPosition2D.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-referencing/src/main/java/org/apache/sis/geometry/DirectPosition2D.java?rev=1466650&r1=1466649&r2=1466650&view=diff
==============================================================================
--- sis/branches/JDK7/sis-referencing/src/main/java/org/apache/sis/geometry/DirectPosition2D.java
[UTF-8] (original)
+++ sis/branches/JDK7/sis-referencing/src/main/java/org/apache/sis/geometry/DirectPosition2D.java
[UTF-8] Wed Apr 10 19:54:19 2013
@@ -116,11 +116,11 @@ public class DirectPosition2D extends Po
      * The actual axis orientations are determined by the specified CRS.
      * See the <a href="#skip-navbar_top">class javadoc</a> for details.
      *
+     * @param crs The coordinate reference system, or {@code null}.
      * @param x   The first ordinate value (not necessarily horizontal).
      * @param y   The second ordinate value (not necessarily vertical).
-     * @param crs The coordinate reference system, or {@code null}.
      */
-    public DirectPosition2D(final double x, final double y, final CoordinateReferenceSystem
crs) {
+    public DirectPosition2D(final CoordinateReferenceSystem crs, final double x, final double
y) {
         super(x, y);
         this.crs = crs;
         ensureDimensionMatches("crs", 2, crs);

Modified: sis/branches/JDK7/sis-referencing/src/main/java/org/apache/sis/geometry/Envelope2D.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-referencing/src/main/java/org/apache/sis/geometry/Envelope2D.java?rev=1466650&r1=1466649&r2=1466650&view=diff
==============================================================================
--- sis/branches/JDK7/sis-referencing/src/main/java/org/apache/sis/geometry/Envelope2D.java
[UTF-8] (original)
+++ sis/branches/JDK7/sis-referencing/src/main/java/org/apache/sis/geometry/Envelope2D.java
[UTF-8] Wed Apr 10 19:54:19 2013
@@ -217,11 +217,11 @@ public class Envelope2D extends Rectangl
      * If the given rectangle has negative width or height, they will be interpreted
      * as an envelope spanning the anti-meridian.
      *
-     * @param rect The rectangle to copy (can not be {@code null}).
      * @param crs  The coordinate reference system, or {@code null}.
+     * @param rect The rectangle to copy (can not be {@code null}).
      * @throws MismatchedDimensionException If the given CRS is not two-dimensional.
      */
-    public Envelope2D(final Rectangle2D rect, final CoordinateReferenceSystem crs)
+    public Envelope2D(final CoordinateReferenceSystem crs, final Rectangle2D rect)
             throws MismatchedDimensionException
     {
         super(rect.getX(), rect.getY(), rect.getWidth(), rect.getHeight()); // Really 'super',
not 'this'.
@@ -244,8 +244,8 @@ public class Envelope2D extends Rectangl
      * @param  height The envelope height. May be negative for envelope spanning the anti-meridian.
      * @throws MismatchedDimensionException If the given CRS is not two-dimensional.
      */
-    public Envelope2D(final double x, final double y, final double width, final double height,
-            final CoordinateReferenceSystem crs) throws MismatchedDimensionException
+    public Envelope2D(final CoordinateReferenceSystem crs, final double x, final double y,
+            final double width, final double height) throws MismatchedDimensionException
     {
         super(x, y, width, height); // Really 'super', not 'this'.
         ensureDimensionMatches("crs", 2, crs);
@@ -303,7 +303,7 @@ public class Envelope2D extends Rectangl
      */
     @Override
     public DirectPosition2D getLowerCorner() {
-        return new DirectPosition2D(x, y, crs);
+        return new DirectPosition2D(crs, x, y);
     }
 
     /**
@@ -326,7 +326,7 @@ public class Envelope2D extends Rectangl
      */
     @Override
     public DirectPosition2D getUpperCorner() {
-        return new DirectPosition2D(x+width, y+height, crs);
+        return new DirectPosition2D(crs, x+width, y+height);
     }
 
     /**
@@ -692,7 +692,7 @@ public class Envelope2D extends Rectangl
     @Override
     public Envelope2D createIntersection(final Rectangle2D rect) {
         final Envelope2D env = (rect instanceof Envelope2D) ? (Envelope2D) rect : null;
-        final Envelope2D inter = new Envelope2D(NaN, NaN, NaN, NaN, crs);
+        final Envelope2D inter = new Envelope2D(crs, NaN, NaN, NaN, NaN);
         for (int i=0; i!=2; i++) {
             final double min0, min1, span0, span1;
             if (i == 0) {

Modified: sis/branches/JDK7/sis-referencing/src/main/java/org/apache/sis/geometry/ImmutableEnvelope.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-referencing/src/main/java/org/apache/sis/geometry/ImmutableEnvelope.java?rev=1466650&r1=1466649&r2=1466650&view=diff
==============================================================================
--- sis/branches/JDK7/sis-referencing/src/main/java/org/apache/sis/geometry/ImmutableEnvelope.java
[UTF-8] (original)
+++ sis/branches/JDK7/sis-referencing/src/main/java/org/apache/sis/geometry/ImmutableEnvelope.java
[UTF-8] Wed Apr 10 19:54:19 2013
@@ -116,12 +116,12 @@ public final class ImmutableEnvelope ext
      * <p>The main purpose of this method is to assign a non-null CRS when the envelope
to
      * copy has a null CRS.</p>
      *
-     * @param  envelope The envelope from which to copy ordinate values.
      * @param  crs      The CRS to assign to this envelope, or {@code null}.
+     * @param  envelope The envelope from which to copy ordinate values.
      * @throws MismatchedDimensionException If the dimension of the given CRS is not equals
      *         to the dimension of the given envelope.
      */
-    public ImmutableEnvelope(final Envelope envelope, final CoordinateReferenceSystem crs)
+    public ImmutableEnvelope(final CoordinateReferenceSystem crs, final Envelope envelope)
             throws MismatchedDimensionException
     {
         super(envelope);
@@ -142,13 +142,13 @@ public final class ImmutableEnvelope ext
      * See the javadoc of the {@link GeneralEnvelope#GeneralEnvelope(CharSequence) GeneralEnvelope}
      * constructor for more information.
      *
-     * @param  wkt The {@code BOX}, {@code POLYGON} or other kind of element to parse.
      * @param  crs The coordinate reference system, or {@code null} if none.
+     * @param  wkt The {@code BOX}, {@code POLYGON} or other kind of element to parse.
      * @throws IllegalArgumentException If the given string can not be parsed.
      * @throws MismatchedDimensionException If the dimension of the given CRS is not equals
      *         to the dimension of the parsed envelope.
      */
-    public ImmutableEnvelope(final CharSequence wkt, final CoordinateReferenceSystem crs)
+    public ImmutableEnvelope(final CoordinateReferenceSystem crs, final CharSequence wkt)
             throws IllegalArgumentException, MismatchedDimensionException
     {
         super(wkt);

Modified: sis/branches/JDK7/sis-referencing/src/test/java/org/apache/sis/geometry/AbstractEnvelopeTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-referencing/src/test/java/org/apache/sis/geometry/AbstractEnvelopeTest.java?rev=1466650&r1=1466649&r2=1466650&view=diff
==============================================================================
--- sis/branches/JDK7/sis-referencing/src/test/java/org/apache/sis/geometry/AbstractEnvelopeTest.java
[UTF-8] (original)
+++ sis/branches/JDK7/sis-referencing/src/test/java/org/apache/sis/geometry/AbstractEnvelopeTest.java
[UTF-8] Wed Apr 10 19:54:19 2013
@@ -82,7 +82,7 @@ public final strictfp class AbstractEnve
                 break;
             }
             case RECTANGLE: {
-                envelope = new Envelope2D(xmin, ymin, xmax - xmin, ymax - ymin, WGS84);
+                envelope = new Envelope2D(WGS84, xmin, ymin, xmax - xmin, ymax - ymin);
                 break;
             }
             default: throw new IllegalArgumentException(String.valueOf(type));

Modified: sis/branches/JDK7/sis-referencing/src/test/java/org/apache/sis/geometry/Envelope2DTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-referencing/src/test/java/org/apache/sis/geometry/Envelope2DTest.java?rev=1466650&r1=1466649&r2=1466650&view=diff
==============================================================================
--- sis/branches/JDK7/sis-referencing/src/test/java/org/apache/sis/geometry/Envelope2DTest.java
[UTF-8] (original)
+++ sis/branches/JDK7/sis-referencing/src/test/java/org/apache/sis/geometry/Envelope2DTest.java
[UTF-8] Wed Apr 10 19:54:19 2013
@@ -43,7 +43,7 @@ public final strictfp class Envelope2DTe
      */
     @Test
     public void testSerialization() {
-        final Envelope2D e1 = new Envelope2D(-20, -10, 40, 20, WGS84);
+        final Envelope2D e1 = new Envelope2D(WGS84, -20, -10, 40, 20);
         final Envelope2D e2 = assertSerializedEquals(e1);
         assertNotSame(e1, e2);
         validate(e2);



Mime
View raw message