Ignore:
Timestamp:
2017-08-27T22:22:31+02:00 (7 years ago)
Author:
donvip
Message:

update to JOSM 12678

Location:
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2
Files:
27 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/UtilsPlugin2.java

    r33522 r33579  
    55import javax.swing.JMenuItem;
    66
    7 import org.openstreetmap.josm.Main;
    87import org.openstreetmap.josm.data.osm.search.SearchCompiler;
     8import org.openstreetmap.josm.gui.MainApplication;
    99import org.openstreetmap.josm.gui.MainMenu;
    1010import org.openstreetmap.josm.gui.MapFrame;
     
    9393        instance = this;
    9494
    95         JMenu editMenu = Main.main.menu.editMenu;
    96         JMenu toolsMenu = Main.main.menu.moreToolsMenu;
    97         JMenu dataMenu = Main.main.menu.dataMenu;
    98         JMenu selectionMenu = Main.main.menu.selectionMenu;
     95        JMenu editMenu = MainApplication.getMenu().editMenu;
     96        JMenu toolsMenu = MainApplication.getMenu().moreToolsMenu;
     97        JMenu dataMenu = MainApplication.getMenu().dataMenu;
     98        JMenu selectionMenu = MainApplication.getMenu().selectionMenu;
    9999
    100         copyTags = MainMenu.addAfter(editMenu, new CopyTagsAction(), false, Main.main.menu.copy);
     100        copyTags = MainMenu.addAfter(editMenu, new CopyTagsAction(), false, MainApplication.getMenu().copy);
    101101
    102102        addIntersections = MainMenu.add(toolsMenu, new AddIntersectionsAction());
  • applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/AddIntersectionsAction.java

    r32410 r33579  
    1515import javax.swing.JOptionPane;
    1616
    17 import org.openstreetmap.josm.Main;
    1817import org.openstreetmap.josm.actions.JosmAction;
    1918import org.openstreetmap.josm.command.AddCommand;
     
    2322import org.openstreetmap.josm.data.osm.OsmPrimitive;
    2423import org.openstreetmap.josm.data.osm.Way;
     24import org.openstreetmap.josm.gui.MainApplication;
    2525import org.openstreetmap.josm.gui.Notification;
    2626import org.openstreetmap.josm.tools.Geometry;
     
    5656        Geometry.addIntersections(ways, false, cmds);
    5757        if (!cmds.isEmpty()) {
    58             Main.main.undoRedo.add(new SequenceCommand(tr("Add nodes at intersections"), cmds));
     58            MainApplication.undoRedo.add(new SequenceCommand(tr("Add nodes at intersections"), cmds));
    5959            Set<Node> nodes = new HashSet<>(10);
    6060            // find and select newly added nodes
  • applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/AlignWayNodesAction.java

    r33328 r33579  
    1515import javax.swing.JOptionPane;
    1616
    17 import org.openstreetmap.josm.Main;
    1817import org.openstreetmap.josm.actions.JosmAction;
    1918import org.openstreetmap.josm.command.Command;
     
    2322import org.openstreetmap.josm.data.osm.OsmPrimitive;
    2423import org.openstreetmap.josm.data.osm.Way;
     24import org.openstreetmap.josm.gui.MainApplication;
    2525import org.openstreetmap.josm.gui.Notification;
    2626import org.openstreetmap.josm.tools.Shortcut;
     
    128128
    129129        if (!commands.isEmpty())
    130             Main.main.undoRedo.add(new SequenceCommand(TITLE, commands));
     130            MainApplication.undoRedo.add(new SequenceCommand(TITLE, commands));
    131131    }
    132132
  • applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/ExtractPointAction.java

    r32410 r33579  
    2424import org.openstreetmap.josm.data.osm.OsmPrimitive;
    2525import org.openstreetmap.josm.data.osm.Way;
     26import org.openstreetmap.josm.gui.MainApplication;
    2627import org.openstreetmap.josm.gui.Notification;
    2728import org.openstreetmap.josm.tools.Shortcut;
     
    5657        List<Command> cmds = new LinkedList<>();
    5758
    58         Point p = Main.map.mapView.getMousePosition();
     59        Point p = MainApplication.getMap().mapView.getMousePosition();
    5960        if (p != null)
    60             cmds.add(new MoveCommand(nd, Main.map.mapView.getLatLon(p.x, p.y)));
     61            cmds.add(new MoveCommand(nd, MainApplication.getMap().mapView.getLatLon(p.x, p.y)));
    6162        List<OsmPrimitive> refs = nd.getReferrers();
    6263        cmds.add(new AddCommand(ndCopy));
     
    7172            }
    7273        }
    73         if (cmds.size() > 1) Main.main.undoRedo.add(new SequenceCommand(tr("Extract node from line"), cmds));
     74        if (cmds.size() > 1) MainApplication.undoRedo.add(new SequenceCommand(tr("Extract node from line"), cmds));
    7475    }
    7576
  • applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/PasteRelationsAction.java

    r33123 r33579  
    2424import org.openstreetmap.josm.data.osm.Relation;
    2525import org.openstreetmap.josm.data.osm.RelationMember;
     26import org.openstreetmap.josm.gui.MainApplication;
    2627import org.openstreetmap.josm.gui.datatransfer.ClipboardUtils;
    2728import org.openstreetmap.josm.gui.datatransfer.data.PrimitiveTransferData;
     29import org.openstreetmap.josm.tools.Logging;
    2830import org.openstreetmap.josm.tools.Shortcut;
    2931
     
    5355            data = ((PrimitiveTransferData) ClipboardUtils.getClipboard().getData(PrimitiveTransferData.DATA_FLAVOR)).getDirectlyAdded();
    5456        } catch (UnsupportedFlavorException | IOException ex) {
    55             Main.warn(ex);
     57            Logging.warn(ex);
    5658        }
    5759        for (PrimitiveData pdata : data) {
     
    99101
    100102        if (!commands.isEmpty())
    101             Main.main.undoRedo.add(new SequenceCommand(TITLE, commands));
     103            MainApplication.undoRedo.add(new SequenceCommand(TITLE, commands));
    102104    }
    103105
     
    113115                    && ClipboardUtils.getClipboard().isDataFlavorAvailable(PrimitiveTransferData.DATA_FLAVOR));
    114116        } catch (IllegalStateException e) {
    115             Main.warn(e);
     117            Logging.warn(e);
    116118        } catch (NullPointerException e) {
    117119            // JDK-6322854: On Linux/X11, NPE can happen for unknown reasons, on all versions of Java
    118             Main.error(e);
     120            Logging.error(e);
    119121        }
    120122    }
  • applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/SplitObjectAction.java

    r32410 r33579  
    1818import javax.swing.JOptionPane;
    1919
    20 import org.openstreetmap.josm.Main;
    2120import org.openstreetmap.josm.actions.JosmAction;
    2221import org.openstreetmap.josm.actions.SplitWayAction;
     
    2524import org.openstreetmap.josm.data.osm.OsmPrimitive;
    2625import org.openstreetmap.josm.data.osm.Way;
     26import org.openstreetmap.josm.gui.MainApplication;
    2727import org.openstreetmap.josm.gui.Notification;
    2828import org.openstreetmap.josm.tools.Shortcut;
     
    210210            SplitWayAction.SplitWayResult result = SplitWayAction.splitWay(
    211211                    getLayerManager().getEditLayer(), selectedWay, wayChunks, Collections.<OsmPrimitive>emptyList());
    212             Main.main.undoRedo.add(result.getCommand());
     212            MainApplication.undoRedo.add(result.getCommand());
    213213            if (splitWay != null)
    214                 Main.main.undoRedo.add(new DeleteCommand(splitWay));
     214                MainApplication.undoRedo.add(new DeleteCommand(splitWay));
    215215            getLayerManager().getEditDataSet().setSelected(result.getNewSelection());
    216216        }
  • applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/SplitOnIntersectionsAction.java

    r32410 r33579  
    1515import javax.swing.JOptionPane;
    1616
    17 import org.openstreetmap.josm.Main;
    1817import org.openstreetmap.josm.actions.JosmAction;
    1918import org.openstreetmap.josm.actions.SplitWayAction;
     
    2322import org.openstreetmap.josm.data.osm.OsmPrimitive;
    2423import org.openstreetmap.josm.data.osm.Way;
     24import org.openstreetmap.josm.gui.MainApplication;
    2525import org.openstreetmap.josm.gui.Notification;
    2626import org.openstreetmap.josm.tools.Shortcut;
     
    9595
    9696        if (!list.isEmpty()) {
    97             Main.main.undoRedo.add(list.size() == 1 ? list.get(0) : new SequenceCommand(TITLE, list));
     97            MainApplication.undoRedo.add(list.size() == 1 ? list.get(0) : new SequenceCommand(TITLE, list));
    9898            getLayerManager().getEditDataSet().clearSelection();
    9999        }
  • applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/SymmetryAction.java

    r32410 r33579  
    2222import org.openstreetmap.josm.data.osm.OsmPrimitive;
    2323import org.openstreetmap.josm.data.osm.Way;
     24import org.openstreetmap.josm.gui.MainApplication;
    2425import org.openstreetmap.josm.gui.Notification;
    2526import org.openstreetmap.josm.tools.Shortcut;
     
    8788        }
    8889
    89         Main.main.undoRedo.add(new SequenceCommand(tr("Symmetry"), cmds));
    90         Main.map.repaint();
     90        MainApplication.undoRedo.add(new SequenceCommand(tr("Symmetry"), cmds));
     91        MainApplication.getMap().repaint();
    9192    }
    9293
  • applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/TagBufferAction.java

    r32725 r33579  
    1515import java.util.function.Predicate;
    1616
    17 import org.openstreetmap.josm.Main;
    1817import org.openstreetmap.josm.actions.JosmAction;
    1918import org.openstreetmap.josm.command.ChangePropertyCommand;
     
    2120import org.openstreetmap.josm.command.SequenceCommand;
    2221import org.openstreetmap.josm.data.osm.OsmPrimitive;
     22import org.openstreetmap.josm.gui.MainApplication;
    2323import org.openstreetmap.josm.tools.Shortcut;
    2424import org.openstreetmap.josm.tools.SubclassFilteredCollection;
     
    6969
    7070        if (!commands.isEmpty())
    71             Main.main.undoRedo.add(new SequenceCommand(TITLE, commands));
     71            MainApplication.undoRedo.add(new SequenceCommand(TITLE, commands));
    7272    }
    7373
  • applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/TagSourceAction.java

    r32410 r33579  
    1414import org.openstreetmap.josm.command.ChangePropertyCommand;
    1515import org.openstreetmap.josm.data.osm.OsmPrimitive;
     16import org.openstreetmap.josm.gui.MainApplication;
    1617import org.openstreetmap.josm.tools.Shortcut;
    1718
     
    4243            return;
    4344
    44         Main.main.undoRedo.add(new ChangePropertyCommand(selection, "source", source));
     45        MainApplication.undoRedo.add(new ChangePropertyCommand(selection, "source", source));
    4546    }
    4647
  • applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/UnGlueRelationAction.java

    r32410 r33579  
    2020import org.openstreetmap.josm.data.osm.Relation;
    2121import org.openstreetmap.josm.data.osm.Way;
     22import org.openstreetmap.josm.gui.MainApplication;
    2223import org.openstreetmap.josm.plugins.utilsplugin2.command.ChangeRelationMemberCommand;
    2324import org.openstreetmap.josm.tools.Shortcut;
     
    7980            // error message nothing to do
    8081        } else {
    81             Main.main.undoRedo.add(new SequenceCommand(tr("Unglued Relations"), cmds));
     82            MainApplication.undoRedo.add(new SequenceCommand(tr("Unglued Relations"), cmds));
    8283            //Set selection all primiteves (new and old)
    8384            newPrimitives.addAll(selection);
    8485            getLayerManager().getEditDataSet().setSelected(newPrimitives);
    85             Main.map.mapView.repaint();
     86            MainApplication.getMap().mapView.repaint();
    8687        }
    8788    }
  • applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/curves/CurveAction.java

    r32410 r33579  
    1818import org.openstreetmap.josm.data.osm.OsmPrimitive;
    1919import org.openstreetmap.josm.data.osm.Way;
     20import org.openstreetmap.josm.gui.MainApplication;
    2021import org.openstreetmap.josm.tools.Shortcut;
    2122
     
    5859        Collection<Command> cmds = CircleArcMaker.doCircleArc(selectedNodes, selectedWays, angleSeparation);
    5960        if (cmds != null)
    60             Main.main.undoRedo.add(new SequenceCommand("Create a curve", cmds));
     61            MainApplication.undoRedo.add(new SequenceCommand("Create a curve", cmds));
    6162    }
    6263
  • applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/customurl/OpenPageAction.java

    r32410 r33579  
    1818import org.openstreetmap.josm.data.osm.OsmPrimitive;
    1919import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
     20import org.openstreetmap.josm.gui.MainApplication;
     21import org.openstreetmap.josm.gui.MapView;
     22import org.openstreetmap.josm.tools.Logging;
    2023import org.openstreetmap.josm.tools.OpenBrowser;
    2124import org.openstreetmap.josm.tools.OsmUrlToBounds;
     
    5053            ChooseURLAction.showConfigDialog(true);
    5154
    52         LatLon center = Main.map.mapView.getLatLon(Main.map.mapView.getWidth()/2, Main.map.mapView.getHeight()/2);
     55        MapView mv = MainApplication.getMap().mapView;
     56        LatLon center = mv.getLatLon(mv.getWidth()/2, mv.getHeight()/2);
    5357
    5458        String addr = URLList.getSelectedURL();
     
    7074                    val = Double.toString(center.lon());
    7175                } else if (key.equals("#zoom")) {
    72                     val = Integer.toString(OsmUrlToBounds.getZoom(Main.map.mapView.getRealBounds()));
     76                    val = Integer.toString(OsmUrlToBounds.getZoom(MainApplication.getMap().mapView.getRealBounds()));
    7377                } else {
    7478                    if (p != null) {
     
    8387            }
    8488        } catch (UnsupportedEncodingException ex) {
    85             Main.error(ex, "Encoding error");
     89            Logging.log(Logging.LEVEL_ERROR, "Encoding error", ex);
    8690            return;
    8791        }
     
    9296            OpenBrowser.displayUrl(addr);
    9397        } catch (Exception ex) {
    94             Main.error(ex, "Can not open URL " + addr);
     98            Logging.log(Logging.LEVEL_ERROR, "Can not open URL " + addr, ex);
    9599        }
    96100    }
  • applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/customurl/URLList.java

    r33124 r33579  
    1515import org.openstreetmap.josm.Main;
    1616import org.openstreetmap.josm.plugins.utilsplugin2.UtilsPlugin2;
     17import org.openstreetmap.josm.tools.Logging;
    1718
    1819public final class URLList {
     
    7879            }
    7980        } catch (IOException e) {
    80             Main.error(e);
     81            Logging.error(e);
    8182        }
    8283        return items;
     
    9394            }
    9495        } catch (IOException e) {
    95             Main.error(e);
     96            Logging.error(e);
    9697        } finally {
    9798            try {
     
    99100                    fw.close();
    100101            } catch (Exception e) {
    101                 Main.warn(e);
     102                Logging.warn(e);
    102103            }
    103104        }
  • applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/latlon/LatLonAction.java

    r32725 r33579  
    1818import org.openstreetmap.josm.data.osm.Node;
    1919import org.openstreetmap.josm.data.osm.Way;
     20import org.openstreetmap.josm.gui.MainApplication;
    2021import org.openstreetmap.josm.tools.Shortcut;
    2122
     
    8081            cmds.add(new AddCommand(wnew));
    8182        }
    82         Main.main.undoRedo.add(new SequenceCommand(tr("Lat Lon tool"), cmds));
    83         Main.map.mapView.repaint();
     83        MainApplication.undoRedo.add(new SequenceCommand(tr("Lat Lon tool"), cmds));
     84        MainApplication.getMap().mapView.repaint();
    8485    }
    8586
  • applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/latlon/LatLonDialog.java

    r32410 r33579  
    3636import org.openstreetmap.josm.data.coor.LatLon;
    3737import org.openstreetmap.josm.gui.ExtendedDialog;
     38import org.openstreetmap.josm.gui.util.WindowGeometry;
    3839import org.openstreetmap.josm.gui.widgets.HtmlPanel;
    3940import org.openstreetmap.josm.tools.GBC;
    40 import org.openstreetmap.josm.tools.WindowGeometry;
    4141
    4242public class LatLonDialog extends ExtendedDialog {
  • applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/multitagger/MultiTagDialog.java

    r33522 r33579  
    4949import org.openstreetmap.josm.data.preferences.ColorProperty;
    5050import org.openstreetmap.josm.gui.ExtendedDialog;
     51import org.openstreetmap.josm.gui.MainApplication;
    5152import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    5253import org.openstreetmap.josm.gui.tagging.ac.AutoCompletingTextField;
     
    5556import org.openstreetmap.josm.gui.util.HighlightHelper;
    5657import org.openstreetmap.josm.gui.util.TableHelper;
     58import org.openstreetmap.josm.gui.util.WindowGeometry;
    5759import org.openstreetmap.josm.gui.widgets.HistoryComboBox;
    5860import org.openstreetmap.josm.gui.widgets.PopupMenuLauncher;
    5961import org.openstreetmap.josm.tools.GBC;
    6062import org.openstreetmap.josm.tools.ImageProvider;
    61 import org.openstreetmap.josm.tools.WindowGeometry;
     63import org.openstreetmap.josm.tools.Logging;
    6264
    6365/**
     
    138140                public void actionPerformed(ActionEvent e) {
    139141                    if (jt.isSelected()) tableModel.shownTypes.add(type); else tableModel.shownTypes.remove(type);
    140                     tableModel.updateData(Main.getLayerManager().getEditDataSet().getSelected());
     142                    tableModel.updateData(MainApplication.getLayerManager().getEditDataSet().getSelected());
    141143                }
    142144            });
     
    181183        @Override
    182184        public void mouseClicked(MouseEvent e) {
    183             if (e.getClickCount() > 1 && Main.isDisplayingMapView()) {
     185            if (e.getClickCount() > 1 && MainApplication.isDisplayingMapView()) {
    184186                AutoScaleAction.zoomTo(currentSelection);
    185187            }
     
    191193        public void valueChanged(ListSelectionEvent e) {
    192194            currentSelection = getSelectedPrimitives();
    193             if (currentSelection != null && Main.isDisplayingMapView()) {
     195            if (currentSelection != null && MainApplication.isDisplayingMapView()) {
    194196                if (highlightHelper.highlightOnly(currentSelection)) {
    195                     Main.map.mapView.repaint();
     197                    MainApplication.getMap().mapView.repaint();
    196198                }
    197199            }
     
    210212
    211213    private void initAutocompletion() {
    212         OsmDataLayer l = Main.getLayerManager().getEditLayer();
     214        OsmDataLayer l = MainApplication.getLayerManager().getEditLayer();
    213215        AutoCompletionManager autocomplete = l.data.getAutoCompletionManager();
    214216        for (int i = 0; i < tableModel.mainTags.length; i++) {
     
    227229            @Override
    228230            public void actionPerformed(ActionEvent e) {
    229                 if (Main.isDisplayingMapView()) {
     231                if (MainApplication.isDisplayingMapView()) {
    230232                    AutoScaleAction.zoomTo(currentSelection);
    231233                }
     
    235237            @Override
    236238            public void actionPerformed(ActionEvent e) {
    237                 Main.getLayerManager().getEditDataSet().setSelected(getSelectedPrimitives());
     239                MainApplication.getLayerManager().getEditDataSet().setSelected(getSelectedPrimitives());
    238240            }
    239241        });
     
    340342
    341343    private void specifyTagSet(String s) {
    342         Main.info("Multitagger tags="+s);
     344        Logging.info("Multitagger tags="+s);
    343345        tableModel.setupColumnsFromText(s);
    344346
  • applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/multitagger/MultiTaggerTableModel.java

    r32410 r33579  
    1212import javax.swing.table.AbstractTableModel;
    1313
    14 import org.openstreetmap.josm.Main;
    1514import org.openstreetmap.josm.command.ChangePropertyCommand;
    1615import org.openstreetmap.josm.command.Command;
     
    2019import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
    2120import org.openstreetmap.josm.data.osm.Way;
     21import org.openstreetmap.josm.gui.MainApplication;
    2222import org.openstreetmap.josm.tools.Geometry;
    2323
     
    4949    public void setWatchSelection(boolean watchSelection) {
    5050        this.watchSelection = watchSelection;
    51         if (watchSelection && Main.getLayerManager().getEditLayer() != null)
    52             selectionChanged(Main.getLayerManager().getEditDataSet().getSelected());
     51        if (watchSelection && MainApplication.getLayerManager().getEditLayer() != null)
     52            selectionChanged(MainApplication.getLayerManager().getEditDataSet().getSelected());
    5353    }
    5454
     
    115115            Command cmd = new ChangePropertyCommand(sel, key, (String) value);
    116116            if (autoCommit) {
    117                 Main.main.undoRedo.add(cmd);
     117                MainApplication.undoRedo.add(cmd);
    118118            } else {
    119119                cmds.add(cmd);
     
    185185
    186186    void commit(String commandTitle) {
    187         Main.main.undoRedo.add(new SequenceCommand(commandTitle, cmds));
     187        MainApplication.undoRedo.add(new SequenceCommand(commandTitle, cmds));
    188188        cmds.clear();
    189189    }
  • applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/replacegeometry/ReplaceGeometryAction.java

    r32410 r33579  
    1212import javax.swing.JOptionPane;
    1313
    14 import org.openstreetmap.josm.Main;
    1514import org.openstreetmap.josm.actions.JosmAction;
    1615import org.openstreetmap.josm.data.osm.OsmPrimitive;
     16import org.openstreetmap.josm.gui.MainApplication;
    1717import org.openstreetmap.josm.gui.Notification;
    1818import org.openstreetmap.josm.tools.Shortcut;
     
    5858                return;
    5959
    60             Main.main.undoRedo.add(replaceCommand);
     60            MainApplication.undoRedo.add(replaceCommand);
    6161        } catch (IllegalArgumentException ex) {
    6262            new Notification(
  • applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/replacegeometry/ReplaceGeometryUtils.java

    r33522 r33579  
    3333import org.openstreetmap.josm.data.osm.TagCollection;
    3434import org.openstreetmap.josm.data.osm.Way;
     35import org.openstreetmap.josm.gui.MainApplication;
    3536import org.openstreetmap.josm.gui.Notification;
    3637import org.openstreetmap.josm.gui.conflict.tags.CombinePrimitiveResolverDialog;
     38import org.openstreetmap.josm.tools.Logging;
    3739import org.openstreetmap.josm.tools.UserCancelException;
    3840
     
    110112        // FIXME: handle different layers
    111113        List<Command> commands = new ArrayList<>();
    112         Command c = MergeNodesAction.mergeNodes(Main.getLayerManager().getEditLayer(), Arrays.asList(subjectNode, referenceNode), referenceNode);
     114        Command c = MergeNodesAction.mergeNodes(MainApplication.getLayerManager().getEditLayer(),
     115            Arrays.asList(subjectNode, referenceNode), referenceNode);
    113116        if (c == null) {
    114117            // User canceled
     
    197200        }
    198201
    199         Main.getLayerManager().getEditDataSet().setSelected(referenceObject);
     202        MainApplication.getLayerManager().getEditDataSet().setSelected(referenceObject);
    200203
    201204        return new ReplaceGeometryCommand(
     
    236239    public static ReplaceGeometryCommand buildReplaceWayCommand(Way subjectWay, Way referenceWay) {
    237240
    238         Area a = Main.getLayerManager().getEditDataSet().getDataSourceArea();
     241        Area a = MainApplication.getLayerManager().getEditDataSet().getDataSourceArea();
    239242        if (!isInArea(subjectWay, a) || !isInArea(referenceWay, a)) {
    240243            throw new ReplaceGeometryException(tr("The ways must be entirely within the downloaded area."));
     
    253256        } catch (UserCancelException e) {
    254257            // user canceled tag merge dialog
    255             Main.trace(e);
     258            Logging.trace(e);
    256259            return null;
    257260        }
     
    354357
    355358        // Remove geometry way from selection
    356         Main.getLayerManager().getEditDataSet().clearSelection(referenceWay);
     359        MainApplication.getLayerManager().getEditDataSet().clearSelection(referenceWay);
    357360
    358361        // And delete old geometry way
  • applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/replacegeometry/ReplaceMembershipAction.java

    r33522 r33579  
    1515import javax.swing.JOptionPane;
    1616
    17 import org.openstreetmap.josm.Main;
    1817import org.openstreetmap.josm.actions.JosmAction;
    1918import org.openstreetmap.josm.command.ChangeCommand;
     
    2423import org.openstreetmap.josm.data.osm.RelationMember;
    2524import org.openstreetmap.josm.data.osm.RelationToChildReference;
     25import org.openstreetmap.josm.gui.MainApplication;
    2626import org.openstreetmap.josm.gui.Notification;
    2727import org.openstreetmap.josm.tools.MultiMap;
     
    4545        final int affectedRelations = command.getChildren().size();
    4646        if (affectedRelations > 0) {
    47             Main.main.undoRedo.add(command);
     47            MainApplication.undoRedo.add(command);
    4848            new Notification(trn("Replaced ''{0}'' by ''{1}'' in {2} relation", "Replaced ''{0}'' by ''{1}'' in {2} relations",
    4949                    affectedRelations,
  • applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/search/ConnectedMatch.java

    r33522 r33579  
    66import java.util.Set;
    77
    8 import org.openstreetmap.josm.Main;
    98import org.openstreetmap.josm.data.osm.Node;
    109import org.openstreetmap.josm.data.osm.OsmPrimitive;
    1110import org.openstreetmap.josm.data.osm.Way;
    1211import org.openstreetmap.josm.data.osm.search.SearchCompiler;
     12import org.openstreetmap.josm.gui.MainApplication;
    1313import org.openstreetmap.josm.plugins.utilsplugin2.selection.NodeWayUtils;
    1414
     
    3232        Set<Node> matchedNodes = new HashSet<>();
    3333        // find all ways that match the expression
    34         Collection<Way> allWays = Main.getLayerManager().getEditDataSet().getWays();
     34        Collection<Way> allWays = MainApplication.getLayerManager().getEditDataSet().getWays();
    3535        for (Way way : allWays) {
    3636            if (match.match(way)) {
     
    3939        }
    4040        // find all nodes that match the expression
    41         Collection<Node> allNodes = Main.getLayerManager().getEditDataSet().getNodes();
     41        Collection<Node> allNodes = MainApplication.getLayerManager().getEditDataSet().getNodes();
    4242        for (Node node : allNodes) {
    4343            if (match.match(node)) {
  • applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/search/InsideMatch.java

    r33522 r33579  
    55import java.util.HashSet;
    66
    7 import org.openstreetmap.josm.Main;
    87import org.openstreetmap.josm.data.osm.OsmPrimitive;
    98import org.openstreetmap.josm.data.osm.Relation;
    109import org.openstreetmap.josm.data.osm.Way;
    1110import org.openstreetmap.josm.data.osm.search.SearchCompiler;
     11import org.openstreetmap.josm.gui.MainApplication;
    1212import org.openstreetmap.josm.plugins.utilsplugin2.selection.NodeWayUtils;
    1313
     
    2828        Collection<OsmPrimitive> matchedAreas = new HashSet<>();
    2929        // find all ways that match the expression
    30         Collection<Way> ways = Main.getLayerManager().getEditDataSet().getWays();
     30        Collection<Way> ways = MainApplication.getLayerManager().getEditDataSet().getWays();
    3131        for (Way way : ways) {
    3232            if (match.match(way)) {
     
    3535        }
    3636        // find all relations that match the expression
    37         Collection<Relation> rels = Main.getLayerManager().getEditDataSet().getRelations();
     37        Collection<Relation> rels = MainApplication.getLayerManager().getEditDataSet().getRelations();
    3838        for (Relation rel : rels) {
    3939            if (match.match(rel)) {
     
    4141            }
    4242        }
    43         inside = NodeWayUtils.selectAllInside(matchedAreas, Main.getLayerManager().getEditDataSet(), false);
     43        inside = NodeWayUtils.selectAllInside(matchedAreas, MainApplication.getLayerManager().getEditDataSet(), false);
    4444    }
    4545
  • applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/search/IntersectingMatch.java

    r33522 r33579  
    66import java.util.Set;
    77
    8 import org.openstreetmap.josm.Main;
    98import org.openstreetmap.josm.data.osm.OsmPrimitive;
    109import org.openstreetmap.josm.data.osm.Way;
    1110import org.openstreetmap.josm.data.osm.search.SearchCompiler;
     11import org.openstreetmap.josm.gui.MainApplication;
    1212import org.openstreetmap.josm.plugins.utilsplugin2.selection.NodeWayUtils;
    1313
     
    3131        Collection<Way> matchedWays = new HashSet<>();
    3232        // find all ways that match the expression
    33         Collection<Way> allWays = Main.getLayerManager().getEditDataSet().getWays();
     33        Collection<Way> allWays = MainApplication.getLayerManager().getEditDataSet().getWays();
    3434        for (Way way : allWays) {
    3535            if (match.match(way)) {
  • applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/SelectBoundaryAction.java

    r33297 r33579  
    1414import javax.swing.JOptionPane;
    1515
    16 import org.openstreetmap.josm.Main;
    1716import org.openstreetmap.josm.actions.JosmAction;
    1817import org.openstreetmap.josm.actions.SelectByInternalPointAction;
     
    2120import org.openstreetmap.josm.data.osm.OsmPrimitive;
    2221import org.openstreetmap.josm.data.osm.Way;
     22import org.openstreetmap.josm.gui.MainApplication;
    2323import org.openstreetmap.josm.gui.Notification;
    2424import org.openstreetmap.josm.tools.Shortcut;
     
    5858                    }
    5959                } else {
    60                     Point p = Main.map.mapView.getMousePosition();
    61                     SelectByInternalPointAction.performSelection(Main.map.mapView.getEastNorth(p.x, p.y), false, false);
     60                    Point p = MainApplication.getMap().mapView.getMousePosition();
     61                    SelectByInternalPointAction.performSelection(MainApplication.getMap().mapView.getEastNorth(p.x, p.y), false, false);
    6262                    return;
    6363                }
  • applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/SelectModNodesAction.java

    r33297 r33579  
    1111import java.util.Set;
    1212
    13 import org.openstreetmap.josm.Main;
    1413import org.openstreetmap.josm.actions.JosmAction;
    1514import org.openstreetmap.josm.command.Command;
     
    1716import org.openstreetmap.josm.data.osm.Node;
    1817import org.openstreetmap.josm.data.osm.OsmPrimitive;
     18import org.openstreetmap.josm.gui.MainApplication;
    1919import org.openstreetmap.josm.tools.Shortcut;
    2020
     
    4242            Command cmd = null;
    4343
    44             if (Main.main.undoRedo.commands == null) return;
    45             int num = Main.main.undoRedo.commands.size();
     44            if (MainApplication.undoRedo.commands == null) return;
     45            int num = MainApplication.undoRedo.commands.size();
    4646            if (num == 0) return;
    4747            int k = 0, idx;
    4848            if (selection != null && !selection.isEmpty() && selection.hashCode() == lastHash) {
    4949                // we are selecting next command in history if nothing is selected
    50                 idx = Main.main.undoRedo.commands.indexOf(lastCmd);
     50                idx = MainApplication.undoRedo.commands.indexOf(lastCmd);
    5151            } else {
    5252                idx = num;
     
    5656            do {  //  select next history element
    5757                if (idx > 0) idx--; else idx = num-1;
    58                 cmd = Main.main.undoRedo.commands.get(idx);
     58                cmd = MainApplication.undoRedo.commands.get(idx);
    5959                Collection<? extends OsmPrimitive> pp = cmd.getParticipatingPrimitives();
    6060                nodes.clear();
  • applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/SelectModWaysAction.java

    r33297 r33579  
    1111import java.util.Set;
    1212
    13 import org.openstreetmap.josm.Main;
    1413import org.openstreetmap.josm.actions.JosmAction;
    1514import org.openstreetmap.josm.command.Command;
     
    1817import org.openstreetmap.josm.data.osm.OsmPrimitive;
    1918import org.openstreetmap.josm.data.osm.Way;
     19import org.openstreetmap.josm.gui.MainApplication;
    2020import org.openstreetmap.josm.tools.Shortcut;
    2121
     
    4343            Command cmd;
    4444
    45             if (Main.main.undoRedo.commands == null) return;
    46             int num = Main.main.undoRedo.commands.size();
     45            if (MainApplication.undoRedo.commands == null) return;
     46            int num = MainApplication.undoRedo.commands.size();
    4747            if (num == 0) return;
    4848            int k = 0, idx;
    4949            if (selection != null && !selection.isEmpty() && selection.hashCode() == lastHash) {
    5050                // we are selecting next command in history if nothing is selected
    51                 idx = Main.main.undoRedo.commands.indexOf(lastCmd);
     51                idx = MainApplication.undoRedo.commands.indexOf(lastCmd);
    5252            } else {
    5353                idx = num;
     
    5757            do {  //  select next history element
    5858                if (idx > 0) idx--; else idx = num-1;
    59                 cmd = Main.main.undoRedo.commands.get(idx);
     59                cmd = MainApplication.undoRedo.commands.get(idx);
    6060                Collection<? extends OsmPrimitive> pp = cmd.getParticipatingPrimitives();
    6161                ways.clear();
Note: See TracChangeset for help on using the changeset viewer.