Changeset 25219 in osm for applications/editors/josm/plugins
- Timestamp:
- 2011-02-03T22:55:49+01:00 (14 years ago)
- Location:
- applications/editors/josm/plugins/piclayer
- Files:
-
- 3 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/piclayer/build.xml
r25199 r25219 23 23 <project name="PicLayer" default="dist" basedir="."> 24 24 25 <property name="commit.message" value=" Changed the constructor signature of the plugin main class" />25 <property name="commit.message" value="applied #J5852 (patch by Petschge) - new shear option" /> 26 26 <property name="plugin.main.version" value="3835" /> 27 27 … … 86 86 <attribute name="Plugin-Description" value="This plugin allows to display any picture as a background in the editor and align it with the map."/> 87 87 <attribute name="Plugin-Icon" value="images/layericon.png"/> 88 <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/wiki/JOSM/Plugins/PicLayer"/> 88 89 <attribute name="Plugin-Mainversion" value="${plugin.main.version}"/> 89 90 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/> -
applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/MovePictureAction.java
r23190 r25219 33 33 import org.openstreetmap.josm.data.coor.EastNorth; 34 34 35 //TODO: Move/Rotate/Scale action classes are similar. Do the redesign!35 //TODO: Move/Rotate/Scale/Shear action classes are similar. Do the redesign! 36 36 37 37 /** -
applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/PicLayerAbstract.java
r24308 r25219 74 74 private double m_scalex = 1.0; 75 75 private double m_scaley = 1.0; 76 // Shear of the image 77 private double m_shearx = 0.0; 78 private double m_sheary = 0.0; 76 79 // The scale that was set on the map during image creation 77 80 private double m_initial_scale = 1.0; … … 88 91 private final String SCALEX = "SCALEX"; 89 92 private final String SCALEY = "SCALEY"; 93 private final String SHEARX = "SHEARX"; 94 private final String SHEARY = "SHEARY"; 90 95 91 96 /** … … 215 220 double scaley = m_scaley * m_initial_scale / Main.map.mapView.getDist100Pixel(); 216 221 g.scale( scalex, scaley ); 222 // Shear 223 g.shear(m_shearx, m_sheary); 217 224 218 225 // Draw picture … … 258 265 259 266 /** 267 * Shear the picture. shearx and sheary will separately add to the 268 * corresponding current value 269 */ 270 public void shearPictureBy( double shearx, double sheary ) { 271 m_shearx += shearx; 272 m_sheary += sheary; 273 } 274 275 /** 260 276 * Sets the image position to the initial position 261 277 */ … … 279 295 } 280 296 297 298 /** 299 * Sets the image to no shear 300 */ 301 public void resetShear() { 302 m_shearx = 0.0; 303 m_sheary = 0.0; 304 } 281 305 @Override 282 306 /** … … 330 354 props.put(SCALEY, "" + m_scaley); 331 355 props.put(ANGLE, "" + m_angle); 356 props.put(SHEARX, "" + m_shearx); 357 props.put(SHEARY, "" + m_sheary); 332 358 } 333 359 … … 358 384 double scale_x = Double.valueOf( props.getProperty(SCALEX)); 359 385 double scale_y = Double.valueOf( props.getProperty(SCALEY)); 386 double shear_x = Double.valueOf( props.getProperty(SHEARX)); 387 double shear_y = Double.valueOf( props.getProperty(SHEARY)); 360 388 m_position.setLocation(pos_x, pos_y); 361 389 m_initial_position.setLocation(pos_x, pos_y); … … 363 391 m_scalex = scale_x; 364 392 m_scaley = scale_y; 393 m_shearx = shear_x; 394 m_sheary = shear_y; 365 395 m_initial_scale = in_scale; 366 396 // Refresh … … 384 414 reset_submenu.add( new ResetPictureAngleAction( PicLayerAbstract.this ) ); 385 415 reset_submenu.add( new ResetPictureScaleAction( PicLayerAbstract.this ) ); 416 reset_submenu.add( new ResetPictureShearAction( PicLayerAbstract.this ) ); 386 417 return reset_submenu; 387 418 } -
applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/PicLayerPlugin.java
r23190 r25219 50 50 private IconToggleButton m_scaleyPictureButton = null; 51 51 private IconToggleButton m_scalexyPictureButton = null; 52 private IconToggleButton m_shearPictureButton = null; 52 53 53 54 // Menu actions … … 89 90 ScaleXPictureAction scaleXPictureAction = new ScaleXPictureAction(newFrame); 90 91 ScaleYPictureAction scaleYPictureAction = new ScaleYPictureAction(newFrame); 92 ShearPictureAction shearPictureAction = new ShearPictureAction(newFrame); 91 93 // Create plugin buttons and add them to the toolbar 92 94 m_movePictureButton = new IconToggleButton(movePictureAction); … … 95 97 m_scalexPictureButton = new IconToggleButton(scaleXPictureAction); 96 98 m_scaleyPictureButton = new IconToggleButton(scaleYPictureAction); 99 m_shearPictureButton = new IconToggleButton(shearPictureAction); 97 100 newFrame.addMapMode(m_movePictureButton); 98 101 newFrame.addMapMode(m_rotatePictureButton); … … 100 103 newFrame.addMapMode(m_scalexPictureButton); 101 104 newFrame.addMapMode(m_scaleyPictureButton); 105 newFrame.addMapMode(m_shearPictureButton); 102 106 // newFrame.toolGroup.add(m_movePictureButton); 103 107 // newFrame.toolGroup.add(m_rotatePictureButton); … … 109 113 m_scalexPictureButton.setVisible(true); 110 114 m_scaleyPictureButton.setVisible(true); 115 m_shearPictureButton.setVisible(true); 111 116 } 112 117 } -
applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/ResetPictureAllAction.java
r23190 r25219 55 55 m_owner.resetPosition(); 56 56 m_owner.resetScale(); 57 m_owner.resetShear(); 57 58 // Redraw 58 59 Main.map.mapView.repaint(); -
applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/RotatePictureAction.java
r24288 r25219 32 32 import org.openstreetmap.josm.tools.ImageProvider; 33 33 34 //TODO: Move/Rotate/Scale action classes are similar. Do the redesign!34 //TODO: Move/Rotate/Scale/Shear action classes are similar. Do the redesign! 35 35 36 36 /** -
applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/ScaleXPictureAction.java
r24300 r25219 28 28 import org.openstreetmap.josm.tools.ImageProvider; 29 29 30 // TODO: Move/Rotate/Scale action classes are similar. Do the redesign!30 // TODO: Move/Rotate/Scale/Shear action classes are similar. Do the redesign! 31 31 32 32 /** -
applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/ScaleXYPictureAction.java
r23190 r25219 28 28 import org.openstreetmap.josm.tools.ImageProvider; 29 29 30 // TODO: Move/Rotate/Scale action classes are similar. Do the redesign!30 // TODO: Move/Rotate/Scale/Shear action classes are similar. Do the redesign! 31 31 32 32 /** -
applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/ScaleYPictureAction.java
r24300 r25219 28 28 import org.openstreetmap.josm.tools.ImageProvider; 29 29 30 // TODO: Move/Rotate/Scale action classes are similar. Do the redesign!30 // TODO: Move/Rotate/Scale/Shear action classes are similar. Do the redesign! 31 31 32 32 /**
Note:
See TracChangeset
for help on using the changeset viewer.