Mercurial > dive4elements > river
comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/NaviChartOutputTab.java @ 2936:a805118fffa6
Fixed zooming in navigatable charts.
flys-client/trunk@4885 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Fri, 06 Jul 2012 11:38:56 +0000 |
parents | 6cf983dd4f8a |
children | bea50e45f0d3 |
comparison
equal
deleted
inserted
replaced
2935:6cf983dd4f8a | 2936:a805118fffa6 |
---|---|
105 currentkm.setValue(collectionView.getCurrentKm()); | 105 currentkm.setValue(collectionView.getCurrentKm()); |
106 } | 106 } |
107 | 107 |
108 lower.addClickHandler(new ClickHandler() { | 108 lower.addClickHandler(new ClickHandler() { |
109 public void onClick(ClickEvent ce) { | 109 public void onClick(ClickEvent ce) { |
110 tbarPanel.deselectControls(); | |
110 updateChartDown(); | 111 updateChartDown(); |
111 currentkm.setValue(collectionView.getCurrentKm()); | 112 currentkm.setValue(collectionView.getCurrentKm()); |
112 } | 113 } |
113 }); | 114 }); |
114 | 115 |
115 upper.addClickHandler(new ClickHandler() { | 116 upper.addClickHandler(new ClickHandler() { |
116 public void onClick(ClickEvent ce) { | 117 public void onClick(ClickEvent ce) { |
118 tbarPanel.deselectControls(); | |
117 updateChartUp(); | 119 updateChartUp(); |
118 currentkm.setValue(collectionView.getCurrentKm()); | 120 currentkm.setValue(collectionView.getCurrentKm()); |
119 } | 121 } |
120 }); | 122 }); |
121 | 123 |
123 public void onKeyPress(KeyPressEvent kpe) { | 125 public void onKeyPress(KeyPressEvent kpe) { |
124 if (!kpe.getKeyName().equals("Enter")) { | 126 if (!kpe.getKeyName().equals("Enter")) { |
125 return; | 127 return; |
126 } | 128 } |
127 if(kpe.getForm().validate() && kpe.getItem().getValue() != null) { | 129 if(kpe.getForm().validate() && kpe.getItem().getValue() != null) { |
130 tbarPanel.deselectControls(); | |
128 try { | 131 try { |
129 String s = kpe.getItem().getValue().toString(); | 132 String s = kpe.getItem().getValue().toString(); |
130 Double d = new Double(s); | 133 Double d = new Double(s); |
131 if (d <= collectionView.getMaxKm() && | 134 if (d <= collectionView.getMaxKm() && |
132 d >= collectionView.getMinKm()) { | 135 d >= collectionView.getMinKm()) { |
173 updateChartInfo(); | 176 updateChartInfo(); |
174 } | 177 } |
175 | 178 |
176 } | 179 } |
177 | 180 |
181 /** | |
182 * Returns the existing chart panel. | |
183 * | |
184 * @return the existing chart panel. | |
185 */ | |
186 @Override | |
187 public Canvas getChartPanel() { | |
188 return chart; | |
189 } | |
190 | |
178 /** | 191 /** |
179 * Builds the URL that points to the chart image. | 192 * Builds the URL that points to the chart image. |
180 * | 193 * |
181 * @param width The width of the requested chart. | 194 * @param width The width of the requested chart. |
182 * @param height The height of the requested chart. | 195 * @param height The height of the requested chart. |
222 (FixAnalysisArtifact) collectionView.getArtifact(); | 235 (FixAnalysisArtifact) collectionView.getArtifact(); |
223 collectionView.setCurrentKm(fix.getFilter().getFromKm()); | 236 collectionView.setCurrentKm(fix.getFilter().getFromKm()); |
224 } | 237 } |
225 imgUrl += "¤tKm=" + collectionView.getCurrentKm(); | 238 imgUrl += "¤tKm=" + collectionView.getCurrentKm(); |
226 } | 239 } |
227 GWT.log(imgUrl); | |
228 | 240 |
229 return imgUrl; | 241 return imgUrl; |
230 } | 242 } |
231 | 243 |
232 public void onTabSelected(TabSelectedEvent tse) { | 244 public void onTabSelected(TabSelectedEvent tse) { |