sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject [sis] 02/05: Rename a few methods for consistency. No change in functionality (except addition of a `DefaultProperty` annotation and an `assert` statement).
Date Fri, 26 Jun 2020 14:53:30 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 480baf241d55f8c73530e9452efb9acb85c6e231
Author: Martin Desruisseaux <martin.desruisseaux@geomatys.com>
AuthorDate: Fri Jun 26 11:22:27 2020 +0200

    Rename a few methods for consistency. No change in functionality (except addition of a
`DefaultProperty` annotation and an `assert` statement).
---
 .../main/java/org/apache/sis/gui/DataViewer.java   |  9 +++----
 .../org/apache/sis/gui/coverage/CellFormat.java    |  6 ++---
 .../apache/sis/gui/coverage/CoverageCanvas.java    |  8 ++++--
 .../apache/sis/gui/coverage/CoverageExplorer.java  |  3 +++
 .../org/apache/sis/gui/coverage/GridError.java     |  9 +++----
 .../java/org/apache/sis/gui/coverage/GridView.java |  1 +
 .../org/apache/sis/gui/coverage/GridViewSkin.java  | 19 +++++++------
 .../sis/gui/coverage/ImagePropertyExplorer.java    | 31 +++++++++++++---------
 .../org/apache/sis/gui/dataset/FeatureTable.java   |  6 ++---
 .../apache/sis/gui/dataset/ResourceExplorer.java   |  8 +++---
 .../org/apache/sis/gui/dataset/ResourceTree.java   | 25 +++++------------
 .../apache/sis/gui/metadata/MetadataSummary.java   |  1 +
 .../org/apache/sis/gui/metadata/MetadataTree.java  |  8 +++---
 .../gui/referencing/RecentReferenceSystems.java    | 16 +++++------
 14 files changed, 76 insertions(+), 74 deletions(-)

diff --git a/application/sis-javafx/src/main/java/org/apache/sis/gui/DataViewer.java b/application/sis-javafx/src/main/java/org/apache/sis/gui/DataViewer.java
index 4bbaa7b..78e685f 100644
--- a/application/sis-javafx/src/main/java/org/apache/sis/gui/DataViewer.java
+++ b/application/sis-javafx/src/main/java/org/apache/sis/gui/DataViewer.java
@@ -23,7 +23,6 @@ import java.util.List;
 import java.util.Set;
 import javafx.application.Application;
 import javafx.application.Platform;
-import javafx.event.ActionEvent;
 import javafx.geometry.Rectangle2D;
 import javafx.scene.Scene;
 import javafx.scene.control.Menu;
