Changeset 18417 in osm


Ignore:
Timestamp:
2009-11-02T08:58:53+01:00 (15 years ago)
Author:
jttt
Message:

Replace Dataset.nodes with getNodes(), etc

Location:
applications/editors/josm/plugins
Files:
6 edited

Legend:

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

    r18293 r18417  
    2626                <attribute name="Plugin-Date" value="${version.entry.commit.date}"/>
    2727                <attribute name="Plugin-Description" value="Launches FireFox to display the current visible screen as a nice SVG image."/>
    28                 <attribute name="Plugin-Mainversion" value="2327"/>
     28                <attribute name="Plugin-Mainversion" value="2381"/>
    2929                <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
    3030            </manifest>
  • applications/editors/josm/plugins/osmarender/src/org/openstreetmap/josm/plugins/osmarender/OsmarenderPlugin.java

    r18293 r18417  
    5656            CollectBackReferencesVisitor backRefsV = new CollectBackReferencesVisitor(Main.main.getCurrentDataSet(), true);
    5757            DataSet fromDataSet = new DataSet();
    58             for (Node n : Main.main.getCurrentDataSet().nodes) {
     58            for (Node n : Main.main.getCurrentDataSet().getNodes()) {
    5959                if (n.isUsable() && n.getCoor().isWithin(b)) {
    60                     fromDataSet.nodes.add(n);
     60                    fromDataSet.addPrimitive(n);
    6161                    n.visit(backRefsV);
    6262                }
  • applications/editors/josm/plugins/remotecontrol/build.xml

    r18295 r18417  
    2626                <attribute name="Plugin-Description" value="Let other applications send commands to JOSM."/>
    2727                <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/index.php/JOSM/Plugins/RemoteControl"/>
    28                 <attribute name="Plugin-Mainversion" value="2327"/>
     28                <attribute name="Plugin-Mainversion" value="2381"/>
    2929                <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
    3030            </manifest>
  • applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/RequestProcessor.java

    r18302 r18417  
    3737import org.openstreetmap.josm.data.osm.Way;
    3838import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor;
    39 import org.openstreetmap.josm.gui.progress.PleaseWaitProgressMonitor;
    4039
    4140/**
     
    167166                        maxlon = downloadBounds.getMaxX();
    168167                    }
    169                     Future<?> future = osmTask.download(false /*no new layer*/, new Bounds(minlat,minlon,maxlat,maxlon), null /* let the task manage the progress monitor */);                   
    170                     Main.worker.submit(new PostDownloadHandler(osmTask, future));                   
     168                    Future<?> future = osmTask.download(false /*no new layer*/, new Bounds(minlat,minlon,maxlat,maxlon), null /* let the task manage the progress monitor */);
     169                    Main.worker.submit(new PostDownloadHandler(osmTask, future));
    171170                } catch (AlreadyLoadedException ex) {
    172171                    System.out.println("RemoteControl: no download necessary");
     
    199198                                }
    200199                            }
    201                             for (Way w : Main.main.getCurrentDataSet().ways) if (ways.contains(w.getId())) newSel.add(w);
    202                             for (Node n : Main.main.getCurrentDataSet().nodes) if (nodes.contains(n.getId())) newSel.add(n);
    203                             for (Relation r : Main.main.getCurrentDataSet().relations) if (relations.contains(r.getId())) newSel.add(r);
     200                            for (Way w : Main.main.getCurrentDataSet().getWays()) if (ways.contains(w.getId())) newSel.add(w);
     201                            for (Node n : Main.main.getCurrentDataSet().getNodes()) if (nodes.contains(n.getId())) newSel.add(n);
     202                            for (Relation r : Main.main.getCurrentDataSet().getRelations()) if (relations.contains(r.getId())) newSel.add(r);
    204203                            Main.main.getCurrentDataSet().setSelected(newSel);
    205204                            if (Main.pref.getBoolean("remotecontrol.permission.change-viewport", true))
     
    291290     * Adds a node, reacts to the GET /add_node?lon=...&amp;lat=... request.
    292291     * @param args
    293      * @param out 
    294      * @throws IOException 
     292     * @param out
     293     * @throws IOException
    295294     */
    296295    private void addNode(HashMap<String, String> args, Writer out) throws IOException {
     
    299298            return;
    300299        }
    301        
     300
    302301        // Parse the arguments
    303302        double lat = Double.parseDouble(args.get("lat"));
    304303        double lon = Double.parseDouble(args.get("lon"));
    305304        System.out.println("Adding node at (" + lat + ", " + lon + ")");
    306        
     305
    307306        // Create a new node
    308307        LatLon ll = new LatLon(lat, lon);
    309308        Node nnew = new Node(ll);
    310        
     309
    311310        // Now execute the commands to add this node.
    312311        Main.main.undoRedo.add(new AddCommand(nnew));
    313312        Main.main.getCurrentDataSet().setSelected(nnew);
    314313        Main.map.mapView.repaint();
    315        
     314
    316315    }
    317316
  • applications/editors/josm/plugins/waydownloader/build.xml

    r18300 r18417  
    9191                <attribute name="Plugin-Description" value="Easy downloading along a long set of interconnected ways"/>
    9292                <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/wiki/JOSM/Plugins/WayDownloaderPlugin"/>
    93                 <attribute name="Plugin-Mainversion" value="2327"/>
     93                <attribute name="Plugin-Mainversion" value="2381"/>
    9494                <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
    9595            </manifest>
  • applications/editors/josm/plugins/waydownloader/src/org/openstreetmap/josm/plugins/waydownloader/WayDownloaderPlugin.java

    r18300 r18417  
    102102                        DownloadOsmTask downloadTask = new DownloadOsmTask();
    103103                        final PleaseWaitProgressMonitor monitor = new PleaseWaitProgressMonitor();
    104                         final Future<?> future = downloadTask.download( 
     104                        final Future<?> future = downloadTask.download(
    105105                                        false /* no new layer */,
    106106                                        new Bounds(
    107                                                         selectedNode.getCoor().lat()- latbuffer, 
    108                                                         selectedNode.getCoor().lon()- lonbuffer, 
    109                                                         selectedNode.getCoor().lat()+ latbuffer, 
     107                                                        selectedNode.getCoor().lat()- latbuffer,
     108                                                        selectedNode.getCoor().lon()- lonbuffer,
     109                                                        selectedNode.getCoor().lat()+ latbuffer,
    110110                                                        selectedNode.getCoor().lon()+ lonbuffer
    111                                         ), 
     111                                        ),
    112112                                        monitor
    113113                        );
     
    200200    /** See if there's another node at the same coordinates. If so return it. Otherwise null */
    201201    private Node duplicateNode() {
    202         for (Node onNode:Main.main.getCurrentDataSet().nodes) {
     202        for (Node onNode:Main.main.getCurrentDataSet().getNodes()) {
    203203            if (!onNode.equals(this.selectedNode)
    204204                    && !onNode.incomplete
     
    223223
    224224        //loop through every way
    225         for (Way onWay:Main.main.getCurrentDataSet().ways) {
     225        for (Way onWay:Main.main.getCurrentDataSet().getWays()) {
    226226            if (onWay.getNodesCount() >= 2) {
    227227                if (onWay.isFirstLastNode(selectedNode)) {
Note: See TracChangeset for help on using the changeset viewer.