Changeset 34500 in osm for applications


Ignore:
Timestamp:
2018-08-18T03:40:22+02:00 (6 years ago)
Author:
donvip
Message:

update to JOSM 14153

Location:
applications/editors/josm/plugins/CustomizePublicTransportStop
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/CustomizePublicTransportStop/build.xml

    r34111 r34500  
    55    <property name="commit.message" value="Commit message"/>
    66    <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
    7     <property name="plugin.main.version" value="12840"/>
     7    <property name="plugin.main.version" value="14153"/>
    88
    99    <!-- ** include targets that all plugins have in common ** -->
  • applications/editors/josm/plugins/CustomizePublicTransportStop/src/ru/rodsoft/openstreetmap/josm/plugins/customizepublictransportstop/CreateNewStopPointOperation.java

    r34156 r34500  
    1010import java.util.TreeMap;
    1111
    12 import org.openstreetmap.josm.Main;
    1312import org.openstreetmap.josm.command.AddCommand;
    1413import org.openstreetmap.josm.command.ChangeCommand;
     14import org.openstreetmap.josm.data.UndoRedoHandler;
    1515import org.openstreetmap.josm.data.coor.EastNorth;
    1616import org.openstreetmap.josm.data.coor.LatLon;
     
    2020import org.openstreetmap.josm.data.osm.Way;
    2121import org.openstreetmap.josm.data.osm.WaySegment;
     22import org.openstreetmap.josm.data.projection.ProjectionRegistry;
    2223import org.openstreetmap.josm.gui.MainApplication;
    2324import org.openstreetmap.josm.gui.MapView;
     25import org.openstreetmap.josm.spi.preferences.Config;
    2426import org.openstreetmap.josm.tools.Geometry;
    2527
     
    187189
    188190        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);
    190192            snapDistanceSq *= snapDistanceSq;
    191193
    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)))) {
    193195                Node lastN = null;
    194196                int i = -2;
     
    256258
    257259                    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);
    260262                    Point2D lastN2D = mapView.getPoint2D(lastN);
    261263                    Point2D n2D = mapView.getPoint2D(n);
     
    280282     */
    281283    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));
    283285        List<Node> wayNodes = waySegment.way.getNodes();
    284286        wayNodes.add(waySegment.lowerIndex + 1, newStopNode);
    285287        Way newWay = new Way(waySegment.way);
    286288        newWay.setNodes(wayNodes);
    287         Main.main.undoRedo.add(new ChangeCommand(waySegment.way, newWay));
     289        UndoRedoHandler.getInstance().add(new ChangeCommand(waySegment.way, newWay));
    288290        return newStopNode;
    289291    }
  • applications/editors/josm/plugins/CustomizePublicTransportStop/src/ru/rodsoft/openstreetmap/josm/plugins/customizepublictransportstop/CustomizePublicTransportStopDialog.java

    r34157 r34500  
    11// License: GPL. For details, see LICENSE file.
    22package ru.rodsoft.openstreetmap.josm.plugins.customizepublictransportstop;
     3
     4import static org.openstreetmap.josm.tools.I18n.tr;
    35
    46import java.awt.Frame;
     
    2123import javax.swing.JTextField;
    2224
    23 import static org.openstreetmap.josm.tools.I18n.tr;
    24 
    25 import org.openstreetmap.josm.Main;
     25import org.openstreetmap.josm.gui.MainApplication;
    2626
    2727/**
     
    144144     */
    145145    public CustomizePublicTransportStopDialog() {
    146         Frame frame = JOptionPane.getFrameForComponent(Main.parent);
     146        Frame frame = JOptionPane.getFrameForComponent(MainApplication.getMainFrame());
    147147        jDialog = new JDialog(frame, tr(STOP_CUSTOMIZING_DIALOG_CAPTION), false);
    148148        JPanel contentPane = createContentPane();
  • applications/editors/josm/plugins/CustomizePublicTransportStop/src/ru/rodsoft/openstreetmap/josm/plugins/customizepublictransportstop/CustomizeStopAreaOperation.java

    r34156 r34500  
    22package ru.rodsoft.openstreetmap.josm.plugins.customizepublictransportstop;
    33
     4import static org.openstreetmap.josm.tools.I18n.tr;
     5
    46import java.util.ArrayList;
    57import java.util.List;
    68
    7 import static org.openstreetmap.josm.tools.I18n.tr;
    8 
    9 import org.openstreetmap.josm.Main;
    109import org.openstreetmap.josm.command.AddCommand;
    1110import org.openstreetmap.josm.command.ChangeCommand;
     
    1312import org.openstreetmap.josm.command.Command;
    1413import org.openstreetmap.josm.command.SequenceCommand;
     14import org.openstreetmap.josm.data.UndoRedoHandler;
    1515import org.openstreetmap.josm.data.coor.LatLon;
    1616import org.openstreetmap.josm.data.osm.DataSet;
     
    276276            newRelation.addMember(new RelationMember("", otherMember));
    277277        }
    278         Main.main.undoRedo.add(new AddCommand(MainApplication.getLayerManager().getEditDataSet(), newRelation));
     278        UndoRedoHandler.getInstance().add(new AddCommand(MainApplication.getLayerManager().getEditDataSet(), newRelation));
    279279        commands = generalTagAssign(newRelation, commands, stopArea);
    280280        commands = assignTag(commands, newRelation, OSMTags.TYPE_TAG, OSMTags.PUBLIC_TRANSPORT_TAG);
     
    465465                Node newNode = new Node();
    466466                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));
    469469                commands = assignTag(commands, newNode, tag, tagValue);
    470470                stopArea.otherMembers.add(newNode);
     
    571571        if (commands != null && !commands.isEmpty())
    572572            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));
    574574                return stopArea;
    575575            } catch (Exception ex) {
  • applications/editors/josm/plugins/CustomizePublicTransportStop/src/ru/rodsoft/openstreetmap/josm/plugins/customizepublictransportstop/MessageBox.java

    r34156 r34500  
    22package ru.rodsoft.openstreetmap.josm.plugins.customizepublictransportstop;
    33
     4import java.awt.Component;
     5
    46import javax.swing.JOptionPane;
    5 import java.awt.Component;
    67
    78/**
Note: See TracChangeset for help on using the changeset viewer.