Changeset 13654 in josm


Ignore:
Timestamp:
2018-04-21T02:42:26+02:00 (18 months ago)
Author:
Don-vip
Message:

More uses of OsmDataLayer.getDataSet()

Location:
trunk/src/org/openstreetmap/josm/gui
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/MainApplication.java

    r13651 r13654  
    239239            Layer layer = e.getRemovedLayer();
    240240            if (layer instanceof OsmDataLayer) {
    241                 undoRedo.clean(((OsmDataLayer) layer).data);
     241                undoRedo.clean(((OsmDataLayer) layer).getDataSet());
    242242            }
    243243        }
  • trunk/src/org/openstreetmap/josm/gui/datatransfer/importers/PrimitiveDataPaster.java

    r12725 r13654  
    8383            }
    8484        }
    85         return new AddPrimitivesCommand(bufferCopy, toSelect, layer.data);
     85        return new AddPrimitivesCommand(bufferCopy, toSelect, layer.getDataSet());
    8686    }
    8787
  • trunk/src/org/openstreetmap/josm/gui/dialogs/layer/DuplicateAction.java

    r13130 r13654  
    5555            String newName = LayerListTransferHandler.suggestNewLayerName(layer.getName(), MainApplication.getLayerManager().getLayers());
    5656            OsmDataLayer oldLayer = (OsmDataLayer) layer;
    57             MainApplication.getLayerManager().addLayer(new OsmDataLayer(new DataSet(oldLayer.data), newName, null));
     57            MainApplication.getLayerManager().addLayer(new OsmDataLayer(new DataSet(oldLayer.getDataSet()), newName, null));
    5858        }
    5959    }
  • trunk/src/org/openstreetmap/josm/gui/dialogs/layer/LayerListTransferHandler.java

    r12620 r13654  
    138138            if (layer instanceof OsmDataLayer) {
    139139                String newName = suggestNewLayerName(layer.getName(), layerNames);
    140                 OsmDataLayer newLayer = new OsmDataLayer(new DataSet(((OsmDataLayer) layer).data), newName, null);
     140                OsmDataLayer newLayer = new OsmDataLayer(new DataSet(((OsmDataLayer) layer).getDataSet()), newName, null);
    141141                layers.add(newLayer);
    142142                layerNames.add(newName);
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/ChildRelationBrowser.java

    r13171 r13654  
    399399
    400400        /**
    401          * Merges the primitives in <code>ds</code> to the dataset of the
    402          * edit layer
     401         * Merges the primitives in <code>ds</code> to the dataset of the edit layer
    403402         *
    404403         * @param ds the data set
     
    406405        protected void mergeDataSet(DataSet ds) {
    407406            if (ds != null) {
    408                 final DataSetMerger visitor = new DataSetMerger(getLayer().data, ds);
     407                final DataSetMerger visitor = new DataSetMerger(getLayer().getDataSet(), ds);
    409408                visitor.merge();
    410409                if (!visitor.getConflicts().isEmpty()) {
     
    465464        protected void mergeDataSet(DataSet dataSet) {
    466465            if (dataSet != null) {
    467                 final DataSetMerger visitor = new DataSetMerger(getLayer().data, dataSet);
     466                final DataSetMerger visitor = new DataSetMerger(getLayer().getDataSet(), dataSet);
    468467                visitor.merge();
    469468                if (!visitor.getConflicts().isEmpty()) {
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/ParentRelationLoadingTask.java

    r13486 r13654  
    161161            referrers = reader.parseOsm(progressMonitor.createSubTaskMonitor(1, false));
    162162            if (referrers != null) {
    163                 final DataSetMerger visitor = new DataSetMerger(getLayer().data, referrers);
     163                final DataSetMerger visitor = new DataSetMerger(getLayer().getDataSet(), referrers);
    164164                visitor.merge();
    165165
    166166                // copy the merged layer's data source info
    167                 getLayer().data.addDataSources(referrers.getDataSources());
     167                getLayer().getDataSet().addDataSources(referrers.getDataSources());
    168168                // FIXME: this is necessary because there are dialogs listening
    169169                // for DataChangeEvents which manipulate Swing components on this thread.
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/SavingAction.java

    r12726 r13654  
    7373        if (newRelation.getMembersCount() == 0 && !newRelation.hasKeys())
    7474            return;
    75         MainApplication.undoRedo.add(new AddCommand(layer.data, newRelation));
     75        MainApplication.undoRedo.add(new AddCommand(layer.getDataSet(), newRelation));
    7676
    7777        // make sure everybody is notified about the changes
     
    9595        memberTableModel.applyToRelation(editedRelation);
    9696        Conflict<Relation> conflict = new Conflict<>(editor.getRelation(), editedRelation);
    97         MainApplication.undoRedo.add(new ConflictAddCommand(layer.data, conflict));
     97        MainApplication.undoRedo.add(new ConflictAddCommand(layer.getDataSet(), conflict));
    9898    }
    9999
  • trunk/src/org/openstreetmap/josm/gui/history/HistoryBrowserModel.java

    r13434 r13654  
    619619        if (oldLayer instanceof OsmDataLayer) {
    620620            OsmDataLayer l = (OsmDataLayer) oldLayer;
    621             l.data.removeDataSetListener(this);
     621            l.getDataSet().removeDataSetListener(this);
    622622        }
    623623        Layer newLayer = e.getSource().getActiveLayer();
     
    628628        }
    629629        OsmDataLayer l = (OsmDataLayer) newLayer;
    630         l.data.addDataSetListener(this);
     630        l.getDataSet().addDataSetListener(this);
    631631        OsmPrimitive primitive = history != null ? l.data.getPrimitiveById(history.getId(), history.getType()) : null;
    632632        HistoryOsmPrimitive newLatest;
  • trunk/src/org/openstreetmap/josm/gui/io/AsynchronousUploadPrimitivesTask.java

    r13146 r13654  
    123123        GuiHelper.runInEDTAndWait(() -> {
    124124            // Remove the commands from the undo stack
    125             MainApplication.undoRedo.clean(uploadDataLayer.data);
     125            MainApplication.undoRedo.clean(uploadDataLayer.getDataSet());
    126126            MainApplication.getLayerManager().prepareLayerForUpload(uploadDataLayer);
    127127
  • trunk/src/org/openstreetmap/josm/gui/io/UploadLayerTask.java

    r12687 r13654  
    107107    public void run() {
    108108        monitor.indeterminateSubTask(tr("Preparing objects to upload ..."));
    109         APIDataSet ds = new APIDataSet(layer.data);
     109        APIDataSet ds = new APIDataSet(layer.getDataSet());
    110110        try {
    111111            ds.adjustRelationUploadOrder();
  • trunk/src/org/openstreetmap/josm/gui/layer/AutosaveTask.java

    r13647 r13654  
    298298    private void registerNewlayer(OsmDataLayer layer) {
    299299        synchronized (layersLock) {
    300             layer.data.addDataSetListener(datasetAdapter);
     300            layer.getDataSet().addDataSetListener(datasetAdapter);
    301301            layersInfo.add(new AutosaveLayerInfo<>(layer));
    302302        }
     
    324324            synchronized (layersLock) {
    325325                OsmDataLayer osmLayer = (OsmDataLayer) e.getRemovedLayer();
    326                 osmLayer.data.removeDataSetListener(datasetAdapter);
     326                osmLayer.getDataSet().removeDataSetListener(datasetAdapter);
    327327                cleanupLayer(osmLayer);
    328328            }
  • trunk/src/org/openstreetmap/josm/gui/layer/MainLayerManager.java

    r13453 r13654  
    114114        public DataSet getPreviousDataSet() {
    115115            if (previousDataLayer != null) {
    116                 return previousDataLayer.data;
     116                return previousDataLayer.getDataSet();
    117117            } else {
    118118                return null;
     
    403403    public synchronized DataSet getEditDataSet() {
    404404        if (dataLayer != null && !dataLayer.isLocked()) {
    405             return dataLayer.data;
     405            return dataLayer.getDataSet();
    406406        } else {
    407407            return null;
     
    417417    public synchronized DataSet getActiveDataSet() {
    418418        if (dataLayer != null) {
    419             return dataLayer.data;
     419            return dataLayer.getDataSet();
    420420        } else {
    421421            return null;
Note: See TracChangeset for help on using the changeset viewer.