Changeset 32452 in osm for applications/editors


Ignore:
Timestamp:
2016-06-29T23:57:30+02:00 (9 years ago)
Author:
donvip
Message:

remove calls to deprecated methods

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

Legend:

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

    r31923 r32452  
    55    <property name="commit.message" value="Changed the constructor signature of the plugin main class"/>
    66    <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
    7     <property name="plugin.main.version" value="7575"/>
     7    <property name="plugin.main.version" value="10353"/>
    88
    99    <property name="plugin.author" value="Harry Wood"/>
  • applications/editors/josm/plugins/waydownloader/src/org/openstreetmap/josm/plugins/waydownloader/WayDownloaderPlugin.java

    r30737 r32452  
    6767        public void actionPerformed(ActionEvent e) {
    6868            selectedNode = null;
    69             Collection<Node> selection = Main.main.getCurrentDataSet().getSelectedNodes();
     69            DataSet ds = Main.getLayerManager().getEditDataSet();
     70            Collection<Node> selection = ds.getSelectedNodes();
    7071            if (selection.isEmpty()) {
    71                 Collection<Way> selWays = Main.main.getCurrentDataSet().getSelectedWays();
     72                Collection<Way> selWays = ds.getSelectedWays();
    7273                if (!workFromWaySelection(selWays)) {
    7374                    showWarningMessage(tr("<html>Neither a node nor a way with an endpoint outside of the<br>current download areas is selected.<br>Select a node on the start or end of a way or an entire way first.</html>"));
    7475                    return;
    7576                }
    76                 selection = Main.main.getCurrentDataSet().getSelectedNodes();
     77                selection = ds.getSelectedNodes();
    7778            }
    7879
     
    176177                        return;
    177178                    Command cmd = MergeNodesAction.mergeNodes(
    178                             Main.main.getEditLayer(),
     179                            Main.getLayerManager().getEditLayer(),
    179180                            Collections.singletonList(dupeNode),
    180181                            selectedNode
     
    182183                    if (cmd != null) {
    183184                        Main.main.undoRedo.add(cmd);
    184                         Main.main.getEditLayer().data.setSelected(selectedNode);
     185                        Main.getLayerManager().getEditLayer().data.setSelected(selectedNode);
    185186                    }
    186187                    connectedWays = findConnectedWays(selectedNode);
     
    213214
    214215                //Select the next node
    215                 Main.main.getCurrentDataSet().setSelected(nextNode);
     216                Main.getLayerManager().getEditDataSet().setSelected(nextNode);
    216217                Main.map.mapView.zoomTo(nextNode.getEastNorth());
    217218            }
     
    220221        @Override
    221222        protected void updateEnabledState() {
    222             setEnabled(getEditLayer() != null);
     223            setEnabled(getLayerManager().getEditLayer() != null);
    223224        }
    224225
     
    236237     */
    237238    private Node findDuplicateNode(Node referenceNode) {
    238         DataSet ds = Main.main.getCurrentDataSet();
     239        DataSet ds = Main.getLayerManager().getEditDataSet();
    239240        List<Node> candidates = ds.searchNodes(new Bounds(referenceNode.getCoor(), 0.0003, 0.0005).toBBox());
    240241        for (Node candidate: candidates) {
     
    289290            if (isDownloaded(selectedNode)) return false;
    290291        }
    291         Main.main.getCurrentDataSet().setSelected(selectedNode);
     292        Main.getLayerManager().getEditDataSet().setSelected(selectedNode);
    292293        return true;
    293294    }
    294295
    295296    private boolean isDownloaded(Node node) {
    296         for (DataSource datasource:Main.main.getCurrentDataSet().dataSources) {
     297        for (DataSource datasource : Main.getLayerManager().getEditDataSet().dataSources) {
    297298            Bounds bounds = datasource.bounds;
    298299            if (bounds != null && bounds.contains(node.getCoor())) return true;
Note: See TracChangeset for help on using the changeset viewer.