Changeset 33846 in osm for applications/editors/josm/plugins
- Timestamp:
- 2017-11-21T01:21:39+01:00 (7 years ago)
- Location:
- applications/editors/josm/plugins/irsrectify
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/irsrectify/build.xml
r32680 r33846 5 5 <property name="commit.message" value="irsrectify shortcut conflict"/> 6 6 <!-- enter the *lowest* JOSM version this plugin is currently compatible with --> 7 <property name="plugin.main.version" value="1 0580"/>7 <property name="plugin.main.version" value="12743"/> 8 8 9 9 <!-- Configure these properties (replace "..." accordingly). -
applications/editors/josm/plugins/irsrectify/src/irsrectify/IRSRectifyPlugin.java
r32469 r33846 15 15 import org.openstreetmap.josm.data.osm.Node; 16 16 import org.openstreetmap.josm.data.osm.Way; 17 import org.openstreetmap.josm.gui.JosmUserIdentityManager; 17 import org.openstreetmap.josm.data.UserIdentityManager; 18 import org.openstreetmap.josm.gui.MainApplication; 18 19 import org.openstreetmap.josm.gui.MapFrame; 19 20 import org.openstreetmap.josm.gui.layer.ImageryLayer; … … 31 32 public IRSRectifyPlugin(PluginInformation info) { 32 33 super(info); 33 Main .main.menu.toolsMenu.add(new IRSRectifyAction());34 MainApplication.getMenu().toolsMenu.add(new IRSRectifyAction()); 34 35 } 35 36 … … 65 66 way.addNode(offset); 66 67 way.put("timestamp", new SimpleDateFormat("yyyy-MM-dd").format(new Date())); 67 String userName = JosmUserIdentityManager.getInstance().getUserName();68 String userName = UserIdentityManager.getInstance().getUserName(); 68 69 if( userName != null ) 69 70 way.put("user", userName); … … 74 75 data.data.addPrimitive(way); 75 76 data.data.setSelected(way.getPrimitiveId()); 76 Main.getLayerManager().setActiveLayer(data); 77 MainApplication.getLayerManager().setActiveLayer(data); 77 78 } 78 79 … … 80 81 if( frame == null || frame.mapView == null ) 81 82 return null; 82 for( Layer l : Main.getLayerManager().getLayers() ) 83 for( Layer l : MainApplication.getLayerManager().getLayers() ) 83 84 if( l instanceof ImageryLayer ) 84 85 return (ImageryLayer)l; … … 90 91 return null; 91 92 92 OsmDataLayer l = Main.getLayerManager().getEditLayer(); 93 OsmDataLayer l = MainApplication.getLayerManager().getEditLayer(); 93 94 if( isOffsetLayer(l) ) 94 95 return l; 95 96 96 97 // try to find among all layers 97 for( Layer layer : Main.getLayerManager().getLayers() ) 98 for( Layer layer : MainApplication.getLayerManager().getLayers() ) 98 99 if( layer instanceof OsmDataLayer && isOffsetLayer((OsmDataLayer)layer) ) 99 100 return (OsmDataLayer) layer; … … 104 105 name = name + " " + newLayerNameCounter; 105 106 l = new OsmDataLayer(new DataSet(), name, null); 106 Main.getLayerManager().addLayer(l); 107 MainApplication.getLayerManager().addLayer(l); 107 108 return l; 108 109 }
Note:
See TracChangeset
for help on using the changeset viewer.