Changeset 33700 in osm for applications/editors/josm/plugins/tracer2/src
- Timestamp:
- 2017-10-04T11:09:28+02:00 (7 years ago)
- Location:
- applications/editors/josm/plugins/tracer2/src/org/openstreetmap/josm/plugins/tracer2
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/tracer2/src/org/openstreetmap/josm/plugins/tracer2/ConnectWays.java
r32788 r33700 10 10 import java.util.Map; 11 11 12 import org.openstreetmap.josm.Main;13 12 import org.openstreetmap.josm.command.AddCommand; 14 13 import org.openstreetmap.josm.command.ChangeCommand; … … 19 18 import org.openstreetmap.josm.data.coor.LatLon; 20 19 import org.openstreetmap.josm.data.osm.BBox; 20 import org.openstreetmap.josm.data.osm.DataSet; 21 21 import org.openstreetmap.josm.data.osm.Node; 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.plugins.tracer2.preferences.ServerParam; 25 26 import org.openstreetmap.josm.tools.Pair; … … 64 65 BBox bbox = new BBox(way); 65 66 bbox.addPrimitive(way, s_dMinDistance); 66 s_oWays = Main .getLayerManager().getEditDataSet().searchWays(bbox);67 s_oWays = MainApplication.getLayerManager().getEditDataSet().searchWays(bbox); 67 68 } 68 69 … … 76 77 BBox bbox = new BBox(way); 77 78 bbox.addPrimitive(way, s_dMinDistance); 78 s_oNodes = Main .getLayerManager().getEditDataSet().searchNodes(bbox);79 s_oNodes = MainApplication.getLayerManager().getEditDataSet().searchNodes(bbox); 79 80 } 80 81 … … 185 186 186 187 cmds2.addAll(connectTo()); 188 DataSet ds = MainApplication.getLayerManager().getEditDataSet(); 187 189 188 190 // add new Node … … 200 202 for (Node node : way.getNodes()) { 201 203 if (firstNode == null || firstNode != node) { 202 cmds.add(new AddCommand( node));204 cmds.add(new AddCommand(ds, node)); 203 205 } 204 206 if (firstNode == null) { … … 210 212 // add new way 211 213 if (bAddWay == true) { 212 cmds.add(new AddCommand( s_oWay));213 } 214 215 cmds.add(new ChangeCommand( s_oWayOld, trySplitWayByAnyNodes(s_oWay)));214 cmds.add(new AddCommand(ds, s_oWay)); 215 } 216 217 cmds.add(new ChangeCommand(ds, s_oWayOld, trySplitWayByAnyNodes(s_oWay))); 216 218 cmds.addAll(cmds2); 217 219 -
applications/editors/josm/plugins/tracer2/src/org/openstreetmap/josm/plugins/tracer2/TagValues.java
r32788 r33700 5 5 import java.util.List; 6 6 7 import org.openstreetmap.josm.Main; 8 import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionListItem; 7 import org.openstreetmap.josm.data.tagging.ac.AutoCompletionItem; 8 import org.openstreetmap.josm.gui.MainApplication; 9 import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionManager; 9 10 import org.openstreetmap.josm.plugins.tracer2.preferences.ServerParam; 10 11 … … 37 38 // get values 38 39 List<String> tagValues = new ArrayList<>(); 39 List<AutoCompletionListItem> values = Main.getLayerManager().getEditDataSet().getAutoCompletionManager().getValues(m_strTag); 40 for (AutoCompletionListItem i : values) { 40 for (AutoCompletionItem i : AutoCompletionManager.of(MainApplication.getLayerManager().getEditDataSet()).getTagValues(m_strTag)) { 41 41 tagValues.add(i.getValue()); 42 42 } -
applications/editors/josm/plugins/tracer2/src/org/openstreetmap/josm/plugins/tracer2/TracerAction.java
r32788 r33700 30 30 import org.openstreetmap.josm.data.osm.OsmPrimitive; 31 31 import org.openstreetmap.josm.data.osm.Way; 32 import org.openstreetmap.josm.gui.MapFrame; 32 import org.openstreetmap.josm.gui.MainApplication; 33 import org.openstreetmap.josm.gui.MapView; 33 34 import org.openstreetmap.josm.gui.PleaseWaitRunnable; 34 35 import org.openstreetmap.josm.gui.progress.ProgressMonitor; … … 39 40 import org.openstreetmap.josm.plugins.tracer2.server.GetVersion; 40 41 import org.openstreetmap.josm.tools.ImageProvider; 42 import org.openstreetmap.josm.tools.Logging; 41 43 import org.openstreetmap.josm.tools.Shortcut; 42 44 import org.xml.sax.SAXException; … … 56 58 TracerPlugin m_oPlugin; 57 59 58 TracerAction( MapFrame mapFrame) {60 TracerAction() { 59 61 super(tr("Tracer2"), "tracer2-sml", tr("Tracer2."), 60 62 Shortcut.registerShortcut("tools:tracer2", tr("Tool: {0}", tr("Tracer2")), KeyEvent.VK_T, Shortcut.DIRECT), 61 mapFrame,getCursor());63 getCursor()); 62 64 } 63 65 … … 122 124 } 123 125 super.enterMode(); 124 Main.map.mapView.setCursor(getCursor()); 125 Main.map.mapView.addMouseListener(this); 126 Main.map.mapView.addKeyListener(this); 126 MapView mapView = MainApplication.getMap().mapView; 127 mapView.setCursor(getCursor()); 128 mapView.addMouseListener(this); 129 mapView.addKeyListener(this); 127 130 } 128 131 … … 132 135 133 136 super.exitMode(); 134 Main.map.mapView.removeMouseListener(this); 135 Main.map.mapView.removeKeyListener(this); 137 MapView mapView = MainApplication.getMap().mapView; 138 mapView.removeMouseListener(this); 139 mapView.removeKeyListener(this); 136 140 } 137 141 … … 145 149 * Positional data 146 150 */ 147 final LatLon pos = Main .map.mapView.getLatLon(clickPoint.x, clickPoint.y);151 final LatLon pos = MainApplication.getMap().mapView.getLatLon(clickPoint.x, clickPoint.y); 148 152 149 153 try { … … 166 170 executeTraceThread.start(); 167 171 } catch (Exception e) { 168 e.printStackTrace();172 Logging.error(e); 169 173 } 170 174 } … … 350 354 @Override 351 355 public void mousePressed(MouseEvent e) { 352 if (!Main .map.mapView.isActiveLayerDrawable()) {356 if (!MainApplication.getMap().mapView.isActiveLayerDrawable()) { 353 357 return; 354 358 } … … 372 376 373 377 } 374 -
applications/editors/josm/plugins/tracer2/src/org/openstreetmap/josm/plugins/tracer2/TracerPlugin.java
r32788 r33700 4 4 import java.io.File; 5 5 6 import org.openstreetmap.josm. Main;6 import org.openstreetmap.josm.gui.MainApplication; 7 7 import org.openstreetmap.josm.gui.MainMenu; 8 8 import org.openstreetmap.josm.gui.preferences.PreferenceSetting; … … 20 20 public TracerPlugin(PluginInformation info) { 21 21 super(info); 22 MainMenu.add(Main .main.menu.moreToolsMenu, new TracerAction(Main.map));22 MainMenu.add(MainApplication.getMenu().moreToolsMenu, new TracerAction()); 23 23 24 24 s_oPlugin = this; -
applications/editors/josm/plugins/tracer2/src/org/openstreetmap/josm/plugins/tracer2/preferences/ServerParamList.java
r32788 r33700 11 11 import java.util.List; 12 12 13 import org.openstreetmap.josm. Main;13 import org.openstreetmap.josm.tools.Logging; 14 14 15 15 public class ServerParamList { … … 58 58 } 59 59 } catch (Exception e) { 60 Main.warn("Tracer2 warning: can't load file " + m_strFilename);60 Logging.warn("Tracer2 warning: can't load file " + m_strFilename); 61 61 } 62 62 } … … 68 68 } 69 69 } catch (Exception e) { 70 Main.warn("Tracer2 warning: can't save file " + m_strFilename);70 Logging.warn("Tracer2 warning: can't save file " + m_strFilename); 71 71 } 72 72 } -
applications/editors/josm/plugins/tracer2/src/org/openstreetmap/josm/plugins/tracer2/server/GetTrace.java
r32788 r33700 4 4 import java.util.ArrayList; 5 5 6 import org.openstreetmap.josm.Main;7 6 import org.openstreetmap.josm.data.coor.LatLon; 8 7 import org.openstreetmap.josm.plugins.tracer2.preferences.ServerParam; 8 import org.openstreetmap.josm.tools.Logging; 9 9 10 10 public class GetTrace extends Request { … … 68 68 } catch (Exception e) { 69 69 //m_listLatLon = new ArrayList<>(); 70 Main.warn(e);70 Logging.warn(e); 71 71 } 72 72 } … … 94 94 } catch (Exception e) { 95 95 //m_listLatLon = new ArrayList<>(); 96 Main.warn(e);96 Logging.warn(e); 97 97 } 98 98 } -
applications/editors/josm/plugins/tracer2/src/org/openstreetmap/josm/plugins/tracer2/server/GetVersion.java
r32788 r33700 2 2 package org.openstreetmap.josm.plugins.tracer2.server; 3 3 4 import org.openstreetmap.josm. Main;4 import org.openstreetmap.josm.tools.Logging; 5 5 6 6 public class GetVersion extends Request { … … 42 42 if (astrParts.length > 3) m_nVersionRevision = Integer.parseInt(astrParts[3]); 43 43 } catch (Exception e) { 44 Main.warn(e);44 Logging.warn(e); 45 45 } 46 46 }
Note:
See TracChangeset
for help on using the changeset viewer.