Changeset 17327 in osm for applications/editors/josm/plugins/piclayer/src/org
- Timestamp:
- 2009-08-28T22:06:42+02:00 (15 years ago)
- Location:
- applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer
- Files:
-
- 3 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/HelpAction.java
r17321 r17327 76 76 + "Step 4d) You can also choose to scale in just one axis by selecting the proper button." 77 77 + "\n" 78 + "NOTE) If it does not work - make sure the right layer is selected ."78 + "NOTE) If it does not work - make sure the right layer is selected AND ACTIVATED." 79 79 + "\n" 80 80 + "Step 5) If you need to reset your changes - you can use the popup menu available under the PicLayer entry in the layer list." 81 + "\n" 82 + "Step 6) If you want to save the calibraton of the picture you have made, you can also do this using the popup menu." 81 83 + "\n\n" 82 84 + "This plugin is meant to help with mapping from photos (for me it's mostly buildings) for people who simply don't like MetaCarta Rectifier (like me)." -
applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/PicLayerAbstract.java
r17321 r17327 29 29 import java.awt.image.BufferedImage; 30 30 import java.io.IOException; 31 import java.util.Properties; 32 31 33 import javax.swing.Icon; 32 34 import javax.swing.ImageIcon; … … 68 70 // Layer icon 69 71 private Icon m_layericon = null; 72 73 // Keys for saving in Properties 74 private final String INITIAL_POS_X = "INITIAL_POS_X"; 75 private final String INITIAL_POS_Y = "INITIAL_POS_y"; 76 private final String POSITION_X = "POSITION_X"; 77 private final String POSITION_Y = "POSITION_Y"; 78 private final String ANGLE = "ANGLE"; 79 private final String INITIAL_SCALE = "INITIAL_SCALE"; 80 private final String SCALEX = "SCALEX"; 81 private final String SCALEY = "SCALEY"; 70 82 71 83 /** … … 89 101 m_popupmenu = new Component[]{ 90 102 reset_submenu, 103 new JSeparator(), 104 new JMenuItem( new SavePictureCalibrationAction(this)), 105 new JMenuItem( new LoadPictureCalibrationAction(this)), 91 106 new JSeparator(), 92 107 new JMenuItem( new HelpAction() ) … … 263 278 264 279 } 280 281 /** 282 * Saves the calibration data into properties structure 283 * @param props Properties to save to 284 */ 285 public void saveCalibration( Properties props ) { 286 // Save 287 props.put(INITIAL_POS_X, "" + m_initial_position.getX()); 288 props.put(INITIAL_POS_Y, "" + m_initial_position.getY()); 289 props.put(POSITION_X, "" + m_position.getX()); 290 props.put(POSITION_Y, "" + m_position.getY()); 291 props.put(INITIAL_SCALE, "" + m_initial_scale); 292 props.put(SCALEX, "" + m_scalex); 293 props.put(SCALEY, "" + m_scaley); 294 props.put(ANGLE, "" + m_angle); 295 } 296 297 /** 298 * Loads calibration data from properties structure 299 * @param props Properties to load from 300 * @return 301 */ 302 public void loadCalibration( Properties props ) { 303 // Load 304 double pos_x = Double.valueOf( props.getProperty(POSITION_X)); 305 double pos_y = Double.valueOf( props.getProperty(POSITION_Y)); 306 double in_pos_x = Double.valueOf( props.getProperty(INITIAL_POS_X)); 307 double in_pos_y = Double.valueOf( props.getProperty(INITIAL_POS_Y)); 308 double angle = Double.valueOf( props.getProperty(ANGLE)); 309 double in_scale = Double.valueOf( props.getProperty(INITIAL_SCALE)); 310 double scale_x = Double.valueOf( props.getProperty(SCALEX)); 311 double scale_y = Double.valueOf( props.getProperty(SCALEY)); 312 m_position.setLocation(pos_x, pos_y); 313 m_initial_position.setLocation(pos_x, pos_y); 314 m_angle = angle; 315 m_scalex = scale_x; 316 m_scaley = scale_y; 317 m_initial_scale = in_scale; 318 // Refresh 319 Main.map.mapView.repaint(); 320 } 265 321 } -
applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/PicLayerFromClipboard.java
r14779 r17327 61 61 @Override 62 62 protected String getPicLayerName() { 63 return super.name + " <Clipboard>";63 return "Clipboard"; 64 64 } 65 65 -
applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/PicLayerFromFile.java
r14779 r17327 40 40 m_file = file; 41 41 // Generate tooltip text 42 m_tooltiptext = super.name + " <" + m_file.getAbsolutePath() + ">";42 m_tooltiptext = m_file.getAbsolutePath(); 43 43 } 44 44 -
applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/ResetPictureAllAction.java
r14779 r17327 39 39 */ 40 40 public ResetPictureAllAction( PicLayerAbstract owner ) { 41 super("All", null, null, null, false);41 super("All", null, "Resets picture calibration", null, false); 42 42 // Remember the owner... 43 43 m_owner = owner; -
applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/ResetPictureAngleAction.java
r14779 r17327 39 39 */ 40 40 public ResetPictureAngleAction( PicLayerAbstract owner ) { 41 super("Angle", null, null, null, false);41 super("Angle", null, "Resets picture rotation", null, false); 42 42 // Remember the owner... 43 43 m_owner = owner; -
applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/ResetPicturePositionAction.java
r14779 r17327 39 39 */ 40 40 public ResetPicturePositionAction( PicLayerAbstract owner ) { 41 super("Position", null, null, null, false);41 super("Position", null, "Resets picture position", null, false); 42 42 // Remember the owner... 43 43 m_owner = owner; -
applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/ResetPictureScaleAction.java
r14779 r17327 39 39 */ 40 40 public ResetPictureScaleAction( PicLayerAbstract owner ) { 41 super("Scale", null, null, null, false);41 super("Scale", null, "Resets picture scale", null, false); 42 42 // Remember the owner... 43 43 m_owner = owner;
Note:
See TracChangeset
for help on using the changeset viewer.