Mercurial > dive4elements > river
comparison gwt-client/src/main/java/org/dive4elements/river/client/client/ui/fixation/FixationPanel.java @ 9584:1a7cfeb1ff89
Punkt 10.8 WQ-Vorschau
author | gernotbelger |
---|---|
date | Wed, 09 Jan 2019 17:13:25 +0100 |
parents | 6c24c857ccf9 |
children |
comparison
equal
deleted
inserted
replaced
9583:2a67d05a1af0 | 9584:1a7cfeb1ff89 |
---|---|
128 if (this.artifact instanceof AbstractFixBunduArtifact == false) | 128 if (this.artifact instanceof AbstractFixBunduArtifact == false) |
129 return this.chartContainer; | 129 return this.chartContainer; |
130 | 130 |
131 final AbstractFixBunduArtifact art = (AbstractFixBunduArtifact) this.artifact; | 131 final AbstractFixBunduArtifact art = (AbstractFixBunduArtifact) this.artifact; |
132 | 132 |
133 this.overviewService.generateOverview(locale, this.artifact.getUuid(), getOverviewFilter(art.getFilter()), | 133 this.overviewService.generateOverview(locale, this.artifact.getUuid(), getOverviewFilter(art.getFilter()), renderCheckboxes(), callBack, |
134 renderCheckboxes(), callBack, new AsyncCallback<FixingsOverviewInfo>() { | 134 new AsyncCallback<FixingsOverviewInfo>() { |
135 @Override | 135 @Override |
136 public void onFailure(final Throwable caught) { | 136 public void onFailure(final Throwable caught) { |
137 GWT.log("Could not receive overview."); | 137 GWT.log("Could not receive overview."); |
138 SC.warn(caught.getMessage()); | 138 SC.warn(caught.getMessage()); |
139 } | 139 } |
140 | 140 |
141 @Override | 141 @Override |
142 public void onSuccess(final FixingsOverviewInfo info) { | 142 public void onSuccess(final FixingsOverviewInfo info) { |
143 GWT.log("Successfully loaded overview."); | 143 GWT.log("Successfully loaded overview."); |
144 | |
144 FixationPanel.this.fixInfo = info; | 145 FixationPanel.this.fixInfo = info; |
145 FixationPanel.this.htmlOverview = info.getHTML(); | 146 FixationPanel.this.htmlOverview = info.getHTML(); |
146 final AbstractFixBunduArtifact art = (AbstractFixBunduArtifact) FixationPanel.this.artifact; | 147 final AbstractFixBunduArtifact art = (AbstractFixBunduArtifact) FixationPanel.this.artifact; |
147 final FixFilter filter = art.getFilter(); | 148 final FixFilter filter = art.getFilter(); |
148 filter.setRiver(info.getRiver()); | 149 filter.setRiver(info.getRiver()); |
149 if (filter.getCurrentKm() == -Double.MAX_VALUE || filter.getCurrentKm() == -1d) { | 150 if (filter.getCurrentKm() == -Double.MAX_VALUE || filter.getCurrentKm() == -1d) { // do not compare doubles (works, because it is set in |
150 filter.setCurrentKm(filter.getLowerKm()); | 151 // the same way) |
151 filter.setToKm(filter.getUpperKm()); | 152 |
153 filter.setCurrentKm(info.getLowerKm()); | |
154 filter.setToKm(info.getUpperKm()); | |
152 } | 155 } |
156 if (FixationPanel.this.kmText != null) { | |
157 final NumberFormat nf = NumberFormat.getDecimalFormat(); | |
158 try { | |
159 final double d = Double.valueOf(filter.getCurrentKm()); | |
160 FixationPanel.this.kmText.setValue(nf.format(d)); | |
161 } | |
162 catch (final NumberFormatException e) { | |
163 FixationPanel.this.kmText.setValue(filter.getCurrentKm()); | |
164 } | |
165 } | |
166 | |
153 if (FixationPanel.this.kmText != null) { | 167 if (FixationPanel.this.kmText != null) { |
154 final NumberFormat nf = NumberFormat.getDecimalFormat(); | 168 final NumberFormat nf = NumberFormat.getDecimalFormat(); |
155 try { | 169 try { |
156 final double d = Double.valueOf(filter.getCurrentKm()); | 170 final double d = Double.valueOf(filter.getCurrentKm()); |
157 FixationPanel.this.kmText.setValue(nf.format(d)); | 171 FixationPanel.this.kmText.setValue(nf.format(d)); |
271 hWidth = (int) (hHeight * 4f / 3); | 285 hWidth = (int) (hHeight * 4f / 3); |
272 } else { | 286 } else { |
273 hHeight = (int) (hWidth * 3f / 4); | 287 hHeight = (int) (hWidth * 3f / 4); |
274 } | 288 } |
275 | 289 |
276 final String imgUrl = URL.encode(GWT.getModuleBaseURL() | 290 final String imgUrl = URL |
277 + "fixings-km-chart" | 291 .encode(GWT.getModuleBaseURL() + "fixings-km-chart" + "?locale=" + locale + "&filter=" + getChartFilter(filter, hWidth, hHeight)); |
278 + "?locale=" + locale | |
279 + "&filter=" + getChartFilter(filter, hWidth, hHeight)); | |
280 | 292 |
281 if (this.chartContainer.hasMember(this.chartImg)) { | 293 if (this.chartContainer.hasMember(this.chartImg)) { |
282 this.chartImg.setWidth(hWidth); | 294 this.chartImg.setWidth(hWidth); |
283 this.chartImg.setHeight(hHeight); | 295 this.chartImg.setHeight(hHeight); |
284 this.chartImg.setSrc(imgUrl); | 296 this.chartImg.setSrc(imgUrl); |