Changeset 17321 in osm for applications/editors/josm/plugins/piclayer/src/org
- Timestamp:
- 2009-08-28T17:53:09+02:00 (15 years ago)
- Location:
- applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer
- Files:
-
- 4 added
- 1 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/HelpAction.java
r14779 r17321 64 64 + "NOTE) If something failed, you should get a message box. If not - check the console for messages (Linux only?)" 65 65 + "\n" 66 + "Step 3) Once the image is visible you may start positioning it. For that - select the PicLayer in the layers list ."66 + "Step 3) Once the image is visible you may start positioning it. For that - select the PicLayer in the layers list and activate it (!!!)." 67 67 + "\n" 68 68 + "Step 4) Start aligning the image." … … 73 73 + "\n" 74 74 + "Step 4c) Scale the image by choosing 'Scale' from the toolbar and draggin the mouse up/down with left button pressed." 75 + "\n" 76 + "Step 4d) You can also choose to scale in just one axis by selecting the proper button." 75 77 + "\n" 76 78 + "NOTE) If it does not work - make sure the right layer is selected." -
applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/PicLayerAbstract.java
r16302 r17321 60 60 private double m_angle = 0.0; 61 61 // Scale of the image 62 private double m_scale = 1.0; 62 private double m_scalex = 1.0; 63 private double m_scaley = 1.0; 63 64 // The scale that was set on the map during image creation 64 65 private double m_initial_scale = 0; … … 190 191 g.rotate( m_angle * Math.PI / 180.0 ); 191 192 // Scale 192 double scale = m_scale * m_initial_scale / Main.map.mapView.getDist100Pixel(); 193 g.scale( scale, scale ); 193 double scalex = m_scalex * m_initial_scale / Main.map.mapView.getDist100Pixel(); 194 double scaley = m_scaley * m_initial_scale / Main.map.mapView.getDist100Pixel(); 195 g.scale( scalex, scaley ); 194 196 195 197 // Draw picture … … 222 224 * Scales the picture. Scaled in... don't know but works ok :) 223 225 */ 224 public void scalePictureBy( double scale ) { 225 m_scale += scale; 226 public void scalePictureBy( double scalex, double scaley ) { 227 m_scalex += scalex; 228 m_scaley += scaley; 226 229 } 227 230 … … 244 247 */ 245 248 public void resetScale() { 246 m_scale = 1.0; 249 m_scalex = 1.0; 250 m_scaley = 1.0; 247 251 } 248 252 -
applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/PicLayerPlugin.java
r14779 r17321 42 42 private IconToggleButton m_movePictureButton = null; 43 43 private IconToggleButton m_rotatePictureButton = null; 44 private IconToggleButton m_scalePictureButton = null; 44 private IconToggleButton m_scalexPictureButton = null; 45 private IconToggleButton m_scaleyPictureButton = null; 46 private IconToggleButton m_scalexyPictureButton = null; 45 47 46 48 // Menu actions … … 81 83 MovePictureAction movePictureAction = new MovePictureAction(newFrame); 82 84 RotatePictureAction rotatePictureAction = new RotatePictureAction(newFrame); 83 ScalePictureAction scalePictureAction = new ScalePictureAction(newFrame); 85 ScaleXYPictureAction scaleXYPictureAction = new ScaleXYPictureAction(newFrame); 86 ScaleXPictureAction scaleXPictureAction = new ScaleXPictureAction(newFrame); 87 ScaleYPictureAction scaleYPictureAction = new ScaleYPictureAction(newFrame); 84 88 // Create plugin buttons and add them to the toolbar 85 89 m_movePictureButton = new IconToggleButton(movePictureAction); 86 m_rotatePictureButton = new IconToggleButton(rotatePictureAction); 87 m_scalePictureButton = new IconToggleButton(scalePictureAction); 90 m_rotatePictureButton = new IconToggleButton(rotatePictureAction); 91 m_scalexyPictureButton = new IconToggleButton(scaleXYPictureAction); 92 m_scalexPictureButton = new IconToggleButton(scaleXPictureAction); 93 m_scaleyPictureButton = new IconToggleButton(scaleYPictureAction); 88 94 newFrame.addMapMode(m_movePictureButton); 89 95 newFrame.addMapMode(m_rotatePictureButton); 90 newFrame.addMapMode(m_scalePictureButton); 91 newFrame.toolGroup.add(m_movePictureButton); 92 newFrame.toolGroup.add(m_rotatePictureButton); 93 newFrame.toolGroup.add(m_scalePictureButton); 94 // Hide them by default 96 newFrame.addMapMode(m_scalexyPictureButton); 97 newFrame.addMapMode(m_scalexPictureButton); 98 newFrame.addMapMode(m_scaleyPictureButton); 99 // newFrame.toolGroup.add(m_movePictureButton); 100 // newFrame.toolGroup.add(m_rotatePictureButton); 101 // newFrame.toolGroup.add(m_scalePictureButton); 102 // Show them by default 95 103 m_movePictureButton.setVisible(true); 96 104 m_rotatePictureButton.setVisible(true); 97 m_scalePictureButton.setVisible(true); 105 m_scalexyPictureButton.setVisible(true); 106 m_scalexPictureButton.setVisible(true); 107 m_scaleyPictureButton.setVisible(true); 98 108 } 99 109 } … … 103 113 */ 104 114 public void activeLayerChange(Layer oldLayer, Layer newLayer) { 105 m_movePictureButton.setEnabled( newLayer instanceof PicLayerAbstract );106 m_rotatePictureButton.setEnabled( newLayer instanceof PicLayerAbstract );107 m_scalePictureButton.setEnabled( newLayer instanceof PicLayerAbstract );108 115 } 109 116
Note:
See TracChangeset
for help on using the changeset viewer.