Changeset 22549 in osm for applications/editors/josm/plugins/piclayer
- Timestamp:
- 2010-08-03T08:17:26+02:00 (15 years ago)
- Location:
- applications/editors/josm/plugins/piclayer
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/piclayer/build.xml
r21706 r22549 24 24 25 25 <property name="commit.message" value="Changed the constructor signature of the plugin main class" /> 26 <property name="plugin.main.version" value=" 2830" />26 <property name="plugin.main.version" value="3408" /> 27 27 28 28 <!-- … … 138 138 139 139 <!-- 140 ************************** Publishing the plugin *********************************** 141 --> 142 <!-- 143 ** extracts the JOSM release for the JOSM version in ../core and saves it in the 140 ************************** Publishing the plugin *********************************** 141 --> 142 <!-- 143 ** extracts the JOSM release for the JOSM version in ../core and saves it in the 144 144 ** property ${coreversion.info.entry.revision} 145 145 ** … … 190 190 191 191 <!-- 192 ** commits the plugin.jar 192 ** commits the plugin.jar 193 193 --> 194 194 <target name="commit-dist"> 195 195 <echo> 196 196 ***** Properties of published ${plugin.jar} ***** 197 Commit message : '${commit.message}' 197 Commit message : '${commit.message}' 198 198 Plugin-Mainversion: ${plugin.main.version} 199 199 JOSM build version: ${coreversion.info.entry.revision} 200 200 Plugin-Version : ${version.entry.commit.revision} 201 ***** / Properties of published ${plugin.jar} ***** 202 201 ***** / Properties of published ${plugin.jar} ***** 202 203 203 Now commiting ${plugin.jar} ... 204 204 </echo> -
applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/NewLayerFromClipboardAction.java
r20217 r22549 51 51 // Add layer only if successfully initialized 52 52 try { 53 layer. Initialize();53 layer.initialize(); 54 54 } 55 55 catch (IOException e) { -
applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/NewLayerFromFileAction.java
r20217 r22549 91 91 // Add layer only if successfully initialized 92 92 try { 93 layer. Initialize();93 layer.initialize(); 94 94 } 95 95 catch (IOException e) { -
applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/PicLayerAbstract.java
r20217 r22549 29 29 import java.awt.Image; 30 30 import java.awt.Toolkit; 31 import java.awt.event.ActionEvent; 31 32 import java.awt.image.BufferedImage; 32 33 import java.io.IOException; 34 import java.util.List; 33 35 import java.util.Properties; 34 36 37 import javax.swing.AbstractAction; 38 import javax.swing.Action; 35 39 import javax.swing.Icon; 36 40 import javax.swing.ImageIcon; 37 41 import javax.swing.JMenu; 38 import javax.swing.JMenuItem;39 import javax.swing.JSeparator;40 42 41 43 import org.openstreetmap.josm.Main; … … 69 71 // The scale that was set on the map during image creation 70 72 private double m_initial_scale = 0; 71 // Popup menu items72 private Component m_popupmenu[] = null;73 73 // Layer icon 74 74 private Icon m_layericon = null; … … 93 93 m_counter++; 94 94 95 // Create popup menu96 // Reset submenu97 JMenu reset_submenu = new JMenu(tr("Reset"));98 reset_submenu.add( new ResetPictureAllAction( this ) );99 reset_submenu.addSeparator();100 reset_submenu.add( new ResetPicturePositionAction( this ) );101 reset_submenu.add( new ResetPictureAngleAction( this ) );102 reset_submenu.add( new ResetPictureScaleAction( this ) );103 // Main menu104 m_popupmenu = new Component[]{105 reset_submenu,106 new JSeparator(),107 new JMenuItem( new SavePictureCalibrationAction(this)),108 new JMenuItem( new LoadPictureCalibrationAction(this)),109 };110 111 95 // Load layer icon 112 96 m_layericon = new ImageIcon(Toolkit.getDefaultToolkit().createImage(PicLayerAbstract.class.getResource("/images/layericon.png"))); … … 117 101 * initial parameters. Throws exception if something fails. 118 102 */ 119 public void Initialize() throws IOException {103 public void initialize() throws IOException { 120 104 121 105 // Create image … … 165 149 166 150 @Override 167 public Component[] getMenuEntries() { 168 return m_popupmenu; 151 public Action[] getMenuEntries() { 152 // Main menu 153 return new Action[] { 154 new ResetSubmenuAction(), 155 SeparatorLayerAction.INSTANCE, 156 new SavePictureCalibrationAction(this), 157 new LoadPictureCalibrationAction(this), 158 }; 169 159 } 170 160 … … 189 179 public void paint(Graphics2D g2, MapView mv, Bounds bounds) { 190 180 191 if ( m_image != null && g2 instanceof Graphics2D) {181 if ( m_image != null) { 192 182 193 183 // Position image at the right graphical place … … 320 310 Main.map.mapView.repaint(); 321 311 } 312 313 private class ResetSubmenuAction extends AbstractAction implements LayerAction { 314 315 public ResetSubmenuAction() { 316 super(tr("Reset")); 317 } 318 319 public void actionPerformed(ActionEvent e) { 320 } 321 322 public Component createMenuComponent() { 323 JMenu reset_submenu = new JMenu(this); 324 reset_submenu.add( new ResetPictureAllAction( PicLayerAbstract.this ) ); 325 reset_submenu.addSeparator(); 326 reset_submenu.add( new ResetPicturePositionAction( PicLayerAbstract.this ) ); 327 reset_submenu.add( new ResetPictureAngleAction( PicLayerAbstract.this ) ); 328 reset_submenu.add( new ResetPictureScaleAction( PicLayerAbstract.this ) ); 329 return reset_submenu; 330 } 331 332 public boolean supportLayers(List<Layer> layers) { 333 return layers.size() == 1 && layers.get(0) instanceof PicLayerAbstract; 334 } 335 336 } 322 337 }
Note:
See TracChangeset
for help on using the changeset viewer.