sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject [sis] 06/33: Initial review of GUI main class (localization, file filters).
Date Mon, 18 Jun 2018 21:02:28 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 cc090f4e2262795e58d61d67b86f0357c819d61b
Author: Martin Desruisseaux <desruisseaux@apache.org>
AuthorDate: Sun May 27 17:50:15 2018 +0000

    Initial review of GUI main class (localization, file filters).
    
    
    git-svn-id: https://svn.apache.org/repos/asf/sis/branches/JDK8@1832343 13f79535-47bb-0310-9956-ffa450edef68
---
 .../src/main/java/org/apache/sis/gui/Main.java     | 116 +++++++++++++++++----
 .../org/apache/sis/gui/metadata/ResourceView.java  |  64 +++++++++---
 .../org/apache/sis/gui/referencing/CRSChooser.java |   3 +-
 .../org/apache/sis/gui/referencing/CRSTable.java   |   6 +-
 .../org/apache/sis/internal/gui/FXUtilities.java   |   7 +-
 .../org/apache/sis/internal/gui/Resources.java     |  78 ++++----------
 .../apache/sis/internal/gui/Resources.properties   |   7 +-
 .../sis/internal/gui/Resources_fr.properties       |   7 +-
 .../org/apache/sis/gui/referencing/CRSChooser.fxml |   2 +-
 .../org/apache/sis/util/resources/Vocabulary.java  |  17 ++-
 .../sis/util/resources/Vocabulary.properties       |   3 +
 .../sis/util/resources/Vocabulary_fr.properties    |   3 +
 .../sis/internal/storage/StoreUtilities.java       |   2 +-
 13 files changed, 197 insertions(+), 118 deletions(-)

diff --git a/application/sis-javafx/src/main/java/org/apache/sis/gui/Main.java b/application/sis-javafx/src/main/java/org/apache/sis/gui/Main.java
index a036ba7..6b19666 100644
--- a/application/sis-javafx/src/main/java/org/apache/sis/gui/Main.java
+++ b/application/sis-javafx/src/main/java/org/apache/sis/gui/Main.java
@@ -16,7 +16,11 @@
  */
 package org.apache.sis.gui;
 
-import java.io.File;
+import java.util.ArrayList;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Locale;
+import java.util.Set;
 import javafx.application.Application;
 import javafx.application.Platform;
 import javafx.scene.Scene;
@@ -29,10 +33,19 @@ import javafx.scene.layout.BorderPane;
 import javafx.stage.FileChooser;
 import javafx.stage.Stage;
 import org.apache.sis.gui.metadata.ResourceView;
