Changeset 17702 in osm for applications/editors/josm/plugins/cadastre-fr/src
- Timestamp:
- 2009-09-20T10:09:00+02:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionGrabPlanImage.java
r17215 r17702 28 28 29 29 public static String name = "Georeference an image"; 30 30 31 31 private DownloadWMSPlanImage downloadWMSPlanImage; 32 32 private WMSLayer wmsLayer; … … 53 53 mouseClickedTime = System.currentTimeMillis(); 54 54 } 55 55 56 56 public void actionInterrupted() { 57 57 actionCompleted(); 58 58 wmsLayer = null; 59 59 } 60 60 61 61 @Override 62 62 protected void updateEnabledState() { … … 69 69 actionInterrupted(); 70 70 } 71 71 72 72 public void actionPerformed(ActionEvent ae) { 73 73 if (Main.map != null) { … … 130 130 } else if (mode == cGetLambertCrosspieces) { 131 131 if (countMouseClicked == 1) { 132 ea1 = ea; 132 ea1 = ea; 133 133 if (inputLambertPosition()) 134 134 continueGeoreferencing(); … … 145 145 } 146 146 } 147 148 /** 149 * 147 148 /** 149 * 150 150 * @return false if all operations are canceled 151 151 */ … … 154 154 countMouseClicked = 0; 155 155 Object[] options = { "OK", "Cancel" }; 156 int ret = JOptionPane.showOptionDialog( null, 156 int ret = JOptionPane.showOptionDialog( null, 157 157 tr("Click first corner for image cropping\n(two points required)"), 158 158 tr("Image cropping"), … … 166 166 return true; 167 167 } 168 169 /** 170 * 168 169 /** 170 * 171 171 * @return false if all operations are canceled 172 172 */ 173 173 private boolean continueCropping() { 174 174 Object[] options = { "OK", "Cancel" }; 175 int ret = JOptionPane.showOptionDialog( null, 175 int ret = JOptionPane.showOptionDialog( null, 176 176 tr("Click second corner for image cropping"), 177 177 tr("Image cropping"), … … 184 184 return true; 185 185 } 186 187 /** 188 * 186 187 /** 188 * 189 189 * @return false if all operations are canceled 190 190 */ … … 193 193 mode = cGetLambertCrosspieces; 194 194 Object[] options = { "OK", "Cancel" }; 195 int ret = JOptionPane.showOptionDialog( null, 195 int ret = JOptionPane.showOptionDialog( null, 196 196 tr("Click first Lambert crosspiece for georeferencing\n(two points required)"), 197 197 tr("Image georeferencing"), … … 207 207 208 208 /** 209 * 209 * 210 210 * @return false if all operations are canceled 211 211 */ 212 212 private boolean continueGeoreferencing() { 213 213 Object[] options = { "OK", "Cancel" }; 214 int ret = JOptionPane.showOptionDialog( null, 214 int ret = JOptionPane.showOptionDialog( null, 215 215 tr("Click second Lambert crosspiece for georeferencing"), 216 216 tr("Image georeferencing"), … … 223 223 return true; 224 224 } 225 226 /** 227 * 225 226 /** 227 * 228 228 * @return false if all operations are canceled 229 229 */ 230 230 private boolean canceledOrRestartCurrAction(String action) { 231 231 Object[] options = { "Cancel", "Retry" }; 232 int selectedValue = JOptionPane.showOptionDialog( null, 232 int selectedValue = JOptionPane.showOptionDialog( null, 233 233 tr("Do you want to cancel completely\n"+ 234 234 "or just retry "+action+" ?"), "", … … 245 245 return true; 246 246 } 247 247 248 248 private boolean inputLambertPosition() { 249 249 JLabel labelEnterPosition = new JLabel(tr("Enter cadastre east,north position")); … … 264 264 if (countMouseClicked == 1) number = "first"; 265 265 else number = "second"; 266 pane.createDialog(Main.parent, tr("Set "+number+" Lambert coordinates")).setVisible(true);266 pane.createDialog(Main.parent, tr("Set {0} Lambert coordinates",number)).setVisible(true); 267 267 if (!Integer.valueOf(JOptionPane.OK_OPTION).equals(pane.getValue())) { 268 268 if (canceledOrRestartCurrAction("georeferencing")) … … 285 285 return false; 286 286 } 287 288 /** 289 * Use point org1 as anchor for scale, then move org1 to dst1, then rotate org2 on dst2 290 * around org1/dst1 anchor 287 288 /** 289 * Use point org1 as anchor for scale, then move org1 to dst1, then rotate org2 on dst2 290 * around org1/dst1 anchor 291 291 * @param org1 first point at original coordinate system (the grabbed image) 292 292 * @param org2 second point " 293 * @param dst1 first point at final destination coordinate system (the real east/north coordinate system) 293 * @param dst1 first point at final destination coordinate system (the real east/north coordinate system) 294 294 * @param dst2 second point " 295 295 */ … … 309 309 wmsLayer.images.get(0).scale(dst1, proportion); 310 310 } 311 311 312 312 public void mouseEntered(MouseEvent arg0) { 313 313 } … … 321 321 public void mouseReleased(MouseEvent arg0) { 322 322 } 323 323 324 324 }
Note:
See TracChangeset
for help on using the changeset viewer.