You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sis.apache.org by de...@apache.org on 2015/03/31 23:07:48 UTC
svn commit: r1670479 [3/12] - in /sis/branches/JDK7: ./
application/sis-console/src/main/java/org/apache/sis/console/
application/sis-webapp/src/main/java/org/apache/sis/services/
core/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/ core...
Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/DefaultScopeDescription.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/DefaultScopeDescription.java?rev=1670479&r1=1670478&r2=1670479&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/DefaultScopeDescription.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/DefaultScopeDescription.java [UTF-8] Tue Mar 31 21:07:44 2015
@@ -37,12 +37,12 @@ import static org.apache.sis.util.collec
/**
* Description of the class of information covered by the information.
*
- * {@section Relationship between properties}
+ * <div class="section">Relationship between properties</div>
* ISO 19115 defines {@code ScopeDescription} as an <cite>union</cite> (in the C/C++ sense):
* only one of the properties in this class can be set to a non-empty value.
* Setting any property to a non-empty value discard all the other ones.
*
- * {@section Limitations}
+ * <div class="section">Limitations</div>
* <ul>
* <li>Instances of this class are not synchronized for multi-threading.
* Synchronization, if needed, is caller's responsibility.</li>
@@ -276,7 +276,7 @@ public class DefaultScopeDescription ext
/**
* Sets the dataset to which the information applies.
*
- * {@section Effect on other properties}
+ * <div class="section">Effect on other properties</div>
* If and only if the {@code newValue} is non-null, then this method automatically
* discards all other properties.
*
@@ -295,12 +295,12 @@ public class DefaultScopeDescription ext
* Returns the feature types to which the information applies.
*
* <div class="note"><b>Example:</b>
- * If an administrative area performs a complete re-survey of the road network,
+ * if an administrative area performs a complete re-survey of the road network,
* the change can be recorded at {@link ScopeCode#FEATURE_TYPE} level with a
* “<cite>Administrative area A — Road network</cite>” description.
* </div>
*
- * {@section Conditions}
+ * <div class="section">Conditions</div>
* This method returns a modifiable collection only if no other property is set.
* Otherwise, this method returns an unmodifiable empty collection.
*
@@ -314,7 +314,7 @@ public class DefaultScopeDescription ext
/**
* Sets the feature types to which the information applies.
*
- * {@section Effect on other properties}
+ * <div class="section">Effect on other properties</div>
* If and only if the {@code newValue} is non-empty, then this method automatically
* discards all other properties.
*
@@ -328,12 +328,12 @@ public class DefaultScopeDescription ext
* Returns the attribute types to which the information applies.
*
* <div class="note"><b>Example:</b>
- * If an administrative area detects an anomaly in all overhead clearance of the road survey,
+ * if an administrative area detects an anomaly in all overhead clearance of the road survey,
* the correction can be recorded at {@link ScopeCode#ATTRIBUTE_TYPE} level with a
* “<cite>Administrative area A — Overhead clearance</cite>” description.
* </div>
*
- * {@section Conditions}
+ * <div class="section">Conditions</div>
* This method returns a modifiable collection only if no other property is set.
* Otherwise, this method returns an unmodifiable empty collection.
*
@@ -347,7 +347,7 @@ public class DefaultScopeDescription ext
/**
* Sets the attribute types to which the information applies.
*
- * {@section Effect on other properties}
+ * <div class="section">Effect on other properties</div>
* If and only if the {@code newValue} is non-empty, then this method automatically
* discards all other properties.
*
@@ -366,7 +366,7 @@ public class DefaultScopeDescription ext
* “<cite>Administrative area A — New bridge</cite>” description.
* </div>
*
- * {@section Conditions}
+ * <div class="section">Conditions</div>
* This method returns a modifiable collection only if no other property is set.
* Otherwise, this method returns an unmodifiable empty collection.
*
@@ -380,7 +380,7 @@ public class DefaultScopeDescription ext
/**
* Sets the feature instances to which the information applies.
*
- * {@section Effect on other properties}
+ * <div class="section">Effect on other properties</div>
* If and only if the {@code newValue} is non-empty, then this method automatically
* discards all other properties.
*
@@ -399,7 +399,7 @@ public class DefaultScopeDescription ext
* “<cite>Administrative area A — New bridge — Overhead clearance</cite>” description.
* </div>
*
- * {@section Conditions}
+ * <div class="section">Conditions</div>
* This method returns a modifiable collection only if no other property is set.
* Otherwise, this method returns an unmodifiable empty collection.
*
@@ -413,7 +413,7 @@ public class DefaultScopeDescription ext
/**
* Sets the attribute instances to which the information applies.
*
- * {@section Effect on other properties}
+ * <div class="section">Effect on other properties</div>
* If and only if the {@code newValue} is non-empty, then this method automatically
* discards all other properties.
*
@@ -438,7 +438,7 @@ public class DefaultScopeDescription ext
* Sets the class of information that does not fall into the other categories to
* which the information applies.
*
- * {@section Effect on other properties}
+ * <div class="section">Effect on other properties</div>
* If and only if the {@code newValue} is non-null, then this method automatically
* discards all other properties.
*
Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/package-info.java?rev=1670479&r1=1670478&r2=1670479&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/package-info.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/package-info.java [UTF-8] Tue Mar 31 21:07:44 2015
@@ -20,7 +20,7 @@
* An explanation for this package is provided in the {@linkplain org.opengis.metadata.maintenance OpenGIS® javadoc}.
* The remaining discussion on this page is specific to the SIS implementation.
*
- * {@section Overview}
+ * <div class="section">Overview</div>
* For a global overview of metadata in SIS, see the {@link org.apache.sis.metadata} package javadoc.
*
* <table class="sis">
@@ -44,7 +44,7 @@
* {@code └─} {@linkplain org.apache.sis.metadata.iso.maintenance.DefaultScopeDescription Scope description}<br>
* </td></tr></table>
*
- * {@section Null values, nil objects and collections}
+ * <div class="section">Null values, nil objects and collections</div>
* All constructors and setter methods accept {@code null} arguments.
* A null argument value means that the metadata element can not be provided, and the reason for that is unspecified.
* Alternatively, users can specify why a metadata element is missing by providing a value created by
Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/package-info.java?rev=1670479&r1=1670478&r2=1670479&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/package-info.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/package-info.java [UTF-8] Tue Mar 31 21:07:44 2015
@@ -20,7 +20,7 @@
* An explanation for this package is provided in the {@linkplain org.opengis.metadata OpenGIS® javadoc}.
* The remaining discussion on this page is specific to the SIS implementation.
*
- * {@section Overview}
+ * <div class="section">Overview</div>
* For a global overview of metadata in SIS, see the {@link org.apache.sis.metadata} package javadoc.
* For some explanation about how to use various ISO 19115 elements for scientific dataset, the
* <a href="https://geo-ide.noaa.gov/wiki/index.php?title=Category:ISO_19115">NOAA wiki page</a>
@@ -57,7 +57,7 @@
* {@code └─} {@linkplain org.apache.sis.metadata.iso.DefaultIdentifier Identifier}<br>
* </td></tr></table>
*
- * {@section Localization}
+ * <div class="section">Localization</div>
* When a metadata object is marshalled as an ISO 19139 compliant XML document, the marshaller
* {@link org.apache.sis.xml.XML#LOCALE} property will be used for the localization of every
* {@link org.opengis.util.InternationalString} and {@link org.opengis.util.CodeList} instances,
@@ -66,7 +66,7 @@
* {@link org.apache.sis.metadata.iso.DefaultMetadata#setLanguage setLanguage(Locale)} method
* will have precedence. The later behavior is compliant with INSPIRE rules.
*
- * {@section Null values, nil objects and collections}
+ * <div class="section">Null values, nil objects and collections</div>
* All constructors and setter methods accept {@code null} arguments.
* A null argument value means that the metadata element can not be provided, and the reason for that is unspecified.
* Alternatively, users can specify why a metadata element is missing by providing a value created by
Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractElement.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractElement.java?rev=1670479&r1=1670478&r2=1670479&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractElement.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractElement.java [UTF-8] Tue Mar 31 21:07:44 2015
@@ -150,7 +150,6 @@ public class AbstractElement extends ISO
/**
* Returns the type of elements in this list.
- * @return
*/
@Override
public Class<Date> getElementType() {
Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultDataQuality.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultDataQuality.java?rev=1670479&r1=1670478&r2=1670479&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultDataQuality.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultDataQuality.java [UTF-8] Tue Mar 31 21:07:44 2015
@@ -30,11 +30,11 @@ import org.apache.sis.metadata.iso.ISOMe
/**
* Quality information for the data specified by a data quality scope.
*
- * {@section Relationship between properties}
+ * <div class="section">Relationship between properties</div>
* According ISO 19115, at least one of {@linkplain #getLineage() lineage} and
* {@linkplain #getReports() reports} shall be provided.
*
- * {@section Limitations}
+ * <div class="section">Limitations</div>
* <ul>
* <li>Instances of this class are not synchronized for multi-threading.
* Synchronization, if needed, is caller's responsibility.</li>
Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/package-info.java?rev=1670479&r1=1670478&r2=1670479&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/package-info.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/package-info.java [UTF-8] Tue Mar 31 21:07:44 2015
@@ -20,7 +20,7 @@
* An explanation for this package is provided in the {@linkplain org.opengis.metadata.quality OpenGIS® javadoc}.
* The remaining discussion on this page is specific to the SIS implementation.
*
- * {@section Overview}
+ * <div class="section">Overview</div>
* For a global overview of metadata in SIS, see the {@link org.apache.sis.metadata} package javadoc.
*
* <table class="sis">
@@ -91,7 +91,7 @@
* {@linkplain org.apache.sis.metadata.iso.quality.DefaultCoverageResult Coverage result}<br>
* </td></tr></table>
*
- * {@section Null values, nil objects and collections}
+ * <div class="section">Null values, nil objects and collections</div>
* All constructors and setter methods accept {@code null} arguments.
* A null argument value means that the metadata element can not be provided, and the reason for that is unspecified.
* Alternatively, users can specify why a metadata element is missing by providing a value created by
Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGeorectified.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGeorectified.java?rev=1670479&r1=1670478&r2=1670479&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGeorectified.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGeorectified.java [UTF-8] Tue Mar 31 21:07:44 2015
@@ -37,12 +37,12 @@ import org.apache.sis.xml.Namespaces;
* Any cell in the grid can be geolocated given its grid coordinate and the grid origin, cell spacing,
* and orientation indication of whether or not geographic.
*
- * {@section Relationship between properties}
+ * <div class="section">Relationship between properties</div>
* Providing the {@linkplain #getCheckPointDescription() check point description} implies that
* {@linkplain #isCheckPointAvailable() check point availability} is {@code true}. The setter
* methods will ensure that this condition is not violated.
*
- * {@section Limitations}
+ * <div class="section">Limitations</div>
* <ul>
* <li>Instances of this class are not synchronized for multi-threading.
* Synchronization, if needed, is caller's responsibility.</li>
@@ -198,7 +198,7 @@ public class DefaultGeorectified extends
* Sets an indication of whether or not geographic position points are available to test the
* accuracy of the georeferenced grid data.
*
- * {@section Effect on other properties}
+ * <div class="section">Effect on other properties</div>
* If and only if the given {@code newValue} is {@code false}, then this method automatically hides
* the {@linkplain #setCheckPointDescription check point description} property. The description can
* be shown again by reverting {@code checkPointAvailability} to {@code true}.
@@ -235,7 +235,7 @@ public class DefaultGeorectified extends
* Sets the description of geographic position points used to test the accuracy of the
* georeferenced grid data.
*
- * {@section Effect on other properties}
+ * <div class="section">Effect on other properties</div>
* If and only if the given {@code newValue} is non-null, then this method automatically sets
* the {@linkplain #setCheckPointAvailable check point availability} property to {@code true}.
*
Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/package-info.java?rev=1670479&r1=1670478&r2=1670479&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/package-info.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/package-info.java [UTF-8] Tue Mar 31 21:07:44 2015
@@ -20,7 +20,7 @@
* An explanation for this package is provided in the {@linkplain org.opengis.metadata.spatial OpenGIS® javadoc}.
* The remaining discussion on this page is specific to the SIS implementation.
*
- * {@section Overview}
+ * <div class="section">Overview</div>
* For a global overview of metadata in SIS, see the {@link org.apache.sis.metadata} package javadoc.
*
* <table class="sis">
@@ -66,7 +66,7 @@
* {@linkplain org.opengis.metadata.spatial.SpatialRepresentationType Spatial representation type} «code list»<br>
* </td></tr></table>
*
- * {@section Null values, nil objects and collections}
+ * <div class="section">Null values, nil objects and collections</div>
* All constructors and setter methods accept {@code null} arguments.
* A null argument value means that the metadata element can not be provided, and the reason for that is unspecified.
* Alternatively, users can specify why a metadata element is missing by providing a value created by
Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/package-info.java?rev=1670479&r1=1670478&r2=1670479&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/package-info.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/package-info.java [UTF-8] Tue Mar 31 21:07:44 2015
@@ -18,13 +18,13 @@
/**
* Root package for various metadata implementations.
*
- * {@section Foreword}
+ * <div class="section">Foreword</div>
* Many metadata standards exist, including <cite>Dublin core</cite>, <cite>ISO 19115</cite> and the Image I/O
* metadata defined in {@link javax.imageio.metadata}. The SIS implementation focuses on ISO 19115 (including
* its ISO 19115-2 extension), but the classes are designed in a way that allow the usage of different standards.
* This genericity goal should be keep in mind in the discussion below.
*
- * {@section How Metadata are defined}
+ * <div class="section">How Metadata are defined</div>
* A metadata standard is defined by a set of Java interfaces belonging to a specific package and its sub-packages.
* For example the ISO 19115 standard is defined by the <a href="http://www.geoapi.org">GeoAPI</a> interfaces
* defined in the {@link org.opengis.metadata} package and sub-packages. That standard is identified in SIS by the
@@ -45,7 +45,7 @@
* or {@code Default}.</p>
*
* <p><b>Notes:</b></p>
- * <ul>
+ * <ul class="verbose">
* <li>The {@code Abstract} prefix means that the class is abstract in the sense of the implemented standard.
* It it not necessarily abstract in the sense of Java. Because incomplete metadata are common in practice,
* sometime we wish to instantiate an "abstract" class despite the lack of knowledge about the exact sub-type.</li>
@@ -59,7 +59,7 @@
* package for generating metadata implementations backed by the content of a database.</li>
* </ul>
*
- * {@section How Metadata are handled}
+ * <div class="section">How Metadata are handled</div>
* Metadata objects in SIS are mostly containers: they provide getter and setter methods for manipulating the values
* associated to properties (for example the {@code title} property of a {@code Citation} object), but provide few logic.
* The package {@link org.apache.sis.metadata.iso} and its sub-packages are the main examples of such containers.
@@ -70,19 +70,19 @@
* and fallback on the reflection technic when the type is known only at runtime.</p>
*
* <p>Using Java reflection, a metadata can be viewed in many different ways:</p>
- * <ul>
- * <li><p><b>As a {@link java.util.Map}</b><br>
+ * <ul class="verbose">
+ * <li><b>As a {@link java.util.Map}</b><br>
* The {@link org.apache.sis.metadata.MetadataStandard} class provides various methods returning a view
* of an arbitrary metadata implementation as a {@code Map}, where the key are the property names and the
* values are the return values, types or descriptions of getter methods. The map is writable if the
* underlying metadata implementation has setter methods, otherwise attempts to set a value throw an
- * {@code UnmodifiableMetadataException}.</p></li>
+ * {@code UnmodifiableMetadataException}.</li>
*
- * <li><p><b>As a {@link org.apache.sis.util.collection.TreeTable}</b><br>
+ * <li><b>As a {@link org.apache.sis.util.collection.TreeTable}</b><br>
* The metadata are organized as a tree. For example the {@code Citation} metadata contains one or many
* {@code ResponsibleParty} elements, each of them containing a {@code Contact} element, which contains
* a {@code Telephone} element, <i>etc</i>. For each node, there is many information that can be displayed
- * in columns:</p>
+ * in columns:
* <ul>
* <li>A description of the element.</li>
* <li>The type of values ({@code String}, {@code double}, <i>etc</i>).</li>
@@ -91,8 +91,8 @@
* <li>The value stored in the element, or the default value.</li>
* </ul></li>
*
- * <li><p><b>As a table record in a database (using {@link org.apache.sis.metadata.sql})</b><br>
- * It is possible to establish the following mapping between metadata and a SQL database:</p>
+ * <li><b>As a table record in a database (using {@link org.apache.sis.metadata.sql})</b><br>
+ * It is possible to establish the following mapping between metadata and a SQL database:
* <ul>
* <li>Each metadata interface maps to a table of the same name in the database.</li>
* <li>Each property in the above interface maps to a column of the same name in the above table.</li>
@@ -102,7 +102,7 @@
* where each call to a getter method is translated into a SQL query for the above database.</li>
* </ul>
*
- * {@section How Metadata are marshalled}
+ * <div class="section">How Metadata are marshalled</div>
* The ISO 19139 standard defines how ISO 19115 metadata shall be represented in XML.
* The SIS library supports XML marshalling and unmarshalling with JAXB annotations.
*
Modified: sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/NameMapTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/NameMapTest.java?rev=1670479&r1=1670478&r2=1670479&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/NameMapTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/NameMapTest.java [UTF-8] Tue Mar 31 21:07:44 2015
@@ -92,7 +92,7 @@ public final strictfp class NameMapTest
* it would just consume more memory than needed. We want to intern those strings because they usually
* match method names or field names, which are already interned by the JVM.
*
- * {@section Explicit calls to <code>String.intern()</code>}
+ * <div class="section">Explicit calls to {@code String.intern()}</div>
* I though that annotation strings were interned like any other constants, but it does not
* seem to be the case as of JDK7. To check if a future JDK release still needs explicit
* call to {@link String#intern()}, try to remove the "{@code .intern()}" part in the
Modified: sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeNodeChildrenTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeNodeChildrenTest.java?rev=1670479&r1=1670478&r2=1670479&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeNodeChildrenTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeNodeChildrenTest.java [UTF-8] Tue Mar 31 21:07:44 2015
@@ -40,7 +40,7 @@ import static org.apache.sis.test.TestUt
* Tests the {@link TreeNodeChildren} class.
* Unless otherwise specified, all tests use the {@link MetadataStandard#ISO_19115} constant.
*
- * {@section Test dependency}
+ * <div class="section">Test dependency</div>
* This class uses the {@link TreeNode#getUserObject()} method for comparing the values.
* We can hardly avoid to use some {@code TreeNode} methods because of the cross-dependencies.
* However we try to use nothing else than {@code getUserObject()} because the purpose of this
Modified: sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeNodeTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeNodeTest.java?rev=1670479&r1=1670478&r2=1670479&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeNodeTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeNodeTest.java [UTF-8] Tue Mar 31 21:07:44 2015
@@ -129,7 +129,7 @@ public final strictfp class TreeNodeTest
/**
* Tests {@link TreeNode#getName()} on a metadata with only one entry in collections.
- * Those names shall <em>not</em> contain numbering like "<cite>(1 of 2)</cite>".
+ * Those names shall <em>not</em> contain numbering like <cite>"(1 of 2)"</cite>.
*/
@Test
@DependsOnMethod("testRootNode") // Because tested more basic methods than 'getValue(TableColumn)'.
@@ -146,7 +146,7 @@ public final strictfp class TreeNodeTest
/**
* Tests {@link TreeNode#getName()} on a metadata with more than one entry in collections.
- * Those names <em>shall</em> contain numbering like "<cite>(1 of 2)</cite>".
+ * Those names <em>shall</em> contain numbering like <cite>"(1 of 2)"</cite>.
*/
@Test
@DependsOnMethod("testGetNameForSingleton")
@@ -194,7 +194,7 @@ public final strictfp class TreeNodeTest
/**
* Tests {@link TreeNode#getIdentifier()} on a metadata with a hierarchy.
- * Those names shall <em>not</em> contain numbering like "<cite>(1 of 2)</cite>", even if the same
+ * Those names shall <em>not</em> contain numbering like <cite>"(1 of 2)"</cite>, even if the same
* identifiers are repeated. Those identifiers are not intended to be unique in a list of children.
* The repetition of the same identifier means that they shall be part of a collection.
*/
Modified: sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/CustomMetadataTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/CustomMetadataTest.java?rev=1670479&r1=1670478&r2=1670479&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/CustomMetadataTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/CustomMetadataTest.java [UTF-8] Tue Mar 31 21:07:44 2015
@@ -25,6 +25,7 @@ import java.lang.reflect.Method;
import java.lang.reflect.InvocationHandler;
import java.nio.charset.Charset;
import javax.xml.bind.JAXBException;
+import org.opengis.util.NameFactory;
import org.opengis.metadata.Identifier;
import org.opengis.metadata.identification.*;
import org.opengis.metadata.citation.Citation;
@@ -102,17 +103,18 @@ public final strictfp class CustomMetada
*/
@Test
public void testSubtypeAttributes() throws JAXBException {
+ final NameFactory factory = DefaultFactories.forBuildin(NameFactory.class);
final DataIdentification identification = new DataIdentification() {
@Override public InternationalString getAbstract() {
Map<Locale, String> names = new HashMap<>();
names.put(Locale.ENGLISH, "Description");
- return DefaultFactories.SIS_NAMES.createInternationalString(names);
+ return factory.createInternationalString(names);
}
@Override public InternationalString getEnvironmentDescription() {
Map<Locale, String> names = new HashMap<>();
names.put(Locale.ENGLISH, "Environment");
- return DefaultFactories.SIS_NAMES.createInternationalString(names);
+ return factory.createInternationalString(names);
}
@Override public InternationalString getSupplementalInformation() {return null;}
Modified: sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/identification/DefaultCoupledResourceTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/identification/DefaultCoupledResourceTest.java?rev=1670479&r1=1670478&r2=1670479&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/identification/DefaultCoupledResourceTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/identification/DefaultCoupledResourceTest.java [UTF-8] Tue Mar 31 21:07:44 2015
@@ -17,19 +17,20 @@
package org.apache.sis.metadata.iso.identification;
import org.opengis.util.ScopedName;
+import org.opengis.util.NameFactory;
import org.opengis.parameter.ParameterDescriptor;
import org.opengis.metadata.citation.OnlineResource;
import org.opengis.metadata.identification.CoupledResource;
import org.opengis.metadata.identification.OperationMetadata;
import org.opengis.metadata.identification.DistributedComputingPlatform;
import org.apache.sis.internal.jaxb.metadata.replace.ServiceParameterTest;
+import org.apache.sis.internal.system.DefaultFactories;
import org.apache.sis.xml.NilReason;
import org.apache.sis.test.DependsOn;
import org.apache.sis.test.TestCase;
import org.junit.Test;
import static java.util.Collections.singleton;
-import static org.apache.sis.internal.system.DefaultFactories.SIS_NAMES;
import static org.junit.Assert.*;
@@ -53,7 +54,8 @@ public final strictfp class DefaultCoupl
operation.setConnectPoints(singleton(NilReason.MISSING.createNilObject(OnlineResource.class)));
final DefaultCoupledResource resource = new DefaultCoupledResource();
- resource.setScopedName((ScopedName) SIS_NAMES.createGenericName(null, "mySpace", "ABC-123"));
+ final NameFactory factory = DefaultFactories.forBuildin(NameFactory.class);
+ resource.setScopedName((ScopedName) factory.createGenericName(null, "mySpace", "ABC-123"));
resource.setOperation(operation);
return resource;
}
Modified: sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/identification/DefaultServiceIdentificationTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/identification/DefaultServiceIdentificationTest.java?rev=1670479&r1=1670478&r2=1670479&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/identification/DefaultServiceIdentificationTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/identification/DefaultServiceIdentificationTest.java [UTF-8] Tue Mar 31 21:07:44 2015
@@ -17,8 +17,10 @@
package org.apache.sis.metadata.iso.identification;
import javax.xml.bind.JAXBException;
+import org.opengis.util.NameFactory;
import org.opengis.metadata.citation.Citation;
import org.opengis.metadata.identification.CouplingType;
+import org.apache.sis.internal.system.DefaultFactories;
import org.apache.sis.util.ComparisonMode;
import org.apache.sis.xml.NilReason;
import org.apache.sis.test.DependsOn;
@@ -27,7 +29,6 @@ import org.junit.Test;
import static org.apache.sis.test.Assert.*;
import static java.util.Collections.singleton;
-import static org.apache.sis.internal.system.DefaultFactories.SIS_NAMES;
/**
@@ -52,9 +53,10 @@ public final strictfp class DefaultServi
* Creates the service identification to use for testing purpose.
*/
private static DefaultServiceIdentification create() {
+ final NameFactory factory = DefaultFactories.forBuildin(NameFactory.class);
final DefaultCoupledResource resource = DefaultCoupledResourceTest.create();
final DefaultServiceIdentification id = new DefaultServiceIdentification(
- SIS_NAMES.createGenericName(null, "Web Map Server"), // serviceType
+ factory.createGenericName(null, "Web Map Server"), // serviceType
NilReason.MISSING.createNilObject(Citation.class), // citation
"A dummy service for testing purpose."); // abstract
id.setServiceTypeVersions(singleton("1.0"));
Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/geometry/AbstractEnvelope.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/geometry/AbstractEnvelope.java?rev=1670479&r1=1670478&r2=1670479&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/geometry/AbstractEnvelope.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/geometry/AbstractEnvelope.java [UTF-8] Tue Mar 31 21:07:44 2015
@@ -69,7 +69,7 @@ import java.util.Objects;
* <p>All other methods, including {@link #toString()}, {@link #equals(Object)} and {@link #hashCode()},
* are implemented on top of the above four methods.</p>
*
- * {@section Spanning the anti-meridian of a Geographic CRS}
+ * <div class="section">Spanning the anti-meridian of a Geographic CRS</div>
* The <cite>Web Coverage Service</cite> (WCS) specification authorizes (with special treatment)
* cases where <var>upper</var> < <var>lower</var> at least in the longitude case. They are
* envelopes crossing the anti-meridian, like the red box below (the green box is the usual case).
@@ -91,13 +91,13 @@ import java.util.Objects;
* </ul>
* </td></tr></table></center>
*
- * {@section Choosing the range of longitude values}
+ * <div class="section">Choosing the range of longitude values</div>
* Geographic CRS typically have longitude values in the [-180 … +180]° range, but the [0 … 360]°
* range is also occasionally used. Users of this class need to ensure that this envelope CRS is
* associated to axes having the desired {@linkplain CoordinateSystemAxis#getMinimumValue() minimum}
* and {@linkplain CoordinateSystemAxis#getMaximumValue() maximum value}.
*
- * {@section Note on positive and negative zeros}
+ * <div class="section">Note on positive and negative zeros</div>
* The IEEE 754 standard defines two different values for positive zero and negative zero.
* When used with SIS envelopes and keeping in mind the above discussion, those zeros have
* different meanings:
@@ -386,7 +386,7 @@ public abstract class AbstractEnvelope i
* median = (getUpper(dimension) + getLower(dimension)) / 2;
* }
*
- * {@section Spanning the anti-meridian of a Geographic CRS}
+ * <div class="section">Spanning the anti-meridian of a Geographic CRS</div>
* If <var>upper</var> < <var>lower</var> and the
* {@linkplain CoordinateSystemAxis#getRangeMeaning() range meaning} for the requested
* dimension is {@linkplain RangeMeaning#WRAPAROUND wraparound}, then the median calculated
@@ -437,7 +437,7 @@ public abstract class AbstractEnvelope i
* span = getUpper(dimension) - getLower(dimension);
* }
*
- * {@section Spanning the anti-meridian of a Geographic CRS}
+ * <div class="section">Spanning the anti-meridian of a Geographic CRS</div>
* If <var>upper</var> < <var>lower</var> and the
* {@linkplain CoordinateSystemAxis#getRangeMeaning() range meaning} for the requested
* dimension is {@linkplain RangeMeaning#WRAPAROUND wraparound}, then the span calculated
@@ -681,11 +681,11 @@ public abstract class AbstractEnvelope i
* If it least one ordinate value in the given point is {@link Double#NaN NaN},
* then this method returns {@code false}.
*
- * {@section Pre-conditions}
+ * <div class="section">Pre-conditions</div>
* This method assumes that the specified point uses the same CRS than this envelope.
* For performance reasons, it will no be verified unless Java assertions are enabled.
*
- * {@section Spanning the anti-meridian of a Geographic CRS}
+ * <div class="section">Spanning the anti-meridian of a Geographic CRS</div>
* For any dimension, if <var>upper</var> < <var>lower</var> then this method uses an
* algorithm which is the opposite of the usual one: rather than testing if the given point is
* inside the envelope interior, this method tests if the given point is <em>outside</em> the
@@ -730,11 +730,11 @@ public abstract class AbstractEnvelope i
/**
* Returns {@code true} if this envelope completely encloses the specified envelope.
*
- * {@section Pre-conditions}
+ * <div class="section">Pre-conditions</div>
* This method assumes that the specified envelope uses the same CRS than this envelope.
* For performance reasons, it will no be verified unless Java assertions are enabled.
*
- * {@section Spanning the anti-meridian of a Geographic CRS}
+ * <div class="section">Spanning the anti-meridian of a Geographic CRS</div>
* For every cases illustrated below, the yellow box is considered completely enclosed
* in the blue envelope:
*
@@ -848,11 +848,11 @@ public abstract class AbstractEnvelope i
/**
* Returns {@code true} if this envelope intersects the specified envelope.
*
- * {@section Pre-conditions}
+ * <div class="section">Pre-conditions</div>
* This method assumes that the specified envelope uses the same CRS than this envelope.
* For performance reasons, it will no be verified unless Java assertions are enabled.
*
- * {@section Spanning the anti-meridian of a Geographic CRS}
+ * <div class="section">Spanning the anti-meridian of a Geographic CRS</div>
* This method can handle envelopes spanning the anti-meridian.
*
* @param envelope The envelope to test for intersection.
@@ -985,7 +985,7 @@ public abstract class AbstractEnvelope i
* smaller for geographic CRS than for UTM projections, because the former typically has a
* [-180…180]° range while the later can have a range of thousands of meters.</div>
*
- * {@section Coordinate Reference System}
+ * <div class="section">Coordinate Reference System</div>
* To be considered equal, the two envelopes must have the same {@linkplain #getDimension() dimension}
* and their CRS must be {@linkplain org.apache.sis.util.Utilities#equalsIgnoreMetadata equals,
* ignoring metadata}. If at least one envelope has a null CRS, then the CRS are ignored and the
Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/geometry/ArrayEnvelope.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/geometry/ArrayEnvelope.java?rev=1670479&r1=1670478&r2=1670479&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/geometry/ArrayEnvelope.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/geometry/ArrayEnvelope.java [UTF-8] Tue Mar 31 21:07:44 2015
@@ -336,7 +336,7 @@ scanNumber: while ((i += Character.charC
* with the checks listed above, where failure to meet those conditions will cause the methods to
* behave in an unexpected way.
*
- * {@section Implementation consistency}
+ * <div class="section">Implementation consistency</div>
* The checks performed by this method shall be consistent with the checks performed by the following methods:
* <ul>
* <li>{@link GeneralEnvelope#setCoordinateReferenceSystem(CoordinateReferenceSystem)}</li>
Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/geometry/DirectPosition2D.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/geometry/DirectPosition2D.java?rev=1670479&r1=1670478&r2=1670479&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/geometry/DirectPosition2D.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/geometry/DirectPosition2D.java [UTF-8] Tue Mar 31 21:07:44 2015
@@ -48,7 +48,7 @@ import java.util.Objects;
* do not have such restriction, and it would be hard to generalize. For example there is no clear "x" or "y"
* classification for North-East direction.</div>
*
- * {@section Caution when used in collections}
+ * <div class="section">Caution when used in collections</div>
* Do not mix instances of this class with ordinary {@link Point2D} instances
* in a {@code HashSet} or as {@code HashMap} keys.
* It is not possible to meet both {@link Point2D#hashCode()} and {@link DirectPosition#hashCode()}
Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/geometry/Envelope2D.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/geometry/Envelope2D.java?rev=1670479&r1=1670478&r2=1670479&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/geometry/Envelope2D.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/geometry/Envelope2D.java [UTF-8] Tue Mar 31 21:07:44 2015
@@ -64,7 +64,7 @@ import java.util.Objects;
* This is not specific to this implementation; in Java2D too, the visual axis orientation depend
* on the {@linkplain java.awt.Graphics2D#getTransform() affine transform in the graphics context}.</p>
*
- * {@section Spanning the anti-meridian of a Geographic CRS}
+ * <div class="section">Spanning the anti-meridian of a Geographic CRS</div>
* The <cite>Web Coverage Service</cite> (WCS) specification authorizes (with special treatment)
* cases where <var>upper</var> < <var>lower</var> at least in the longitude case. They are
* envelopes spanning the anti-meridian, like the red box below (the green box is the usual case).
@@ -644,7 +644,7 @@ public class Envelope2D extends Rectangl
* of the given ordinate value is {@link java.lang.Double#NaN NaN}, then this method returns
* {@code false}.
*
- * {@section Spanning the anti-meridian of a Geographic CRS}
+ * <div class="section">Spanning the anti-meridian of a Geographic CRS</div>
* This method supports anti-meridian spanning in the same way than
* {@link AbstractEnvelope#contains(DirectPosition)}.
*
@@ -672,7 +672,7 @@ public class Envelope2D extends Rectangl
* envelope or the given rectangle have at least one {@link java.lang.Double#NaN NaN} value,
* then this method returns {@code false}.
*
- * {@section Spanning the anti-meridian of a Geographic CRS}
+ * <div class="section">Spanning the anti-meridian of a Geographic CRS</div>
* This method supports anti-meridian spanning in the same way than
* {@link AbstractEnvelope#contains(Envelope)}.
*
@@ -694,7 +694,7 @@ public class Envelope2D extends Rectangl
* envelope or the given rectangle have at least one {@link java.lang.Double#NaN NaN} value,
* then this method returns {@code false}.
*
- * {@section Spanning the anti-meridian of a Geographic CRS}
+ * <div class="section">Spanning the anti-meridian of a Geographic CRS</div>
* This method supports anti-meridian spanning in the same way than
* {@link AbstractEnvelope#contains(Envelope)}.
*
@@ -741,7 +741,7 @@ public class Envelope2D extends Rectangl
* or the given rectangle have at least one {@link java.lang.Double#NaN NaN} value, then this
* method returns {@code false}.
*
- * {@section Spanning the anti-meridian of a Geographic CRS}
+ * <div class="section">Spanning the anti-meridian of a Geographic CRS</div>
* This method supports anti-meridian spanning in the same way than
* {@link AbstractEnvelope#intersects(Envelope)}.
*
@@ -763,7 +763,7 @@ public class Envelope2D extends Rectangl
* or the given rectangle have at least one {@link java.lang.Double#NaN NaN} value, then this
* method returns {@code false}.
*
- * {@section Spanning the anti-meridian of a Geographic CRS}
+ * <div class="section">Spanning the anti-meridian of a Geographic CRS</div>
* This method supports anti-meridian spanning in the same way than
* {@link AbstractEnvelope#intersects(Envelope)}.
*
@@ -808,7 +808,7 @@ public class Envelope2D extends Rectangl
* or the given rectangle have at least one {@link java.lang.Double#NaN NaN} values, then this
* method returns an {@linkplain #isEmpty() empty} envelope.
*
- * {@section Spanning the anti-meridian of a Geographic CRS}
+ * <div class="section">Spanning the anti-meridian of a Geographic CRS</div>
* This method supports anti-meridian spanning in the same way than
* {@link GeneralEnvelope#intersect(Envelope)}.
*
@@ -893,7 +893,7 @@ public class Envelope2D extends Rectangl
* Adds an other rectangle to this rectangle. The resulting rectangle is the union of the
* two {@code Rectangle} objects.
*
- * {@section Spanning the anti-meridian of a Geographic CRS}
+ * <div class="section">Spanning the anti-meridian of a Geographic CRS</div>
* This method supports anti-meridian spanning in the same way than
* {@link GeneralEnvelope#add(Envelope)}, except if the result is a rectangle expanding to
* infinities. In the later case, the field values are set to {@code NaN} because infinite
@@ -991,7 +991,7 @@ public class Envelope2D extends Rectangl
* as an argument will return {@code true}, except if one of the point ordinates was
* {@link java.lang.Double#NaN} in which case the corresponding ordinate has been ignored.
*
- * {@section Spanning the anti-meridian of a Geographic CRS}
+ * <div class="section">Spanning the anti-meridian of a Geographic CRS</div>
* This method supports anti-meridian spanning in the same way than
* {@link GeneralEnvelope#add(DirectPosition)}.
*
@@ -1031,7 +1031,7 @@ public class Envelope2D extends Rectangl
* i.e. the {@linkplain #getCoordinateReferenceSystem() coordinate reference system} of this
* envelope is ignored.
*
- * {@section Note on <code>hashCode()</code>}
+ * <div class="section">Note on {@code hashCode()}</div>
* This class does not override the {@link #hashCode()} method for consistency with the
* {@link Rectangle2D#equals(Object)} method, which compare arbitrary {@code Rectangle2D}
* implementations.
Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/geometry/Envelopes.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/geometry/Envelopes.java?rev=1670479&r1=1670478&r2=1670479&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/geometry/Envelopes.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/geometry/Envelopes.java [UTF-8] Tue Mar 31 21:07:44 2015
@@ -53,7 +53,7 @@ import static org.apache.sis.util.String
/**
* Transforms envelopes to new Coordinate Reference Systems, and miscellaneous utilities.
*
- * {@section Envelope transformations}
+ * <div class="section">Envelope transformations</div>
* All {@code transform(…)} methods in this class take in account the curvature of the transformed shape.
* For example the shape of a geographic envelope (figure below on the left side) is not rectangular in a
* conic projection (figure below on the right side). In order to get the envelope represented by the red
@@ -158,7 +158,7 @@ public final class Envelopes extends Sta
* same instance than the given target CRS, then the given envelope is returned unchanged.
* Otherwise a new transformed envelope is returned.
*
- * {@section Performance tip}
+ * <div class="section">Performance tip</div>
* If there is many envelopes to transform with the same source and target CRS, then it is more efficient
* to get the {@link CoordinateOperation} or {@link MathTransform} instance once and invoke one of the
* others {@code transform(…)} methods.
@@ -200,10 +200,10 @@ public final class Envelopes extends Sta
* The transformation is only approximative: the returned envelope may be bigger than necessary,
* or smaller than required if the bounding box contains a pole.
*
- * <p><b>Limitation</b><br>
+ * <div class="section">Limitation</div>
* This method can not handle the case where the envelope contains the North or South pole,
* or when it crosses the ±180° longitude, because {@link MathTransform} does not carry sufficient information.
- * For a more robust envelope transformation, use {@link #transform(CoordinateOperation, Envelope)} instead.</p>
+ * For a more robust envelope transformation, use {@link #transform(CoordinateOperation, Envelope)} instead.
*
* @param transform The transform to use.
* @param envelope Envelope to transform, or {@code null}. This envelope will not be modified.
Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/geometry/GeneralDirectPosition.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/geometry/GeneralDirectPosition.java?rev=1670479&r1=1670478&r2=1670479&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/geometry/GeneralDirectPosition.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/geometry/GeneralDirectPosition.java [UTF-8] Tue Mar 31 21:07:44 2015
@@ -42,7 +42,7 @@ import java.util.Objects;
* position is known to be always two-dimensional, then {@link DirectPosition2D} provides
* a more efficient implementation.
*
- * {@section Coordinate Reference System (CRS) optionality}
+ * <div class="section">Coordinate Reference System (CRS) optionality</div>
* Since {@code DirectPosition}s, as data types, will often be included in larger objects
* (such as {@link org.opengis.geometry.Geometry}) that have references
* to {@code CoordinateReferenceSystem}, the {@link #getCoordinateReferenceSystem()} method
Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/geometry/GeneralEnvelope.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/geometry/GeneralEnvelope.java?rev=1670479&r1=1670478&r2=1670479&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/geometry/GeneralEnvelope.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/geometry/GeneralEnvelope.java [UTF-8] Tue Mar 31 21:07:44 2015
@@ -65,7 +65,7 @@ import static org.apache.sis.math.MathFu
* representing a {@code BBOX} or a <cite>Well Known Text</cite> (WKT) format.</li>
* </ul>
*
- * {@section Spanning the anti-meridian of a Geographic CRS}
+ * <div class="section">Spanning the anti-meridian of a Geographic CRS</div>
* The <cite>Web Coverage Service</cite> (WCS) specification authorizes (with special treatment)
* cases where <var>upper</var> < <var>lower</var> at least in the longitude case. They are
* envelopes crossing the anti-meridian, like the red box below (the green box is the usual case).
@@ -91,7 +91,7 @@ import static org.apache.sis.math.MathFu
* </ul>
* </td></tr></table></center>
*
- * {@section Envelope validation}
+ * <div class="section">Envelope validation</div>
* If and only if this envelope is associated to a non-null CRS, then constructors and setter methods
* in this class perform the following checks:
*
@@ -490,11 +490,11 @@ public class GeneralEnvelope extends Arr
* with the added point as an argument will return {@code true}, except if one of the point
* ordinates was {@link Double#NaN} in which case the corresponding ordinate has been ignored.</p>
*
- * {@section Pre-conditions}
+ * <div class="section">Pre-conditions</div>
* This method assumes that the specified point uses the same CRS than this envelope.
* For performance reasons, it will no be verified unless Java assertions are enabled.
*
- * {@section Spanning the anti-meridian of a Geographic CRS}
+ * <div class="section">Spanning the anti-meridian of a Geographic CRS</div>
* This method supports envelopes spanning the anti-meridian. In such cases it is possible to
* move both envelope borders in order to encompass the given point, as illustrated below (the
* new point is represented by the {@code +} symbol):
@@ -570,11 +570,11 @@ public class GeneralEnvelope extends Arr
* Adds an envelope object to this envelope. The resulting envelope is the union of the
* two {@code Envelope} objects.
*
- * {@section Pre-conditions}
+ * <div class="section">Pre-conditions</div>
* This method assumes that the specified envelope uses the same CRS than this envelope.
* For performance reasons, it will no be verified unless Java assertions are enabled.
*
- * {@section Spanning the anti-meridian of a Geographic CRS}
+ * <div class="section">Spanning the anti-meridian of a Geographic CRS</div>
* This method supports envelopes spanning the anti-meridian. If one or both envelopes span
* the anti-meridian, then the result of the {@code add} operation may be an envelope expanding
* to infinities. In such case, the ordinate range will be either [-∞…∞] or [0…-0] depending on
@@ -697,11 +697,11 @@ public class GeneralEnvelope extends Arr
/**
* Sets this envelope to the intersection if this envelope with the specified one.
*
- * {@section Pre-conditions}
+ * <div class="section">Pre-conditions</div>
* This method assumes that the specified envelope uses the same CRS than this envelope.
* For performance reasons, it will no be verified unless Java assertions are enabled.
*
- * {@section Spanning the anti-meridian of a Geographic CRS}
+ * <div class="section">Spanning the anti-meridian of a Geographic CRS</div>
* This method supports envelopes spanning the anti-meridian.
*
* @param envelope the {@code Envelope} to intersect to this envelope.
@@ -850,7 +850,7 @@ public class GeneralEnvelope extends Arr
* class javadoc for more information about the meaning of such range.</li>
* </ul>
*
- * {@section Spanning the anti-meridian of a Geographic CRS}
+ * <div class="section">Spanning the anti-meridian of a Geographic CRS</div>
* If the envelope is spanning the anti-meridian, then some {@linkplain #getLower(int) lower}
* ordinate values may become greater than their {@linkplain #getUpper(int) upper} counterpart
* as a result of this method call. If such effect is undesirable, then this method may be
@@ -862,13 +862,13 @@ public class GeneralEnvelope extends Arr
* }
* }
*
- * {@section Choosing the range of longitude values}
+ * <div class="section">Choosing the range of longitude values</div>
* Geographic CRS typically have longitude values in the [-180 … +180]° range, but the [0 … 360]°
* range is also occasionally used. Callers need to ensure that this envelope CRS is associated
* to axes having the desired {@linkplain CoordinateSystemAxis#getMinimumValue() minimum} and
* {@linkplain CoordinateSystemAxis#getMaximumValue() maximum value}.
*
- * {@section Usage}
+ * <div class="section">Usage</div>
* This method is sometime useful before to compute the {@linkplain #add(Envelope) union}
* or {@linkplain #intersect(Envelope) intersection} of envelopes, in order to ensure that
* both envelopes are defined in the same domain. This method may also be invoked before
Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/geometry/ImmutableEnvelope.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/geometry/ImmutableEnvelope.java?rev=1670479&r1=1670478&r2=1670479&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/geometry/ImmutableEnvelope.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/geometry/ImmutableEnvelope.java [UTF-8] Tue Mar 31 21:07:44 2015
@@ -37,7 +37,7 @@ import static org.apache.sis.util.Argume
* This class is final in order to ensure that the immutability contract can not be broken
* (assuming not using <cite>Java Native Interface</cite> or reflections).
*
- * {@section Immutability and thread safety}
+ * <div class="section">Immutability and thread safety</div>
* This final class is immutable and thus inherently thread-safe if the {@link CoordinateReferenceSystem}
* instance given to the constructor is immutable. This is usually the case in Apache SIS.
*
Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/geometry/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/geometry/package-info.java?rev=1670479&r1=1670478&r2=1670479&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/geometry/package-info.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/geometry/package-info.java [UTF-8] Tue Mar 31 21:07:44 2015
@@ -45,7 +45,7 @@
* </tr>
* </table>
*
- * {@section Envelopes spanning the anti-meridian of a Geographic CRS}
+ * <div class="section">Envelopes spanning the anti-meridian of a Geographic CRS</div>
* The Web Coverage Service (WCS) 1.1 specification uses an extended interpretation
* of the bounding box definition. In a WCS 1.1 data structure, the
* {@linkplain org.apache.sis.geometry.GeneralEnvelope#getLowerCorner() lower corner}
Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/RS_Identifier.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/RS_Identifier.java?rev=1670479&r1=1670478&r2=1670479&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/RS_Identifier.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/RS_Identifier.java [UTF-8] Tue Mar 31 21:07:44 2015
@@ -29,7 +29,7 @@ import org.opengis.metadata.Identifier;
* syntax instead. The ISO 19139 syntax represents the code and codespace as XML elements, while in this
* GML representation the code is a XML value and the codespace is a XML attribute.</p>
*
- * {@section Marshalling}
+ * <div class="section">Marshalling</div>
* Identifiers are typically marshalled as below:
*
* {@preformat xml
@@ -43,7 +43,7 @@ import org.opengis.metadata.Identifier;
* <gml:identifier codeSpace="EPSG:8.3">4326</gml:identifier>
* }
*
- * {@section Unmarshalling}
+ * <div class="section">Unmarshalling</div>
* Some data producers put a URN instead than a simple code value, as in the example below:
*
* {@preformat xml
Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/AxisDirections.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/AxisDirections.java?rev=1670479&r1=1670478&r2=1670479&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/AxisDirections.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/AxisDirections.java [UTF-8] Tue Mar 31 21:07:44 2015
@@ -440,7 +440,7 @@ public final class AxisDirections extend
/**
* Searches pre-defined {@link AxisDirection} for a given name. This method searches for a match in the set
* of known axis directions as returned by {@link AxisDirection#values()}, plus a few special cases like
- * "<cite>Geocentre > equator/90°E</cite>". The later are used in the EPSG database for geocentric CRS.
+ * <cite>"Geocentre > equator/90°E"</cite>. The later are used in the EPSG database for geocentric CRS.
*
* <p>This method does not know about {@code org.apache.sis.referencing.cs.DirectionAlongMeridian}.
* The later is a parser which may create new directions, while this method searches only in a set
Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/ExtendedPrecisionMatrix.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/ExtendedPrecisionMatrix.java?rev=1670479&r1=1670478&r2=1670479&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/ExtendedPrecisionMatrix.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/ExtendedPrecisionMatrix.java [UTF-8] Tue Mar 31 21:07:44 2015
@@ -25,11 +25,18 @@ import org.opengis.referencing.operation
*
* @author Martin Desruisseaux (Geomatys)
* @since 0.5
- * @version 0.5
+ * @version 0.6
* @module
*/
public interface ExtendedPrecisionMatrix extends Matrix {
/**
+ * A sentinel value for {@link org.apache.sis.referencing.operation.matrix.Matrices#create(int, int, Number[])}
+ * meaning that we request an extended precision matrix initialized to the identity (or diagonal) matrix.
+ * This is a non-public feature because we try to hide our extended-precision mechanism from the users.
+ */
+ Number[] IDENTITY = new Number[0];
+
+ /**
* Returns a copy of all matrix elements, potentially followed by the error terms for extended-precision arithmetic.
* Matrix elements are returned in a flat, row-major (column indices vary fastest) array.
*
Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/Formulas.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/Formulas.java?rev=1670479&r1=1670478&r2=1670479&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/Formulas.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/Formulas.java [UTF-8] Tue Mar 31 21:07:44 2015
@@ -37,8 +37,8 @@ import static org.apache.sis.internal.me
public final class Formulas extends Static {
/**
* Default tolerance threshold for comparing ordinate values in a projected CRS,
- * assuming that the unit of measurement is metre. This is not a tolerance for
- * testing map projection accuracy.
+ * assuming that the unit of measurement is metre. This constant determines also
+ * (indirectly) the minimum accuracy of iterative methods in map projections.
*
* @see #ANGULAR_TOLERANCE
* @see org.apache.sis.internal.util.Numerics#COMPARISON_THRESHOLD
@@ -50,6 +50,8 @@ public final class Formulas extends Stat
* assuming that the unit of measurement is decimal degrees and using the standard
* nautical mile length.
*
+ * <p>For a {@link #LINEAR_TOLERANCE} of 1 centimetre, this is slightly less than 1E-7°.</p>
+ *
* @see #LINEAR_TOLERANCE
* @see org.apache.sis.internal.util.Numerics#COMPARISON_THRESHOLD
*/
@@ -57,8 +59,8 @@ public final class Formulas extends Stat
/**
* The length of a <cite>Julian year</cite> in milliseconds.
- * From Wikipedia, "<cite>In astronomy, a Julian year (symbol: <b>a</b>) is a unit of measurement of time
- * defined as exactly 365.25 days of 86,400 SI seconds each.</cite>".
+ * From Wikipedia, <cite>"In astronomy, a Julian year (symbol: <b>a</b>) is a unit of measurement of time
+ * defined as exactly 365.25 days of 86,400 SI seconds each."</cite>.
*
* @see <a href="http://en.wikipedia.org/wiki/Julian_year_%28astronomy%29">Wikipedia: Julian year (astronomy)</a>
*/
Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/j2d/AffineTransform2D.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/j2d/AffineTransform2D.java?rev=1670479&r1=1670478&r2=1670479&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/j2d/AffineTransform2D.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/j2d/AffineTransform2D.java [UTF-8] Tue Mar 31 21:07:44 2015
@@ -28,6 +28,7 @@ import org.opengis.referencing.operation
import org.apache.sis.geometry.DirectPosition2D;
import org.apache.sis.parameter.Parameterized;
import org.apache.sis.referencing.operation.matrix.Matrix2;
+import org.apache.sis.referencing.operation.matrix.Matrices;
import org.apache.sis.referencing.operation.matrix.AffineTransforms2D;
import org.apache.sis.referencing.operation.transform.LinearTransform;
import org.apache.sis.internal.referencing.provider.Affine;
@@ -47,13 +48,13 @@ import static org.apache.sis.util.Argume
*
* @author Martin Desruisseaux (IRD, Geomatys)
* @since 0.5
- * @version 0.5
+ * @version 0.6
* @module
*
* @see ProjectiveTransform
*/
public class AffineTransform2D extends ImmutableAffineTransform implements MathTransform2D,
- LinearTransform, LenientComparable, Parameterized, Cloneable
+ LinearTransform, LenientComparable, Parameterized
{
/**
* Serial number for inter-operability with different versions.
@@ -188,6 +189,14 @@ public class AffineTransform2D extends I
}
/**
+ * Returns {@code true} since this transform is affine.
+ */
+ @Override
+ public final boolean isAffine() {
+ return true;
+ }
+
+ /**
* Returns the parameter descriptors for this math transform.
*/
@Override
@@ -438,10 +447,11 @@ public class AffineTransform2D extends I
}
/**
- * Returns the WKT representation of this transform.
+ * Returns a string representation of this transform as a matrix, for consistency with other
+ * {@link LinearTransform} implementations in Apache SIS.
*/
@Override
public String toString() {
- return toWKT();
+ return Matrices.toString(getMatrix());
}
}
Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/AbstractProvider.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/AbstractProvider.java?rev=1670479&r1=1670478&r2=1670479&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/AbstractProvider.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/AbstractProvider.java [UTF-8] Tue Mar 31 21:07:44 2015
@@ -114,6 +114,13 @@ abstract class AbstractProvider extends
}
/**
+ * Creates a descriptor for a constant value in degrees.
+ */
+ static ParameterDescriptor<Double> createConstant(final ParameterBuilder builder, final Double constant) {
+ return builder.createBounded(MeasurementRange.create(constant, true, constant, true, NonSI.DEGREE_ANGLE), constant);
+ }
+
+ /**
* Creates a descriptor for a latitude parameter in degrees.
*/
static ParameterDescriptor<Double> createLatitude(final ParameterBuilder builder, final boolean includePoles) {
Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Affine.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Affine.java?rev=1670479&r1=1670478&r2=1670479&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Affine.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Affine.java [UTF-8] Tue Mar 31 21:07:44 2015
@@ -25,6 +25,7 @@ import org.opengis.parameter.ParameterNo
import org.opengis.referencing.operation.Matrix;
import org.opengis.referencing.operation.Conversion;
import org.opengis.referencing.operation.MathTransform;
+import org.opengis.referencing.operation.MathTransformFactory;
import org.opengis.referencing.operation.OperationMethod;
import org.apache.sis.internal.util.Constants;
import org.apache.sis.metadata.iso.citation.Citations;
@@ -36,7 +37,7 @@ import org.apache.sis.referencing.operat
/**
- * The provider for "<cite>Affine parametric transformation</cite>" (EPSG:9624).
+ * The provider for <cite>"Affine parametric transformation"</cite> (EPSG:9624).
* The set of available parameters depends on the matrix size, which is 3×3 by default.
*
* <table class="sis">
@@ -180,12 +181,15 @@ public final class Affine extends Abstra
/**
* Creates a projective transform from the specified group of parameter values.
*
+ * @param factory Ignored (can be null).
* @param values The group of parameter values.
* @return The created math transform.
* @throws ParameterNotFoundException if a required parameter was not found.
*/
@Override
- public MathTransform createMathTransform(final ParameterValueGroup values) throws ParameterNotFoundException {
+ public MathTransform createMathTransform(final MathTransformFactory factory, final ParameterValueGroup values)
+ throws ParameterNotFoundException
+ {
/*
* The TensorParameters constant used below (WKT1 or EPSG) does not matter,
* since both of them understand the names of the other TensorParameters.
Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/LongitudeRotation.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/LongitudeRotation.java?rev=1670479&r1=1670478&r2=1670479&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/LongitudeRotation.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/LongitudeRotation.java [UTF-8] Tue Mar 31 21:07:44 2015
@@ -16,20 +16,20 @@
*/
package org.apache.sis.internal.referencing.provider;
-import javax.measure.unit.NonSI;
import org.opengis.parameter.ParameterValueGroup;
import org.opengis.parameter.ParameterDescriptor;
import org.opengis.parameter.ParameterDescriptorGroup;
import org.opengis.parameter.ParameterNotFoundException;
import org.opengis.referencing.operation.Conversion;
import org.opengis.referencing.operation.MathTransform;
+import org.opengis.referencing.operation.MathTransformFactory;
import org.apache.sis.internal.referencing.j2d.AffineTransform2D;
import org.apache.sis.parameter.ParameterBuilder;
import org.apache.sis.parameter.Parameters;
/**
- * The provider for "<cite>Longitude rotation</cite>" (EPSG:9601).
+ * The provider for <cite>"Longitude rotation"</cite> (EPSG:9601).
* The "Longitude rotation" is created as an affine transform containing only a translation term in degrees.
* Advantage of using an affine transform for such simple operation is that this {@code AffineTransform} can
* be efficiently concatenated with other affine transform instances.
@@ -61,7 +61,7 @@ public final class LongitudeRotation ext
static final String NAME = "Longitude offset";
/**
- * The operation parameter descriptor for the "<cite>longitude offset</cite>" parameter value.
+ * The operation parameter descriptor for the <cite>"longitude offset"</cite> parameter value.
*/
private static final ParameterDescriptor<Double> OFFSET;
@@ -103,12 +103,15 @@ public final class LongitudeRotation ext
* does not, so maybe our unconditional conversion to degrees would be more surprising for the user if the
* operation was shown as a "Longitude rotation".</p>
*
+ * @param factory Ignored (can be null).
* @param values The group of parameter values.
* @return The created math transform.
* @throws ParameterNotFoundException if a required parameter was not found.
*/
@Override
- public MathTransform createMathTransform(final ParameterValueGroup values) throws ParameterNotFoundException {
+ public MathTransform createMathTransform(final MathTransformFactory factory, final ParameterValueGroup values)
+ throws ParameterNotFoundException
+ {
final double offset = Parameters.castOrWrap(values).doubleValue(OFFSET);
return new AffineTransform2D(1, 0, 0, 1, offset, 0);
}
Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/MapProjection.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/MapProjection.java?rev=1670479&r1=1670478&r2=1670479&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/MapProjection.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/MapProjection.java [UTF-8] Tue Mar 31 21:07:44 2015
@@ -18,18 +18,30 @@ package org.apache.sis.internal.referenc
import java.util.Map;
import java.util.HashMap;
+import java.util.NoSuchElementException;
import javax.measure.unit.SI;
+import org.opengis.util.FactoryException;
+import org.opengis.util.InternationalString;
+import org.opengis.metadata.Identifier;
+import org.opengis.metadata.citation.Citation;
+import org.opengis.parameter.ParameterDescriptor;
+import org.opengis.parameter.GeneralParameterDescriptor;
import org.opengis.util.GenericName;
import org.opengis.parameter.ParameterValueGroup;
import org.opengis.parameter.ParameterDescriptorGroup;
import org.opengis.parameter.ParameterNotFoundException;
-import org.opengis.referencing.operation.MathTransform2D;
+import org.opengis.referencing.operation.MathTransform;
+import org.opengis.referencing.operation.MathTransformFactory;
import org.opengis.referencing.operation.Projection;
import org.apache.sis.internal.util.Constants;
import org.apache.sis.measure.MeasurementRange;
import org.apache.sis.referencing.NamedIdentifier;
+import org.apache.sis.referencing.operation.projection.NormalizedProjection;
import org.apache.sis.metadata.iso.citation.Citations;
import org.apache.sis.parameter.DefaultParameterDescriptor;
+import org.apache.sis.parameter.ParameterBuilder;
+import org.apache.sis.parameter.Parameters;
+import org.apache.sis.util.resources.Messages;
import static org.opengis.metadata.Identifier.AUTHORITY_KEY;
@@ -51,24 +63,18 @@ public abstract class MapProjection exte
private static final long serialVersionUID = 6280666068007678702L;
/**
- * All names known to Apache SIS for the
- * {@linkplain org.apache.sis.referencing.operation.projection.UnitaryProjection.Parameters#semiMajor semi-major}
- * parameter. This parameter is mandatory and has no default value. The range of valid values is (0 … ∞).
+ * All names known to Apache SIS for the <cite>semi-major</cite> parameter.
+ * This parameter is mandatory and has no default value. The range of valid values is (0 … ∞).
*
* <p>Some names for this parameter are {@code "semi_major"}, {@code "SemiMajor"} and {@code "a"}.</p>
- *
- * @see org.apache.sis.referencing.operation.projection.UnitaryProjection.Parameters#semiMajor
*/
public static final DefaultParameterDescriptor<Double> SEMI_MAJOR;
/**
- * All names known to Apache SIS for the
- * {@linkplain org.apache.sis.referencing.operation.projection.UnitaryProjection.Parameters#semiMinor semi-minor}
- * parameter. This parameter is mandatory and has no default value. The range of valid values is (0 … ∞).
+ * All names known to Apache SIS for the <cite>semi-minor</cite> parameter.
+ * This parameter is mandatory and has no default value. The range of valid values is (0 … ∞).
*
* <p>Some names for this parameter are {@code "semi_minor"}, {@code "SemiMinor"} and {@code "b"}.</p>
- *
- * @see org.apache.sis.referencing.operation.projection.UnitaryProjection.Parameters#semiMinor
*/
public static final DefaultParameterDescriptor<Double> SEMI_MINOR;
static {
@@ -119,10 +125,99 @@ public abstract class MapProjection exte
/**
* Creates a map projection from the specified group of parameter values.
*
- * @param values The group of parameter values.
+ * @param factory The factory to use for creating and concatenating the (de)normalization transforms.
+ * @param parameters The group of parameter values.
* @return The map projection created from the given parameter values.
* @throws ParameterNotFoundException if a required parameter was not found.
+ * @throws FactoryException if the map projection can not be created.
*/
@Override
- public abstract MathTransform2D createMathTransform(ParameterValueGroup values) throws ParameterNotFoundException;
+ public final MathTransform createMathTransform(final MathTransformFactory factory, final ParameterValueGroup parameters)
+ throws ParameterNotFoundException, FactoryException
+ {
+ return createProjection(Parameters.castOrWrap(parameters)).createMapProjection(factory);
+ }
+
+ /**
+ * Creates a map projection on an ellipsoid having a semi-major axis length of 1.
+ *
+ * @param parameters The group of parameter values.
+ * @return The map projection created from the given parameter values.
+ * @throws ParameterNotFoundException if a required parameter was not found.
+ */
+ protected abstract NormalizedProjection createProjection(final Parameters parameters) throws ParameterNotFoundException;
+
+
+
+
+ //////////////////////////////////////////////////////////////////////////////////////////
+ //////// ////////
+ //////// HELPER METHODS FOR SUBCLASSES ////////
+ //////// ////////
+ //////// Following methods are defined for sharing the same GenericName or ////////
+ //////// Identifier instances when possible. ////////
+ //////////////////////////////////////////////////////////////////////////////////////////
+
+ /**
+ * Returns the name of the given authority declared in the given parameter descriptor.
+ * This method is used only as a way to avoid creating many instances of the same name.
+ */
+ static GenericName sameNameAs(final Citation authority, final GeneralParameterDescriptor parameters) {
+ for (final GenericName candidate : parameters.getAlias()) {
+ if (candidate instanceof Identifier && ((Identifier) candidate).getAuthority() == authority) {
+ return candidate;
+ }
+ }
+ throw new NoSuchElementException();
+ }
+
+ /**
+ * Copies the EPSG name and identifier from the given parameter into the builder.
+ * The EPSG objects are presumed the first name and identifier (this is not verified).
+ */
+ static ParameterBuilder onlyEPSG(final ParameterDescriptor<?> source, final ParameterBuilder builder) {
+ return builder.addIdentifier(source.getIdentifiers().iterator().next()).addName(source.getName());
+ }
+
+ /**
+ * Copies all names except the EPSG one from the given parameter into the builder.
+ * The EPSG name is presumed the first name and identifier (this is not verified).
+ */
+ static ParameterBuilder exceptEPSG(final ParameterDescriptor<?> source, final ParameterBuilder builder) {
+ for (final GenericName alias : source.getAlias()) {
+ builder.addName(alias);
+ }
+ return builder;
+ }
+
+ /**
+ * Copies the names and identifiers from the given parameter into the builder.
+ * The given {@code esri} and {@code netcdf} parameters will be inserted after the OGC name.
+ */
+ static ParameterBuilder withEsriAndNetcdf(final ParameterDescriptor<?> source, final ParameterBuilder builder,
+ final String esri, final String netcdf)
+ {
+ for (final Identifier identifier : source.getIdentifiers()) {
+ builder.addIdentifier(identifier);
+ }
+ builder.addName(source.getName());
+ for (final GenericName alias : source.getAlias()) {
+ builder.addName(alias);
+ if (((Identifier) alias).getAuthority() == Citations.OGC) {
+ builder.addName(Citations.ESRI, esri)
+ .addName(Citations.NETCDF, netcdf);
+ }
+ }
+ return builder;
+ }
+
+ /**
+ * Creates a remarks for parameters that are not formally EPSG parameter.
+ *
+ * @param origin The name of the projection for where the parameter is formally used.
+ * @param usedIn The name of the projection where we also use that parameter.
+ */
+ static InternationalString notFormalParameter(final String origin, final String usedIn) {
+ return Messages.formatInternational(Messages.Keys.NotFormalProjectionParameter_2, origin, usedIn);
+ }
}