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 d2ca18b8b5e6a52cc051daa3d39522d0c7436a80
Author: Martin Desruisseaux <[email protected]>
AuthorDate: Fri Apr 10 14:37:59 2026 +0200

    Add tooltip texts.
---
 .../org/apache/sis/gui/internal/Resources.java     | 10 ++++++++
 .../apache/sis/gui/internal/Resources.properties   |  2 ++
 .../sis/gui/internal/Resources_fr.properties       |  2 ++
 .../main/org/apache/sis/gui/map/MultiCanvas.java   | 29 ++++++++++++++++------
 4 files changed, 36 insertions(+), 7 deletions(-)

diff --git 
a/optional/src/org.apache.sis.gui/main/org/apache/sis/gui/internal/Resources.java
 
b/optional/src/org.apache.sis.gui/main/org/apache/sis/gui/internal/Resources.java
index d62c85744c..b2f6871bf9 100644
--- 
a/optional/src/org.apache.sis.gui/main/org/apache/sis/gui/internal/Resources.java
+++ 
b/optional/src/org.apache.sis.gui/main/org/apache/sis/gui/internal/Resources.java
@@ -245,6 +245,11 @@ public class Resources extends IndexedResourceBundle {
          */
         public static final short FileAccesses = 63;
 
+        /**
+         * Follow on other maps the displacements of this map.
+         */
+        public static final short ForwardMoveToOthers = 81;
+
         /**
          * Full screen
          */
@@ -381,6 +386,11 @@ public class Resources extends IndexedResourceBundle {
          */
         public static final short ReferenceByIdentifiers = 73;
 
+        /**
+         * Remove this map from the mosaic.
+         */
+        public static final short RemoveCanvasFromMosaic = 82;
+
         /**
          * Select a coordinate reference system
          */
diff --git 
a/optional/src/org.apache.sis.gui/main/org/apache/sis/gui/internal/Resources.properties
 
b/optional/src/org.apache.sis.gui/main/org/apache/sis/gui/internal/Resources.properties
index 8ca1f85558..d8fe843802 100644
--- 
a/optional/src/org.apache.sis.gui/main/org/apache/sis/gui/internal/Resources.properties
+++ 
b/optional/src/org.apache.sis.gui/main/org/apache/sis/gui/internal/Resources.properties
@@ -59,6 +59,7 @@ ErrorAt                = An error occurred at the following 
location:
 Exit                   = Exit
 FileAccesses           = File accesses
 FullScreen             = Full screen
+ForwardMoveToOthers    = Follow on other maps the displacements of this map.
 GeodeticDataset_1      = {0} geodetic dataset
 GeospatialFiles        = Geospatial data files
 Help                   = Help
@@ -85,6 +86,7 @@ PropertyValue          = Property value
 RangeOfValues          = Range of values\u2026
 ReferenceByCellIndices = Reference by cell indices
 ReferenceByIdentifiers = Reference system by identifiers
+RemoveCanvasFromMosaic = Remove this map from the mosaic.
 SelectCRS              = Select a coordinate reference system
 SelectCrsByContextMenu = For changing the projection, use contextual menu on 
the map.
 SelectParentLogger     = Select parent logger
diff --git 
a/optional/src/org.apache.sis.gui/main/org/apache/sis/gui/internal/Resources_fr.properties
 
b/optional/src/org.apache.sis.gui/main/org/apache/sis/gui/internal/Resources_fr.properties
index 189cb170cd..91f843d95f 100644
--- 
a/optional/src/org.apache.sis.gui/main/org/apache/sis/gui/internal/Resources_fr.properties
+++ 
b/optional/src/org.apache.sis.gui/main/org/apache/sis/gui/internal/Resources_fr.properties
@@ -64,6 +64,7 @@ ErrorAt                = Une erreur est survenue \u00e0 
l\u2019endroit suivant\u
 Exit                   = Quitter
 FileAccesses           = Acc\u00e8s aux fichiers
 FullScreen             = Plein \u00e9cran
+ForwardMoveToOthers    = Suivre sur les autres cartes les d\u00e9placements de 
cette carte.
 GeodeticDataset_1      = Base de donn\u00e9es g\u00e9od\u00e9siques {0}
 GeospatialFiles        = Fichiers de donn\u00e9es g\u00e9ospatiales
 Help                   = Aide
@@ -90,6 +91,7 @@ PropertyValue          = Valeur de la propri\u00e9t\u00e9
 RangeOfValues          = Plage de valeurs\u2026
 ReferenceByCellIndices = R\u00e9f\u00e9rencement par indices de cellules
 ReferenceByIdentifiers = Syst\u00e8me de r\u00e9f\u00e9rence par identifiants
+RemoveCanvasFromMosaic = Retirer cette carte de la mosa\u00efque.
 SelectCRS              = Choisir un syst\u00e8me de r\u00e9f\u00e9rence des 
coordonn\u00e9es
 SelectCrsByContextMenu = Pour changer la projection, utilisez le menu 
contextuel sur la carte.
 SelectParentLogger     = Choisir le journal parent
diff --git 
a/optional/src/org.apache.sis.gui/main/org/apache/sis/gui/map/MultiCanvas.java 
b/optional/src/org.apache.sis.gui/main/org/apache/sis/gui/map/MultiCanvas.java
index dcaf62a4bd..14504672a2 100644
--- 
a/optional/src/org.apache.sis.gui/main/org/apache/sis/gui/map/MultiCanvas.java
+++ 
b/optional/src/org.apache.sis.gui/main/org/apache/sis/gui/map/MultiCanvas.java
@@ -34,6 +34,8 @@ import javafx.beans.value.ObservableValue;
 import javafx.scene.Node;
 import javafx.scene.control.Label;
 import javafx.scene.control.Button;
+import javafx.scene.control.ButtonBase;
+import javafx.scene.control.Tooltip;
 import javafx.scene.control.ToggleButton;
 import javafx.scene.input.MouseEvent;
 import javafx.scene.layout.BorderPane;
@@ -53,6 +55,7 @@ import org.apache.sis.gui.coverage.CoverageCanvas;
 import org.apache.sis.gui.internal.BackgroundThreads;
 import org.apache.sis.gui.internal.DataStoreOpener;
 import org.apache.sis.gui.internal.FontGIS;
+import org.apache.sis.gui.internal.Resources;
 import static org.apache.sis.gui.internal.LogHandler.LOGGER;
 import org.apache.sis.gui.referencing.RecentReferenceSystems;
 import org.apache.sis.io.TableAppender;
@@ -434,14 +437,16 @@ final class MultiCanvas extends Widget implements 
Observable {
     private BorderPane addTitleBar(final Region canvasView, final Controls 
controls) {
         final Label title = controls.title;
         final var close = new Button("❌");
+        setTooltip(close, Resources.Keys.RemoveCanvasFromMosaic);
         close.setOnAction((event) -> closeCanvasView(canvasView));
-        final var pin = new ToggleButton();
-        pin.selectedProperty().addListener(controls);
-        FontGIS.setGlyph(pin, FontGIS.Code.MOVE, "⮀", -1, -1);
-        HBox.setHgrow(pin,   Priority.NEVER);
-        HBox.setHgrow(title, Priority.ALWAYS);
-        HBox.setHgrow(close, Priority.NEVER);
-        final var bar = new HBox(pin, title, close);
+        final var follow = new ToggleButton();
+        follow.selectedProperty().addListener(controls);
+        FontGIS.setGlyph(follow, FontGIS.Code.MOVE, "⮀", -1, -1);
+        setTooltip(follow, Resources.Keys.ForwardMoveToOthers);
+        HBox.setHgrow(follow, Priority.NEVER);
+        HBox.setHgrow(title,  Priority.ALWAYS);
+        HBox.setHgrow(close,  Priority.NEVER);
+        final var bar = new HBox(follow, title, close);
         bar.setAlignment(Pos.CENTER);
         title.setAlignment(Pos.CENTER);
         title.setMaxWidth(Double.MAX_VALUE);
@@ -451,6 +456,16 @@ final class MultiCanvas extends Widget implements 
Observable {
         return pane;
     }
 
+    /**
+     * Sets the tool tip of the specified button.
+     *
+     * @param button  the button on which to set the tool tip.
+     * @param key     key of the {@link Resources} to use as the text.
+     */
+    private static void setTooltip(final ButtonBase button, final short key) {
+        button.setTooltip(new Tooltip(Resources.format(key)));
+    }
+
     /**
      * Returns whether the given resource is supported.
      * This is currently a static method because {@link 
#createOrReuseCanvas(Resource, Collection)} is static.

Reply via email to