Ignore:
Timestamp:
2016-06-21T00:58:45+02:00 (8 years ago)
Author:
Don-vip
Message:

see #13001 - replace calls to Main.main.getCurrentDataSet() by Main.getLayerManager().getEditDataSet()

Location:
trunk/src/org/openstreetmap/josm/io
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/io/GpxExporter.java

    r9461 r10446  
    172172            gpxData = ((GpxLayer) layer).data;
    173173        } else {
    174             gpxData = OsmDataLayer.toGpxData(Main.main.getCurrentDataSet(), file);
     174            gpxData = OsmDataLayer.toGpxData(Main.getLayerManager().getEditDataSet(), file);
    175175        }
    176176
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/AddTagsDialog.java

    r10378 r10446  
    242242    protected void buttonAction(int buttonIndex, ActionEvent evt) {
    243243        // if layer all layers were closed, ignore all actions
    244         if (Main.main.getCurrentDataSet() != null && buttonIndex != 2) {
     244        if (Main.getLayerManager().getEditDataSet() != null && buttonIndex != 2) {
    245245            TableModel tm = propertyTable.getModel();
    246246            for (int i = 0; i < tm.getRowCount(); i++) {
     
    304304    public static void addTags(String[][] keyValue, String sender, Collection<? extends OsmPrimitive> primitives) {
    305305        if (trustedSenders.contains(sender)) {
    306             if (Main.main.getCurrentDataSet() != null) {
     306            if (Main.getLayerManager().getEditDataSet() != null) {
    307307                for (String[] row : keyValue) {
    308308                    Main.main.undoRedo.add(new ChangePropertyCommand(primitives, row[0], row[1]));
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/AddNodeHandler.java

    r9732 r10446  
    102102        }
    103103
    104         Main.main.getCurrentDataSet().setSelected(node);
     104        Main.getLayerManager().getEditDataSet().setSelected(node);
    105105        if (PermissionPrefWithDefault.CHANGE_VIEWPORT.isAllowed()) {
    106106            AutoScaleAction.autoScale("selection");
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/AddWayHandler.java

    r10116 r10446  
    171171        commands.add(new AddCommand(way));
    172172        Main.main.undoRedo.add(new SequenceCommand(tr("Add way"), commands));
    173         Main.main.getCurrentDataSet().setSelected(way);
     173        Main.getLayerManager().getEditDataSet().setSelected(way);
    174174        if (PermissionPrefWithDefault.CHANGE_VIEWPORT.isAllowed()) {
    175175            AutoScaleAction.autoScale("selection");
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/LoadAndZoomHandler.java

    r10212 r10446  
    119119                        // find out whether some data has already been downloaded
    120120                        Area present = null;
    121                         DataSet ds = Main.main.getCurrentDataSet();
     121                        DataSet ds = Main.getLayerManager().getEditDataSet();
    122122                        if (ds != null) {
    123123                            present = ds.getDataSourceArea();
     
    158158                @Override
    159159                public void run() {
    160                     DataSet ds = Main.main.getCurrentDataSet();
     160                    DataSet ds = Main.getLayerManager().getEditDataSet();
    161161                    if (ds == null) // e.g. download failed
    162162                        return;
     
    174174                public void run() {
    175175                    Set<OsmPrimitive> newSel = new HashSet<>();
    176                     DataSet ds = Main.main.getCurrentDataSet();
     176                    DataSet ds = Main.getLayerManager().getEditDataSet();
    177177                    if (ds == null) // e.g. download failed
    178178                        return;
     
    200200                    @Override
    201201                    public void run() {
    202                         final DataSet ds = Main.main.getCurrentDataSet();
     202                        final DataSet ds = Main.getLayerManager().getEditDataSet();
    203203                        final Collection<OsmPrimitive> filteredPrimitives = Utils.filter(ds.allPrimitives(), search);
    204204                        ds.setSelected(filteredPrimitives);
     
    221221                @Override
    222222                public void run() {
    223                     if (Main.main.getCurrentDataSet() != null) {
     223                    if (Main.getLayerManager().getEditDataSet() != null) {
    224224                        if (args.containsKey("changeset_comment")) {
    225                             Main.main.getCurrentDataSet().addChangeSetTag("comment", args.get("changeset_comment"));
     225                            Main.getLayerManager().getEditDataSet().addChangeSetTag("comment", args.get("changeset_comment"));
    226226                        }
    227227                        if (args.containsKey("changeset_source")) {
    228                             Main.main.getCurrentDataSet().addChangeSetTag("source", args.get("changeset_source"));
     228                            Main.getLayerManager().getEditDataSet().addChangeSetTag("source", args.get("changeset_source"));
    229229                        }
    230230                    }
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/LoadObjectHandler.java

    r10116 r10446  
    7272                public void run() {
    7373                    final List<PrimitiveId> downloaded = task.getDownloadedId();
    74                     final DataSet ds = Main.main.getCurrentDataSet();
     74                    final DataSet ds = Main.getLayerManager().getEditDataSet();
    7575                    if (downloaded != null) {
    7676                        GuiHelper.runInEDT(new Runnable() {
Note: See TracChangeset for help on using the changeset viewer.