Ignore:
Timestamp:
2011-11-25T10:42:34+01:00 (13 years ago)
Author:
larry0ua
Message:

'PicLayer - fixing #7075.1'

Location:
applications/editors/josm/plugins/piclayer
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/piclayer/build.xml

    r27142 r27144  
    2222-->
    2323<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"/>
    2525    <property name="plugin.main.version" value="4549"/>
    2626    <!--
  • applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/actions/SavePictureCalibrationAction.java

    r27120 r27144  
    3838/**
    3939 * Action for resetting properties of an image.
    40  * 
     40 *
    4141 * TODO Four almost identical classes. Refactoring needed.
    4242 */
     
    4646    // Owner layer of the action
    4747    PicLayerAbstract m_owner = null;
    48    
     48
    4949    /**
    5050     * Constructor
     
    5555        m_owner = owner;
    5656    }
    57    
     57
    5858    /**
    5959     * Action handler
    6060     */
     61    @Override
    6162    public void actionPerformed(ActionEvent arg0) {
    6263        // Save dialog
     
    7576                file = new File( path + CalibrationFileFilter.EXTENSION );
    7677            }
    77                        
     78
    7879            // Save
    7980            Properties props = new Properties();
    8081            m_owner.saveCalibration(props);
    8182            try {
    82                 props.store(new FileOutputStream(file), tr("JOSM PicLayer plugin calibration data"));
     83                props.store(new FileOutputStream(file), "JOSM PicLayer plugin calibration data");
    8384            } catch (Exception e) {
    8485                // Error
     
    8687                JOptionPane.showMessageDialog(Main.parent , tr("Saving file failed: {0}", e.getMessage()));
    8788            }
    88         }   
     89        }
    8990    }
    9091}
  • applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/layer/PicLayerAbstract.java

    r27142 r27144  
    384384        AffineTransform transform;
    385385
     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
    386391        if (props.containsKey(SCALEX)) {// old format
    387392            double in_pos_x = Double.valueOf( props.getProperty(INITIAL_POS_X));
    388393            double in_pos_y = Double.valueOf( props.getProperty(INITIAL_POS_Y));
    389394            double angle = Double.valueOf( props.getProperty(ANGLE));
    390             double in_scale = Double.valueOf( props.getProperty(INITIAL_SCALE));
    391395            double scale_x = Double.valueOf( props.getProperty(SCALEX));
    392396            double scale_y = Double.valueOf( props.getProperty(SCALEY));
     
    397401
    398402            // transform to matrix from these values - need testing
    399             transform = AffineTransform.getRotateInstance(angle);
     403            transform = AffineTransform.getRotateInstance(angle/180*Math.PI);
    400404            transform.scale(scale_x, scale_y);
    401405            transform.shear(shear_x, shear_y);
    402             initialImageScale = in_scale;
    403406        } 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_scale
    409 
    410407            // initialize matrix
    411408            double[] matrix = new double[6];
Note: See TracChangeset for help on using the changeset viewer.