This is an automated email from the ASF dual-hosted git repository. asf-gitbox-commits pushed a commit to branch geoapi-4.0 in repository https://gitbox.apache.org/repos/asf/sis.git
commit 337b819bd6d68a37c897a6fdd6df27ba9eba3a8a Author: Martin Desruisseaux <[email protected]> AuthorDate: Fri Aug 14 17:16:48 2026 +0200 Reduce the number of false reports of tile loading. --- .../main/org/apache/sis/storage/geotiff/DataSubset.java | 2 +- .../main/org/apache/sis/gui/coverage/TileReadListener.java | 4 ++++ .../main/org/apache/sis/gui/internal/ShapeConverter.java | 5 ++++- .../main/org/apache/sis/gui/map/EvanescentPane.java | 1 + .../org.apache.sis.gui/main/org/apache/sis/gui/map/MapCanvas.java | 2 +- 5 files changed, 11 insertions(+), 3 deletions(-) diff --git a/endorsed/src/org.apache.sis.storage.geotiff/main/org/apache/sis/storage/geotiff/DataSubset.java b/endorsed/src/org.apache.sis.storage.geotiff/main/org/apache/sis/storage/geotiff/DataSubset.java index f3591d0f4f..6c04bb6274 100644 --- a/endorsed/src/org.apache.sis.storage.geotiff/main/org/apache/sis/storage/geotiff/DataSubset.java +++ b/endorsed/src/org.apache.sis.storage.geotiff/main/org/apache/sis/storage/geotiff/DataSubset.java @@ -404,7 +404,6 @@ class DataSubset extends TiledGridCoverage { for (int i=0; i<numMissings; i++) { final Tile tile = missings[i]; if (tile.getRegionInsideTile(lower, upper, subsampling, false)) { - tile.fireTileReadStarted(); origin.x = tile.originX; origin.y = tile.originY; tile.copyTileInfo(tileOffsets, offsets, includedBanks, numTiles); @@ -431,6 +430,7 @@ class DataSubset extends TiledGridCoverage { } r = emptyTiles.create(origin); } else { + tile.fireTileReadStarted(); r = readSlice(offsets, byteCounts, lower, upper, subsampling, origin); } result[tile.getTileIndexInResultArray()] = tile.cache(r); diff --git a/optional/src/org.apache.sis.gui/main/org/apache/sis/gui/coverage/TileReadListener.java b/optional/src/org.apache.sis.gui/main/org/apache/sis/gui/coverage/TileReadListener.java index 2cf894b0e7..0160ed6656 100644 --- a/optional/src/org.apache.sis.gui/main/org/apache/sis/gui/coverage/TileReadListener.java +++ b/optional/src/org.apache.sis.gui/main/org/apache/sis/gui/coverage/TileReadListener.java @@ -29,6 +29,7 @@ import javafx.scene.Node; import javafx.scene.paint.Color; import javafx.scene.shape.Shape; import javafx.scene.shape.Rectangle; +import javafx.scene.shape.StrokeType; import javafx.scene.layout.Pane; import javafx.animation.FadeTransition; import javafx.application.Platform; @@ -149,6 +150,8 @@ final class TileReadListener implements StoreListener<TileReadEvent>, EventHandl /* * `TileReadListener.snapshot` may change at any time. We can take any value, * but it must stay constant for the rest of this method for consistency. + * It is not really useful to take the value at the time when the event occurred, + * because that event is itself sent after an arbitrarily long background thread. */ @SuppressWarnings("LocalVariableHidesMemberVariable") final CoverageCanvas.StaticGraphics snapshot = TileReadListener.this.snapshot; @@ -171,6 +174,7 @@ final class TileReadListener implements StoreListener<TileReadEvent>, EventHandl } } else { tile.setStroke(TILE_COLORS[ic]); + tile.setStrokeType(StrokeType.INSIDE); } tile.setFill(FILL_COLORS[ic]); tile.setOpacity(0.5); diff --git a/optional/src/org.apache.sis.gui/main/org/apache/sis/gui/internal/ShapeConverter.java b/optional/src/org.apache.sis.gui/main/org/apache/sis/gui/internal/ShapeConverter.java index 638731c239..a9b2f4ed2f 100644 --- a/optional/src/org.apache.sis.gui/main/org/apache/sis/gui/internal/ShapeConverter.java +++ b/optional/src/org.apache.sis.gui/main/org/apache/sis/gui/internal/ShapeConverter.java @@ -124,6 +124,7 @@ public final class ShapeConverter { case PathIterator.WIND_EVEN_ODD: path.setFillRule(FillRule.EVEN_ODD); break; case PathIterator.WIND_NON_ZERO: path.setFillRule(FillRule.NON_ZERO); break; } + path.setManaged(false); return path; } @@ -144,10 +145,12 @@ public final class ShapeConverter { if (tr != null) { tr.transform(coords, 0, coords, 0, 2); } - return new Rectangle( + final var path = new Rectangle( Math.min(coords[0], coords[2]), Math.min(coords[1], coords[3]), Math.abs(coords[2] - coords[0]), Math.abs(coords[3] - coords[1])); + path.setManaged(false); + return path; } } diff --git a/optional/src/org.apache.sis.gui/main/org/apache/sis/gui/map/EvanescentPane.java b/optional/src/org.apache.sis.gui/main/org/apache/sis/gui/map/EvanescentPane.java index 2542547f09..f5d91b352e 100644 --- a/optional/src/org.apache.sis.gui/main/org/apache/sis/gui/map/EvanescentPane.java +++ b/optional/src/org.apache.sis.gui/main/org/apache/sis/gui/map/EvanescentPane.java @@ -50,6 +50,7 @@ final class EvanescentPane extends Pane implements ListChangeListener<Node> { */ private EvanescentPane(final MapCanvas.StaticGraphics owner) { this.owner = owner; + setManaged(false); } /** diff --git a/optional/src/org.apache.sis.gui/main/org/apache/sis/gui/map/MapCanvas.java b/optional/src/org.apache.sis.gui/main/org/apache/sis/gui/map/MapCanvas.java index 590588ff35..766211a845 100644 --- a/optional/src/org.apache.sis.gui/main/org/apache/sis/gui/map/MapCanvas.java +++ b/optional/src/org.apache.sis.gui/main/org/apache/sis/gui/map/MapCanvas.java @@ -507,7 +507,7 @@ public abstract class MapCanvas extends PlanarCanvas { public final CoordinateReferenceSystem objectiveCRS; /** - * Returns the (usually affine) conversion from objective <abbr>CRS</abbr> to display coordinate system. + * The (usually affine) conversion from objective <abbr>CRS</abbr> to display coordinate system. * This is the value of {@link #getObjectiveToDisplay()} at the time when this {@code StaticGraphics} * instance has been obtained. This is never {@code null}. *
