Changeset 10446 in josm
- Timestamp:
- 2016-06-21T00:58:45+02:00 (9 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 40 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/AutoScaleAction.java
r10413 r10446 325 325 } else { 326 326 lastZoomArea = -1; 327 Area sourceArea = Main. main.getCurrentDataSet().getDataSourceArea();327 Area sourceArea = Main.getLayerManager().getEditDataSet().getDataSourceArea(); 328 328 if (sourceArea != null) { 329 329 v.visit(new Bounds(sourceArea.getBounds2D())); -
trunk/src/org/openstreetmap/josm/actions/CreateMultipolygonAction.java
r10413 r10446 144 144 } 145 145 146 final Collection<Way> selectedWays = Main. main.getCurrentDataSet().getSelectedWays();146 final Collection<Way> selectedWays = Main.getLayerManager().getEditDataSet().getSelectedWays(); 147 147 148 148 if (selectedWays.isEmpty()) { … … 157 157 } 158 158 159 final Collection<Relation> selectedRelations = Main. main.getCurrentDataSet().getSelectedRelations();159 final Collection<Relation> selectedRelations = Main.getLayerManager().getEditDataSet().getSelectedRelations(); 160 160 final Relation multipolygonRelation = update 161 161 ? getSelectedMultipolygonRelation(selectedWays, selectedRelations) -
trunk/src/org/openstreetmap/josm/actions/DownloadPrimitiveAction.java
r8510 r10446 61 61 @Override 62 62 public void run() { 63 Main. main.getCurrentDataSet().setSelected(downloaded);63 Main.getLayerManager().getEditDataSet().setSelected(downloaded); 64 64 } 65 65 }); -
trunk/src/org/openstreetmap/josm/actions/JoinAreasAction.java
r10413 r10446 413 413 @Override 414 414 public void actionPerformed(ActionEvent e) { 415 join(Main. main.getCurrentDataSet().getSelectedWays());415 join(Main.getLayerManager().getEditDataSet().getSelectedWays()); 416 416 } 417 417 … … 1425 1425 List<RelationRole> result = new ArrayList<>(); 1426 1426 1427 for (Relation r : Main. main.getCurrentDataSet().getRelations()) {1427 for (Relation r : Main.getLayerManager().getEditDataSet().getRelations()) { 1428 1428 if (r.isDeleted()) { 1429 1429 continue; -
trunk/src/org/openstreetmap/josm/actions/SelectNonBranchingWaySequencesAction.java
r7937 r10446 32 32 @Override 33 33 public void actionPerformed(ActionEvent ev) { 34 DataSet ds = Main. main.getCurrentDataSet();34 DataSet ds = Main.getLayerManager().getEditDataSet(); 35 35 SelectNonBranchingWaySequences ws = new SelectNonBranchingWaySequences(ds.getSelectedWays()); 36 36 ws.extend(ds); … … 44 44 @Override 45 45 protected void updateEnabledState() { 46 setEnabled(Main. main.getCurrentDataSet() != null);46 setEnabled(Main.getLayerManager().getEditDataSet() != null); 47 47 } 48 48 } -
trunk/src/org/openstreetmap/josm/actions/ShowStatusReportAction.java
r10242 r10446 145 145 } 146 146 if (Main.main != null) { 147 DataSet dataset = Main. main.getCurrentDataSet();147 DataSet dataset = Main.getLayerManager().getEditDataSet(); 148 148 if (dataset != null) { 149 149 String result = DatasetConsistencyTest.runTests(dataset); -
trunk/src/org/openstreetmap/josm/actions/UploadAction.java
r10413 r10446 268 268 return; 269 269 } 270 APIDataSet apiData = new APIDataSet(Main. main.getCurrentDataSet());270 APIDataSet apiData = new APIDataSet(Main.getLayerManager().getEditDataSet()); 271 271 uploadData(Main.getLayerManager().getEditLayer(), apiData); 272 272 } -
trunk/src/org/openstreetmap/josm/actions/ValidateAction.java
r10382 r10446 73 73 Collection<OsmPrimitive> selection; 74 74 if (getSelectedItems) { 75 selection = Main. main.getCurrentDataSet().getAllSelected();75 selection = Main.getLayerManager().getEditDataSet().getAllSelected(); 76 76 if (selection.isEmpty()) { 77 selection = Main. main.getCurrentDataSet().allNonDeletedPrimitives();77 selection = Main.getLayerManager().getEditDataSet().allNonDeletedPrimitives(); 78 78 lastSelection = null; 79 79 } else { … … 84 84 } else { 85 85 if (lastSelection == null) { 86 selection = Main. main.getCurrentDataSet().allNonDeletedPrimitives();86 selection = Main.getLayerManager().getEditDataSet().allNonDeletedPrimitives(); 87 87 } else { 88 88 selection = lastSelection; … … 147 147 Main.map.validatorDialog.tree.setErrors(errors); 148 148 Main.map.validatorDialog.unfurlDialog(); 149 Main. main.getCurrentDataSet().fireSelectionChanged();149 Main.getLayerManager().getEditDataSet().fireSelectionChanged(); 150 150 } 151 151 }); -
trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java
r10409 r10446 336 336 // let everybody else know about the current selection 337 337 // 338 Main. main.getCurrentDataSet().fireSelectionChanged();338 Main.getLayerManager().getEditDataSet().fireSelectionChanged(); 339 339 lastUsedNode = null; 340 340 wayIsFinished = true; -
trunk/src/org/openstreetmap/josm/actions/relation/AddSelectionToRelations.java
r10039 r10446 39 39 Collection<Command> cmds = new LinkedList<>(); 40 40 for (Relation orig : relations) { 41 Command c = GenericRelationEditor.addPrimitivesToRelation(orig, Main. main.getCurrentDataSet().getSelected());41 Command c = GenericRelationEditor.addPrimitivesToRelation(orig, Main.getLayerManager().getEditDataSet().getSelected()); 42 42 if (c != null) { 43 43 cmds.add(c); -
trunk/src/org/openstreetmap/josm/actions/relation/RecentRelationsAction.java
r10413 r10446 100 100 return relation != null && 101 101 !relation.isDeleted() && 102 Main. main.getCurrentDataSet().containsRelation(relation);102 Main.getLayerManager().getEditDataSet().containsRelation(relation); 103 103 } 104 104 -
trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java
r10382 r10446 550 550 551 551 static SearchTask newSearchTask(SearchSetting setting) { 552 final DataSet ds = Main. main.getCurrentDataSet();552 final DataSet ds = Main.getLayerManager().getEditDataSet(); 553 553 final Collection<OsmPrimitive> selection = new HashSet<>(ds.getAllSelected()); 554 554 return new SearchTask(ds, setting, selection, new Predicate<OsmPrimitive>() { … … 579 579 Collection<OsmPrimitive> all; 580 580 if (setting.allElements) { 581 all = Main. main.getCurrentDataSet().allPrimitives();581 all = Main.getLayerManager().getEditDataSet().allPrimitives(); 582 582 } else { 583 all = Main. main.getCurrentDataSet().allNonDeletedCompletePrimitives();583 all = Main.getLayerManager().getEditDataSet().allNonDeletedCompletePrimitives(); 584 584 } 585 585 final ProgressMonitor subMonitor = getProgressMonitor().createSubTaskMonitor(all.size(), false); -
trunk/src/org/openstreetmap/josm/actions/upload/ApiPreconditionCheckerHook.java
r8870 r10446 73 73 JOptionPane.ERROR_MESSAGE 74 74 ); 75 Main. main.getCurrentDataSet().setSelected(Collections.singleton(osmPrimitive));75 Main.getLayerManager().getEditDataSet().setSelected(Collections.singleton(osmPrimitive)); 76 76 return false; 77 77 } … … 90 90 JOptionPane.ERROR_MESSAGE 91 91 ); 92 Main. main.getCurrentDataSet().setSelected(Collections.singleton(osmPrimitive));92 Main.getLayerManager().getEditDataSet().setSelected(Collections.singleton(osmPrimitive)); 93 93 return false; 94 94 } -
trunk/src/org/openstreetmap/josm/actions/upload/ValidateUploadHook.java
r10247 r10446 151 151 OsmValidator.initializeErrorLayer(); 152 152 Main.map.validatorDialog.unfurlDialog(); 153 Main. main.getCurrentDataSet().fireSelectionChanged();153 Main.getLayerManager().getEditDataSet().fireSelectionChanged(); 154 154 return false; 155 155 } -
trunk/src/org/openstreetmap/josm/data/UndoRedoHandler.java
r10345 r10446 59 59 60 60 // the command may have changed the selection so tell the listeners about the current situation 61 DataSet ds = Main. main.getCurrentDataSet();61 DataSet ds = Main.getLayerManager().getEditDataSet(); 62 62 if (ds != null) { 63 63 ds.fireSelectionChanged(); … … 88 88 if (commands.isEmpty()) 89 89 return; 90 Collection<? extends OsmPrimitive> oldSelection = Main. main.getCurrentDataSet().getSelected();91 Main. main.getCurrentDataSet().beginUpdate();90 Collection<? extends OsmPrimitive> oldSelection = Main.getLayerManager().getEditDataSet().getSelected(); 91 Main.getLayerManager().getEditDataSet().beginUpdate(); 92 92 try { 93 93 for (int i = 1; i <= num; ++i) { … … 100 100 } 101 101 } finally { 102 Main. main.getCurrentDataSet().endUpdate();103 } 104 fireCommandsChanged(); 105 Collection<? extends OsmPrimitive> newSelection = Main. main.getCurrentDataSet().getSelected();102 Main.getLayerManager().getEditDataSet().endUpdate(); 103 } 104 fireCommandsChanged(); 105 Collection<? extends OsmPrimitive> newSelection = Main.getLayerManager().getEditDataSet().getSelected(); 106 106 if (!oldSelection.equals(newSelection)) { 107 Main. main.getCurrentDataSet().fireSelectionChanged();107 Main.getLayerManager().getEditDataSet().fireSelectionChanged(); 108 108 } 109 109 } … … 123 123 if (redoCommands.isEmpty()) 124 124 return; 125 Collection<? extends OsmPrimitive> oldSelection = Main. main.getCurrentDataSet().getSelected();125 Collection<? extends OsmPrimitive> oldSelection = Main.getLayerManager().getEditDataSet().getSelected(); 126 126 for (int i = 0; i < num; ++i) { 127 127 final Command c = redoCommands.removeFirst(); … … 133 133 } 134 134 fireCommandsChanged(); 135 Collection<? extends OsmPrimitive> newSelection = Main. main.getCurrentDataSet().getSelected();135 Collection<? extends OsmPrimitive> newSelection = Main.getLayerManager().getEditDataSet().getSelected(); 136 136 if (!oldSelection.equals(newSelection)) { 137 Main. main.getCurrentDataSet().fireSelectionChanged();137 Main.getLayerManager().getEditDataSet().fireSelectionChanged(); 138 138 } 139 139 } -
trunk/src/org/openstreetmap/josm/data/validation/tests/UnconnectedWays.java
r10378 r10446 164 164 mindist = Main.pref.getDouble(PREFIX + ".node_way_distance", 10.0); 165 165 minmiddledist = Main.pref.getDouble(PREFIX + ".way_way_distance", 0.0); 166 dsArea = Main.main == null || !Main.main.hasEditLayer() ? null : Main. main.getCurrentDataSet().getDataSourceArea();166 dsArea = Main.main == null || !Main.main.hasEditLayer() ? null : Main.getLayerManager().getEditDataSet().getDataSourceArea(); 167 167 } 168 168 -
trunk/src/org/openstreetmap/josm/gui/MapStatus.java
r10378 r10446 462 462 */ 463 463 private void popupCycleSelection(Collection<OsmPrimitive> osms, int mods) { 464 DataSet ds = Main. main.getCurrentDataSet();464 DataSet ds = Main.getLayerManager().getEditDataSet(); 465 465 // Find some items that are required for cycling through 466 466 OsmPrimitive firstItem = null; … … 566 566 */ 567 567 private void popupSetLabelColors(JLabel lbl, OsmPrimitive osm) { 568 DataSet ds = Main. main.getCurrentDataSet();568 DataSet ds = Main.getLayerManager().getEditDataSet(); 569 569 if (ds.isSelected(osm)) { 570 570 lbl.setBackground(SystemColor.textHighlight); … … 638 638 @Override 639 639 public void mouseClicked(MouseEvent e) { 640 DataSet ds = Main. main.getCurrentDataSet();640 DataSet ds = Main.getLayerManager().getEditDataSet(); 641 641 // Let the user toggle the selection 642 642 ds.toggleSelected(osm); -
trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java
r10409 r10446 311 311 @Deprecated 312 312 protected DataSet getCurrentDataSet() { 313 return Main. main.getCurrentDataSet();313 return Main.getLayerManager().getEditDataSet(); 314 314 } 315 315 -
trunk/src/org/openstreetmap/josm/gui/SelectionManager.java
r10395 r10446 199 199 @Override 200 200 public void mousePressed(MouseEvent e) { 201 if (e.getButton() == MouseEvent.BUTTON1 && e.getClickCount() > 1 && Main. main.getCurrentDataSet() != null) {201 if (e.getButton() == MouseEvent.BUTTON1 && e.getClickCount() > 1 && Main.getLayerManager().getEditDataSet() != null) { 202 202 SelectByInternalPointAction.performSelection(Main.map.mapView.getEastNorth(e.getX(), e.getY()), 203 203 (e.getModifiersEx() & MouseEvent.SHIFT_DOWN_MASK) != 0, -
trunk/src/org/openstreetmap/josm/gui/dialogs/ChangesetDialog.java
r10428 r10446 268 268 if (sel.isEmpty()) 269 269 return; 270 if (Main. main.getCurrentDataSet() == null)271 return; 272 new SelectObjectsAction().selectObjectsByChangesetIds(Main. main.getCurrentDataSet(), sel);270 if (Main.getLayerManager().getEditDataSet() == null) 271 return; 272 new SelectObjectsAction().selectObjectsByChangesetIds(Main.getLayerManager().getEditDataSet(), sel); 273 273 } 274 274 -
trunk/src/org/openstreetmap/josm/gui/dialogs/ConflictDialog.java
r10413 r10446 460 460 sel.add(o); 461 461 } 462 DataSet ds = Main. main.getCurrentDataSet();462 DataSet ds = Main.getLayerManager().getEditDataSet(); 463 463 if (ds != null) { // Can't see how it is possible but it happened in #7942 464 464 ds.setSelected(sel); -
trunk/src/org/openstreetmap/josm/gui/dialogs/FilterTableModel.java
r10217 r10446 77 77 78 78 public void executeFilters() { 79 DataSet ds = Main. main.getCurrentDataSet();79 DataSet ds = Main.getLayerManager().getEditDataSet(); 80 80 boolean changed = false; 81 81 if (ds == null) { … … 124 124 125 125 public void executeFilters(Collection<? extends OsmPrimitive> primitives) { 126 DataSet ds = Main. main.getCurrentDataSet();126 DataSet ds = Main.getLayerManager().getEditDataSet(); 127 127 if (ds == null) 128 128 return; … … 177 177 178 178 public void clearFilterFlags() { 179 DataSet ds = Main. main.getCurrentDataSet();179 DataSet ds = Main.getLayerManager().getEditDataSet(); 180 180 if (ds != null) { 181 181 FilterWorker.clearFilterFlags(ds.allPrimitives()); -
trunk/src/org/openstreetmap/josm/gui/dialogs/InspectPrimitiveDialog.java
r10305 r10446 125 125 126 126 protected static String buildMapPaintText() { 127 final Collection<OsmPrimitive> sel = Main. main.getCurrentDataSet().getAllSelected();127 final Collection<OsmPrimitive> sel = Main.getLayerManager().getEditDataSet().getAllSelected(); 128 128 ElemStyles elemstyles = MapPaintStyles.getStyles(); 129 129 NavigatableComponent nc = Main.map.mapView; -
trunk/src/org/openstreetmap/josm/gui/dialogs/RelationListDialog.java
r10428 r10446 330 330 331 331 protected void setCurrentRelationAsSelection() { 332 Main. main.getCurrentDataSet().setSelected(displaylist.getSelectedValue());332 Main.getLayerManager().getEditDataSet().setSelected(displaylist.getSelectedValue()); 333 333 } 334 334 -
trunk/src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java
r10413 r10446 847 847 @Override 848 848 public void actionPerformed(ActionEvent e) { 849 Main. main.getCurrentDataSet().setSelected(sel);849 Main.getLayerManager().getEditDataSet().setSelected(sel); 850 850 } 851 851 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/UserListDialog.java
r10413 r10446 356 356 users.add(data.get(index).user); 357 357 } 358 Collection<OsmPrimitive> selected = Main. main.getCurrentDataSet().getAllSelected();358 Collection<OsmPrimitive> selected = Main.getLayerManager().getEditDataSet().getAllSelected(); 359 359 Collection<OsmPrimitive> byUser = new LinkedList<>(); 360 360 for (OsmPrimitive p : selected) { … … 363 363 } 364 364 } 365 Main. main.getCurrentDataSet().setSelected(byUser);365 Main.getLayerManager().getEditDataSet().setSelected(byUser); 366 366 } 367 367 -
trunk/src/org/openstreetmap/josm/gui/dialogs/ValidatorDialog.java
r10378 r10446 125 125 @Override 126 126 public void actionPerformed(ActionEvent e) { 127 final DataSet ds = Main. main.getCurrentDataSet();127 final DataSet ds = Main.getLayerManager().getEditDataSet(); 128 128 if (ds == null) { 129 129 return; … … 174 174 public void showNotify() { 175 175 DataSet.addSelectionListener(this); 176 DataSet ds = Main. main.getCurrentDataSet();176 DataSet ds = Main.getLayerManager().getEditDataSet(); 177 177 if (ds != null) { 178 178 updateSelection(ds.getAllSelected()); … … 342 342 } 343 343 } 344 DataSet ds = Main. main.getCurrentDataSet();344 DataSet ds = Main.getLayerManager().getEditDataSet(); 345 345 if (ds != null) { 346 346 ds.setSelected(sel); … … 479 479 480 480 if (isDblClick) { 481 Main. main.getCurrentDataSet().setSelected(sel);481 Main.getLayerManager().getEditDataSet().setSelected(sel); 482 482 if (Main.pref.getBoolean("validator.autozoom", false)) { 483 483 AutoScaleAction.zoomTo(sel); … … 617 617 @Override 618 618 public void run() { 619 Main. main.getCurrentDataSet().beginUpdate();619 Main.getLayerManager().getEditDataSet().beginUpdate(); 620 620 } 621 621 }); … … 633 633 @Override 634 634 public void run() { 635 Main. main.getCurrentDataSet().endUpdate();635 Main.getLayerManager().getEditDataSet().endUpdate(); 636 636 } 637 637 }); … … 644 644 Main.map.repaint(); 645 645 tree.resetErrors(); 646 Main. main.getCurrentDataSet().fireSelectionChanged();646 Main.getLayerManager().getEditDataSet().fireSelectionChanged(); 647 647 } 648 648 }); -
trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java
r10422 r10446 609 609 public void setVisible(boolean b) { 610 610 super.setVisible(b); 611 if (b && Main. main.getCurrentDataSet() != null) {611 if (b && Main.getLayerManager().getEditDataSet() != null) { 612 612 updateSelection(); 613 613 } … … 1413 1413 public void preferenceChanged(PreferenceChangeEvent e) { 1414 1414 super.preferenceChanged(e); 1415 if ("display.discardable-keys".equals(e.getKey()) && Main. main.getCurrentDataSet() != null) {1415 if ("display.discardable-keys".equals(e.getKey()) && Main.getLayerManager().getEditDataSet() != null) { 1416 1416 // Re-load data when display preference change 1417 1417 updateSelection(); -
trunk/src/org/openstreetmap/josm/gui/dialogs/validator/ValidatorTreePanel.java
r9243 r10446 324 324 return; 325 325 clearErrors(); 326 DataSet ds = Main. main.getCurrentDataSet();326 DataSet ds = Main.getLayerManager().getEditDataSet(); 327 327 for (TestError error : newerrors) { 328 328 if (!error.isIgnored()) { … … 443 443 private void clearErrors() { 444 444 if (errors != null) { 445 DataSet ds = Main. main.getCurrentDataSet();445 DataSet ds = Main.getLayerManager().getEditDataSet(); 446 446 if (ds != null) { 447 447 for (TestError e : errors) { -
trunk/src/org/openstreetmap/josm/gui/io/DownloadPrimitivesWithReferrersTask.java
r10436 r10446 157 157 // Warm about deleted primitives 158 158 final Set<PrimitiveId> del = new HashSet<>(); 159 DataSet ds = Main. main.getCurrentDataSet();159 DataSet ds = Main.getLayerManager().getEditDataSet(); 160 160 for (PrimitiveId id : ids) { 161 161 OsmPrimitive osm = ds.getPrimitiveById(id); -
trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPreset.java
r10413 r10446 355 355 return; 356 356 } 357 DataSet ds = Main. main.getCurrentDataSet();357 DataSet ds = Main.getLayerManager().getEditDataSet(); 358 358 Collection<OsmPrimitive> participants = Collections.emptyList(); 359 359 if (Main.main != null && ds != null) { … … 520 520 521 521 protected final void updateEnabledState() { 522 setEnabled(Main.main != null && Main. main.getCurrentDataSet() != null);522 setEnabled(Main.main != null && Main.getLayerManager().getEditDataSet() != null); 523 523 } 524 524 -
trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetSearchPrimitiveDialog.java
r10382 r10446 93 93 TaggingPreset preset = selector.getSelectedPresetAndUpdateClassification(); 94 94 if (preset != null) { 95 final Set<OsmPrimitive> matching = new HashSet<>(Utils.filter(Main. main.getCurrentDataSet().allPrimitives(), preset));96 Main. main.getCurrentDataSet().setSelected(matching);95 final Set<OsmPrimitive> matching = new HashSet<>(Utils.filter(Main.getLayerManager().getEditDataSet().allPrimitives(), preset)); 96 Main.getLayerManager().getEditDataSet().setSelected(matching); 97 97 } 98 98 } -
trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetSelector.java
r10378 r10446 241 241 boolean inTags = ckSearchInTags != null && ckSearchInTags.isSelected(); 242 242 243 DataSet ds = Main. main.getCurrentDataSet();243 DataSet ds = Main.getLayerManager().getEditDataSet(); 244 244 Collection<OsmPrimitive> selected = (ds == null) ? Collections.<OsmPrimitive>emptyList() : ds.getSelected(); 245 245 final List<PresetClassification> result = classifications.getMatchingPresets( … … 372 372 typesInSelectionDirty = false; 373 373 typesInSelection.clear(); 374 if (Main.main == null || Main. main.getCurrentDataSet() == null) return typesInSelection;375 for (OsmPrimitive primitive : Main. main.getCurrentDataSet().getSelected()) {374 if (Main.main == null || Main.getLayerManager().getEditDataSet() == null) return typesInSelection; 375 for (OsmPrimitive primitive : Main.getLayerManager().getEditDataSet().getSelected()) { 376 376 typesInSelection.add(TaggingPresetType.forPrimitive(primitive)); 377 377 } -
trunk/src/org/openstreetmap/josm/gui/util/HighlightHelper.java
r9419 r10446 122 122 */ 123 123 public void findAllHighlighted() { 124 DataSet ds = Main. main.getCurrentDataSet();124 DataSet ds = Main.getLayerManager().getEditDataSet(); 125 125 if (ds != null) { 126 126 highlightedPrimitives.addAll(ds.allNonDeletedPrimitives()); … … 132 132 */ 133 133 public static void clearAllHighlighted() { 134 DataSet ds = Main. main.getCurrentDataSet();134 DataSet ds = Main.getLayerManager().getEditDataSet(); 135 135 if (ds != null) { 136 136 for (OsmPrimitive p: ds.allNonDeletedPrimitives()) { -
trunk/src/org/openstreetmap/josm/io/GpxExporter.java
r9461 r10446 172 172 gpxData = ((GpxLayer) layer).data; 173 173 } else { 174 gpxData = OsmDataLayer.toGpxData(Main. main.getCurrentDataSet(), file);174 gpxData = OsmDataLayer.toGpxData(Main.getLayerManager().getEditDataSet(), file); 175 175 } 176 176 -
trunk/src/org/openstreetmap/josm/io/remotecontrol/AddTagsDialog.java
r10378 r10446 242 242 protected void buttonAction(int buttonIndex, ActionEvent evt) { 243 243 // 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) { 245 245 TableModel tm = propertyTable.getModel(); 246 246 for (int i = 0; i < tm.getRowCount(); i++) { … … 304 304 public static void addTags(String[][] keyValue, String sender, Collection<? extends OsmPrimitive> primitives) { 305 305 if (trustedSenders.contains(sender)) { 306 if (Main. main.getCurrentDataSet() != null) {306 if (Main.getLayerManager().getEditDataSet() != null) { 307 307 for (String[] row : keyValue) { 308 308 Main.main.undoRedo.add(new ChangePropertyCommand(primitives, row[0], row[1])); -
trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/AddNodeHandler.java
r9732 r10446 102 102 } 103 103 104 Main. main.getCurrentDataSet().setSelected(node);104 Main.getLayerManager().getEditDataSet().setSelected(node); 105 105 if (PermissionPrefWithDefault.CHANGE_VIEWPORT.isAllowed()) { 106 106 AutoScaleAction.autoScale("selection"); -
trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/AddWayHandler.java
r10116 r10446 171 171 commands.add(new AddCommand(way)); 172 172 Main.main.undoRedo.add(new SequenceCommand(tr("Add way"), commands)); 173 Main. main.getCurrentDataSet().setSelected(way);173 Main.getLayerManager().getEditDataSet().setSelected(way); 174 174 if (PermissionPrefWithDefault.CHANGE_VIEWPORT.isAllowed()) { 175 175 AutoScaleAction.autoScale("selection"); -
trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/LoadAndZoomHandler.java
r10212 r10446 119 119 // find out whether some data has already been downloaded 120 120 Area present = null; 121 DataSet ds = Main. main.getCurrentDataSet();121 DataSet ds = Main.getLayerManager().getEditDataSet(); 122 122 if (ds != null) { 123 123 present = ds.getDataSourceArea(); … … 158 158 @Override 159 159 public void run() { 160 DataSet ds = Main. main.getCurrentDataSet();160 DataSet ds = Main.getLayerManager().getEditDataSet(); 161 161 if (ds == null) // e.g. download failed 162 162 return; … … 174 174 public void run() { 175 175 Set<OsmPrimitive> newSel = new HashSet<>(); 176 DataSet ds = Main. main.getCurrentDataSet();176 DataSet ds = Main.getLayerManager().getEditDataSet(); 177 177 if (ds == null) // e.g. download failed 178 178 return; … … 200 200 @Override 201 201 public void run() { 202 final DataSet ds = Main. main.getCurrentDataSet();202 final DataSet ds = Main.getLayerManager().getEditDataSet(); 203 203 final Collection<OsmPrimitive> filteredPrimitives = Utils.filter(ds.allPrimitives(), search); 204 204 ds.setSelected(filteredPrimitives); … … 221 221 @Override 222 222 public void run() { 223 if (Main. main.getCurrentDataSet() != null) {223 if (Main.getLayerManager().getEditDataSet() != null) { 224 224 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")); 226 226 } 227 227 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")); 229 229 } 230 230 } -
trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/LoadObjectHandler.java
r10116 r10446 72 72 public void run() { 73 73 final List<PrimitiveId> downloaded = task.getDownloadedId(); 74 final DataSet ds = Main. main.getCurrentDataSet();74 final DataSet ds = Main.getLayerManager().getEditDataSet(); 75 75 if (downloaded != null) { 76 76 GuiHelper.runInEDT(new Runnable() {
Note:
See TracChangeset
for help on using the changeset viewer.