Changeset 17540 in osm for applications/editors/josm/plugins/validator/src
- Timestamp:
- 2009-09-09T00:01:56+02:00 (15 years ago)
- Location:
- applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/OSMValidatorPlugin.java
r17479 r17540 156 156 } 157 157 158 private ValidateUploadHook uploadHook; 159 158 160 @Override 159 161 public void mapFrameInitialized(MapFrame oldFrame, MapFrame newFrame) { … … 168 170 Layer.listeners.remove(this); 169 171 170 LinkedList<UploadHook> hooks = ((UploadAction) Main.main.menu.upload).uploadHooks; 171 Iterator<UploadHook> hooksIt = hooks.iterator(); 172 while (hooksIt.hasNext()) { 173 if (hooksIt.next() instanceof ValidateUploadHook) { 174 if (newFrame == null) 175 hooksIt.remove(); 176 break; 177 } 178 } 179 if (newFrame != null) 180 hooks.add(0, new ValidateUploadHook(this)); 172 if (newFrame != null) { 173 UploadAction.registerUploadHook(uploadHook = new ValidateUploadHook(this)); 174 } else { 175 UploadAction.unregisterUploadHook(uploadHook); 176 uploadHook = null; 177 } 181 178 } 182 179 -
applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/ValidateUploadHook.java
r17351 r17540 14 14 import org.openstreetmap.josm.Main; 15 15 import org.openstreetmap.josm.actions.UploadAction.UploadHook; 16 import org.openstreetmap.josm.data.APIDataSet; 16 17 import org.openstreetmap.josm.data.osm.DataSet; 17 18 import org.openstreetmap.josm.data.osm.OsmPrimitive; … … 42 43 * Validate the modified data before uploading 43 44 */ 44 public boolean checkUpload( Collection<OsmPrimitive> add, Collection<OsmPrimitive> update, Collection<OsmPrimitive> delete)45 public boolean checkUpload(APIDataSet apiDataSet) 45 46 { 46 47 Collection<Test> tests = OSMValidatorPlugin.getEnabledTests(true); … … 49 50 50 51 AgregatePrimitivesVisitor v = new AgregatePrimitivesVisitor(); 51 v.visit(a dd);52 Collection<OsmPrimitive> selection = v.visit( update);52 v.visit(apiDataSet.getPrimitivesToAdd()); 53 Collection<OsmPrimitive> selection = v.visit(apiDataSet.getPrimitivesToUpdate()); 53 54 54 55 List<TestError> errors = new ArrayList<TestError>(30); -
applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/tests/UntaggedWay.java
r17479 r17540 119 119 if(r.isUsable() && "multipolygon".equals(r.get("type"))) 120 120 { 121 for (RelationMember m : r. members)121 for (RelationMember m : r.getMembers()) 122 122 { 123 if(m. member!= null && m.memberinstanceof Way &&124 m. member.isUsable() && !m.member.isTagged())125 multipolygonways.add((Way)m. member);123 if(m.getMember() != null && m.getMember() instanceof Way && 124 m.getMember().isUsable() && !m.getMember().isTagged()) 125 multipolygonways.add((Way)m.getMember()); 126 126 } 127 127 } -
applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/util/AgregatePrimitivesVisitor.java
r17351 r17540 65 65 if (!aggregatedData.contains(r)) { 66 66 aggregatedData.add(r); 67 for (RelationMember m : r. members) {68 m. member.visit(this);67 for (RelationMember m : r.getMembers()) { 68 m.getMember().visit(this); 69 69 } 70 70 }
Note:
See TracChangeset
for help on using the changeset viewer.