Changeset 21616 in osm for applications
- Timestamp:
- 2010-06-08T15:34:46+02:00 (15 years ago)
- Location:
- applications/editors/josm/plugins
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/OSMValidatorPlugin.java
r21539 r21616 48 48 import org.openstreetmap.josm.plugins.validator.tests.SimilarNamedWays; 49 49 import org.openstreetmap.josm.plugins.validator.tests.TagChecker; 50 import org.openstreetmap.josm.plugins.validator.tests.TurnrestrictionTest; 50 51 import org.openstreetmap.josm.plugins.validator.tests.UnclosedWays; 51 52 import org.openstreetmap.josm.plugins.validator.tests.UnconnectedWays; … … 103 104 MultipolygonTest.class, // ID 1601 .. 1699 104 105 RelationChecker.class, // ID 1701 .. 1799 106 TurnrestrictionTest.class, // ID 1801 .. 1899 105 107 }; 106 108 -
applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/tests/MultipolygonTest.java
r20828 r21616 12 12 import org.openstreetmap.josm.Main; 13 13 import org.openstreetmap.josm.data.osm.Node; 14 import org.openstreetmap.josm.data.osm.OsmPrimitive; 14 15 import org.openstreetmap.josm.data.osm.Relation; 15 16 import org.openstreetmap.josm.data.osm.RelationMember; … … 18 19 import org.openstreetmap.josm.data.osm.visitor.paint.relations.Multipolygon.JoinedWay; 19 20 import org.openstreetmap.josm.data.osm.visitor.paint.relations.Multipolygon.PolyData.Intersection; 21 import org.openstreetmap.josm.gui.mappaint.AreaElemStyle; 22 import org.openstreetmap.josm.gui.mappaint.ElemStyle; 23 import org.openstreetmap.josm.gui.mappaint.ElemStyles; 24 import org.openstreetmap.josm.gui.mappaint.MapPaintStyles; 25 import org.openstreetmap.josm.plugins.validator.OSMValidatorPlugin; 20 26 import org.openstreetmap.josm.plugins.validator.Severity; 21 27 import org.openstreetmap.josm.plugins.validator.Test; … … 30 36 protected static final int INNER_WAY_OUTSIDE = 1605; 31 37 protected static final int CROSSING_WAYS = 1606; 38 protected static final int OUTER_STYLE_MISMATCH = 1607; 39 protected static final int INNER_STYLE_MISMATCH = 1608; 40 protected static final int NOT_CLOSED = 1609; 41 protected static final int NO_STYLE = 1610; 42 protected static final int NO_STYLE_POLYGON = 1611; 43 44 private static ElemStyles.StyleSet styles; 32 45 33 46 private final List<List<Node>> nonClosedWays = new ArrayList<List<Node>>(); … … 36 49 super(tr("Multipolygon"), 37 50 tr("This test checks if multipolygons are valid")); 51 } 52 53 @Override 54 public void initialize(OSMValidatorPlugin plugin) throws Exception 55 { 56 styles = MapPaintStyles.getStyles().getStyleSet(); 38 57 } 39 58 … … 94 113 95 114 @Override 115 public void visit(Way w) { 116 if (styles != null && !w.isClosed()) 117 { 118 ElemStyle e = styles.getArea(w); 119 if(e instanceof AreaElemStyle && !((AreaElemStyle)e).closed) 120 errors.add( new TestError(this, Severity.WARNING, tr("Area style way is not closed"), NOT_CLOSED, w)); 121 } 122 } 123 124 @Override 96 125 public void visit(Relation r) { 97 126 nonClosedWays.clear(); … … 114 143 List<List<Node>> innerWays = joinWays(polygon.getInnerWays()); // Side effect - sets nonClosedWays 115 144 List<List<Node>> outerWays = joinWays(polygon.getOuterWays()); 145 146 if(styles != null) { 147 ElemStyle wayStyle = styles.get(r); 148 149 // If area style was not found for relation then use style of ways 150 if(!(wayStyle instanceof AreaElemStyle)) { 151 errors.add( new TestError(this, Severity.OTHER, tr("No style in multipolygon relation"), 152 NO_STYLE_POLYGON, r)); 153 for (Way w : polygon.getOuterWays()) { 154 wayStyle = styles.getArea(w); 155 if(wayStyle != null) { 156 break; 157 } 158 } 159 } 160 161 if (wayStyle instanceof AreaElemStyle) { 162 for (Way wInner : polygon.getInnerWays()) 163 { 164 ElemStyle innerStyle = styles.get(wInner); 165 if(wayStyle != null && wayStyle.equals(innerStyle)) { 166 List<OsmPrimitive> l = new ArrayList<OsmPrimitive>(); 167 l.add(r); 168 l.add(wInner); 169 errors.add( new TestError(this, Severity.WARNING, tr("Style for inner way equals multipolygon"), 170 INNER_STYLE_MISMATCH, l, Collections.singletonList(wInner))); 171 } 172 } 173 for (Way wOuter : polygon.getOuterWays()) 174 { 175 ElemStyle outerStyle = styles.get(wOuter); 176 if(outerStyle instanceof AreaElemStyle && !wayStyle.equals(outerStyle)) { 177 List<OsmPrimitive> l = new ArrayList<OsmPrimitive>(); 178 l.add(r); 179 l.add(wOuter); 180 errors.add( new TestError(this, Severity.WARNING, tr("Style for outer way mismatches"), 181 OUTER_STYLE_MISMATCH, l, Collections.singletonList(wOuter))); 182 } 183 } 184 } 185 else 186 errors.add( new TestError(this, Severity.OTHER, tr("No style for multipolygon"), 187 NO_STYLE, r)); 188 } 116 189 117 190 if (!nonClosedWays.isEmpty()) { … … 134 207 } 135 208 } 136 if (outside | crossing) {209 if (outside || crossing) { 137 210 List<List<Node>> highlights = new ArrayList<List<Node>>(); 138 211 highlights.add(pdInner); 139 212 if (outside) { 140 errors.add(new TestError(this, Severity.WARNING, tr("Multipolygon inner way is outside ."), INNER_WAY_OUTSIDE, Collections.singletonList(r), highlights));213 errors.add(new TestError(this, Severity.WARNING, tr("Multipolygon inner way is outside"), INNER_WAY_OUTSIDE, Collections.singletonList(r), highlights)); 141 214 } else if (crossing) { 142 215 highlights.add(outerWay); … … 155 228 } 156 229 } else { 157 errors.add( new TestError(this, Severity.WARNING, tr("Non-Way in multipolygon ."), WRONG_MEMBER_TYPE, rm.getMember()));230 errors.add( new TestError(this, Severity.WARNING, tr("Non-Way in multipolygon"), WRONG_MEMBER_TYPE, rm.getMember())); 158 231 } 159 232 } -
applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/tests/TagChecker.java
r21540 r21616 92 92 public static final String PREF_CHECK_COMPLEX = PREFIX + ".checkComplex"; 93 93 public static final String PREF_CHECK_FIXMES = PREFIX + ".checkFixmes"; 94 public static final String PREF_CHECK_PAINT = PREFIX + ".paint";95 94 96 95 public static final String PREF_SOURCES = PREFIX + ".sources"; … … 103 102 public static final String PREF_CHECK_COMPLEX_BEFORE_UPLOAD = PREF_CHECK_COMPLEX + "BeforeUpload"; 104 103 public static final String PREF_CHECK_FIXMES_BEFORE_UPLOAD = PREF_CHECK_FIXMES + "BeforeUpload"; 105 public static final String PREF_CHECK_PAINT_BEFORE_UPLOAD = PREF_CHECK_PAINT + "BeforeUpload";106 104 107 105 protected boolean checkKeys = false; … … 109 107 protected boolean checkComplex = false; 110 108 protected boolean checkFixmes = false; 111 protected boolean checkPaint = false;112 109 113 110 protected JCheckBox prefCheckKeys; … … 137 134 protected static int INVALID_SPACE = 1204; 138 135 protected static int INVALID_KEY_SPACE = 1205; 139 protected static int INVALID_HTML = 1206; 140 protected static int PAINT = 1207; 136 protected static int INVALID_HTML = 1206; /* 1207 was PAINT */ 141 137 protected static int LONG_VALUE = 1208; 142 138 protected static int LONG_KEY = 1209; … … 466 462 } 467 463 } 468 if(checkPaint)469 {470 List<String> pe = p.getDataSet().getErrors(p);471 if(pe != null)472 {473 for(String s: pe)474 {475 /* passing translated text also to original string, as we already476 translated the stuff before. Makes the ignore file language dependend. */477 errors.add( new TestError(this, Severity.WARNING, tr("Painting problem"),478 s, s, PAINT, p) );479 withErrors.add(p, "P");480 }481 }482 }483 464 484 465 Map<String, String> props = (p.getKeys() == null) ? Collections.<String, String>emptyMap() : p.getKeys(); … … 627 608 if( isBeforeUpload ) 628 609 checkFixmes = checkFixmes && Main.pref.getBoolean(PREF_CHECK_FIXMES_BEFORE_UPLOAD, true); 629 630 checkPaint = Main.pref.getBoolean(PREF_CHECK_PAINT, true);631 if( isBeforeUpload )632 checkPaint = checkPaint && Main.pref.getBoolean(PREF_CHECK_PAINT_BEFORE_UPLOAD, true);633 610 } 634 611 … … 636 613 public void visit(Collection<OsmPrimitive> selection) 637 614 { 638 if( checkKeys || checkValues || checkComplex || check Paint || checkFixmes)615 if( checkKeys || checkValues || checkComplex || checkFixmes) 639 616 super.visit(selection); 640 617 } … … 782 759 testPanel.add(prefCheckFixmesBeforeUpload, a); 783 760 784 prefCheckPaint = new JCheckBox(tr("Check for paint notes."), Main.pref.getBoolean(PREF_CHECK_PAINT, true));785 prefCheckPaint.setToolTipText(tr("Check if map painting found data errors."));786 testPanel.add(prefCheckPaint, GBC.std().insets(20,0,0,0));787 788 prefCheckPaintBeforeUpload = new JCheckBox();789 prefCheckPaintBeforeUpload.setSelected(Main.pref.getBoolean(PREF_CHECK_PAINT_BEFORE_UPLOAD, true));790 testPanel.add(prefCheckPaintBeforeUpload, a);791 792 761 prefUseDataFile = new JCheckBox(tr("Use default data file."), Main.pref.getBoolean(PREF_USE_DATA_FILE, true)); 793 762 prefUseDataFile.setToolTipText(tr("Use the default data file (recommended).")); … … 824 793 Main.pref.put(PREF_CHECK_KEYS, prefCheckKeys.isSelected()); 825 794 Main.pref.put(PREF_CHECK_FIXMES, prefCheckFixmes.isSelected()); 826 Main.pref.put(PREF_CHECK_PAINT, prefCheckPaint.isSelected());827 795 Main.pref.put(PREF_CHECK_VALUES_BEFORE_UPLOAD, prefCheckValuesBeforeUpload.isSelected()); 828 796 Main.pref.put(PREF_CHECK_COMPLEX_BEFORE_UPLOAD, prefCheckComplexBeforeUpload.isSelected()); 829 797 Main.pref.put(PREF_CHECK_KEYS_BEFORE_UPLOAD, prefCheckKeysBeforeUpload.isSelected()); 830 798 Main.pref.put(PREF_CHECK_FIXMES_BEFORE_UPLOAD, prefCheckFixmesBeforeUpload.isSelected()); 831 Main.pref.put(PREF_CHECK_PAINT_BEFORE_UPLOAD, prefCheckPaintBeforeUpload.isSelected());832 799 Main.pref.put(PREF_USE_DATA_FILE, prefUseDataFile.isSelected()); 833 800 Main.pref.put(PREF_USE_IGNORE_FILE, prefUseIgnoreFile.isSelected()); -
applications/editors/josm/plugins/videomapping/build.xml
r21298 r21616 47 47 <property name="ant.build.javac.target" value="1.5"/> 48 48 <property name="plugin.jar" value="${plugin.dist.dir}/${ant.project.name}.jar"/> 49 <property name="vlcj" value="lib/vlcj-1.1f.jar"/>50 49 <!-- 51 50 ********************************************************** … … 67 66 <compilerarg value="-Xlint:deprecation"/> 68 67 <compilerarg value="-Xlint:unchecked"/> 69 <classpath> 70 <pathelement location="${vlcj}"/> <!--Add external library --> 71 </classpath> 68 <classpath> 69 <fileset dir="lib"> 70 <include name="**/*.jar"/> 71 </fileset> 72 </classpath> 72 73 </javac> 73 74 </target>
Note:
See TracChangeset
for help on using the changeset viewer.