Mercurial > dive4elements > river
diff flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/CrossSectionChartThemePanel.java @ 2484:6f30bbd98618
Small fix for retrieving closest km.
flys-client/trunk@4260 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Wed, 18 Apr 2012 09:03:08 +0000 |
parents | cef4c624c68c |
children | 26fc6163643d |
line wrap: on
line diff
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/CrossSectionChartThemePanel.java Wed Apr 18 08:10:17 2012 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/CrossSectionChartThemePanel.java Wed Apr 18 09:03:08 2012 +0000 @@ -16,7 +16,9 @@ import com.smartgwt.client.types.Alignment; import com.smartgwt.client.types.ListGridFieldType; +import com.smartgwt.client.widgets.Button; import com.smartgwt.client.widgets.Canvas; +import com.smartgwt.client.widgets.Label; import com.smartgwt.client.widgets.grid.ListGrid; import com.smartgwt.client.widgets.grid.ListGridField; import com.smartgwt.client.widgets.grid.ListGridRecord; @@ -37,6 +39,8 @@ import com.smartgwt.client.widgets.menu.Menu; import com.smartgwt.client.widgets.menu.MenuItem; + +import com.smartgwt.client.widgets.events.ClickEvent; import com.smartgwt.client.widgets.menu.events.ClickHandler; import com.smartgwt.client.widgets.menu.events.MenuItemClickEvent; @@ -154,7 +158,6 @@ } - /** * Sets currentCSMasterUUID. */ @@ -288,7 +291,7 @@ if (in[i] == to) { return to; } - double diff = Math.abs(to - in[0]); + double diff = Math.abs(to - in[i]); if (diff < minDiff) { minDiff = diff; bestMatch = in[i]; @@ -431,7 +434,7 @@ Double[] kms = obj.get(dbid); double closest = CrossSectionChartThemePanel.closest(kms, enteredKm); - GWT.log("Got single km for " + dbid + ", it is " + GWT.log("Got single km close to " + enteredKm + " for " + dbid + ", it is " + closest); // Do not set value, as it will trigger strange