@@ -97,7 +96,7 @@ public class DataViewer extends Application {
     private FileChooser.ExtensionFilter[] saveFilters;
 
     /**
-     * The last filter used by the {@link #open(ActionEvent)} action.
+     * The last filter used by the {@link #showOpenFileDialog()} action.
      */
     private FileChooser.ExtensionFilter lastFilter;
 
@@ -128,7 +127,7 @@ public class DataViewer extends Application {
         {   // For keeping variables locale.
             final MenuItem open;
             file.getItems().addAll(
-                    open = localized.menu(Resources.Keys.Open, this::open),
+                    open = localized.menu(Resources.Keys.Open, (e) -> showOpenFileDialog()),
                     new SeparatorMenuItem(),
                     localized.menu(Resources.Keys.Exit, (event) -> Platform.exit()));
 
@@ -204,10 +203,8 @@ public class DataViewer extends Application {
      * 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.
-     *
-     * @param  event  ignored (can be {@code null}).
      */
-    private void open(final ActionEvent event) {
+    private void showOpenFileDialog() {
         if (openFilters == null) {
             createFileFilters();
             lastFilter = openFilters[1];
diff --git a/application/sis-javafx/src/main/java/org/apache/sis/gui/coverage/CellFormat.java
b/application/sis-javafx/src/main/java/org/apache/sis/gui/coverage/CellFormat.java
index 462f039..cdb24de 100644
--- a/application/sis-javafx/src/main/java/org/apache/sis/gui/coverage/CellFormat.java
+++ b/application/sis-javafx/src/main/java/org/apache/sis/gui/coverage/CellFormat.java
@@ -102,7 +102,7 @@ final class CellFormat extends SimpleStringProperty {
     /**
      * Temporarily set to {@code true} when the user selects or enters a new pattern in a
GUI control, then
      * reset to {@code false} after the new values has been set. This is a safety against
recursive calls
-     * to {@link #patternSelected(ComboBox, String)} because of bi-directional change listeners.
+     * to {@link #onPatternSelected(ComboBox, String)} because of bi-directional change listeners.
      */
     private boolean isAdjusting;
 
@@ -160,7 +160,7 @@ final class CellFormat extends SimpleStringProperty {
      * @param  choices   the control where format pattern is selected.
      * @param  newValue  the new format pattern.
      */
-    private void patternSelected(final ComboBox<String> choices, final String newValue)
{
+    private void onPatternSelected(final ComboBox<String> choices, final String newValue)
{
         if (!isAdjusting) {
             Background background;
             String message;
@@ -219,7 +219,7 @@ final class CellFormat extends SimpleStringProperty {
         choices.setEditable(true);
         choices.getItems().setAll(patterns);
         choices.getSelectionModel().selectFirst();
-        choices.getSelectionModel().selectedItemProperty().addListener((e,o,n) -> patternSelected(choices,
n));
+        choices.getSelectionModel().selectedItemProperty().addListener((e,o,n) -> onPatternSelected(choices,
n));
         addListener((e,o,n) -> RecentChoices.setInList(choices, n));
         return choices;
     }
diff --git a/application/sis-javafx/src/main/java/org/apache/sis/gui/coverage/CoverageCanvas.java
b/application/sis-javafx/src/main/java/org/apache/sis/gui/coverage/CoverageCanvas.java
index 8006a07..d3eb1de 100644
--- a/application/sis-javafx/src/main/java/org/apache/sis/gui/coverage/CoverageCanvas.java
+++ b/application/sis-javafx/src/main/java/org/apache/sis/gui/coverage/CoverageCanvas.java
@@ -28,10 +28,12 @@ import javafx.scene.paint.Color;
 import javafx.scene.layout.Region;
 import javafx.scene.layout.Background;
 import javafx.scene.layout.BackgroundFill;
+import javafx.beans.DefaultProperty;
 import javafx.beans.property.ObjectProperty;
 import javafx.beans.property.SimpleObjectProperty;
 import javafx.beans.value.ObservableValue;
 import javafx.beans.value.WritableValue;
+import javafx.application.Platform;
 import javafx.concurrent.Task;
 import javax.measure.Quantity;
 import javax.measure.quantity.Length;
@@ -74,6 +76,7 @@ import org.apache.sis.measure.Units;
  * @since 1.1
  * @module
  */
+@DefaultProperty("coverage")
 public class CoverageCanvas extends MapCanvasAWT {
     /**
      * The data shown in this canvas. Note that setting this property to a non-null value
may not
@@ -197,6 +200,7 @@ public class CoverageCanvas extends MapCanvasAWT {
      * @see #coverageProperty
      */
     public final void setCoverage(final GridCoverage coverage) {
+        assert Platform.isFxApplicationThread();
         coverageProperty.set(coverage);
     }
 
@@ -323,8 +327,8 @@ public class CoverageCanvas extends MapCanvasAWT {
     /**
      * Invoked when a new interpolation has been specified.
      */
-    private void onInterpolationSpecified(final Interpolation interpolation) {
-        data.processor.setInterpolation(interpolation);
+    private void onInterpolationSpecified(final Interpolation newValue) {
+        data.processor.setInterpolation(newValue);
         resampledImages.clear();
         requestRepaint();
     }
diff --git a/application/sis-javafx/src/main/java/org/apache/sis/gui/coverage/CoverageExplorer.java
b/application/sis-javafx/src/main/java/org/apache/sis/gui/coverage/CoverageExplorer.java
index f197b5f..e35103a 100644
--- a/application/sis-javafx/src/main/java/org/apache/sis/gui/coverage/CoverageExplorer.java
+++ b/application/sis-javafx/src/main/java/org/apache/sis/gui/coverage/CoverageExplorer.java
@@ -17,6 +17,7 @@
 package org.apache.sis.gui.coverage;
 
 import java.util.Locale;
+import javafx.beans.DefaultProperty;
 import javafx.scene.control.Control;
 import javafx.scene.control.SplitPane;
 import javafx.scene.control.Separator;
@@ -51,6 +52,7 @@ import org.apache.sis.gui.Widget;
  * @since 1.1
  * @module
  */
+@DefaultProperty("coverage")
 public class CoverageExplorer extends Widget {
     /**
      * Type of view shown in the explorer.
@@ -96,6 +98,7 @@ public class CoverageExplorer extends Widget {
      *
      * @see #getCoverage()
      * @see #setCoverage(GridCoverage)
+     * @see #setCoverage(ImageRequest)
      */
     public final ObjectProperty<GridCoverage> coverageProperty;
 
diff --git a/application/sis-javafx/src/main/java/org/apache/sis/gui/coverage/GridError.java
b/application/sis-javafx/src/main/java/org/apache/sis/gui/coverage/GridError.java
index 27431b6..629a718 100644
--- a/application/sis-javafx/src/main/java/org/apache/sis/gui/coverage/GridError.java
+++ b/application/sis-javafx/src/main/java/org/apache/sis/gui/coverage/GridError.java
@@ -19,7 +19,6 @@ package org.apache.sis.gui.coverage;
 import java.awt.Rectangle;
 import javafx.geometry.Pos;
 import javafx.geometry.Insets;
-import javafx.event.ActionEvent;
 import javafx.scene.control.Button;
 import javafx.scene.control.Label;
 import javafx.scene.layout.TilePane;
@@ -98,8 +97,8 @@ final class GridError extends VBox {
         getChildren().addAll(message, buttons);
         setAlignment(Pos.CENTER);
         setPadding(new Insets(12, 18, 24, 18));
-        details.setOnAction(this::showDetails);
-        retry  .setOnAction(this::retry);
+        details.setOnAction((e) -> showDetails());
+        retry  .setOnAction((e) -> retry());
     }
 
     /**
@@ -116,14 +115,14 @@ final class GridError extends VBox {
     /**
      * Invoked when the user click on the "details" button.
      */
-    private void showDetails(final ActionEvent event) {
+    private void showDetails() {
         ExceptionReporter.show(Resources.format(Resources.Keys.ErrorDataAccess), header,
exception);
     }
 
     /**
      * Invoked when the user asked to retry a tile computation.
      */
-    private void retry(final ActionEvent event) {
+    private void retry() {
         final GridView view = (GridView) getParent();
         ((GridViewSkin) view.getSkin()).removeError(this);
         tile.clear();
diff --git a/application/sis-javafx/src/main/java/org/apache/sis/gui/coverage/GridView.java
b/application/sis-javafx/src/main/java/org/apache/sis/gui/coverage/GridView.java
index de8b21a..3447369 100644
--- a/application/sis-javafx/src/main/java/org/apache/sis/gui/coverage/GridView.java
+++ b/application/sis-javafx/src/main/java/org/apache/sis/gui/coverage/GridView.java
@@ -93,6 +93,7 @@ public class GridView extends Control {
      *
      * @see #getImage()
      * @see #setImage(RenderedImage)
+     * @see #setImage(ImageRequest)
      */
     public final ObjectProperty<RenderedImage> imageProperty;
 
diff --git a/application/sis-javafx/src/main/java/org/apache/sis/gui/coverage/GridViewSkin.java
b/application/sis-javafx/src/main/java/org/apache/sis/gui/coverage/GridViewSkin.java
index bd306ca..2eab9c2 100644
--- a/application/sis-javafx/src/main/java/org/apache/sis/gui/coverage/GridViewSkin.java
+++ b/application/sis-javafx/src/main/java/org/apache/sis/gui/coverage/GridViewSkin.java
@@ -144,9 +144,9 @@ final class GridViewSkin extends VirtualContainerBase<GridView, GridRow>
impleme
         flow.setCellFactory(GridRow::new);
         flow.setFocusTraversable(true);
         flow.setFixedCellSize(GridView.getSizeValue(view.cellHeight));
-        view.cellHeight .addListener(this::cellHeightChanged);
-        view.cellWidth  .addListener(this::cellWidthChanged);
-        view.headerWidth.addListener(this::cellWidthChanged);
+        view.cellHeight .addListener((p,o,n) -> cellHeightChanged(n));
+        view.cellWidth  .addListener((p,o,n) -> cellWidthChanged(n, true));
+        view.headerWidth.addListener((p,o,n) -> cellWidthChanged(n, false));
         /*
          * Rectangles for filling the background of the cells in the header row and header
column.
          * Those rectangles will be resized and relocated by the `layout(…)` method.
@@ -168,7 +168,7 @@ final class GridViewSkin extends VirtualContainerBase<GridView, GridRow>
impleme
         selection     .setVisible(false);
         selectedRow   .setVisible(false);
         selectedColumn.setVisible(false);
-        flow.setOnMouseExited(this::hideSelection);
+        flow.setOnMouseExited((e) -> hideSelection());
         /*
          * The status bar where to show coordinates of selected cell.
          * Mouse exit event is handled by `hideSelection(…)`.
@@ -221,7 +221,7 @@ final class GridViewSkin extends VirtualContainerBase<GridView, GridRow>
impleme
     /**
      * Hides the selection when the mouse moved outside the grid view area.
      */
-    private void hideSelection(final MouseEvent event) {
+    private void hideSelection() {
         selection     .setVisible(false);
         selectedRow   .setVisible(false);
         selectedColumn.setVisible(false);
@@ -232,7 +232,7 @@ final class GridViewSkin extends VirtualContainerBase<GridView, GridRow>
impleme
      * Invoked when the value of {@link GridView#cellHeight} property changed.
      * This method copies the new value into {@link VirtualFlow#fixedCellSizeProperty()}
after bounds check.
      */
-    private void cellHeightChanged(ObservableValue<? extends Number> property, Number
oldValue, Number newValue) {
+    private void cellHeightChanged(Number newValue) {
         final Flow flow = (Flow) getVirtualFlow();
         double value = newValue.doubleValue();
         if (!(value >= GridView.MIN_CELL_SIZE)) {           // Use ! for catching NaN
values.
@@ -247,8 +247,11 @@ final class GridViewSkin extends VirtualContainerBase<GridView, GridRow>
impleme
     /**
      * Invoked when the cell width or header width changed.
      * This method notifies all children about the new width.
+     *
+     * @param  cell  {@code true} if modifying the width of cells, or
+     *               {@code false} if modifying the width of headers.
      */
-    private void cellWidthChanged(ObservableValue<? extends Number> property, Number
oldValue, Number newValue) {
+    private void cellWidthChanged(Number newValue, final boolean cell) {
         final GridView view = getSkinnable();
         final double width = view.getContentWidth();
         for (final Node child : getChildren()) {
@@ -256,7 +259,7 @@ final class GridViewSkin extends VirtualContainerBase<GridView, GridRow>
impleme
                 ((GridRow) child).setPrefWidth(width);
             }
         }
-        if (property == view.cellWidth) {
+        if (cell) {
             selection.setVisible(false);
             selection.setWidth(newValue.doubleValue());
         }
diff --git a/application/sis-javafx/src/main/java/org/apache/sis/gui/coverage/ImagePropertyExplorer.java
b/application/sis-javafx/src/main/java/org/apache/sis/gui/coverage/ImagePropertyExplorer.java
index 7484d9c..f3a2150 100644
--- a/application/sis-javafx/src/main/java/org/apache/sis/gui/coverage/ImagePropertyExplorer.java
+++ b/application/sis-javafx/src/main/java/org/apache/sis/gui/coverage/ImagePropertyExplorer.java
@@ -84,6 +84,10 @@ public class ImagePropertyExplorer extends Widget {
     /**
      * The root image to describe. This image will be the root of a tree;
      * children will be image {@linkplain RenderedImage#getSources() sources}.
+     *
+     * <div class="note"><b>API note:</b>
+     * We do not provide getter/setter for this property; use {@link ObjectProperty#set(Object)}
+     * directly instead. We omit the "Property" suffix for making this operation more natural.</div>
      */
     public final ObjectProperty<RenderedImage> image;
 
@@ -137,6 +141,10 @@ public class ImagePropertyExplorer extends Widget {
      * Note that setting this property to {@code false} may have the effect of discarding
current content
      * when the {@link #image} change. This is done for allowing the garbage collector to
reclaim memory.
      * The content is reset to {@link #image} properties when {@code updateOnChange} become
{@code true} again.
+     *
+     * <div class="note"><b>API note:</b>
+     * We do not provide getter/setter for this property; use {@link BooleanProperty#set(boolean)}
+     * directly instead. We omit the "Property" suffix for making this operation more natural.</div>
      */
     public final BooleanProperty updateOnChange;
 
@@ -146,7 +154,7 @@ public class ImagePropertyExplorer extends Widget {
      * and reset to {@code true} when {@code updateOnChange} become {@code true} again.
      *
      * @see #updateOnChange
-     * @see #setEnabled(boolean)
+     * @see #startListening()
      */
     private boolean listening;
 
@@ -461,22 +469,21 @@ public class ImagePropertyExplorer extends Widget {
         view.setOrientation(Orientation.VERTICAL);
         SplitPane.setResizableWithParent(sources, false);
         sources.setMinHeight(50);
-        updateOnChange.addListener((p,o,n) -> {setEnabled(n);});
+        updateOnChange.addListener((p,o,n) -> {if (n) startListening();});
     }
 
     /**
      * Invoked when {@link #updateOnChange} became {@code true}.
      * This method updates the visual components for current image.
-     */
-    private void setEnabled(final boolean enabled) {
-        if (enabled) {
-            listening = true;
-            if (sourcesRoot.getValue() == null) {
-                setTreeRoot(image.get());
-                refreshTables();
-            }
-        } else {
-            // Do not set `listening = false` now; it may be done by `setImage(…)` later.
+     *
+     * <p>Note: there is no {@code stopListening()} method because setting {@link #listening}
flag
+     * to {@code false} will be done by the {@link #setImage(RenderedImage, Rectangle)} method.</p>
+     */
+    private void startListening() {
+        listening = true;
+        if (sourcesRoot.getValue() == null) {
+            setTreeRoot(image.get());
+            refreshTables();
         }
     }
 
diff --git a/application/sis-javafx/src/main/java/org/apache/sis/gui/dataset/FeatureTable.java
b/application/sis-javafx/src/main/java/org/apache/sis/gui/dataset/FeatureTable.java
index 548fe79..550175d 100644
--- a/application/sis-javafx/src/main/java/org/apache/sis/gui/dataset/FeatureTable.java
+++ b/application/sis-javafx/src/main/java/org/apache/sis/gui/dataset/FeatureTable.java
@@ -164,7 +164,7 @@ public class FeatureTable extends TableView<Feature> {
      * This is common code shared by both constructors.
      */
     private void initialize() {
-        featuresProperty.addListener(this::startFeaturesLoading);
+        featuresProperty.addListener((p,o,n) -> startFeaturesLoading(n));
         setColumnResizePolicy(CONSTRAINED_RESIZE_POLICY);
         setTableMenuButtonVisible(true);
     }
@@ -229,9 +229,7 @@ public class FeatureTable extends TableView<Feature> {
      * Invoked (indirectly) when the user sets a new {@link FeatureSet}.
      * See {@link #setFeatures(FeatureSet)} for method description.
      */
-    private void startFeaturesLoading(final ObservableValue<? extends FeatureSet> property,
-                                      final FeatureSet old, final FeatureSet features)
-    {
+    private void startFeaturesLoading(final FeatureSet features) {
         final FeatureList items;
         if (isSharingList) {
             items = new FeatureList();
diff --git a/application/sis-javafx/src/main/java/org/apache/sis/gui/dataset/ResourceExplorer.java
b/application/sis-javafx/src/main/java/org/apache/sis/gui/dataset/ResourceExplorer.java
index 178e949..7f23dca 100644
--- a/application/sis-javafx/src/main/java/org/apache/sis/gui/dataset/ResourceExplorer.java
+++ b/application/sis-javafx/src/main/java/org/apache/sis/gui/dataset/ResourceExplorer.java
@@ -64,7 +64,7 @@ public class ResourceExplorer extends WindowManager {
     /**
      * The currently selected resource.
      *
-     * @see #getSelectedResourceProperty()
+     * @see #selectedResourceProperty()
      */
     private final ReadOnlyObjectWrapper<Resource> selectedResource;
 
@@ -139,7 +139,7 @@ public class ResourceExplorer extends WindowManager {
          * Build the resource explorer. Must be first because `localized()` depends on it.
          */
         resources = new ResourceTree();
-        resources.getSelectionModel().getSelectedItems().addListener(this::selectResource);
+        resources.getSelectionModel().getSelectedItems().addListener(this::onResourceSelected);
         resources.setPrefWidth(400);
         selectedResource = new ReadOnlyObjectWrapper<>(this, "selectedResource");
         metadata = new MetadataSummary();
@@ -275,7 +275,7 @@ public class ResourceExplorer extends WindowManager {
      *
      * @param  change  a change event with the new resource to show.
      */
-    private void selectResource(final ListChangeListener.Change<? extends TreeItem<Resource>>
change) {
+    private void onResourceSelected(final ListChangeListener.Change<? extends TreeItem<Resource>>
change) {
         Resource resource = null;
         for (final TreeItem<Resource> item : change.getList()) {
             if (item != null) {
@@ -444,7 +444,7 @@ public class ResourceExplorer extends WindowManager {
      *
      * @return property for currently selected resource.
      */
-    public ReadOnlyProperty<Resource> getSelectedResourceProperty() {
+    public ReadOnlyProperty<Resource> selectedResourceProperty() {
         return selectedResource.getReadOnlyProperty();
     }
 }
diff --git a/application/sis-javafx/src/main/java/org/apache/sis/gui/dataset/ResourceTree.java
b/application/sis-javafx/src/main/java/org/apache/sis/gui/dataset/ResourceTree.java
index e5ef83a..3201e10 100644
--- a/application/sis-javafx/src/main/java/org/apache/sis/gui/dataset/ResourceTree.java
+++ b/application/sis-javafx/src/main/java/org/apache/sis/gui/dataset/ResourceTree.java
@@ -29,7 +29,6 @@ import java.util.Optional;
 import javafx.application.Platform;
 import javafx.concurrent.Task;
 import javafx.collections.ObservableList;
-import javafx.event.ActionEvent;
 import javafx.scene.control.Button;
 import javafx.scene.control.ContextMenu;
 import javafx.scene.control.TreeCell;
@@ -102,9 +101,9 @@ public class ResourceTree extends TreeView<Resource> {
      */
     public ResourceTree() {
         localized = Resources.forLocale(null);
-        setCellFactory(ResourceTree::newCell);
+        setCellFactory((v) -> new Cell());
         setOnDragOver(ResourceTree::onDragOver);
-        setOnDragDropped(this::load);
+        setOnDragDropped(this::onDragDropped);
     }
 
     /**
@@ -209,7 +208,7 @@ public class ResourceTree extends TreeView<Resource> {
      *
      * @param  event  the "drag and drop" event.
      */
-    private void load(final DragEvent event) {
+    private void onDragDropped(final DragEvent event) {
         final Dragboard db = event.getDragboard();
         final List<File> files = db.getFiles();
         boolean success = false;
@@ -301,17 +300,6 @@ public class ResourceTree extends TreeView<Resource> {
     }
 
     /**
-     * Invoked when a new cell needs to be created. This method creates a specialized instance
-     * which will get the cell text from a resource by a call to {@link #getTitle(Resource,
boolean)}.
-     *
-     * @param  tree  the {@link ResourceTree} for which to create a cell.
-     * @return a new cell renderer for the given tree.
-     */
-    private static TreeCell<Resource> newCell(final TreeView<Resource> tree)
{
-        return new Cell();
-    }
-
-    /**
      * Returns the locale to use for titles, messages, labels, etc.
      */
     final Locale getLocale() {
@@ -409,7 +397,8 @@ public class ResourceTree extends TreeView<Resource> {
     }
 
     /**
-     * The visual appearance of an {@link Item} in a tree. Cells are initially empty;
+     * The visual appearance of an {@link Item} in a tree. This call gets the cell text from
a resource
+     * by a call to {@link ResourceTree#getTitle(Resource, boolean)}. Cells are initially
empty;
      * their content will be specified by {@link TreeView} after construction.
      * The same call may be recycled many times for different {@link Item} data.
      *
@@ -481,7 +470,7 @@ public class ResourceTree extends TreeView<Resource> {
                     if (menu == null) {
                         final Resources localized = tree.localized;
                         menu = new ContextMenu();
-                        menu.getItems().add(localized.menu(Resources.Keys.Close, this::close));
+                        menu.getItems().add(localized.menu(Resources.Keys.Close, (e) ->
close()));
                     }
                 }
                 setContextMenu(menu);
@@ -491,7 +480,7 @@ public class ResourceTree extends TreeView<Resource> {
         /**
          * Invoked when user selected the "close" action in the contextual menu.
          */
-        private void close(final ActionEvent event) {
+        private void close() {
             ((ResourceTree) getTreeView()).removeAndClose(getItem());
         }
     }
diff --git a/application/sis-javafx/src/main/java/org/apache/sis/gui/metadata/MetadataSummary.java
b/application/sis-javafx/src/main/java/org/apache/sis/gui/metadata/MetadataSummary.java
index b447205..ba28dbb 100644
--- a/application/sis-javafx/src/main/java/org/apache/sis/gui/metadata/MetadataSummary.java
+++ b/application/sis-javafx/src/main/java/org/apache/sis/gui/metadata/MetadataSummary.java
@@ -115,6 +115,7 @@ public class MetadataSummary extends Widget {
      *
      * @see #getMetadata()
      * @see #setMetadata(Metadata)
+     * @see #setMetadata(Resource)
      */
     public final ObjectProperty<Metadata> metadataProperty;
 
diff --git a/application/sis-javafx/src/main/java/org/apache/sis/gui/metadata/MetadataTree.java
b/application/sis-javafx/src/main/java/org/apache/sis/gui/metadata/MetadataTree.java
index fe34dab..6bdd23f 100644
--- a/application/sis-javafx/src/main/java/org/apache/sis/gui/metadata/MetadataTree.java
+++ b/application/sis-javafx/src/main/java/org/apache/sis/gui/metadata/MetadataTree.java
@@ -212,15 +212,15 @@ public class MetadataTree extends TreeTableView<TreeTable.Node>
{
      *
      * @param  property  the property which has been modified.
      * @param  oldValue  the old tree table.
-     * @param  content   the tree table to use for building new content.
+     * @param  newValue  the tree table to use for building new content.
      */
     private static void applyChange(final ObservableValue<? extends TreeTable> property,
-                                    final TreeTable oldValue, final TreeTable  content)
+                                    final TreeTable oldValue, final TreeTable  newValue)
     {
         final MetadataTree s = (MetadataTree) ((ContentProperty) property).getBean();
         TreeItem<TreeTable.Node> root = null;
-        if (content != null) {
-            root = new Item(content.getRoot());
+        if (newValue != null) {
+            root = new Item(newValue.getRoot());
             root.setExpanded(true);
         }
         s.setRoot(root);
diff --git a/application/sis-javafx/src/main/java/org/apache/sis/gui/referencing/RecentReferenceSystems.java
b/application/sis-javafx/src/main/java/org/apache/sis/gui/referencing/RecentReferenceSystems.java
index 82329c2..abb3ccb 100644
--- a/application/sis-javafx/src/main/java/org/apache/sis/gui/referencing/RecentReferenceSystems.java
+++ b/application/sis-javafx/src/main/java/org/apache/sis/gui/referencing/RecentReferenceSystems.java
@@ -205,7 +205,7 @@ public class RecentReferenceSystems {
      * {@code true} if the {@link #referenceSystems} list needs to be rebuilt from {@link
#systemsOrCodes} content.
      * This field shall be read and modified in a block synchronized on {@link #systemsOrCodes}.
      *
-     * @see #modified()
+     * @see #listModified()
      */
     private boolean isModified;
 
@@ -238,10 +238,10 @@ public class RecentReferenceSystems {
         areaOfInterest       = new SimpleObjectProperty<>(this, "areaOfInterest");
         duplicationCriterion = new NonNullObjectProperty<>(this, "duplicationCriterion",
ComparisonMode.ALLOW_VARIANT);
         controlValues        = new ArrayList<>();
-        duplicationCriterion.addListener((e) -> modified());
+        duplicationCriterion.addListener((e) -> listModified());
         areaOfInterest.addListener((e,o,n) -> {
             geographicAOI = Utils.toGeographic(RecentReferenceSystems.class, "areaOfInterest",
n);
-            modified();
+            listModified();
         });
     }
 
@@ -262,7 +262,7 @@ public class RecentReferenceSystems {
         ArgumentChecks.ensureNonNull("system", system);
         synchronized (systemsOrCodes) {
             systemsOrCodes.add(0, replaceByAuthoritativeDefinition ? new Unverified(system)
: system);
-            modified();
+            listModified();
         }
     }
 
@@ -282,7 +282,7 @@ public class RecentReferenceSystems {
         ArgumentChecks.ensureNonEmpty("code", code);
         synchronized (systemsOrCodes) {
             systemsOrCodes.add(0, code);
-            modified();
+            listModified();
         }
     }
 
@@ -309,7 +309,7 @@ public class RecentReferenceSystems {
                     systemsOrCodes.add(replaceByAuthoritativeDefinition ? new Unverified(system)
: system);
                 }
             }
-            modified();
+            listModified();
         }
         // Check for duplication will be done in `filterReferenceSystems()` method.
     }
@@ -338,7 +338,7 @@ public class RecentReferenceSystems {
                     systemsOrCodes.add(code);
                 }
             }
-            modified();
+            listModified();
         }
         // Parsing will be done in `filterReferenceSystems()` method.
     }
@@ -483,7 +483,7 @@ public class RecentReferenceSystems {
      * some controls have been created ({@link ChoiceBox} or {@link MenuItem}s), then this
method
      * updates their list of items. The update may happen at some time after this method
returned.
      */
-    private void modified() {
+    private void listModified() {
         synchronized (systemsOrCodes) {
             isModified = true;
             if (referenceSystems != null) {


Mime
View raw message