comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/NaviChartOutputTab.java @ 4321:e7f7be368cf3

NaviChartOutputTab: Doc.
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Tue, 30 Oct 2012 10:45:16 +0100
parents c3ac330d9be4
children f36550788add
comparison
equal deleted inserted replaced
4320:c3ac330d9be4 4321:e7f7be368cf3
200 root.addMember(layout); 200 root.addMember(layout);
201 return root; 201 return root;
202 } 202 }
203 203
204 204
205 /** Callback when km-up-button is clicked.
206 * Increases collectionViews KM and refreshes view. */
205 protected void updateChartUp() { 207 protected void updateChartUp() {
206 double currentKm = collectionView.getCurrentKm(); 208 double currentKm = collectionView.getCurrentKm();
207 if (currentKm < collectionView.getMaxKm()) { 209 if (currentKm < collectionView.getMaxKm()) {
210 // Why this math?
208 double newVal = currentKm * 100; 211 double newVal = currentKm * 100;
209 newVal += (collectionView.getSteps() / 10); 212 newVal += (collectionView.getSteps() / 10);
210 collectionView.setCurrentKm((double)Math.round(newVal) / 100); 213 collectionView.setCurrentKm((double)Math.round(newVal) / 100);
211 tbarPanel.updateLinks(); 214 tbarPanel.updateLinks();
212 updateChartPanel(); 215 updateChartPanel();
213 updateChartInfo(); 216 updateChartInfo();
214 } 217 }
215 } 218 }
219
220 /** Callback when km-down-button is clicked.
221 * Decreases collectionViews KM and refreshes view. */
216 protected void updateChartDown() { 222 protected void updateChartDown() {
217 double currentKm = collectionView.getCurrentKm(); 223 double currentKm = collectionView.getCurrentKm();
218 if (currentKm > collectionView.getMinKm()) { 224 if (currentKm > collectionView.getMinKm()) {
225 // Why this math?
219 double newVal = currentKm * 100; 226 double newVal = currentKm * 100;
220 newVal -= (collectionView.getSteps() / 10); 227 newVal -= (collectionView.getSteps() / 10);
221 collectionView.setCurrentKm((double)Math.round(newVal) / 100); 228 collectionView.setCurrentKm((double)Math.round(newVal) / 100);
222 tbarPanel.updateLinks(); 229 tbarPanel.updateLinks();
223 updateChartPanel(); 230 updateChartPanel();

http://dive4elements.wald.intevation.org