Mercurial > dive4elements > river
diff flys-client/src/main/java/de/intevation/flys/client/client/ui/fixation/FixationPanel.java @ 2922:71db63f67d31
FixA: Do not throw layout away if only the km chart needs reloading.
flys-client/trunk@4777 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Mon, 25 Jun 2012 13:50:22 +0000 |
parents | be99bf1aa59b |
children | 43e0f6d96206 |
line wrap: on
line diff
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/fixation/FixationPanel.java Sat Jun 23 08:16:40 2012 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/fixation/FixationPanel.java Mon Jun 25 13:50:22 2012 +0000 @@ -235,18 +235,15 @@ km = 0; } art.getFilter().setCurrentKm(km); - if (chartContainer.hasMember(chartImg)) { - chartContainer.removeMember(chartImg); - } int hWidth = helperContainer.getWidth() - 12; int hHeight = helperContainer.getHeight() - 62; - if ((int)(hHeight *4/3) < hWidth) { - hWidth = (int)hHeight * 4/3; + if ((int)(hHeight *4f/3) < hWidth) { + hWidth = (int)(hHeight * 4f/3); } else { - hHeight = (int)hWidth *3/4; + hHeight = (int)(hWidth *3f/4); } String imgUrl = GWT.getModuleBaseURL(); @@ -254,9 +251,15 @@ imgUrl += "?locale=" + locale; imgUrl += "&filter=" + art.getFilter().getChartFilter(hWidth, hHeight); - chartImg = new Img(imgUrl, hWidth, hHeight); - chartContainer.addMember(chartImg); - + if (chartContainer.hasMember(chartImg)) { + chartImg.setWidth(hWidth); + chartImg.setHeight(hHeight); + chartImg.setSrc(imgUrl); + } + else { + chartImg = new Img(imgUrl, hWidth, hHeight); + chartContainer.addMember(chartImg); + } }