Changeset 27144 in osm for applications/editors/josm/plugins
- Timestamp:
- 2011-11-25T10:42:34+01:00 (13 years ago)
- Location:
- applications/editors/josm/plugins/piclayer
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/piclayer/build.xml
r27142 r27144 22 22 --> 23 23 <project name="PicLayer" default="dist" basedir="."> 24 <property name="commit.message" value="PicLayer - fixing #7075. 2"/>24 <property name="commit.message" value="PicLayer - fixing #7075.1"/> 25 25 <property name="plugin.main.version" value="4549"/> 26 26 <!-- -
applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/actions/SavePictureCalibrationAction.java
r27120 r27144 38 38 /** 39 39 * Action for resetting properties of an image. 40 * 40 * 41 41 * TODO Four almost identical classes. Refactoring needed. 42 42 */ … … 46 46 // Owner layer of the action 47 47 PicLayerAbstract m_owner = null; 48 48 49 49 /** 50 50 * Constructor … … 55 55 m_owner = owner; 56 56 } 57 57 58 58 /** 59 59 * Action handler 60 60 */ 61 @Override 61 62 public void actionPerformed(ActionEvent arg0) { 62 63 // Save dialog … … 75 76 file = new File( path + CalibrationFileFilter.EXTENSION ); 76 77 } 77 78 78 79 // Save 79 80 Properties props = new Properties(); 80 81 m_owner.saveCalibration(props); 81 82 try { 82 props.store(new FileOutputStream(file), tr("JOSM PicLayer plugin calibration data"));83 props.store(new FileOutputStream(file), "JOSM PicLayer plugin calibration data"); 83 84 } catch (Exception e) { 84 85 // Error … … 86 87 JOptionPane.showMessageDialog(Main.parent , tr("Saving file failed: {0}", e.getMessage())); 87 88 } 88 } 89 } 89 90 } 90 91 } -
applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/layer/PicLayerAbstract.java
r27142 r27144 384 384 AffineTransform transform; 385 385 386 double pos_x = Double.valueOf(props.getProperty(POSITION_X)); 387 double pos_y = Double.valueOf(props.getProperty(POSITION_Y)); 388 389 imagePosition = new EastNorth(pos_x, pos_y); 390 initialImageScale = Double.valueOf(props.getProperty(INITIAL_SCALE)); //in_scale 386 391 if (props.containsKey(SCALEX)) {// old format 387 392 double in_pos_x = Double.valueOf( props.getProperty(INITIAL_POS_X)); 388 393 double in_pos_y = Double.valueOf( props.getProperty(INITIAL_POS_Y)); 389 394 double angle = Double.valueOf( props.getProperty(ANGLE)); 390 double in_scale = Double.valueOf( props.getProperty(INITIAL_SCALE));391 395 double scale_x = Double.valueOf( props.getProperty(SCALEX)); 392 396 double scale_y = Double.valueOf( props.getProperty(SCALEY)); … … 397 401 398 402 // transform to matrix from these values - need testing 399 transform = AffineTransform.getRotateInstance(angle );403 transform = AffineTransform.getRotateInstance(angle/180*Math.PI); 400 404 transform.scale(scale_x, scale_y); 401 405 transform.shear(shear_x, shear_y); 402 initialImageScale = in_scale;403 406 } else { 404 double pos_x = Double.valueOf(props.getProperty(POSITION_X));405 double pos_y = Double.valueOf(props.getProperty(POSITION_Y));406 407 imagePosition = new EastNorth(pos_x, pos_y);408 initialImageScale = Double.valueOf(props.getProperty(INITIAL_SCALE)); //in_scale409 410 407 // initialize matrix 411 408 double[] matrix = new double[6];
Note:
See TracChangeset
for help on using the changeset viewer.