Changeset 16631 in osm for applications/editors


Ignore:
Timestamp:
2009-07-21T22:15:30+02:00 (15 years ago)
Author:
jttt
Message:

Make it work without Main.ds

Location:
applications/editors/josm/plugins/waydownloader
Files:
2 edited

Legend:

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

    r16590 r16631  
    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="1813"/>
     93                <attribute name="Plugin-Mainversion" value="1815"/>
    9494                <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
    9595            </manifest>
  • applications/editors/josm/plugins/waydownloader/src/WayDownloaderPlugin.java

    r16590 r16631  
    6060
    6161            selectedNode = null;
    62             Collection<OsmPrimitive> selection = Main.ds.getSelectedNodes();
     62            Collection<OsmPrimitive> selection = Main.main.getCurrentDataSet().getSelectedNodes();
    6363
    6464            if (selection.size()==0) {
    65                 selection = Main.ds.getSelectedWays();
     65                selection = Main.main.getCurrentDataSet().getSelectedWays();
    6666                if (!workFromWaySelection(selection)) {
    6767                    errMsg = tr("Select a starting node on the end of a way");
    6868                }
    69                 selection = Main.ds.getSelectedNodes();
     69                selection = Main.main.getCurrentDataSet().getSelectedNodes();
    7070            }
    7171
     
    138138                        LinkedList<Node> dupeNodes = new LinkedList<Node>();
    139139                        dupeNodes.add(dupeNode);
    140                         MergeNodesAction.mergeNodes(dupeNodes, selectedNode);
     140                        new MergeNodesAction().mergeNodes(dupeNodes, selectedNode);
    141141
    142142                        connectedWays = findConnectedWays(); //Carry on
     
    166166
    167167                //Select the next node
    168                 Main.ds.setSelected(nextNode);
     168                Main.main.getCurrentDataSet().setSelected(nextNode);
    169169
    170170                Main.map.mapView.zoomTo(nextNode.getEastNorth());
     
    177177    /** See if there's another node at the same coordinates. If so return it. Otherwise null */
    178178    private Node duplicateNode() {
    179         for (Node onNode:Main.ds.nodes) {
     179        for (Node onNode:Main.main.getCurrentDataSet().nodes) {
    180180            if (!onNode.equals(this.selectedNode)
    181181                    && onNode.getCoor().lat()==selectedNode.getCoor().lat()
     
    199199
    200200        //loop through every way
    201         for (Way onWay:Main.ds.ways) {
     201        for (Way onWay:Main.main.getCurrentDataSet().ways) {
    202202            Object[] nodes = onWay.nodes.toArray();
    203203            if (nodes.length<2) {
     
    236236            }
    237237        }
    238         Main.ds.setSelected(selectedNode);
     238        Main.main.getCurrentDataSet().setSelected(selectedNode);
    239239        return true;
    240240    }
    241241
    242242    private boolean isDownloaded(Node node) {
    243         for (DataSource datasource:Main.ds.dataSources) {
     243        for (DataSource datasource:Main.main.getCurrentDataSet().dataSources) {
    244244            Bounds bounds = datasource.bounds;
    245245
Note: See TracChangeset for help on using the changeset viewer.