Changeset 34500 in osm for applications
- Timestamp:
- 2018-08-18T03:40:22+02:00 (6 years ago)
- Location:
- applications/editors/josm/plugins/CustomizePublicTransportStop
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/CustomizePublicTransportStop/build.xml
r34111 r34500 5 5 <property name="commit.message" value="Commit message"/> 6 6 <!-- enter the *lowest* JOSM version this plugin is currently compatible with --> 7 <property name="plugin.main.version" value="1 2840"/>7 <property name="plugin.main.version" value="14153"/> 8 8 9 9 <!-- ** include targets that all plugins have in common ** --> -
applications/editors/josm/plugins/CustomizePublicTransportStop/src/ru/rodsoft/openstreetmap/josm/plugins/customizepublictransportstop/CreateNewStopPointOperation.java
r34156 r34500 10 10 import java.util.TreeMap; 11 11 12 import org.openstreetmap.josm.Main;13 12 import org.openstreetmap.josm.command.AddCommand; 14 13 import org.openstreetmap.josm.command.ChangeCommand; 14 import org.openstreetmap.josm.data.UndoRedoHandler; 15 15 import org.openstreetmap.josm.data.coor.EastNorth; 16 16 import org.openstreetmap.josm.data.coor.LatLon; … … 20 20 import org.openstreetmap.josm.data.osm.Way; 21 21 import org.openstreetmap.josm.data.osm.WaySegment; 22 import org.openstreetmap.josm.data.projection.ProjectionRegistry; 22 23 import org.openstreetmap.josm.gui.MainApplication; 23 24 import org.openstreetmap.josm.gui.MapView; 25 import org.openstreetmap.josm.spi.preferences.Config; 24 26 import org.openstreetmap.josm.tools.Geometry; 25 27 … … 187 189 188 190 if (ds != null) { 189 double snapDistanceSq = Main.pref.getInt("mappaint.segment.snap-distance", 200);191 double snapDistanceSq = Config.getPref().getInt("mappaint.segment.snap-distance", 200); 190 192 snapDistanceSq *= snapDistanceSq; 191 193 192 for (Way w : ds.searchWays(getBBox(p, Main.pref.getInt("mappaint.segment.snap-distance", 200)))) {194 for (Way w : ds.searchWays(getBBox(p, Config.getPref().getInt("mappaint.segment.snap-distance", 200)))) { 193 195 Node lastN = null; 194 196 int i = -2; … … 256 258 257 259 EastNorth newPosition = Geometry.closestPointToSegment(n.getEastNorth(), lastN.getEastNorth(), 258 Main.getProjection().latlon2eastNorth(platformCoord));259 LatLon newNodePosition = Main.getProjection().eastNorth2latlon(newPosition);260 ProjectionRegistry.getProjection().latlon2eastNorth(platformCoord)); 261 LatLon newNodePosition = ProjectionRegistry.getProjection().eastNorth2latlon(newPosition); 260 262 Point2D lastN2D = mapView.getPoint2D(lastN); 261 263 Point2D n2D = mapView.getPoint2D(n); … … 280 282 */ 281 283 protected Node createNodeOnWay(Node newStopNode, WaySegment waySegment) { 282 Main.main.undoRedo.add(new AddCommand(MainApplication.getLayerManager().getEditDataSet(), newStopNode));284 UndoRedoHandler.getInstance().add(new AddCommand(MainApplication.getLayerManager().getEditDataSet(), newStopNode)); 283 285 List<Node> wayNodes = waySegment.way.getNodes(); 284 286 wayNodes.add(waySegment.lowerIndex + 1, newStopNode); 285 287 Way newWay = new Way(waySegment.way); 286 288 newWay.setNodes(wayNodes); 287 Main.main.undoRedo.add(new ChangeCommand(waySegment.way, newWay));289 UndoRedoHandler.getInstance().add(new ChangeCommand(waySegment.way, newWay)); 288 290 return newStopNode; 289 291 } -
applications/editors/josm/plugins/CustomizePublicTransportStop/src/ru/rodsoft/openstreetmap/josm/plugins/customizepublictransportstop/CustomizePublicTransportStopDialog.java
r34157 r34500 1 1 // License: GPL. For details, see LICENSE file. 2 2 package ru.rodsoft.openstreetmap.josm.plugins.customizepublictransportstop; 3 4 import static org.openstreetmap.josm.tools.I18n.tr; 3 5 4 6 import java.awt.Frame; … … 21 23 import javax.swing.JTextField; 22 24 23 import static org.openstreetmap.josm.tools.I18n.tr; 24 25 import org.openstreetmap.josm.Main; 25 import org.openstreetmap.josm.gui.MainApplication; 26 26 27 27 /** … … 144 144 */ 145 145 public CustomizePublicTransportStopDialog() { 146 Frame frame = JOptionPane.getFrameForComponent(Main .parent);146 Frame frame = JOptionPane.getFrameForComponent(MainApplication.getMainFrame()); 147 147 jDialog = new JDialog(frame, tr(STOP_CUSTOMIZING_DIALOG_CAPTION), false); 148 148 JPanel contentPane = createContentPane(); -
applications/editors/josm/plugins/CustomizePublicTransportStop/src/ru/rodsoft/openstreetmap/josm/plugins/customizepublictransportstop/CustomizeStopAreaOperation.java
r34156 r34500 2 2 package ru.rodsoft.openstreetmap.josm.plugins.customizepublictransportstop; 3 3 4 import static org.openstreetmap.josm.tools.I18n.tr; 5 4 6 import java.util.ArrayList; 5 7 import java.util.List; 6 8 7 import static org.openstreetmap.josm.tools.I18n.tr;8 9 import org.openstreetmap.josm.Main;10 9 import org.openstreetmap.josm.command.AddCommand; 11 10 import org.openstreetmap.josm.command.ChangeCommand; … … 13 12 import org.openstreetmap.josm.command.Command; 14 13 import org.openstreetmap.josm.command.SequenceCommand; 14 import org.openstreetmap.josm.data.UndoRedoHandler; 15 15 import org.openstreetmap.josm.data.coor.LatLon; 16 16 import org.openstreetmap.josm.data.osm.DataSet; … … 276 276 newRelation.addMember(new RelationMember("", otherMember)); 277 277 } 278 Main.main.undoRedo.add(new AddCommand(MainApplication.getLayerManager().getEditDataSet(), newRelation));278 UndoRedoHandler.getInstance().add(new AddCommand(MainApplication.getLayerManager().getEditDataSet(), newRelation)); 279 279 commands = generalTagAssign(newRelation, commands, stopArea); 280 280 commands = assignTag(commands, newRelation, OSMTags.TYPE_TAG, OSMTags.PUBLIC_TRANSPORT_TAG); … … 465 465 Node newNode = new Node(); 466 466 newNode.setCoor(centerOfPlatform); 467 Main.main.undoRedo.add(new AddCommand(MainApplication.getLayerManager().getEditDataSet(), newNode));468 Main.main.undoRedo.add(new ChangePropertyCommand(newNode, tag, tagValue));467 UndoRedoHandler.getInstance().add(new AddCommand(MainApplication.getLayerManager().getEditDataSet(), newNode)); 468 UndoRedoHandler.getInstance().add(new ChangePropertyCommand(newNode, tag, tagValue)); 469 469 commands = assignTag(commands, newNode, tag, tagValue); 470 470 stopArea.otherMembers.add(newNode); … … 571 571 if (commands != null && !commands.isEmpty()) 572 572 try { 573 Main.main.undoRedo.add(new SequenceCommand(tr(TAG_ASSIGN_COMMAND_NAME), commands));573 UndoRedoHandler.getInstance().add(new SequenceCommand(tr(TAG_ASSIGN_COMMAND_NAME), commands)); 574 574 return stopArea; 575 575 } catch (Exception ex) { -
applications/editors/josm/plugins/CustomizePublicTransportStop/src/ru/rodsoft/openstreetmap/josm/plugins/customizepublictransportstop/MessageBox.java
r34156 r34500 2 2 package ru.rodsoft.openstreetmap.josm.plugins.customizepublictransportstop; 3 3 4 import java.awt.Component; 5 4 6 import javax.swing.JOptionPane; 5 import java.awt.Component;6 7 7 8 /**
Note:
See TracChangeset
for help on using the changeset viewer.