Changeset 23190 in osm for applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionGrabPlanImage.java
- Timestamp:
- 2010-09-15T18:54:18+02:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionGrabPlanImage.java
r21493 r23190 180 180 */ 181 181 private boolean startCropping() { 182 mode = cGetCorners;183 countMouseClicked = 0;184 Object[] options = { "OK", "Cancel" };185 int ret = JOptionPane.showOptionDialog( null,186 tr("Click first corner for image cropping\n(two points required)"),187 tr("Image cropping"),188 JOptionPane.DEFAULT_OPTION, JOptionPane.INFORMATION_MESSAGE,189 null, options, options[0]);190 if (ret == JOptionPane.OK_OPTION) {191 mouseClickedTime = System.currentTimeMillis();192 } else193 if (canceledOrRestartCurrAction("image cropping"))194 return startCropping();195 return true;182 mode = cGetCorners; 183 countMouseClicked = 0; 184 Object[] options = { "OK", "Cancel" }; 185 int ret = JOptionPane.showOptionDialog( null, 186 tr("Click first corner for image cropping\n(two points required)"), 187 tr("Image cropping"), 188 JOptionPane.DEFAULT_OPTION, JOptionPane.INFORMATION_MESSAGE, 189 null, options, options[0]); 190 if (ret == JOptionPane.OK_OPTION) { 191 mouseClickedTime = System.currentTimeMillis(); 192 } else 193 if (canceledOrRestartCurrAction("image cropping")) 194 return startCropping(); 195 return true; 196 196 } 197 197 … … 201 201 */ 202 202 private boolean continueCropping() { 203 Object[] options = { "OK", "Cancel" };204 int ret = JOptionPane.showOptionDialog( null,205 tr("Click second corner for image cropping"),206 tr("Image cropping"),207 JOptionPane.DEFAULT_OPTION, JOptionPane.INFORMATION_MESSAGE,208 null, options, options[0]);209 if (ret != JOptionPane.OK_OPTION) {210 if (canceledOrRestartCurrAction("image cropping"))211 return startCropping();212 }213 return true;203 Object[] options = { "OK", "Cancel" }; 204 int ret = JOptionPane.showOptionDialog( null, 205 tr("Click second corner for image cropping"), 206 tr("Image cropping"), 207 JOptionPane.DEFAULT_OPTION, JOptionPane.INFORMATION_MESSAGE, 208 null, options, options[0]); 209 if (ret != JOptionPane.OK_OPTION) { 210 if (canceledOrRestartCurrAction("image cropping")) 211 return startCropping(); 212 } 213 return true; 214 214 } 215 215 … … 219 219 */ 220 220 private boolean startGeoreferencing() { 221 countMouseClicked = 0;222 mode = cGetLambertCrosspieces;223 Object[] options = { "OK", "Cancel" };224 int ret = JOptionPane.showOptionDialog( null,225 tr("Click first Lambert crosspiece for georeferencing\n(two points required)"),226 tr("Image georeferencing"),227 JOptionPane.DEFAULT_OPTION, JOptionPane.INFORMATION_MESSAGE,228 null, options, options[0]);229 if (ret == JOptionPane.OK_OPTION) {230 mouseClickedTime = System.currentTimeMillis();231 } else232 if (canceledOrRestartCurrAction("georeferencing"))233 return startGeoreferencing();234 return true;221 countMouseClicked = 0; 222 mode = cGetLambertCrosspieces; 223 Object[] options = { "OK", "Cancel" }; 224 int ret = JOptionPane.showOptionDialog( null, 225 tr("Click first Lambert crosspiece for georeferencing\n(two points required)"), 226 tr("Image georeferencing"), 227 JOptionPane.DEFAULT_OPTION, JOptionPane.INFORMATION_MESSAGE, 228 null, options, options[0]); 229 if (ret == JOptionPane.OK_OPTION) { 230 mouseClickedTime = System.currentTimeMillis(); 231 } else 232 if (canceledOrRestartCurrAction("georeferencing")) 233 return startGeoreferencing(); 234 return true; 235 235 } 236 236 … … 240 240 */ 241 241 private boolean continueGeoreferencing() { 242 Object[] options = { "OK", "Cancel" };243 int ret = JOptionPane.showOptionDialog( null,244 tr("Click second Lambert crosspiece for georeferencing"),245 tr("Image georeferencing"),246 JOptionPane.DEFAULT_OPTION, JOptionPane.INFORMATION_MESSAGE,247 null, options, options[0]);248 if (ret != JOptionPane.OK_OPTION) {249 if (canceledOrRestartCurrAction("georeferencing"))250 return startGeoreferencing();251 }252 return true;242 Object[] options = { "OK", "Cancel" }; 243 int ret = JOptionPane.showOptionDialog( null, 244 tr("Click second Lambert crosspiece for georeferencing"), 245 tr("Image georeferencing"), 246 JOptionPane.DEFAULT_OPTION, JOptionPane.INFORMATION_MESSAGE, 247 null, options, options[0]); 248 if (ret != JOptionPane.OK_OPTION) { 249 if (canceledOrRestartCurrAction("georeferencing")) 250 return startGeoreferencing(); 251 } 252 return true; 253 253 } 254 254 … … 271 271 */ 272 272 private boolean canceledOrRestartCurrAction(String action) { 273 Object[] options = { "Cancel", "Retry" };274 int selectedValue = JOptionPane.showOptionDialog( null,275 tr("Do you want to cancel completely\n"+276 "or just retry "+action+" ?"), "",277 JOptionPane.DEFAULT_OPTION, JOptionPane.WARNING_MESSAGE,278 null, options, options[0]);273 Object[] options = { "Cancel", "Retry" }; 274 int selectedValue = JOptionPane.showOptionDialog( null, 275 tr("Do you want to cancel completely\n"+ 276 "or just retry "+action+" ?"), "", 277 JOptionPane.DEFAULT_OPTION, JOptionPane.WARNING_MESSAGE, 278 null, options, options[0]); 279 279 countMouseClicked = 0; 280 280 if (selectedValue == 0) { // "Cancel" 281 // remove layer282 Main.map.mapView.removeLayer(wmsLayer);281 // remove layer 282 Main.map.mapView.removeLayer(wmsLayer); 283 283 wmsLayer = null; 284 284 Main.map.mapView.removeMouseListener(this);
Note:
See TracChangeset
for help on using the changeset viewer.
