Changeset 12691 in josm for trunk/src/org
- Timestamp:
- 2017-08-28T19:26:47+02:00 (7 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/Main.java
r12665 r12691 632 632 633 633 /** 634 * Gets the data set of the active edit layer. 635 * @return That data set, <code>null</code> if there is no edit layer. 636 * @since 12691 637 */ 638 public DataSet getEditDataSet() { 639 return null; 640 } 641 642 /** 634 643 * Registers a {@code JosmAction} and its shortcut. 635 644 * @param action action defining its own shortcut -
trunk/src/org/openstreetmap/josm/data/UndoRedoHandler.java
r12636 r12691 86 86 */ 87 87 public synchronized void add(final Command c) { 88 DataSet ds = Optional.ofNullable(c.getAffectedDataSet()).orElseGet(() -> Main Application.getLayerManager().getEditDataSet());88 DataSet ds = Optional.ofNullable(c.getAffectedDataSet()).orElseGet(() -> Main.main.getEditDataSet()); 89 89 Collection<? extends OsmPrimitive> oldSelection = null; 90 90 if (ds != null) { … … 115 115 if (commands.isEmpty()) 116 116 return; 117 DataSet ds = Main Application.getLayerManager().getEditDataSet();117 DataSet ds = Main.main.getEditDataSet(); 118 118 Collection<? extends OsmPrimitive> oldSelection = null; 119 119 if (ds != null) { … … 156 156 if (redoCommands.isEmpty()) 157 157 return; 158 DataSet ds = Main Application.getLayerManager().getEditDataSet();158 DataSet ds = Main.main.getEditDataSet(); 159 159 Collection<? extends OsmPrimitive> oldSelection = ds.getSelected(); 160 160 for (int i = 0; i < num; ++i) { -
trunk/src/org/openstreetmap/josm/data/osm/FilterModel.java
r12656 r12691 96 96 */ 97 97 public void executeFilters() { 98 DataSet ds = Main Application.getLayerManager().getEditDataSet();98 DataSet ds = Main.main.getEditDataSet(); 99 99 changed = false; 100 100 if (ds == null) { … … 145 145 */ 146 146 public void executeFilters(Collection<? extends OsmPrimitive> primitives) { 147 DataSet ds = Main Application.getLayerManager().getEditDataSet();147 DataSet ds = Main.main.getEditDataSet(); 148 148 if (ds == null) 149 149 return; … … 207 207 */ 208 208 public void clearFilterFlags() { 209 DataSet ds = Main Application.getLayerManager().getEditDataSet();209 DataSet ds = Main.main.getEditDataSet(); 210 210 if (ds != null) { 211 211 FilterWorker.clearFilterFlags(ds.allPrimitives()); -
trunk/src/org/openstreetmap/josm/data/validation/tests/UnconnectedWays.java
r12649 r12691 32 32 import org.openstreetmap.josm.data.validation.Test; 33 33 import org.openstreetmap.josm.data.validation.TestError; 34 import org.openstreetmap.josm.gui.MainApplication;35 34 import org.openstreetmap.josm.gui.progress.ProgressMonitor; 36 35 import org.openstreetmap.josm.tools.Logging; … … 169 168 mindist = Main.pref.getDouble(PREFIX + ".node_way_distance", 10.0); 170 169 minmiddledist = Main.pref.getDouble(PREFIX + ".way_way_distance", 0.0); 171 DataSet dataSet = Main Application.getLayerManager().getEditDataSet();170 DataSet dataSet = Main.main.getEditDataSet(); 172 171 dsArea = dataSet == null ? null : dataSet.getDataSourceArea(); 173 172 } -
trunk/src/org/openstreetmap/josm/data/validation/tests/UntaggedWay.java
r12636 r12691 9 9 import java.util.Set; 10 10 11 import org.openstreetmap.josm.Main; 11 12 import org.openstreetmap.josm.command.Command; 12 13 import org.openstreetmap.josm.data.osm.DataSet; … … 18 19 import org.openstreetmap.josm.data.validation.Test; 19 20 import org.openstreetmap.josm.data.validation.TestError; 20 import org.openstreetmap.josm.gui.MainApplication;21 21 import org.openstreetmap.josm.gui.progress.ProgressMonitor; 22 22 … … 142 142 public void startTest(ProgressMonitor monitor) { 143 143 super.startTest(monitor); 144 DataSet ds = Main Application.getLayerManager().getEditDataSet();144 DataSet ds = Main.main.getEditDataSet(); 145 145 if (ds == null) 146 146 return; -
trunk/src/org/openstreetmap/josm/gui/MainApplication.java
r12686 r12691 397 397 } 398 398 399 @Override 400 public DataSet getEditDataSet() { 401 return getLayerManager().getEditDataSet(); 402 } 403 399 404 /** 400 405 * Returns the command-line arguments used to run the application. -
trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPreset.java
r12656 r12691 382 382 return; 383 383 } 384 DataSet ds = Main Application.getLayerManager().getEditDataSet();384 DataSet ds = Main.main.getEditDataSet(); 385 385 Collection<OsmPrimitive> participants = Collections.emptyList(); 386 if ( Main.main != null &&ds != null) {386 if (ds != null) { 387 387 participants = ds.getSelected(); 388 388 } … … 556 556 557 557 protected final void updateEnabledState() { 558 setEnabled(Main.main != null && Main Application.getLayerManager().getEditDataSet() != null);558 setEnabled(Main.main != null && Main.main.getEditDataSet() != null); 559 559 } 560 560 -
trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetSearchPrimitiveDialog.java
r12637 r12691 87 87 TaggingPreset preset = selector.getSelectedPresetAndUpdateClassification(); 88 88 if (preset != null) { 89 final Set<OsmPrimitive> matching = new HashSet<>(Main Application.getLayerManager().getEditDataSet().getPrimitives(preset));90 Main Application.getLayerManager().getEditDataSet().setSelected(matching);89 final Set<OsmPrimitive> matching = new HashSet<>(Main.main.getEditDataSet().getPrimitives(preset)); 90 Main.main.getEditDataSet().setSelected(matching); 91 91 } 92 92 } -
trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetSelector.java
r12637 r12691 236 236 boolean inTags = ckSearchInTags != null && ckSearchInTags.isSelected(); 237 237 238 DataSet ds = Main Application.getLayerManager().getEditDataSet();238 DataSet ds = Main.main.getEditDataSet(); 239 239 Collection<OsmPrimitive> selected = (ds == null) ? Collections.<OsmPrimitive>emptyList() : ds.getSelected(); 240 240 final List<PresetClassification> result = classifications.getMatchingPresets( … … 356 356 typesInSelectionDirty = false; 357 357 typesInSelection.clear(); 358 if (Main.main == null || Main Application.getLayerManager().getEditDataSet() == null) return typesInSelection;359 for (OsmPrimitive primitive : Main Application.getLayerManager().getEditDataSet().getSelected()) {358 if (Main.main == null || Main.main.getEditDataSet() == null) return typesInSelection; 359 for (OsmPrimitive primitive : Main.main.getEditDataSet().getSelected()) { 360 360 typesInSelection.add(TaggingPresetType.forPrimitive(primitive)); 361 361 }
Note:
See TracChangeset
for help on using the changeset viewer.