+import org.apache.sis.internal.gui.Resources;
+import org.apache.sis.internal.storage.Capability;
+import org.apache.sis.internal.storage.StoreMetadata;
+import org.apache.sis.storage.DataStoreProvider;
+import org.apache.sis.storage.DataStores;
+import org.apache.sis.util.ArraysExt;
+import org.apache.sis.util.resources.Vocabulary;
 
 
 /**
  * Entry point for Apache SIS application.
+ * Current implementation shows a {@link ResourceView} on which user can drop the files to
open.
+ * The content shown by this {@code Main} class may change in any future Apache SIS version.
  *
  * @author  Smaniotto Enzo
  * @author  Martin Desruisseaux (Geomatys)
@@ -48,11 +61,19 @@ public class Main extends Application {
 
     /**
      * The main content of this application. For now this is the metadata viewer.
-     * In a future version it will be another component.
+     * In a future version it may be another component.
      */
     private ResourceView content;
 
     /**
+     * The file filters to use in the dialog box shown by the "File" ▶ "Open" menu.
+     * This array is created when first needed.
+     *
+     * @see #createFileFilters()
+     */
+    private FileChooser.ExtensionFilter[] openFilters;
+
+    /**
      * Creates a new Apache SIS application.
      */
     public Main() {
@@ -67,22 +88,25 @@ public class Main extends Application {
     @Override
     public void start(final Stage window) {
         this.window = window;
+        final Vocabulary vocabulary = Vocabulary.getResources((Locale) null);
         /*
-         * Configure the menu bar.
+         * Configure the menu bar. For most menu item, the action is to invoke a method
+         * of the same name in this application class (e.g. open()).
          */
         final MenuBar menus = new MenuBar();
-        final Menu file = new Menu("File");                                 // TODO: localize
-        menus.getMenus().add(file);
+        final Menu file = new Menu(vocabulary.getString(Vocabulary.Keys.File));
+        {
+            final MenuItem open = new MenuItem(vocabulary.getMenuLabel(Vocabulary.Keys.Open));
+            open.setAccelerator(KeyCombination.keyCombination("Shortcut+O"));
+            open.setOnAction(e -> open());
 
-        final MenuItem open = new MenuItem("Open…");                        // TODO: localize
-        open.setAccelerator(KeyCombination.keyCombination("Shortcut+O"));
-        open.setOnAction(e -> open());
-
-        final MenuItem exit = new MenuItem("Exit");                         // TODO: localize
-        exit.setOnAction(e -> Platform.exit());
-        file.getItems().addAll(open, new SeparatorMenuItem(), exit);
+            final MenuItem exit = new MenuItem(vocabulary.getString(Vocabulary.Keys.Exit));
+            exit.setOnAction(e -> Platform.exit());
+            file.getItems().addAll(open, new SeparatorMenuItem(), exit);
+        }
+        menus.getMenus().add(file);
         /*
-         *
+         * Set the main content and show.
          */
         content = new ResourceView();
         final BorderPane pane = new BorderPane();
@@ -97,19 +121,65 @@ public class Main extends Application {
     }
 
     /**
-     * Invoked when the user selected "File / open" menu.
+     * Creates the file filters for the dialog box to shown in "File" ▶ "Open" and "File"
▶ "Save" menus.
+     *
+     * @todo Iterate only over the classes in JDK9, without initializing the providers.
      */
-    private void open() {
-        final FileChooser fileChooser = new FileChooser();
-        fileChooser.setTitle("Open data file");                         // TODO: localize
-        File fileByChooser = fileChooser.showOpenDialog(window);
-        if (fileByChooser != null) {
-            if (fileByChooser.isDirectory()) {
-                content.openDirectory(fileByChooser);
-            } else {
-                content.openFile(fileByChooser);
+    private void createFileFilters() {
+        final Resources res = Resources.getInstance();
+        final Set<String> allSuffixes = new LinkedHashSet<>();
+        final List<FileChooser.ExtensionFilter> openFilters = new ArrayList<>();
+//      final List<FileChooser.ExtensionFilter> saveFilters = new ArrayList<>();
+        /*
+         * Add an "All files (*.*)" filter only for the Open action.
+         * The Save action will need to specify a specific filter.
+         */
+        openFilters.add(new FileChooser.ExtensionFilter(res.getString(Resources.Keys.AllFiles),
"*.*"));
+        for (DataStoreProvider provider : DataStores.providers()) {
+            final StoreMetadata md = provider.getClass().getAnnotation(StoreMetadata.class);
+            if (md != null) {
+                final String[] suffixes = md.fileSuffixes();
+                if (suffixes.length != 0) {
+                    final boolean canOpen = ArraysExt.contains(md.capabilities(), Capability.READ);
+//                  final boolean canSave = ArraysExt.contains(md.capabilities(), Capability.WRITE);
+                    for (int i=0; i < suffixes.length; i++) {
+                        final String fs = "*.".concat(suffixes[i]);
+                        suffixes[i] = fs;
+                        if (canOpen) {
+                            allSuffixes.add(fs);
+                        }
+                    }
+                    final FileChooser.ExtensionFilter f = new FileChooser.ExtensionFilter(
+                                    md.formatName() + " (" + suffixes[0] + ')', suffixes);
+                    if (canOpen) openFilters.add(f);
+//                  if (canSave) saveFilters.add(f);
+                }
             }
         }
+        /*
+         * Add a filter for all geospatial files in second position, after "All files" and
before
+         * the filters for specific formats. This will be the default filter for the "Open"
action.
+         */
+        openFilters.add(1, new FileChooser.ExtensionFilter(res.getString(Resources.Keys.GeospatialFiles),
+                            allSuffixes.toArray(new String[allSuffixes.size()])));
+        this.openFilters = openFilters.toArray(new FileChooser.ExtensionFilter[openFilters.size()]);
+//      this.saveFilters = saveFilters.toArray(new FileChooser.ExtensionFilter[saveFilters.size()]);
+    }
+
+    /**
+     * Invoked when the user selects "File" ▶ "Open" menu.
+     * Users can select an arbitrary amount of files or directories.
+     * The effect is the same as dragging the files in the "resources tree" window.
+     */
+    private void open() {
+        if (openFilters == null) {
+            createFileFilters();
+        }
+        final FileChooser chooser = new FileChooser();
+        chooser.setTitle(Resources.format(Resources.Keys.OpenDataFile));
+        chooser.getExtensionFilters().addAll(openFilters);
+        chooser.setSelectedExtensionFilter(openFilters[1]);         // TODO: remember last
filter used.
+        content.open(chooser.showOpenMultipleDialog(window));
     }
 
     /**
diff --git a/application/sis-javafx/src/main/java/org/apache/sis/gui/metadata/ResourceView.java
b/application/sis-javafx/src/main/java/org/apache/sis/gui/metadata/ResourceView.java
index 2b5511d..72571a0 100644
--- a/application/sis-javafx/src/main/java/org/apache/sis/gui/metadata/ResourceView.java
+++ b/application/sis-javafx/src/main/java/org/apache/sis/gui/metadata/ResourceView.java
@@ -21,7 +21,9 @@ import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import javafx.collections.ObservableList;
 import javafx.event.Event;
+import javafx.scene.Node;
 import javafx.scene.control.Alert;
 import javafx.scene.control.ContextMenu;
 import javafx.scene.control.Label;
@@ -33,7 +35,7 @@ import javafx.scene.input.Dragboard;
 import javafx.scene.input.MouseButton;
 import javafx.scene.input.MouseEvent;
 import javafx.scene.input.TransferMode;
-import javafx.scene.layout.BorderPane;
+import javafx.scene.control.SplitPane;
 import javafx.scene.layout.VBox;
 import javafx.scene.paint.Color;
 import org.apache.sis.internal.storage.folder.FolderStoreProvider;
@@ -54,8 +56,7 @@ import org.apache.sis.storage.StorageConnector;
 public class ResourceView {
 
     private final TreeItem<Label> root = new TreeItem<>(new Label("Files"));
-    private final TreeView<Label> resources = new TreeView<>(root);
-    public final BorderPane pane = new BorderPane();
+    public final SplitPane pane = new SplitPane();
     private final Map<Label, TreeItem<?>> labelToItem = new HashMap<>();
 
     // TODO: What is that?
@@ -68,6 +69,7 @@ public class ResourceView {
         final VBox dragTarget = new VBox();
 
         root.setExpanded(true);
+        final TreeView<Label> resources = new TreeView<>(root);
         resources.setStyle("-fx-background-color: rgba(77, 201, 68, 0.4);");
         resources.setShowRoot(false);
 
@@ -98,9 +100,25 @@ public class ResourceView {
             event.setDropCompleted(success);
             event.consume();
         });
+        pane.getItems().add(resources);
+    }
 
-        pane.setLeft(resources);
-        pane.setCenter(null);
+    private MetadataOverview getContent() {
+        final ObservableList<Node> items = pane.getItems();
+        if (items.size() >= 2) {
+            return (MetadataOverview) items.get(1);
+        } else {
+            return null;
+        }
+    }
+
+    private void setContent(final MetadataOverview content) {
+        final ObservableList<Node> items = pane.getItems();
+        if (items.size() >= 2) {
+            items.set(1, content);
+        } else {
+            items.add(content);
+        }
     }
 
     private void addContextMenu(Label lab) {
@@ -109,9 +127,10 @@ public class ResourceView {
             root.getChildren().remove(labelToItem.get(lab));
             labelToItem.remove(lab);
             LABINTRV.remove(lab.getId());
-            if (pane.getCenter() != null) {
-                if (lab.getId().equals(((MetadataOverview) pane.getCenter()).getFromFile()))
{
-                    pane.setCenter(null);
+            final MetadataOverview content = getContent();
+            if (content != null) {
+                if (lab.getId().equals(content.getFromFile())) {
+                    setContent(null);
                 }
             }
         });
@@ -158,7 +177,7 @@ public class ResourceView {
         try {
             DataStore ds = DataStores.open(filePath);
             meta = new MetadataOverview(new DefaultMetadata(ds.getMetadata()), filePath);
-            pane.setCenter(meta);
+            setContent(meta);
         } catch (DataStoreException e) {
             final Alert alert = new Alert(Alert.AlertType.ERROR);
             alert.setTitle("An error was occur");
@@ -176,7 +195,7 @@ public class ResourceView {
         MetadataOverview meta;
         try {
             meta = new MetadataOverview(((DefaultMetadata) res.getMetadata()), filePath);
-            pane.setCenter(meta);
+            setContent(meta);
         } catch (DataStoreException e) {
             final Alert alert = new Alert(Alert.AlertType.ERROR);
             alert.setTitle("An error was occur");
@@ -190,7 +209,19 @@ public class ResourceView {
         }
     }
 
-    public void openFile(File f) {
+    public void open(final List<File> files) {
+        if (files != null) {
+            for (final File file : files) {
+                if (file.isDirectory()) {
+                    openDirectory(file);
+                } else {
+                    openFile(file);
+                }
+            }
+        }
+    }
+
+    private void openFile(File f) {
         if (checkMetaPanel(f.getAbsolutePath())) {
             Label label = new Label(f.getName());
             label.setId(f.getAbsolutePath());
@@ -210,7 +241,7 @@ public class ResourceView {
         }
     }
 
-    public void openDirectory(File firstFile) {
+    private void openDirectory(File firstFile) {
         if (!LABINTRV.contains("[Aggregate] " + firstFile.getName())) {
             DataStore resource = null;
             try {
@@ -234,9 +265,10 @@ public class ResourceView {
                     root.getChildren().remove(labelToItem.get(cl));
                     labelToItem.remove(cl);
                     LABINTRV.remove(parent.getText());
-                    if (pane.getCenter() != null) {
-                        if (parent.getId().equals(((MetadataOverview) pane.getCenter()).getFromFile()))
{
-                            pane.setCenter(null);
+                    final MetadataOverview content = getContent();
+                    if (content != null) {
+                        if (parent.getId().equals(content.getFromFile())) {
+                            setContent(null);
                         }
                     }
                 });
@@ -276,7 +308,7 @@ public class ResourceView {
                     elem.getValue().setTextFill(Color.RED);
                 }
             });
-            pane.setCenter(null);
+            setContent(null);
         }
     }
 }
diff --git a/application/sis-javafx/src/main/java/org/apache/sis/gui/referencing/CRSChooser.java
b/application/sis-javafx/src/main/java/org/apache/sis/gui/referencing/CRSChooser.java
index a4b8901..690bf5b 100644
--- a/application/sis-javafx/src/main/java/org/apache/sis/gui/referencing/CRSChooser.java
+++ b/application/sis-javafx/src/main/java/org/apache/sis/gui/referencing/CRSChooser.java
@@ -16,7 +16,6 @@
  */
 package org.apache.sis.gui.referencing;
 
-import java.util.Locale;
 import java.io.IOException;
 import java.io.UncheckedIOException;
 import javafx.beans.property.ObjectProperty;
@@ -60,7 +59,7 @@ public class CRSChooser extends BorderPane {
      */
     public CRSChooser() {
         try {
-            FXUtilities.loadJRXML(this, CRSChooser.class, Locale.getDefault());
+            FXUtilities.loadJRXML(this, CRSChooser.class);
         } catch (IOException e) {
             throw new UncheckedIOException(e);
         }
diff --git a/application/sis-javafx/src/main/java/org/apache/sis/gui/referencing/CRSTable.java
b/application/sis-javafx/src/main/java/org/apache/sis/gui/referencing/CRSTable.java
index 66448c5..33db6d6 100644
--- a/application/sis-javafx/src/main/java/org/apache/sis/gui/referencing/CRSTable.java
+++ b/application/sis-javafx/src/main/java/org/apache/sis/gui/referencing/CRSTable.java
@@ -47,11 +47,11 @@ import javafx.scene.layout.Background;
 import javafx.scene.layout.BackgroundFill;
 import javafx.scene.layout.CornerRadii;
 import javafx.util.Callback;
-import org.apache.sis.internal.gui.Resources;
 import org.apache.sis.internal.gui.FontGlyphs;
 import org.apache.sis.internal.gui.FXUtilities;
 import org.apache.sis.io.wkt.FormattableObject;
 import org.apache.sis.metadata.iso.citation.Citations;
+import org.apache.sis.util.resources.Vocabulary;
 import org.opengis.referencing.IdentifiedObject;
 import org.opengis.referencing.crs.CRSAuthorityFactory;
 import org.opengis.referencing.crs.CoordinateReferenceSystem;
@@ -278,7 +278,7 @@ final class CRSTable extends ScrollPane {
     private static class CodeColumn extends TableColumn<Code, String> {
 
         public CodeColumn() {
-            super(Resources.format(Resources.Keys.Code));
+            super(Vocabulary.format(Vocabulary.Keys.Code));
             setEditable(false);
             setPrefWidth(150);
             setCellValueFactory((TableColumn.CellDataFeatures<Code, String> param)
-> new SimpleObjectProperty<>(param.getValue().code));
@@ -289,7 +289,7 @@ final class CRSTable extends ScrollPane {
     private static class DescColumn extends TableColumn<Code, String> {
 
         public DescColumn() {
-            super(Resources.format(Resources.Keys.Description));
+            super(Vocabulary.format(Vocabulary.Keys.Description));
             setEditable(false);
             setCellValueFactory((TableColumn.CellDataFeatures<Code, String> param)
->
                     new SimpleObjectProperty<>(param.getValue().getDescription()));
diff --git a/application/sis-javafx/src/main/java/org/apache/sis/internal/gui/FXUtilities.java
b/application/sis-javafx/src/main/java/org/apache/sis/internal/gui/FXUtilities.java
index 73c8bc8..500c0b3 100644
--- a/application/sis-javafx/src/main/java/org/apache/sis/internal/gui/FXUtilities.java
+++ b/application/sis-javafx/src/main/java/org/apache/sis/internal/gui/FXUtilities.java
@@ -16,7 +16,6 @@
  */
 package org.apache.sis.internal.gui;
 
-import java.util.Locale;
 import java.awt.Dimension;
 import java.awt.Graphics2D;
 import java.awt.RenderingHints;
@@ -76,12 +75,10 @@ public final class FXUtilities {
      *
      * @param  target  the widget for which to load the JRXML file.
      * @param  loader  the class to use for loading the file.
-     * @param  locale  the locale for the resources.
      * @throws IOException if an error occurred while loading the JRXML file.
      */
-    public static void loadJRXML(final Parent target, final Class<?> loader, final
Locale locale) throws IOException {
-        final FXMLLoader fxl = new FXMLLoader(loader.getResource(loader.getSimpleName() +
".fxml"),
-                                              Resources.forLocale(locale));
+    public static void loadJRXML(final Parent target, final Class<?> loader) throws
IOException {
+        final FXMLLoader fxl = new FXMLLoader(loader.getResource(loader.getSimpleName() +
".fxml"), Resources.getInstance());
         fxl.setRoot(target);
         fxl.setController(target);
         /*
diff --git a/application/sis-javafx/src/main/java/org/apache/sis/internal/gui/Resources.java
b/application/sis-javafx/src/main/java/org/apache/sis/internal/gui/Resources.java
index 9cf419b..152237a 100644
--- a/application/sis-javafx/src/main/java/org/apache/sis/internal/gui/Resources.java
+++ b/application/sis-javafx/src/main/java/org/apache/sis/internal/gui/Resources.java
@@ -17,13 +17,10 @@
 package org.apache.sis.internal.gui;
 
 import java.net.URL;
-import java.util.Locale;
 import java.util.MissingResourceException;
 import javax.annotation.Generated;
-import org.opengis.util.InternationalString;
 import org.apache.sis.util.resources.KeyConstants;
 import org.apache.sis.util.resources.IndexedResourceBundle;
-import org.apache.sis.util.resources.ResourceInternationalString;
 
 
 /**
@@ -56,24 +53,25 @@ public final class Resources extends IndexedResourceBundle {
         private Keys() {
         }
 
-        public static final short AxisConvention = 3;
-
         /**
-         * CRS
+         * All files
          */
-        public static final short CRS = 4;
+        public static final short AllFiles = 3;
 
         /**
-         * Code
+         * Coordinate Reference Systems
          */
-        public static final short Code = 1;
+        public static final short CRSs = 1;
 
         /**
-         * Description
+         * Geospatial data files
          */
-        public static final short Description = 2;
+        public static final short GeospatialFiles = 4;
 
-        public static final short LongitudeFirst = 5;
+        /**
+         * Open data file
+         */
+        public static final short OpenDataFile = 2;
     }
 
     /**
@@ -97,14 +95,13 @@ public final class Resources extends IndexedResourceBundle {
     }
 
     /**
-     * Returns resources in the given locale.
+     * Returns resources in the default locale.
      *
-     * @param  locale  the locale, or {@code null} for the default locale.
-     * @return resources in the given locale.
+     * @return resources in the default locale.
      * @throws MissingResourceException if resources can not be found.
      */
-    public static Resources forLocale(final Locale locale) throws MissingResourceException
{
-        return getBundle(Resources.class, locale);
+    public static Resources getInstance() throws MissingResourceException {
+        return getBundle(Resources.class, null);
     }
 
     /**
@@ -115,7 +112,7 @@ public final class Resources extends IndexedResourceBundle {
      * @throws MissingResourceException if no object for the given key can be found.
      */
     public static String format(final short key) throws MissingResourceException {
-        return forLocale(null).getString(key);
+        return getInstance().getString(key);
     }
 
     /**
@@ -130,7 +127,7 @@ public final class Resources extends IndexedResourceBundle {
     public static String format(final short  key,
                                 final Object arg0) throws MissingResourceException
     {
-        return forLocale(null).getString(key, arg0);
+        return getInstance().getString(key, arg0);
     }
 
     /**
@@ -147,7 +144,7 @@ public final class Resources extends IndexedResourceBundle {
                                 final Object arg0,
                                 final Object arg1) throws MissingResourceException
     {
-        return forLocale(null).getString(key, arg0, arg1);
+        return getInstance().getString(key, arg0, arg1);
     }
 
     /**
@@ -166,45 +163,6 @@ public final class Resources extends IndexedResourceBundle {
                                 final Object arg1,
                                 final Object arg2) throws MissingResourceException
     {
-        return forLocale(null).getString(key, arg0, arg1, arg2);
-    }
-
-    /**
-     * The international string to be returned by {@link formatInternational}.
-     */
-    private static final class International extends ResourceInternationalString {
-        private static final long serialVersionUID = -7265791441872360274L;
-
-        International(short key)                           {super(key);}
-        International(short key, Object args)              {super(key, args);}
-        @Override protected KeyConstants getKeyConstants() {return Keys.INSTANCE;}
-        @Override protected IndexedResourceBundle getBundle(final Locale locale) {
-            return forLocale(locale);
-        }
-    }
-
-    /**
-     * Gets an international string for the given key. This method does not check for the
key
-     * validity. If the key is invalid, then a {@link MissingResourceException} may be thrown
-     * when a {@link InternationalString#toString(Locale)} method is invoked.
-     *
-     * @param  key  the key for the desired string.
-     * @return an international string for the given key.
-     */
-    public static InternationalString formatInternational(final short key) {
-        return new International(key);
-    }
-
-    /**
-     * Gets an international string for the given key. This method does not check for the
key
-     * validity. If the key is invalid, then a {@link MissingResourceException} may be thrown
-     * when a {@link InternationalString#toString(Locale)} method is invoked.
-     *
-     * @param  key   the key for the desired string.
-     * @param  args  values to substitute to "{0}", "{1}", <i>etc</i>.
-     * @return an international string for the given key.
-     */
-    public static InternationalString formatInternational(final short key, final Object...
args) {
-        return new International(key, args);
+        return getInstance().getString(key, arg0, arg1, arg2);
     }
 }
diff --git a/application/sis-javafx/src/main/java/org/apache/sis/internal/gui/Resources.properties
b/application/sis-javafx/src/main/java/org/apache/sis/internal/gui/Resources.properties
index 61b64ed..630609c 100644
--- a/application/sis-javafx/src/main/java/org/apache/sis/internal/gui/Resources.properties
+++ b/application/sis-javafx/src/main/java/org/apache/sis/internal/gui/Resources.properties
@@ -20,6 +20,7 @@
 # For resources shared by all modules in the Apache SIS project, see "org.apache.sis.util.resources"
package.
 #
 
-Code            = Code
-Description     = Description
-CRS             = CRS
+AllFiles          = All files
+CRSs              = Coordinate Reference Systems
+GeospatialFiles   = Geospatial data files
+OpenDataFile      = Open data file
diff --git a/application/sis-javafx/src/main/java/org/apache/sis/internal/gui/Resources_fr.properties
b/application/sis-javafx/src/main/java/org/apache/sis/internal/gui/Resources_fr.properties
index b7a20f2..9d73d9c 100644
--- a/application/sis-javafx/src/main/java/org/apache/sis/internal/gui/Resources_fr.properties
+++ b/application/sis-javafx/src/main/java/org/apache/sis/internal/gui/Resources_fr.properties
@@ -25,6 +25,7 @@
 #   U+00A0 NO-BREAK SPACE         before  :
 #
 
-Code            = Code
-Description     = Description
-CRS             = CRS
+AllFiles          = Tous les fichiers
+CRSs              = Syst\u00e8mes de r\u00e9f\u00e9rence des coordonn\u00e9es
+GeospatialFiles   = Fichiers de donn\u00e9es g\u00e9ospatiales
+OpenDataFile      = Ouvrir un fichier de donn\u00e9es
diff --git a/application/sis-javafx/src/main/resources/org/apache/sis/gui/referencing/CRSChooser.fxml
b/application/sis-javafx/src/main/resources/org/apache/sis/gui/referencing/CRSChooser.fxml
index 0e6587f..7401b15 100644
--- a/application/sis-javafx/src/main/resources/org/apache/sis/gui/referencing/CRSChooser.fxml
+++ b/application/sis-javafx/src/main/resources/org/apache/sis/gui/referencing/CRSChooser.fxml
@@ -19,7 +19,7 @@
         <RowConstraints vgrow="NEVER" />
       </rowConstraints>
       <children>
-        <Label styleClass="property-key" text="%CRS" GridPane.rowSpan="2" />
+        <Label styleClass="property-key" text="%CRSs" GridPane.rowSpan="2" />
         <TextField fx:id="uiSearch" GridPane.columnSpan="3" GridPane.rowIndex="2" />
        </children>
     </GridPane>
diff --git a/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.java
b/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.java
index 05829f5..982badc 100644
--- a/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.java
+++ b/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.java
@@ -28,7 +28,7 @@ import org.opengis.util.InternationalString;
  * Locale-dependent resources for single words or short sentences.
  *
  * @author  Martin Desruisseaux (IRD, Geomatys)
- * @version 0.8
+ * @version 1.0
  * @since   0.3
  * @module
  */
@@ -312,6 +312,16 @@ public final class Vocabulary extends IndexedResourceBundle {
         public static final short EntryCount_1 = 121;
 
         /**
+         * Exit
+         */
+        public static final short Exit = 143;
+
+        /**
+         * File
+         */
+        public static final short File = 144;
+
+        /**
          * Geocentric
          */
         public static final short Geocentric = 42;
@@ -522,6 +532,11 @@ public final class Vocabulary extends IndexedResourceBundle {
         public static final short Offset = 79;
 
         /**
+         * Open
+         */
+        public static final short Open = 145;
+
+        /**
          * Operating system
          */
         public static final short OperatingSystem = 80;
diff --git a/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.properties
b/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.properties
index de0f9f8..72250e5 100644
--- a/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.properties
+++ b/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.properties
@@ -65,6 +65,8 @@ EllipsoidChange         = Ellipsoid change
 EllipsoidalHeight       = Ellipsoidal height
 EndDate                 = End date
 EntryCount_1            = {0} entr{0,choice,0#y|2#ies}
+Exit                    = Exit
+File                    = File
 Geocentric              = Geocentric
 GeocentricRadius        = Geocentric radius
 GeocentricConversion    = Geocentric conversion
@@ -107,6 +109,7 @@ NumberOfNaN             = Number of \u2018NaN\u2019
 Obligation              = Obligation
 Of_3                    = {0} ({1} of {2})
 Offset                  = Offset
+Open                    = Open
 OperatingSystem         = Operating system
 Operations              = Operations
 Optional                = Optional
diff --git a/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary_fr.properties
b/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary_fr.properties
index add2f86..39351ab 100644
--- a/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary_fr.properties
+++ b/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary_fr.properties
@@ -72,6 +72,8 @@ EllipsoidChange         = Changement d\u2019ellipso\u00efde
 EllipsoidalHeight       = Hauteur ellipso\u00efdale
 EntryCount_1            = {0} entr\u00e9e{0,choice,0#|2#s}
 EndDate                 = Date de fin
+Exit                    = Quitter
+File                    = Fichier
 Geocentric              = G\u00e9ocentrique
 GeocentricRadius        = Rayon g\u00e9ocentrique
 GeocentricConversion    = Conversion g\u00e9ocentrique
@@ -114,6 +116,7 @@ NumberOfNaN             = Nombre de \u2018NaN\u2019
 Obligation              = Obligation
 Of_3                    = {0} ({1} de {2})
 Offset                  = D\u00e9calage
+Open                    = Ouvrir
 OperatingSystem         = Syst\u00e8me d\u2019exploitation
 Operations              = Op\u00e9rations
 Optional                = Optionnel
diff --git a/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/StoreUtilities.java
b/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/StoreUtilities.java
index bb612c8..b52d702 100644
--- a/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/StoreUtilities.java
+++ b/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/StoreUtilities.java
@@ -17,9 +17,9 @@
 package org.apache.sis.internal.storage;
 
 import java.util.EnumSet;
+import java.util.stream.Stream;
 import java.nio.file.OpenOption;
 import java.nio.file.StandardOpenOption;
-import java.util.stream.Stream;
 import org.opengis.metadata.Metadata;
 import org.opengis.metadata.identification.Identification;
 import org.opengis.metadata.identification.DataIdentification;


Mime
View raw message