Changeset 35760 in osm


Ignore:
Timestamp:
2021-05-17T20:57:47+02:00 (3 years ago)
Author:
taylor.smock
Message:

CustomizePublicTransportStop: recompile for compatibility with JOSM r17896

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

Legend:

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

    r35750 r35760  
    33
    44    <!-- enter the SVN commit message -->
    5     <property name="commit.message" value="CustomizePublicTransportStop: recompile for compatibility with JOSM r17867"/>
     5    <property name="commit.message" value="CustomizePublicTransportStop: recompile for compatibility with JOSM r17896"/>
    66    <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
    7     <property name="plugin.main.version" value="17867"/>
     7    <property name="plugin.main.version" value="17896"/>
    88
    99    <property name="plugin.author" value="Rodion Scherbakov"/>
  • applications/editors/josm/plugins/CustomizePublicTransportStop/src/org/openstreetmap/josm/plugins/customizepublictransportstop/CreateNewStopPointOperation.java

    r34501 r35760  
    1717import org.openstreetmap.josm.data.osm.BBox;
    1818import org.openstreetmap.josm.data.osm.DataSet;
     19import org.openstreetmap.josm.data.osm.IWaySegment;
    1920import org.openstreetmap.josm.data.osm.Node;
    2021import org.openstreetmap.josm.data.osm.Way;
     
    184185     *         their associated way segments to point p.
    185186     */
    186     private Map<Double, List<WaySegment>> getNearestWaySegmentsImpl(Point p) {
    187         Map<Double, List<WaySegment>> nearestMap = new TreeMap<>();
     187    private Map<Double, List<IWaySegment<Node, Way>>> getNearestWaySegmentsImpl(Point p) {
     188        Map<Double, List<IWaySegment<Node, Way>>> nearestMap = new TreeMap<>();
    188189        DataSet ds = getCurrentDataSet();
    189190
     
    222223
    223224                    if (perDistSq < snapDistanceSq && a < c + snapDistanceSq && b < c + snapDistanceSq) {
    224                         List<WaySegment> wslist;
     225                        List<IWaySegment<Node, Way>> wslist;
    225226                        if (nearestMap.containsKey(perDistSq)) {
    226227                            wslist = nearestMap.get(perDistSq);
     
    229230                            nearestMap.put(perDistSq, wslist);
    230231                        }
    231                         wslist.add(new WaySegment(w, i));
     232                        wslist.add(new IWaySegment<>(w, i));
    232233                    }
    233234
     
    250251        MapView mapView = MainApplication.getMap().mapView;
    251252        Point p = mapView.getPoint(platformCoord);
    252         Map<Double, List<WaySegment>> dist_waySegments = getNearestWaySegmentsImpl(p);
    253         for (Map.Entry<Double, List<WaySegment>> entry : dist_waySegments.entrySet()) {
    254             for (WaySegment waySegment : entry.getValue()) {
    255                 if (testWay(waySegment.way, stopArea)) {
     253        Map<Double, List<IWaySegment<Node, Way>>> dist_waySegments = getNearestWaySegmentsImpl(p);
     254        for (Map.Entry<Double, List<IWaySegment<Node, Way>>> entry : dist_waySegments.entrySet()) {
     255            for (IWaySegment<Node, Way> waySegment : entry.getValue()) {
     256                if (testWay(waySegment.getWay(), stopArea)) {
    256257                    Node n = waySegment.getFirstNode();
    257258                    Node lastN = waySegment.getSecondNode();
     
    281282     * @return Stop position node
    282283     */
    283     protected Node createNodeOnWay(Node newStopNode, WaySegment waySegment) {
     284    protected Node createNodeOnWay(Node newStopNode, IWaySegment<Node, Way> waySegment) {
    284285        UndoRedoHandler.getInstance().add(new AddCommand(MainApplication.getLayerManager().getEditDataSet(), newStopNode));
    285         List<Node> wayNodes = waySegment.way.getNodes();
    286         wayNodes.add(waySegment.lowerIndex + 1, newStopNode);
    287         Way newWay = new Way(waySegment.way);
     286        List<Node> wayNodes = waySegment.getWay().getNodes();
     287        wayNodes.add(waySegment.getUpperIndex(), newStopNode);
     288        Way newWay = new Way(waySegment.getWay());
    288289        newWay.setNodes(wayNodes);
    289         UndoRedoHandler.getInstance().add(new ChangeCommand(waySegment.way, newWay));
     290        UndoRedoHandler.getInstance().add(new ChangeCommand(waySegment.getWay(), newWay));
    290291        return newStopNode;
    291292    }
  • applications/editors/josm/plugins/CustomizePublicTransportStop/src/org/openstreetmap/josm/plugins/customizepublictransportstop/NearestWaySegment.java

    r34501 r35760  
    22package org.openstreetmap.josm.plugins.customizepublictransportstop;
    33
     4import org.openstreetmap.josm.data.osm.IWaySegment;
    45import org.openstreetmap.josm.data.osm.Node;
     6import org.openstreetmap.josm.data.osm.Way;
    57import org.openstreetmap.josm.data.osm.WaySegment;
    68
     
    1820     * Way segment
    1921     */
    20     public WaySegment waySegment;
     22    public IWaySegment<Node, Way> waySegment;
    2123    /**
    2224     * Node
     
    3133     * @param newNode Node
    3234     */
    33     public NearestWaySegment(Double distanceSq, WaySegment waySegment, Node newNode) {
     35    public NearestWaySegment(Double distanceSq, IWaySegment<Node, Way> waySegment, Node newNode) {
    3436        this.distanceSq = distanceSq;
    3537        this.waySegment = waySegment;
Note: See TracChangeset for help on using the changeset viewer.