sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject [sis] 03/06: Show the file format in metadata summary panel.
Date Wed, 15 Jul 2020 18:06:01 GMT
This is an automated email from the ASF dual-hosted git repository.

desruisseaux pushed a commit to branch geoapi-4.0
in repository https://gitbox.apache.org/repos/asf/sis.git

commit 5e8e6cea1ede5dbd21c93942523029ea478a837c
Author: Martin Desruisseaux <martin.desruisseaux@geomatys.com>
AuthorDate: Wed Jul 15 11:24:26 2020 +0200

    Show the file format in metadata summary panel.
---
 .../org/apache/sis/gui/metadata/IdentificationInfo.java   | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/application/sis-javafx/src/main/java/org/apache/sis/gui/metadata/IdentificationInfo.java
b/application/sis-javafx/src/main/java/org/apache/sis/gui/metadata/IdentificationInfo.java
index 9797620..0dfe761 100644
--- a/application/sis-javafx/src/main/java/org/apache/sis/gui/metadata/IdentificationInfo.java
+++ b/application/sis-javafx/src/main/java/org/apache/sis/gui/metadata/IdentificationInfo.java
@@ -39,6 +39,7 @@ import org.opengis.metadata.extent.GeographicBoundingBox;
 import org.opengis.metadata.extent.GeographicDescription;
 import org.opengis.metadata.extent.GeographicExtent;
 import org.opengis.metadata.identification.Identification;
+import org.opengis.metadata.distribution.Format;
 import org.opengis.util.InternationalString;
 import org.apache.sis.metadata.iso.citation.Citations;
 import org.apache.sis.metadata.iso.extent.Extents;
@@ -70,6 +71,7 @@ import static org.apache.sis.internal.util.CollectionsExt.nonNull;
  *   <li>Topic category.</li>
  *   <li>Release date, or publication date, or creation date, or any date (in this
preference order).</li>
  *   <li>Type of resource.</li>
+ *   <li>Resource format.</li>
  *   <li>Spatiotemporal extent as a textual description.</li>
  *   <li>Extent shown as a rectangle on a world map.</li>
  * </ol>
@@ -338,6 +340,19 @@ final class IdentificationInfo extends Section<Identification>
{
          */
         addLine(Vocabulary.Keys.TypeOfResource, owner.string(nonNull(info.getSpatialRepresentationTypes())));
         /*
+         * Resource format. Current implementation shows only the first format found.
+         */
+        for (final Format format : nonNull(info.getResourceFormats())) {
+            final Citation c = format.getFormatSpecificationCitation();
+            if (c != null) {
+                text = owner.string(c.getTitle());
+                if (text != null) {
+                    addLine(Vocabulary.Keys.Format, text);
+                    break;
+                }
+            }
+        }
+        /*
          * Write the first description about the spatio-temporal extent, then draw all geographic
bounding boxes
          * on a world map. If the bounding box encompasses the whole world, replace it by
a "World" description.
          * The reason is that drawing a box over the whole world is not very informative;
it rather looks like a


Mime
View raw message