Changeset 18088 in osm for applications/editors/josm/plugins/validator
- Timestamp:
- 2009-10-11T18:22:56+02:00 (15 years ago)
- Location:
- applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/Test.java
r17722 r18088 8 8 import javax.swing.JPanel; 9 9 10 import org.openstreetmap.josm.Main; 10 11 import org.openstreetmap.josm.command.Command; 12 import org.openstreetmap.josm.data.osm.BackreferencedDataSet; 11 13 import org.openstreetmap.josm.data.osm.Node; 12 14 import org.openstreetmap.josm.data.osm.OsmPrimitive; … … 56 58 /** Whether the test is run on a partial selection data */ 57 59 protected boolean partialSelection; 58 60 59 61 /** the progress monitor to use */ 60 62 protected ProgressMonitor progressMonitor; 63 64 /** 65 * the data structure with child->parent references 66 */ 67 protected BackreferencedDataSet backreferenceDataSet; 61 68 62 69 /** … … 93 100 */ 94 101 public void startTest(ProgressMonitor progressMonitor) { 95 if (progressMonitor == null) { 96 this.progressMonitor = NullProgressMonitor.INSTANCE; 97 } else { 98 this.progressMonitor = progressMonitor; 99 } 100 this.progressMonitor.beginTask(tr("Running test {0}", name)); 101 errors = new ArrayList<TestError>(30); 102 backreferenceDataSet = new BackreferencedDataSet(Main.main.getCurrentDataSet()); 103 backreferenceDataSet.build(); 104 if (progressMonitor == null) { 105 this.progressMonitor = NullProgressMonitor.INSTANCE; 106 } else { 107 this.progressMonitor = progressMonitor; 108 } 109 this.progressMonitor.beginTask(tr("Running test {0}", name)); 110 errors = new ArrayList<TestError>(30); 102 111 } 103 112 … … 125 134 */ 126 135 public void endTest() { 127 progressMonitor.finishTask(); 128 progressMonitor = null; 136 progressMonitor.finishTask(); 137 progressMonitor = null; 138 backreferenceDataSet = null; 129 139 } 130 140 … … 137 147 public void visit(Collection<OsmPrimitive> selection) 138 148 { 139 149 progressMonitor.setTicksCount(selection.size()); 140 150 for (OsmPrimitive p : selection) { 141 151 if( p.isUsable() ) -
applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/tests/UnclosedWays.java
r17722 r18088 11 11 import org.openstreetmap.josm.data.osm.OsmPrimitive; 12 12 import org.openstreetmap.josm.data.osm.OsmUtils; 13 import org.openstreetmap.josm.data.osm.Relation; 13 14 import org.openstreetmap.josm.data.osm.Way; 14 15 import org.openstreetmap.josm.gui.progress.ProgressMonitor; … … 36 37 @Override 37 38 public void startTest(ProgressMonitor monitor) { 38 39 super.startTest(monitor); 39 40 _errorWays = new Bag<Way, Way>(); 40 41 } … … 108 109 if (type != null && !w.isClosed()) 109 110 { 111 for (OsmPrimitive parent: this.backreferenceDataSet.getParents(w)) { 112 if (parent instanceof Relation && "multipolygon".equals(parent.get("type"))) 113 return; 114 } 110 115 Node f = w.getNode(0); 111 116 Node l = w.getNode(w.getNodesCount() - 1); -
applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/tests/UntaggedWay.java
r17722 r18088 90 90 if( !hasName && !isRoundabout) 91 91 errors.add( new TestError(this, Severity.WARNING, tr("Unnamed ways"), UNNAMED_WAY, w) ); 92 92 else if(isRoundabout) 93 93 errors.add( new TestError(this, Severity.WARNING, tr("Unnamed junction"), UNNAMED_JUNCTION, w) ); 94 94 } … … 115 115 public void startTest(ProgressMonitor monitor) 116 116 { 117 117 super.startTest(monitor); 118 118 multipolygonways = new LinkedList<Way>(); 119 119 for (final Relation r : Main.main.getCurrentDataSet().relations)
Note:
See TracChangeset
for help on using the changeset viewer.