Changeset 33579 in osm for applications/editors/josm/plugins/utilsplugin2
- Timestamp:
- 2017-08-27T22:22:31+02:00 (7 years ago)
- Location:
- applications/editors/josm/plugins/utilsplugin2
- Files:
-
- 28 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/utilsplugin2/build.xml
r33543 r33579 5 5 <property name="commit.message" value="[josm_utilsplugin2]: select boundary by double-click; multitagger table highlights"/> 6 6 <!-- enter the *lowest* JOSM version this plugin is currently compatible with --> 7 <property name="plugin.main.version" value="126 66"/>7 <property name="plugin.main.version" value="12678"/> 8 8 9 9 <property name="plugin.author" value="Kalle Lampila, Upliner, Zverik, akks, joshdoe and others"/> -
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/UtilsPlugin2.java
r33522 r33579 5 5 import javax.swing.JMenuItem; 6 6 7 import org.openstreetmap.josm.Main;8 7 import org.openstreetmap.josm.data.osm.search.SearchCompiler; 8 import org.openstreetmap.josm.gui.MainApplication; 9 9 import org.openstreetmap.josm.gui.MainMenu; 10 10 import org.openstreetmap.josm.gui.MapFrame; … … 93 93 instance = this; 94 94 95 JMenu editMenu = Main .main.menu.editMenu;96 JMenu toolsMenu = Main .main.menu.moreToolsMenu;97 JMenu dataMenu = Main .main.menu.dataMenu;98 JMenu selectionMenu = Main .main.menu.selectionMenu;95 JMenu editMenu = MainApplication.getMenu().editMenu; 96 JMenu toolsMenu = MainApplication.getMenu().moreToolsMenu; 97 JMenu dataMenu = MainApplication.getMenu().dataMenu; 98 JMenu selectionMenu = MainApplication.getMenu().selectionMenu; 99 99 100 copyTags = MainMenu.addAfter(editMenu, new CopyTagsAction(), false, Main .main.menu.copy);100 copyTags = MainMenu.addAfter(editMenu, new CopyTagsAction(), false, MainApplication.getMenu().copy); 101 101 102 102 addIntersections = MainMenu.add(toolsMenu, new AddIntersectionsAction()); -
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/AddIntersectionsAction.java
r32410 r33579 15 15 import javax.swing.JOptionPane; 16 16 17 import org.openstreetmap.josm.Main;18 17 import org.openstreetmap.josm.actions.JosmAction; 19 18 import org.openstreetmap.josm.command.AddCommand; … … 23 22 import org.openstreetmap.josm.data.osm.OsmPrimitive; 24 23 import org.openstreetmap.josm.data.osm.Way; 24 import org.openstreetmap.josm.gui.MainApplication; 25 25 import org.openstreetmap.josm.gui.Notification; 26 26 import org.openstreetmap.josm.tools.Geometry; … … 56 56 Geometry.addIntersections(ways, false, cmds); 57 57 if (!cmds.isEmpty()) { 58 Main .main.undoRedo.add(new SequenceCommand(tr("Add nodes at intersections"), cmds));58 MainApplication.undoRedo.add(new SequenceCommand(tr("Add nodes at intersections"), cmds)); 59 59 Set<Node> nodes = new HashSet<>(10); 60 60 // find and select newly added nodes -
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/AlignWayNodesAction.java
r33328 r33579 15 15 import javax.swing.JOptionPane; 16 16 17 import org.openstreetmap.josm.Main;18 17 import org.openstreetmap.josm.actions.JosmAction; 19 18 import org.openstreetmap.josm.command.Command; … … 23 22 import org.openstreetmap.josm.data.osm.OsmPrimitive; 24 23 import org.openstreetmap.josm.data.osm.Way; 24 import org.openstreetmap.josm.gui.MainApplication; 25 25 import org.openstreetmap.josm.gui.Notification; 26 26 import org.openstreetmap.josm.tools.Shortcut; … … 128 128 129 129 if (!commands.isEmpty()) 130 Main .main.undoRedo.add(new SequenceCommand(TITLE, commands));130 MainApplication.undoRedo.add(new SequenceCommand(TITLE, commands)); 131 131 } 132 132 -
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/ExtractPointAction.java
r32410 r33579 24 24 import org.openstreetmap.josm.data.osm.OsmPrimitive; 25 25 import org.openstreetmap.josm.data.osm.Way; 26 import org.openstreetmap.josm.gui.MainApplication; 26 27 import org.openstreetmap.josm.gui.Notification; 27 28 import org.openstreetmap.josm.tools.Shortcut; … … 56 57 List<Command> cmds = new LinkedList<>(); 57 58 58 Point p = Main .map.mapView.getMousePosition();59 Point p = MainApplication.getMap().mapView.getMousePosition(); 59 60 if (p != null) 60 cmds.add(new MoveCommand(nd, Main .map.mapView.getLatLon(p.x, p.y)));61 cmds.add(new MoveCommand(nd, MainApplication.getMap().mapView.getLatLon(p.x, p.y))); 61 62 List<OsmPrimitive> refs = nd.getReferrers(); 62 63 cmds.add(new AddCommand(ndCopy)); … … 71 72 } 72 73 } 73 if (cmds.size() > 1) Main .main.undoRedo.add(new SequenceCommand(tr("Extract node from line"), cmds));74 if (cmds.size() > 1) MainApplication.undoRedo.add(new SequenceCommand(tr("Extract node from line"), cmds)); 74 75 } 75 76 -
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/PasteRelationsAction.java
r33123 r33579 24 24 import org.openstreetmap.josm.data.osm.Relation; 25 25 import org.openstreetmap.josm.data.osm.RelationMember; 26 import org.openstreetmap.josm.gui.MainApplication; 26 27 import org.openstreetmap.josm.gui.datatransfer.ClipboardUtils; 27 28 import org.openstreetmap.josm.gui.datatransfer.data.PrimitiveTransferData; 29 import org.openstreetmap.josm.tools.Logging; 28 30 import org.openstreetmap.josm.tools.Shortcut; 29 31 … … 53 55 data = ((PrimitiveTransferData) ClipboardUtils.getClipboard().getData(PrimitiveTransferData.DATA_FLAVOR)).getDirectlyAdded(); 54 56 } catch (UnsupportedFlavorException | IOException ex) { 55 Main.warn(ex);57 Logging.warn(ex); 56 58 } 57 59 for (PrimitiveData pdata : data) { … … 99 101 100 102 if (!commands.isEmpty()) 101 Main .main.undoRedo.add(new SequenceCommand(TITLE, commands));103 MainApplication.undoRedo.add(new SequenceCommand(TITLE, commands)); 102 104 } 103 105 … … 113 115 && ClipboardUtils.getClipboard().isDataFlavorAvailable(PrimitiveTransferData.DATA_FLAVOR)); 114 116 } catch (IllegalStateException e) { 115 Main.warn(e);117 Logging.warn(e); 116 118 } catch (NullPointerException e) { 117 119 // JDK-6322854: On Linux/X11, NPE can happen for unknown reasons, on all versions of Java 118 Main.error(e);120 Logging.error(e); 119 121 } 120 122 } -
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/SplitObjectAction.java
r32410 r33579 18 18 import javax.swing.JOptionPane; 19 19 20 import org.openstreetmap.josm.Main;21 20 import org.openstreetmap.josm.actions.JosmAction; 22 21 import org.openstreetmap.josm.actions.SplitWayAction; … … 25 24 import org.openstreetmap.josm.data.osm.OsmPrimitive; 26 25 import org.openstreetmap.josm.data.osm.Way; 26 import org.openstreetmap.josm.gui.MainApplication; 27 27 import org.openstreetmap.josm.gui.Notification; 28 28 import org.openstreetmap.josm.tools.Shortcut; … … 210 210 SplitWayAction.SplitWayResult result = SplitWayAction.splitWay( 211 211 getLayerManager().getEditLayer(), selectedWay, wayChunks, Collections.<OsmPrimitive>emptyList()); 212 Main .main.undoRedo.add(result.getCommand());212 MainApplication.undoRedo.add(result.getCommand()); 213 213 if (splitWay != null) 214 Main .main.undoRedo.add(new DeleteCommand(splitWay));214 MainApplication.undoRedo.add(new DeleteCommand(splitWay)); 215 215 getLayerManager().getEditDataSet().setSelected(result.getNewSelection()); 216 216 } -
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/SplitOnIntersectionsAction.java
r32410 r33579 15 15 import javax.swing.JOptionPane; 16 16 17 import org.openstreetmap.josm.Main;18 17 import org.openstreetmap.josm.actions.JosmAction; 19 18 import org.openstreetmap.josm.actions.SplitWayAction; … … 23 22 import org.openstreetmap.josm.data.osm.OsmPrimitive; 24 23 import org.openstreetmap.josm.data.osm.Way; 24 import org.openstreetmap.josm.gui.MainApplication; 25 25 import org.openstreetmap.josm.gui.Notification; 26 26 import org.openstreetmap.josm.tools.Shortcut; … … 95 95 96 96 if (!list.isEmpty()) { 97 Main .main.undoRedo.add(list.size() == 1 ? list.get(0) : new SequenceCommand(TITLE, list));97 MainApplication.undoRedo.add(list.size() == 1 ? list.get(0) : new SequenceCommand(TITLE, list)); 98 98 getLayerManager().getEditDataSet().clearSelection(); 99 99 } -
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/SymmetryAction.java
r32410 r33579 22 22 import org.openstreetmap.josm.data.osm.OsmPrimitive; 23 23 import org.openstreetmap.josm.data.osm.Way; 24 import org.openstreetmap.josm.gui.MainApplication; 24 25 import org.openstreetmap.josm.gui.Notification; 25 26 import org.openstreetmap.josm.tools.Shortcut; … … 87 88 } 88 89 89 Main .main.undoRedo.add(new SequenceCommand(tr("Symmetry"), cmds));90 Main .map.repaint();90 MainApplication.undoRedo.add(new SequenceCommand(tr("Symmetry"), cmds)); 91 MainApplication.getMap().repaint(); 91 92 } 92 93 -
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/TagBufferAction.java
r32725 r33579 15 15 import java.util.function.Predicate; 16 16 17 import org.openstreetmap.josm.Main;18 17 import org.openstreetmap.josm.actions.JosmAction; 19 18 import org.openstreetmap.josm.command.ChangePropertyCommand; … … 21 20 import org.openstreetmap.josm.command.SequenceCommand; 22 21 import org.openstreetmap.josm.data.osm.OsmPrimitive; 22 import org.openstreetmap.josm.gui.MainApplication; 23 23 import org.openstreetmap.josm.tools.Shortcut; 24 24 import org.openstreetmap.josm.tools.SubclassFilteredCollection; … … 69 69 70 70 if (!commands.isEmpty()) 71 Main .main.undoRedo.add(new SequenceCommand(TITLE, commands));71 MainApplication.undoRedo.add(new SequenceCommand(TITLE, commands)); 72 72 } 73 73 -
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/TagSourceAction.java
r32410 r33579 14 14 import org.openstreetmap.josm.command.ChangePropertyCommand; 15 15 import org.openstreetmap.josm.data.osm.OsmPrimitive; 16 import org.openstreetmap.josm.gui.MainApplication; 16 17 import org.openstreetmap.josm.tools.Shortcut; 17 18 … … 42 43 return; 43 44 44 Main .main.undoRedo.add(new ChangePropertyCommand(selection, "source", source));45 MainApplication.undoRedo.add(new ChangePropertyCommand(selection, "source", source)); 45 46 } 46 47 -
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/UnGlueRelationAction.java
r32410 r33579 20 20 import org.openstreetmap.josm.data.osm.Relation; 21 21 import org.openstreetmap.josm.data.osm.Way; 22 import org.openstreetmap.josm.gui.MainApplication; 22 23 import org.openstreetmap.josm.plugins.utilsplugin2.command.ChangeRelationMemberCommand; 23 24 import org.openstreetmap.josm.tools.Shortcut; … … 79 80 // error message nothing to do 80 81 } else { 81 Main .main.undoRedo.add(new SequenceCommand(tr("Unglued Relations"), cmds));82 MainApplication.undoRedo.add(new SequenceCommand(tr("Unglued Relations"), cmds)); 82 83 //Set selection all primiteves (new and old) 83 84 newPrimitives.addAll(selection); 84 85 getLayerManager().getEditDataSet().setSelected(newPrimitives); 85 Main .map.mapView.repaint();86 MainApplication.getMap().mapView.repaint(); 86 87 } 87 88 } -
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/curves/CurveAction.java
r32410 r33579 18 18 import org.openstreetmap.josm.data.osm.OsmPrimitive; 19 19 import org.openstreetmap.josm.data.osm.Way; 20 import org.openstreetmap.josm.gui.MainApplication; 20 21 import org.openstreetmap.josm.tools.Shortcut; 21 22 … … 58 59 Collection<Command> cmds = CircleArcMaker.doCircleArc(selectedNodes, selectedWays, angleSeparation); 59 60 if (cmds != null) 60 Main .main.undoRedo.add(new SequenceCommand("Create a curve", cmds));61 MainApplication.undoRedo.add(new SequenceCommand("Create a curve", cmds)); 61 62 } 62 63 -
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/customurl/OpenPageAction.java
r32410 r33579 18 18 import org.openstreetmap.josm.data.osm.OsmPrimitive; 19 19 import org.openstreetmap.josm.data.osm.OsmPrimitiveType; 20 import org.openstreetmap.josm.gui.MainApplication; 21 import org.openstreetmap.josm.gui.MapView; 22 import org.openstreetmap.josm.tools.Logging; 20 23 import org.openstreetmap.josm.tools.OpenBrowser; 21 24 import org.openstreetmap.josm.tools.OsmUrlToBounds; … … 50 53 ChooseURLAction.showConfigDialog(true); 51 54 52 LatLon center = Main.map.mapView.getLatLon(Main.map.mapView.getWidth()/2, Main.map.mapView.getHeight()/2); 55 MapView mv = MainApplication.getMap().mapView; 56 LatLon center = mv.getLatLon(mv.getWidth()/2, mv.getHeight()/2); 53 57 54 58 String addr = URLList.getSelectedURL(); … … 70 74 val = Double.toString(center.lon()); 71 75 } else if (key.equals("#zoom")) { 72 val = Integer.toString(OsmUrlToBounds.getZoom(Main .map.mapView.getRealBounds()));76 val = Integer.toString(OsmUrlToBounds.getZoom(MainApplication.getMap().mapView.getRealBounds())); 73 77 } else { 74 78 if (p != null) { … … 83 87 } 84 88 } catch (UnsupportedEncodingException ex) { 85 Main.error(ex, "Encoding error");89 Logging.log(Logging.LEVEL_ERROR, "Encoding error", ex); 86 90 return; 87 91 } … … 92 96 OpenBrowser.displayUrl(addr); 93 97 } catch (Exception ex) { 94 Main.error(ex, "Can not open URL " + addr);98 Logging.log(Logging.LEVEL_ERROR, "Can not open URL " + addr, ex); 95 99 } 96 100 } -
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/customurl/URLList.java
r33124 r33579 15 15 import org.openstreetmap.josm.Main; 16 16 import org.openstreetmap.josm.plugins.utilsplugin2.UtilsPlugin2; 17 import org.openstreetmap.josm.tools.Logging; 17 18 18 19 public final class URLList { … … 78 79 } 79 80 } catch (IOException e) { 80 Main.error(e);81 Logging.error(e); 81 82 } 82 83 return items; … … 93 94 } 94 95 } catch (IOException e) { 95 Main.error(e);96 Logging.error(e); 96 97 } finally { 97 98 try { … … 99 100 fw.close(); 100 101 } catch (Exception e) { 101 Main.warn(e);102 Logging.warn(e); 102 103 } 103 104 } -
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/latlon/LatLonAction.java
r32725 r33579 18 18 import org.openstreetmap.josm.data.osm.Node; 19 19 import org.openstreetmap.josm.data.osm.Way; 20 import org.openstreetmap.josm.gui.MainApplication; 20 21 import org.openstreetmap.josm.tools.Shortcut; 21 22 … … 80 81 cmds.add(new AddCommand(wnew)); 81 82 } 82 Main .main.undoRedo.add(new SequenceCommand(tr("Lat Lon tool"), cmds));83 Main .map.mapView.repaint();83 MainApplication.undoRedo.add(new SequenceCommand(tr("Lat Lon tool"), cmds)); 84 MainApplication.getMap().mapView.repaint(); 84 85 } 85 86 -
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/latlon/LatLonDialog.java
r32410 r33579 36 36 import org.openstreetmap.josm.data.coor.LatLon; 37 37 import org.openstreetmap.josm.gui.ExtendedDialog; 38 import org.openstreetmap.josm.gui.util.WindowGeometry; 38 39 import org.openstreetmap.josm.gui.widgets.HtmlPanel; 39 40 import org.openstreetmap.josm.tools.GBC; 40 import org.openstreetmap.josm.tools.WindowGeometry;41 41 42 42 public class LatLonDialog extends ExtendedDialog { -
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/multitagger/MultiTagDialog.java
r33522 r33579 49 49 import org.openstreetmap.josm.data.preferences.ColorProperty; 50 50 import org.openstreetmap.josm.gui.ExtendedDialog; 51 import org.openstreetmap.josm.gui.MainApplication; 51 52 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 52 53 import org.openstreetmap.josm.gui.tagging.ac.AutoCompletingTextField; … … 55 56 import org.openstreetmap.josm.gui.util.HighlightHelper; 56 57 import org.openstreetmap.josm.gui.util.TableHelper; 58 import org.openstreetmap.josm.gui.util.WindowGeometry; 57 59 import org.openstreetmap.josm.gui.widgets.HistoryComboBox; 58 60 import org.openstreetmap.josm.gui.widgets.PopupMenuLauncher; 59 61 import org.openstreetmap.josm.tools.GBC; 60 62 import org.openstreetmap.josm.tools.ImageProvider; 61 import org.openstreetmap.josm.tools. WindowGeometry;63 import org.openstreetmap.josm.tools.Logging; 62 64 63 65 /** … … 138 140 public void actionPerformed(ActionEvent e) { 139 141 if (jt.isSelected()) tableModel.shownTypes.add(type); else tableModel.shownTypes.remove(type); 140 tableModel.updateData(Main .getLayerManager().getEditDataSet().getSelected());142 tableModel.updateData(MainApplication.getLayerManager().getEditDataSet().getSelected()); 141 143 } 142 144 }); … … 181 183 @Override 182 184 public void mouseClicked(MouseEvent e) { 183 if (e.getClickCount() > 1 && Main .isDisplayingMapView()) {185 if (e.getClickCount() > 1 && MainApplication.isDisplayingMapView()) { 184 186 AutoScaleAction.zoomTo(currentSelection); 185 187 } … … 191 193 public void valueChanged(ListSelectionEvent e) { 192 194 currentSelection = getSelectedPrimitives(); 193 if (currentSelection != null && Main .isDisplayingMapView()) {195 if (currentSelection != null && MainApplication.isDisplayingMapView()) { 194 196 if (highlightHelper.highlightOnly(currentSelection)) { 195 Main .map.mapView.repaint();197 MainApplication.getMap().mapView.repaint(); 196 198 } 197 199 } … … 210 212 211 213 private void initAutocompletion() { 212 OsmDataLayer l = Main .getLayerManager().getEditLayer();214 OsmDataLayer l = MainApplication.getLayerManager().getEditLayer(); 213 215 AutoCompletionManager autocomplete = l.data.getAutoCompletionManager(); 214 216 for (int i = 0; i < tableModel.mainTags.length; i++) { … … 227 229 @Override 228 230 public void actionPerformed(ActionEvent e) { 229 if (Main .isDisplayingMapView()) {231 if (MainApplication.isDisplayingMapView()) { 230 232 AutoScaleAction.zoomTo(currentSelection); 231 233 } … … 235 237 @Override 236 238 public void actionPerformed(ActionEvent e) { 237 Main .getLayerManager().getEditDataSet().setSelected(getSelectedPrimitives());239 MainApplication.getLayerManager().getEditDataSet().setSelected(getSelectedPrimitives()); 238 240 } 239 241 }); … … 340 342 341 343 private void specifyTagSet(String s) { 342 Main.info("Multitagger tags="+s);344 Logging.info("Multitagger tags="+s); 343 345 tableModel.setupColumnsFromText(s); 344 346 -
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/multitagger/MultiTaggerTableModel.java
r32410 r33579 12 12 import javax.swing.table.AbstractTableModel; 13 13 14 import org.openstreetmap.josm.Main;15 14 import org.openstreetmap.josm.command.ChangePropertyCommand; 16 15 import org.openstreetmap.josm.command.Command; … … 20 19 import org.openstreetmap.josm.data.osm.OsmPrimitiveType; 21 20 import org.openstreetmap.josm.data.osm.Way; 21 import org.openstreetmap.josm.gui.MainApplication; 22 22 import org.openstreetmap.josm.tools.Geometry; 23 23 … … 49 49 public void setWatchSelection(boolean watchSelection) { 50 50 this.watchSelection = watchSelection; 51 if (watchSelection && Main .getLayerManager().getEditLayer() != null)52 selectionChanged(Main .getLayerManager().getEditDataSet().getSelected());51 if (watchSelection && MainApplication.getLayerManager().getEditLayer() != null) 52 selectionChanged(MainApplication.getLayerManager().getEditDataSet().getSelected()); 53 53 } 54 54 … … 115 115 Command cmd = new ChangePropertyCommand(sel, key, (String) value); 116 116 if (autoCommit) { 117 Main .main.undoRedo.add(cmd);117 MainApplication.undoRedo.add(cmd); 118 118 } else { 119 119 cmds.add(cmd); … … 185 185 186 186 void commit(String commandTitle) { 187 Main .main.undoRedo.add(new SequenceCommand(commandTitle, cmds));187 MainApplication.undoRedo.add(new SequenceCommand(commandTitle, cmds)); 188 188 cmds.clear(); 189 189 } -
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/replacegeometry/ReplaceGeometryAction.java
r32410 r33579 12 12 import javax.swing.JOptionPane; 13 13 14 import org.openstreetmap.josm.Main;15 14 import org.openstreetmap.josm.actions.JosmAction; 16 15 import org.openstreetmap.josm.data.osm.OsmPrimitive; 16 import org.openstreetmap.josm.gui.MainApplication; 17 17 import org.openstreetmap.josm.gui.Notification; 18 18 import org.openstreetmap.josm.tools.Shortcut; … … 58 58 return; 59 59 60 Main .main.undoRedo.add(replaceCommand);60 MainApplication.undoRedo.add(replaceCommand); 61 61 } catch (IllegalArgumentException ex) { 62 62 new Notification( -
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/replacegeometry/ReplaceGeometryUtils.java
r33522 r33579 33 33 import org.openstreetmap.josm.data.osm.TagCollection; 34 34 import org.openstreetmap.josm.data.osm.Way; 35 import org.openstreetmap.josm.gui.MainApplication; 35 36 import org.openstreetmap.josm.gui.Notification; 36 37 import org.openstreetmap.josm.gui.conflict.tags.CombinePrimitiveResolverDialog; 38 import org.openstreetmap.josm.tools.Logging; 37 39 import org.openstreetmap.josm.tools.UserCancelException; 38 40 … … 110 112 // FIXME: handle different layers 111 113 List<Command> commands = new ArrayList<>(); 112 Command c = MergeNodesAction.mergeNodes(Main.getLayerManager().getEditLayer(), Arrays.asList(subjectNode, referenceNode), referenceNode); 114 Command c = MergeNodesAction.mergeNodes(MainApplication.getLayerManager().getEditLayer(), 115 Arrays.asList(subjectNode, referenceNode), referenceNode); 113 116 if (c == null) { 114 117 // User canceled … … 197 200 } 198 201 199 Main .getLayerManager().getEditDataSet().setSelected(referenceObject);202 MainApplication.getLayerManager().getEditDataSet().setSelected(referenceObject); 200 203 201 204 return new ReplaceGeometryCommand( … … 236 239 public static ReplaceGeometryCommand buildReplaceWayCommand(Way subjectWay, Way referenceWay) { 237 240 238 Area a = Main .getLayerManager().getEditDataSet().getDataSourceArea();241 Area a = MainApplication.getLayerManager().getEditDataSet().getDataSourceArea(); 239 242 if (!isInArea(subjectWay, a) || !isInArea(referenceWay, a)) { 240 243 throw new ReplaceGeometryException(tr("The ways must be entirely within the downloaded area.")); … … 253 256 } catch (UserCancelException e) { 254 257 // user canceled tag merge dialog 255 Main.trace(e);258 Logging.trace(e); 256 259 return null; 257 260 } … … 354 357 355 358 // Remove geometry way from selection 356 Main .getLayerManager().getEditDataSet().clearSelection(referenceWay);359 MainApplication.getLayerManager().getEditDataSet().clearSelection(referenceWay); 357 360 358 361 // And delete old geometry way -
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/replacegeometry/ReplaceMembershipAction.java
r33522 r33579 15 15 import javax.swing.JOptionPane; 16 16 17 import org.openstreetmap.josm.Main;18 17 import org.openstreetmap.josm.actions.JosmAction; 19 18 import org.openstreetmap.josm.command.ChangeCommand; … … 24 23 import org.openstreetmap.josm.data.osm.RelationMember; 25 24 import org.openstreetmap.josm.data.osm.RelationToChildReference; 25 import org.openstreetmap.josm.gui.MainApplication; 26 26 import org.openstreetmap.josm.gui.Notification; 27 27 import org.openstreetmap.josm.tools.MultiMap; … … 45 45 final int affectedRelations = command.getChildren().size(); 46 46 if (affectedRelations > 0) { 47 Main .main.undoRedo.add(command);47 MainApplication.undoRedo.add(command); 48 48 new Notification(trn("Replaced ''{0}'' by ''{1}'' in {2} relation", "Replaced ''{0}'' by ''{1}'' in {2} relations", 49 49 affectedRelations, -
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/search/ConnectedMatch.java
r33522 r33579 6 6 import java.util.Set; 7 7 8 import org.openstreetmap.josm.Main;9 8 import org.openstreetmap.josm.data.osm.Node; 10 9 import org.openstreetmap.josm.data.osm.OsmPrimitive; 11 10 import org.openstreetmap.josm.data.osm.Way; 12 11 import org.openstreetmap.josm.data.osm.search.SearchCompiler; 12 import org.openstreetmap.josm.gui.MainApplication; 13 13 import org.openstreetmap.josm.plugins.utilsplugin2.selection.NodeWayUtils; 14 14 … … 32 32 Set<Node> matchedNodes = new HashSet<>(); 33 33 // find all ways that match the expression 34 Collection<Way> allWays = Main .getLayerManager().getEditDataSet().getWays();34 Collection<Way> allWays = MainApplication.getLayerManager().getEditDataSet().getWays(); 35 35 for (Way way : allWays) { 36 36 if (match.match(way)) { … … 39 39 } 40 40 // find all nodes that match the expression 41 Collection<Node> allNodes = Main .getLayerManager().getEditDataSet().getNodes();41 Collection<Node> allNodes = MainApplication.getLayerManager().getEditDataSet().getNodes(); 42 42 for (Node node : allNodes) { 43 43 if (match.match(node)) { -
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/search/InsideMatch.java
r33522 r33579 5 5 import java.util.HashSet; 6 6 7 import org.openstreetmap.josm.Main;8 7 import org.openstreetmap.josm.data.osm.OsmPrimitive; 9 8 import org.openstreetmap.josm.data.osm.Relation; 10 9 import org.openstreetmap.josm.data.osm.Way; 11 10 import org.openstreetmap.josm.data.osm.search.SearchCompiler; 11 import org.openstreetmap.josm.gui.MainApplication; 12 12 import org.openstreetmap.josm.plugins.utilsplugin2.selection.NodeWayUtils; 13 13 … … 28 28 Collection<OsmPrimitive> matchedAreas = new HashSet<>(); 29 29 // find all ways that match the expression 30 Collection<Way> ways = Main .getLayerManager().getEditDataSet().getWays();30 Collection<Way> ways = MainApplication.getLayerManager().getEditDataSet().getWays(); 31 31 for (Way way : ways) { 32 32 if (match.match(way)) { … … 35 35 } 36 36 // find all relations that match the expression 37 Collection<Relation> rels = Main .getLayerManager().getEditDataSet().getRelations();37 Collection<Relation> rels = MainApplication.getLayerManager().getEditDataSet().getRelations(); 38 38 for (Relation rel : rels) { 39 39 if (match.match(rel)) { … … 41 41 } 42 42 } 43 inside = NodeWayUtils.selectAllInside(matchedAreas, Main .getLayerManager().getEditDataSet(), false);43 inside = NodeWayUtils.selectAllInside(matchedAreas, MainApplication.getLayerManager().getEditDataSet(), false); 44 44 } 45 45 -
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/search/IntersectingMatch.java
r33522 r33579 6 6 import java.util.Set; 7 7 8 import org.openstreetmap.josm.Main;9 8 import org.openstreetmap.josm.data.osm.OsmPrimitive; 10 9 import org.openstreetmap.josm.data.osm.Way; 11 10 import org.openstreetmap.josm.data.osm.search.SearchCompiler; 11 import org.openstreetmap.josm.gui.MainApplication; 12 12 import org.openstreetmap.josm.plugins.utilsplugin2.selection.NodeWayUtils; 13 13 … … 31 31 Collection<Way> matchedWays = new HashSet<>(); 32 32 // find all ways that match the expression 33 Collection<Way> allWays = Main .getLayerManager().getEditDataSet().getWays();33 Collection<Way> allWays = MainApplication.getLayerManager().getEditDataSet().getWays(); 34 34 for (Way way : allWays) { 35 35 if (match.match(way)) { -
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/SelectBoundaryAction.java
r33297 r33579 14 14 import javax.swing.JOptionPane; 15 15 16 import org.openstreetmap.josm.Main;17 16 import org.openstreetmap.josm.actions.JosmAction; 18 17 import org.openstreetmap.josm.actions.SelectByInternalPointAction; … … 21 20 import org.openstreetmap.josm.data.osm.OsmPrimitive; 22 21 import org.openstreetmap.josm.data.osm.Way; 22 import org.openstreetmap.josm.gui.MainApplication; 23 23 import org.openstreetmap.josm.gui.Notification; 24 24 import org.openstreetmap.josm.tools.Shortcut; … … 58 58 } 59 59 } else { 60 Point p = Main .map.mapView.getMousePosition();61 SelectByInternalPointAction.performSelection(Main .map.mapView.getEastNorth(p.x, p.y), false, false);60 Point p = MainApplication.getMap().mapView.getMousePosition(); 61 SelectByInternalPointAction.performSelection(MainApplication.getMap().mapView.getEastNorth(p.x, p.y), false, false); 62 62 return; 63 63 } -
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/SelectModNodesAction.java
r33297 r33579 11 11 import java.util.Set; 12 12 13 import org.openstreetmap.josm.Main;14 13 import org.openstreetmap.josm.actions.JosmAction; 15 14 import org.openstreetmap.josm.command.Command; … … 17 16 import org.openstreetmap.josm.data.osm.Node; 18 17 import org.openstreetmap.josm.data.osm.OsmPrimitive; 18 import org.openstreetmap.josm.gui.MainApplication; 19 19 import org.openstreetmap.josm.tools.Shortcut; 20 20 … … 42 42 Command cmd = null; 43 43 44 if (Main .main.undoRedo.commands == null) return;45 int num = Main .main.undoRedo.commands.size();44 if (MainApplication.undoRedo.commands == null) return; 45 int num = MainApplication.undoRedo.commands.size(); 46 46 if (num == 0) return; 47 47 int k = 0, idx; 48 48 if (selection != null && !selection.isEmpty() && selection.hashCode() == lastHash) { 49 49 // we are selecting next command in history if nothing is selected 50 idx = Main .main.undoRedo.commands.indexOf(lastCmd);50 idx = MainApplication.undoRedo.commands.indexOf(lastCmd); 51 51 } else { 52 52 idx = num; … … 56 56 do { // select next history element 57 57 if (idx > 0) idx--; else idx = num-1; 58 cmd = Main .main.undoRedo.commands.get(idx);58 cmd = MainApplication.undoRedo.commands.get(idx); 59 59 Collection<? extends OsmPrimitive> pp = cmd.getParticipatingPrimitives(); 60 60 nodes.clear(); -
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/SelectModWaysAction.java
r33297 r33579 11 11 import java.util.Set; 12 12 13 import org.openstreetmap.josm.Main;14 13 import org.openstreetmap.josm.actions.JosmAction; 15 14 import org.openstreetmap.josm.command.Command; … … 18 17 import org.openstreetmap.josm.data.osm.OsmPrimitive; 19 18 import org.openstreetmap.josm.data.osm.Way; 19 import org.openstreetmap.josm.gui.MainApplication; 20 20 import org.openstreetmap.josm.tools.Shortcut; 21 21 … … 43 43 Command cmd; 44 44 45 if (Main .main.undoRedo.commands == null) return;46 int num = Main .main.undoRedo.commands.size();45 if (MainApplication.undoRedo.commands == null) return; 46 int num = MainApplication.undoRedo.commands.size(); 47 47 if (num == 0) return; 48 48 int k = 0, idx; 49 49 if (selection != null && !selection.isEmpty() && selection.hashCode() == lastHash) { 50 50 // we are selecting next command in history if nothing is selected 51 idx = Main .main.undoRedo.commands.indexOf(lastCmd);51 idx = MainApplication.undoRedo.commands.indexOf(lastCmd); 52 52 } else { 53 53 idx = num; … … 57 57 do { // select next history element 58 58 if (idx > 0) idx--; else idx = num-1; 59 cmd = Main .main.undoRedo.commands.get(idx);59 cmd = MainApplication.undoRedo.commands.get(idx); 60 60 Collection<? extends OsmPrimitive> pp = cmd.getParticipatingPrimitives(); 61 61 ways.clear();
Note:
See TracChangeset
for help on using the changeset viewer.