[PATCH 1 of 2] Waterlevel/Sounding TwinPanel wil hide all soundings/waterlevels that have no year information
Wald Commits
scm-commit at wald.intevation.org
Fri Jul 20 14:57:21 CEST 2018
# HG changeset patch
# User gernotbelger
# Date 1532091387 -7200
# Node ID 83ef08b5e1ac1ed38cb55f971d3451fd29868b57
# Parent 717c9dc1859fc698280e5e0dfee0d96683b21ec3
Waterlevel/Sounding TwinPanel wil hide all soundings/waterlevels that have no year information.
diff -r 717c9dc1859f -r 83ef08b5e1ac gwt-client/src/main/java/org/dive4elements/river/client/client/ui/sinfo/WaterlevelSoundingSelectionController.java
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/sinfo/WaterlevelSoundingSelectionController.java Fri Jul 20 11:19:07 2018 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/sinfo/WaterlevelSoundingSelectionController.java Fri Jul 20 14:56:27 2018 +0200
@@ -67,7 +67,7 @@
final Integer waterlevelYear = WaterlevelSoundingYearFilter.parseYear(year);
if (waterlevelYear == null) {
- // should never happen, we should only show waterlevels that have a year
+ // should never happen, we should only show soundings that have a year
return false;
}
@@ -129,7 +129,8 @@
protected final void handleSoundingChanged(final DatacageWidget waterlevelWidget, final List<TreeNode> selection) {
if (this.turnFilterOff) {
- waterlevelWidget.setFilter(DatacageWidget.ACCEPT_ALL_FILTER);
+ // still filter waterlevels without year
+ waterlevelWidget.setFilter(new WaterlevelSoundingYearFilter(null));
waterlevelWidget.getTreeGrid().setEmptyMessage(this.msg.databasket_empty());
return;
}
diff -r 717c9dc1859f -r 83ef08b5e1ac gwt-client/src/main/java/org/dive4elements/river/client/client/ui/sinfo/WaterlevelSoundingYearFilter.java
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/sinfo/WaterlevelSoundingYearFilter.java Fri Jul 20 11:19:07 2018 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/sinfo/WaterlevelSoundingYearFilter.java Fri Jul 20 14:56:27 2018 +0200
@@ -18,9 +18,12 @@
*/
final class WaterlevelSoundingYearFilter implements DatacageFilter {
- private final int soundingYear;
+ private final Integer soundingYear;
- public WaterlevelSoundingYearFilter(final int soundingYear) {
+ /**
+ * @param soundingYear If <code>null</code>, we do not check the distance to the waterlevel year, but still hide waterlevels without year
+ */
+ public WaterlevelSoundingYearFilter(final Integer soundingYear) {
this.soundingYear = soundingYear;
}
@@ -38,6 +41,9 @@
// should never happen, we should only show waterlevels that have a year
return false;
}
+
+ if( this.soundingYear == null )
+ return true;
final int diff = Math.abs(this.soundingYear - waterlevelYear);
More information about the Dive4Elements-commits
mailing list