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 0a4b43a53fc6448eab706389b393afee9a30b3e8
Author: Martin Desruisseaux <martin.desruisseaux@geomatys.com>
AuthorDate: Wed Jul 15 14:20:42 2020 +0200
Fix a NullPointerException.
---
.../src/main/java/org/apache/sis/gui/coverage/CoverageControls.java | 2 +-
.../src/main/java/org/apache/sis/gui/coverage/RenderingData.java | 4 ++++
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/application/sis-javafx/src/main/java/org/apache/sis/gui/coverage/CoverageControls.java
b/application/sis-javafx/src/main/java/org/apache/sis/gui/coverage/CoverageControls.java
index 03c8a93..69bf462 100644
--- a/application/sis-javafx/src/main/java/org/apache/sis/gui/coverage/CoverageControls.java
+++ b/application/sis-javafx/src/main/java/org/apache/sis/gui/coverage/CoverageControls.java
@@ -251,7 +251,7 @@ final class CoverageControls extends Controls {
this.pane = pane;
}
- /** Creates the {@link ImagePropertyExplorer}. */
+ /** Creates the {@link ImagePropertyExplorer} when {@link TitledPane#expandedProperty()}
changed. */
@Override public void changed(ObservableValue<? extends Boolean> property,
Boolean oldValue, Boolean newValue) {
if (newValue) {
pane.expandedProperty().removeListener(this);
diff --git a/application/sis-javafx/src/main/java/org/apache/sis/gui/coverage/RenderingData.java
b/application/sis-javafx/src/main/java/org/apache/sis/gui/coverage/RenderingData.java
index 8fab99c..100d066 100644
--- a/application/sis-javafx/src/main/java/org/apache/sis/gui/coverage/RenderingData.java
+++ b/application/sis-javafx/src/main/java/org/apache/sis/gui/coverage/RenderingData.java
@@ -124,6 +124,7 @@ final class RenderingData implements Cloneable {
* The inverse of the {@linkplain CoverageCanvas#objectiveToDisplay objective to display}
transform which was
* active at the time resampled images have been computed. The concatenation of this
transform with the actual
* "objective to display" transform at the time the rendered image is drawn should be
a translation.
+ * May be {@code null} if not yet computed.
*/
private AffineTransform displayToObjective;
@@ -308,6 +309,9 @@ final class RenderingData implements Cloneable {
* has an optimization which avoid to copy the whole data only for that case.
*/
final AffineTransform getTransform(final LinearTransform objectiveToDisplay) {
+ if (displayToObjective == null) {
+ return new AffineTransform();
+ }
AffineTransform resampledToDisplay = AffineTransforms2D.castOrCopy(objectiveToDisplay);
if (resampledToDisplay == objectiveToDisplay) {
resampledToDisplay = new AffineTransform(resampledToDisplay);
|