Changeset 9675 in josm
- Timestamp:
- 2016-01-29T22:08:26+01:00 (9 years ago)
- Location:
- trunk
- Files:
-
- 6 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/JosmAction.java
r9594 r9675 208 208 * @return the current edit layer. null, if no edit layer exists 209 209 */ 210 p rotectedstatic OsmDataLayer getEditLayer() {210 public static OsmDataLayer getEditLayer() { 211 211 return Main.main != null ? Main.main.getEditLayer() : null; 212 212 } -
trunk/src/org/openstreetmap/josm/actions/upload/ValidateUploadHook.java
r8870 r9675 14 14 15 15 import org.openstreetmap.josm.Main; 16 import org.openstreetmap.josm.actions.JosmAction; 16 17 import org.openstreetmap.josm.data.APIDataSet; 17 18 import org.openstreetmap.josm.data.osm.OsmPrimitive; … … 73 74 } 74 75 tests = null; 75 OsmDataLayer editLayer = Main.main.getEditLayer(); 76 editLayer.validationErrors.clear(); 77 editLayer.validationErrors.addAll(errors); 78 Main.map.validatorDialog.tree.setErrors(errors); 79 if (errors == null || errors.isEmpty()) 76 OsmDataLayer editLayer = JosmAction.getEditLayer(); 77 if (editLayer != null) { 78 editLayer.validationErrors.clear(); 79 editLayer.validationErrors.addAll(errors); 80 } 81 if (Main.map != null) { 82 Main.map.validatorDialog.tree.setErrors(errors); 83 } 84 if (errors.isEmpty()) 80 85 return true; 81 86 -
trunk/src/org/openstreetmap/josm/data/validation/tests/Coastlines.java
r8840 r9675 12 12 import java.util.List; 13 13 14 import org.openstreetmap.josm. Main;14 import org.openstreetmap.josm.actions.JosmAction; 15 15 import org.openstreetmap.josm.command.ChangeCommand; 16 16 import org.openstreetmap.josm.command.Command; … … 53 53 super.startTest(monitor); 54 54 55 OsmDataLayer layer = Main.main.getEditLayer();55 OsmDataLayer layer = JosmAction.getEditLayer(); 56 56 57 57 if (layer != null) { -
trunk/src/org/openstreetmap/josm/data/validation/tests/UntaggedWay.java
r8882 r9675 8 8 import java.util.Set; 9 9 10 import org.openstreetmap.josm. Main;10 import org.openstreetmap.josm.actions.JosmAction; 11 11 import org.openstreetmap.josm.command.Command; 12 import org.openstreetmap.josm.data.osm.DataSet; 12 13 import org.openstreetmap.josm.data.osm.OsmPrimitive; 13 14 import org.openstreetmap.josm.data.osm.Relation; … … 120 121 public void startTest(ProgressMonitor monitor) { 121 122 super.startTest(monitor); 123 DataSet ds = JosmAction.getCurrentDataSet(); 124 if (ds == null) 125 return; 122 126 waysUsedInRelations = new HashSet<>(); 123 for (Relation r : Main.main.getCurrentDataSet().getRelations()) {127 for (Relation r : ds.getRelations()) { 124 128 if (r.isUsable()) { 125 129 for (RelationMember m : r.getMembers()) {
Note:
See TracChangeset
for help on using the changeset viewer.