Changeset 16628 in osm for applications/editors/josm/plugins/utilsplugin/src
- Timestamp:
- 2009-07-21T21:53:14+02:00 (15 years ago)
- Location:
- applications/editors/josm/plugins/utilsplugin/src/UtilsPlugin
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/utilsplugin/src/UtilsPlugin/JoinAreasAction.java
r16419 r16628 114 114 if(result != 1) return; 115 115 116 Collection<OsmPrimitive> selection = Main. ds.getSelectedWays();116 Collection<OsmPrimitive> selection = Main.main.getCurrentDataSet().getSelectedWays(); 117 117 118 118 int ways = 0; … … 177 177 if(joinAreas(selWays[0], selWays[ways == 2 ? 1 : 0])) { 178 178 Main.map.mapView.repaint(); 179 DataSet.fireSelectionChanged(Main. ds.getSelected());179 DataSet.fireSelectionChanged(Main.main.getCurrentDataSet().getSelected()); 180 180 } else 181 181 JOptionPane.showMessageDialog(Main.parent, tr("No intersection found. Nothing was changed.")); … … 448 448 private ArrayList<RelationRole> removeFromRelations(OsmPrimitive osm) { 449 449 ArrayList<RelationRole> result = new ArrayList<RelationRole>(); 450 for (Relation r : Main. ds.relations) {450 for (Relation r : Main.main.getCurrentDataSet().relations) { 451 451 if (r.deleted || r.incomplete) continue; 452 452 for (RelationMember rm : r.members) { … … 479 479 for (Way way : ways) { 480 480 nodes.add(way); 481 Main. ds.setSelected(nodes);481 Main.main.getCurrentDataSet().setSelected(nodes); 482 482 nodes.remove(way); 483 483 new SplitWayAction().actionPerformed(null); 484 484 cmdsCount++; 485 affected.addAll(Main. ds.getSelectedWays());485 affected.addAll(Main.main.getCurrentDataSet().getSelectedWays()); 486 486 } 487 487 return osmprim2way(affected); … … 584 584 if(w.isClosed()) 585 585 return w; 586 Main. ds.setSelected(w);586 Main.main.getCurrentDataSet().setSelected(w); 587 587 Way wnew = new Way(w); 588 588 wnew.addNode(wnew.firstNode()); 589 589 cmds.add(new ChangeCommand(w, wnew)); 590 590 commitCommands(marktr("Closed Way")); 591 return (Way)(Main. ds.getSelectedWays().toArray())[0];591 return (Way)(Main.main.getCurrentDataSet().getSelectedWays().toArray())[0]; 592 592 } 593 593 … … 610 610 if(a.nodes.get(0).equals(b.nodes.get(0)) || 611 611 a.nodes.get(a.nodes.size()-1).equals(b.nodes.get(b.nodes.size()-1))) { 612 Main. ds.setSelected(b);612 Main.main.getCurrentDataSet().setSelected(b); 613 613 new ReverseWayAction().actionPerformed(null); 614 614 cmdsCount++; … … 616 616 a = b; 617 617 } 618 Main. ds.setSelected(ways);618 Main.main.getCurrentDataSet().setSelected(ways); 619 619 // TODO: It might be possible that a confirmation dialog is presented even after reversing (for 620 620 // "strange" ways). If the user cancels this, makeCommitsOneAction will wrongly consume a previous … … 622 622 new CombineWayAction().actionPerformed(null); 623 623 cmdsCount++; 624 return (Way)(Main. ds.getSelectedWays().toArray())[0];624 return (Way)(Main.main.getCurrentDataSet().getSelectedWays().toArray())[0]; 625 625 } 626 626 -
applications/editors/josm/plugins/utilsplugin/src/UtilsPlugin/SimplifyWayAction.java
r16419 r16628 36 36 37 37 public void actionPerformed(ActionEvent e) { 38 Collection<OsmPrimitive> selection = Main. ds.getSelected();38 Collection<OsmPrimitive> selection = Main.main.getCurrentDataSet().getSelected(); 39 39 40 40 int ways = 0; … … 107 107 int toI = wnew.nodes.size() - 1; 108 108 for (int i = wnew.nodes.size() - 1; i >= 0; i--) { 109 CollectBackReferencesVisitor backRefsV = new CollectBackReferencesVisitor(Main. ds, false);109 CollectBackReferencesVisitor backRefsV = new CollectBackReferencesVisitor(Main.main.getCurrentDataSet(), false); 110 110 backRefsV.visit(wnew.nodes.get(i)); 111 111 boolean used = false;
Note:
See TracChangeset
for help on using the changeset viewer.