Changeset 33856 in osm
- Timestamp:
- 2017-11-21T23:49:34+01:00 (7 years ago)
- Location:
- applications/editors/josm/plugins/Create_grid_of_ways
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/Create_grid_of_ways
- Property svn:ignore
-
old new 4 4 checkstyle-josm-Create_grid_of_ways.xml 5 5 findbugs-josm-Create_grid_of_ways.xml 6 spotbugs-josm-Create_grid_of_ways.xml
-
- Property svn:ignore
-
applications/editors/josm/plugins/Create_grid_of_ways/build.xml
r32680 r33856 4 4 <property name="commit.message" value="Changed constructor signature, updated build.xml"/> 5 5 <!-- enter the *lowest* JOSM version this plugin is currently compatible with --> 6 <property name="plugin.main.version" value="1 0580"/>6 <property name="plugin.main.version" value="12630"/> 7 7 8 8 <!-- Configure these properties (replace "..." accordingly). -
applications/editors/josm/plugins/Create_grid_of_ways/src/CreateGridOfWaysPlugin/CreateGridOfWaysAction.java
r32440 r33856 16 16 import org.openstreetmap.josm.command.SequenceCommand; 17 17 import org.openstreetmap.josm.data.coor.LatLon; 18 import org.openstreetmap.josm.data.osm.DataSet; 18 19 import org.openstreetmap.josm.data.osm.Node; 19 20 import org.openstreetmap.josm.data.osm.OsmPrimitive; 20 21 import org.openstreetmap.josm.data.osm.Way; 22 import org.openstreetmap.josm.gui.MainApplication; 21 23 import org.openstreetmap.josm.tools.Shortcut; 22 24 … … 46 48 @Override 47 49 public void actionPerformed(ActionEvent e) { 48 Collection<OsmPrimitive> sel = Main.getLayerManager().getEditDataSet().getSelected(); 50 DataSet ds = getLayerManager().getEditDataSet(); 51 Collection<OsmPrimitive> sel = ds.getSelected(); 49 52 Collection<Node> nodesWay1 = new LinkedList<>(); 50 53 Collection<Node> nodesWay2 = new LinkedList<>(); … … 90 93 } 91 94 Node nodeOfGrid = new Node(new LatLon(n2.getCoor().lat()+latDif,n2.getCoor().lon()+lonDif)); 92 cmds.add(new AddCommand(nodeOfGrid)); 95 cmds.add(new AddCommand(ds, nodeOfGrid)); 93 96 w1[c1].addNode(nodeOfGrid); 94 97 w2[c2++].addNode(nodeOfGrid); … … 98 101 } 99 102 for (int c=0;c<w1.length;c++) 100 cmds.add(new AddCommand(w1[c])); 103 cmds.add(new AddCommand(ds, w1[c])); 101 104 for (int c=0;c<w2.length;c++) 102 cmds.add(new AddCommand(w2[c])); 105 cmds.add(new AddCommand(ds, w2[c])); 103 106 Main.main.undoRedo.add(new SequenceCommand(tr("Create a grid of ways"), cmds)); 104 Main .map.repaint();107 MainApplication.getMap().repaint(); 105 108 } 106 109 } -
applications/editors/josm/plugins/Create_grid_of_ways/src/CreateGridOfWaysPlugin/CreateGridOfWaysPlugin.java
r29771 r33856 1 1 package CreateGridOfWaysPlugin; 2 2 3 import org.openstreetmap.josm.Main; 3 import org.openstreetmap.josm.gui.MainApplication; 4 import org.openstreetmap.josm.gui.MainMenu; 4 5 import org.openstreetmap.josm.plugins.Plugin; 5 6 import org.openstreetmap.josm.plugins.PluginInformation; 6 import org.openstreetmap.josm.gui.MainMenu;7 7 8 8 public class CreateGridOfWaysPlugin extends Plugin { 9 9 public CreateGridOfWaysPlugin(PluginInformation info) { 10 10 super(info); 11 MainMenu.add(Main .main.menu.moreToolsMenu, new CreateGridOfWaysAction());11 MainMenu.add(MainApplication.getMenu().moreToolsMenu, new CreateGridOfWaysAction()); 12 12 } 13 13 }
Note:
See TracChangeset
for help on using the changeset viewer.