Changeset 14015 in osm for applications/editors/josm/plugins
- Timestamp:
- 2009-03-08T14:39:18+01:00 (16 years ago)
- Location:
- applications/editors/josm/plugins
- Files:
-
- 30 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/DirectUpload/build.xml
r14003 r14015 10 10 <target name="compile" depends="init"> 11 11 <echo message="creating ${plugin.jar}"/> 12 <javac srcdir="src" classpath="${josm}" debug=" false" destdir="${plugin.build.dir}">12 <javac srcdir="src" classpath="${josm}" debug="true" destdir="${plugin.build.dir}"> 13 13 <compilerarg value="-Xlint:deprecation"/> 14 14 <compilerarg value="-Xlint:unchecked"/> -
applications/editors/josm/plugins/agpifoj/build.xml
r14003 r14015 10 10 <target name="compile" depends="init"> 11 11 <echo message="creating ${plugin.jar}"/> 12 <javac srcdir="src" classpath="${josm}" debug=" false" destdir="${plugin.build.dir}">12 <javac srcdir="src" classpath="${josm}" debug="true" destdir="${plugin.build.dir}"> 13 13 <compilerarg value="-Xlint:deprecation"/> 14 14 <compilerarg value="-Xlint:unchecked"/> -
applications/editors/josm/plugins/cadastre-fr/build.xml
r14003 r14015 10 10 <target name="compile" depends="init"> 11 11 <echo message="creating ${plugin.jar}"/> 12 <javac srcdir="src" classpath="${josm}" debug=" false" destdir="${plugin.build.dir}">12 <javac srcdir="src" classpath="${josm}" debug="true" destdir="${plugin.build.dir}"> 13 13 <compilerarg value="-Xlint:deprecation"/> 14 14 <compilerarg value="-Xlint:unchecked"/> -
applications/editors/josm/plugins/colorscheme/build.xml
r14003 r14015 10 10 <target name="compile" depends="init"> 11 11 <echo message="creating ${plugin.jar}"/> 12 <javac srcdir="src" classpath="${josm}" debug=" false" destdir="${plugin.build.dir}">12 <javac srcdir="src" classpath="${josm}" debug="true" destdir="${plugin.build.dir}"> 13 13 <compilerarg value="-Xlint:deprecation"/> 14 14 <compilerarg value="-Xlint:unchecked"/> -
applications/editors/josm/plugins/globalsat/build.xml
r14003 r14015 11 11 <target name="compile" depends="init"> 12 12 <echo message="creating ${plugin.jar}"/> 13 <javac srcdir="src" debug=" false" destdir="${plugin.build.dir}">13 <javac srcdir="src" debug="true" destdir="${plugin.build.dir}"> 14 14 <compilerarg value="-Xlint:deprecation"/> 15 15 <compilerarg value="-Xlint:unchecked"/> -
applications/editors/josm/plugins/imagewaypoint/build.xml
r14003 r14015 10 10 <target name="compile" depends="init"> 11 11 <echo message="creating ${plugin.jar}"/> 12 <javac srcdir="src" classpath="${josm}" debug=" false" destdir="${plugin.build.dir}">12 <javac srcdir="src" classpath="${josm}" debug="true" destdir="${plugin.build.dir}"> 13 13 <compilerarg value="-Xlint:deprecation"/> 14 14 <compilerarg value="-Xlint:unchecked"/> -
applications/editors/josm/plugins/lakewalker/build.xml
r14003 r14015 10 10 <target name="compile" depends="init"> 11 11 <echo message="creating ${plugin.jar}"/> 12 <javac srcdir="src" classpath="${josm}" debug=" false" destdir="${plugin.build.dir}">12 <javac srcdir="src" classpath="${josm}" debug="true" destdir="${plugin.build.dir}"> 13 13 <compilerarg value="-Xlint:deprecation"/> 14 14 <compilerarg value="-Xlint:unchecked"/> -
applications/editors/josm/plugins/livegps/build.xml
r14003 r14015 10 10 <target name="compile" depends="init"> 11 11 <echo message="creating ${plugin.jar}"/> 12 <javac srcdir="src" classpath="${josm}" debug=" false" destdir="${plugin.build.dir}">12 <javac srcdir="src" classpath="${josm}" debug="true" destdir="${plugin.build.dir}"> 13 13 <compilerarg value="-Xlint:deprecation"/> 14 14 <compilerarg value="-Xlint:unchecked"/> -
applications/editors/josm/plugins/measurement/build.xml
r14003 r14015 10 10 <target name="compile" depends="init"> 11 11 <echo message="creating ${plugin.jar}"/> 12 <javac srcdir="src" classpath="${josm}" debug=" false" destdir="${plugin.build.dir}">12 <javac srcdir="src" classpath="${josm}" debug="true" destdir="${plugin.build.dir}"> 13 13 <compilerarg value="-Xlint:deprecation"/> 14 14 <compilerarg value="-Xlint:unchecked"/> -
applications/editors/josm/plugins/nearclick/build.xml
r14003 r14015 10 10 <target name="compile" depends="init"> 11 11 <echo message="creating ${plugin.jar}"/> 12 <javac srcdir="src" classpath="${josm}" debug=" false" destdir="${plugin.build.dir}">12 <javac srcdir="src" classpath="${josm}" debug="true" destdir="${plugin.build.dir}"> 13 13 <compilerarg value="-Xlint:deprecation"/> 14 14 <compilerarg value="-Xlint:unchecked"/> -
applications/editors/josm/plugins/openstreetbugs/build.xml
r14003 r14015 10 10 <target name="compile" depends="init"> 11 11 <echo message="creating ${plugin.jar}"/> 12 <javac srcdir="src" classpath="${josm}" debug=" false" destdir="${plugin.build.dir}">12 <javac srcdir="src" classpath="${josm}" debug="true" destdir="${plugin.build.dir}"> 13 13 <compilerarg value="-Xlint:deprecation"/> 14 14 <compilerarg value="-Xlint:unchecked"/> -
applications/editors/josm/plugins/openvisible/build.xml
r14003 r14015 10 10 <target name="compile" depends="init"> 11 11 <echo message="creating ${plugin.jar}"/> 12 <javac srcdir="src" classpath="${josm}" debug=" false" destdir="${plugin.build.dir}">12 <javac srcdir="src" classpath="${josm}" debug="true" destdir="${plugin.build.dir}"> 13 13 <compilerarg value="-Xlint:deprecation"/> 14 14 <compilerarg value="-Xlint:unchecked"/> -
applications/editors/josm/plugins/osmarender/build.xml
r14003 r14015 12 12 <target name="compile" depends="init"> 13 13 <echo message="creating ${plugin.jar}"/> 14 <javac srcdir="src" classpath="${josm}" debug=" false" destdir="${plugin.build.dir}">14 <javac srcdir="src" classpath="${josm}" debug="true" destdir="${plugin.build.dir}"> 15 15 <compilerarg value="-Xlint:deprecation"/> 16 16 <compilerarg value="-Xlint:unchecked"/> -
applications/editors/josm/plugins/plastic_laf/build.xml
r14003 r14015 10 10 <target name="compile" depends="init"> 11 11 <echo message="creating ${plugin.jar}"/> 12 <javac srcdir="src" classpath="${josm}" debug=" false" destdir="${plugin.build.dir}">12 <javac srcdir="src" classpath="${josm}" debug="true" destdir="${plugin.build.dir}"> 13 13 <compilerarg value="-Xlint:deprecation"/> 14 14 <compilerarg value="-Xlint:unchecked"/> -
applications/editors/josm/plugins/remotecontrol/build.xml
r14003 r14015 10 10 <target name="compile" depends="init"> 11 11 <echo message="creating ${plugin.jar}"/> 12 <javac srcdir="src" classpath="${josm}" debug=" false" destdir="${plugin.build.dir}">12 <javac srcdir="src" classpath="${josm}" debug="true" destdir="${plugin.build.dir}"> 13 13 <compilerarg value="-Xlint:deprecation"/> 14 14 <compilerarg value="-Xlint:unchecked"/> -
applications/editors/josm/plugins/slippymap/build.xml
r14003 r14015 10 10 <target name="compile" depends="init"> 11 11 <echo message="creating ${plugin.jar}"/> 12 <javac srcdir="src" classpath="${josm}" debug=" false" destdir="${plugin.build.dir}">12 <javac srcdir="src" classpath="${josm}" debug="true" destdir="${plugin.build.dir}"> 13 13 <compilerarg value="-Xlint:deprecation"/> 14 14 <compilerarg value="-Xlint:unchecked"/> -
applications/editors/josm/plugins/surveyor/build.xml
r14003 r14015 11 11 <target name="compile" depends="init"> 12 12 <echo message="creating ${plugin.jar}"/> 13 <javac srcdir="src" debug=" false" destdir="${plugin.build.dir}">13 <javac srcdir="src" debug="true" destdir="${plugin.build.dir}"> 14 14 <compilerarg value="-Xlint:deprecation"/> 15 15 <compilerarg value="-Xlint:unchecked"/> -
applications/editors/josm/plugins/tagging-preset-tester/build.xml
r14003 r14015 10 10 <target name="compile" depends="init"> 11 11 <echo message="creating ${plugin.jar}"/> 12 <javac srcdir="src" classpath="${josm}" debug=" false" destdir="${plugin.build.dir}">12 <javac srcdir="src" classpath="${josm}" debug="true" destdir="${plugin.build.dir}"> 13 13 <compilerarg value="-Xlint:deprecation"/> 14 14 <compilerarg value="-Xlint:unchecked"/> -
applications/editors/josm/plugins/tcxplugin/build.xml
r14005 r14015 10 10 <target name="compile" depends="init"> 11 11 <echo message="creating ${plugin.jar}"/> 12 <javac srcdir="src" debug=" false" destdir="${plugin.build.dir}">12 <javac srcdir="src" debug="true" destdir="${plugin.build.dir}"> 13 13 <compilerarg value="-Xlint:deprecation"/> 14 14 <compilerarg value="-Xlint:unchecked"/> -
applications/editors/josm/plugins/terracer/build.xml
r14003 r14015 10 10 <target name="compile" depends="init"> 11 11 <echo message="creating ${plugin.jar}"/> 12 <javac srcdir="src" classpath="${josm}" debug=" false" destdir="${plugin.build.dir}">12 <javac srcdir="src" classpath="${josm}" debug="true" destdir="${plugin.build.dir}"> 13 13 <compilerarg value="-Xlint:deprecation"/> 14 14 <compilerarg value="-Xlint:unchecked"/> -
applications/editors/josm/plugins/usertools/build.xml
r14003 r14015 10 10 <target name="compile" depends="init"> 11 11 <echo message="creating ${plugin.jar}"/> 12 <javac srcdir="src" classpath="${josm}" debug=" false" destdir="${plugin.build.dir}">12 <javac srcdir="src" classpath="${josm}" debug="true" destdir="${plugin.build.dir}"> 13 13 <compilerarg value="-Xlint:deprecation"/> 14 14 <compilerarg value="-Xlint:unchecked"/> -
applications/editors/josm/plugins/utilsplugin/build.xml
r14003 r14015 10 10 <target name="compile" depends="init"> 11 11 <echo message="creating ${plugin.jar}"/> 12 <javac srcdir="src" classpath="${josm}" debug=" false" destdir="${plugin.build.dir}">12 <javac srcdir="src" classpath="${josm}" debug="true" destdir="${plugin.build.dir}"> 13 13 <compilerarg value="-Xlint:deprecation"/> 14 14 <compilerarg value="-Xlint:unchecked"/> -
applications/editors/josm/plugins/validator/build.xml
r14003 r14015 10 10 <target name="compile" depends="init"> 11 11 <echo message="creating ${plugin.jar}"/> 12 <javac srcdir="src" classpath="${josm}" debug=" false" destdir="${plugin.build.dir}">12 <javac srcdir="src" classpath="${josm}" debug="true" destdir="${plugin.build.dir}"> 13 13 <compilerarg value="-Xlint:deprecation"/> 14 14 <compilerarg value="-Xlint:unchecked"/> … … 26 26 <attribute name="Plugin-Description" value="An OSM data validator. It checks for problems in data, and provides fixes for the common ones. Spellcheck integrated for tag names."/> 27 27 <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/index.php/JOSM/Plugins/Validator"/> 28 <attribute name="Plugin-Mainversion" value="14 65"/>28 <attribute name="Plugin-Mainversion" value="1470"/> 29 29 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/> 30 30 </manifest> -
applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/PreferenceEditor.java
r13497 r14015 45 45 public static final String PREF_TESTS_BEFORE_UPLOAD = PREFIX + ".testsBeforeUpload"; 46 46 47 /** The preferences key for ignored severity other on upload */ 48 public static final String PREF_OTHER_UPLOAD = PREFIX + ".otherUpload"; 49 47 50 /** 48 51 * The preferences key for enabling the permanent filtering … … 53 56 private JCheckBox prefUseIgnore; 54 57 private JCheckBox prefUseLayer; 58 private JCheckBox prefOtherUpload; 55 59 56 60 /** The list of all tests */ … … 73 77 prefUseLayer.setToolTipText(tr("Use the error layer to display problematic elements.")); 74 78 testPanel.add(prefUseLayer, GBC.eol()); 79 80 prefOtherUpload = new JCheckBox(tr("Show informational level on upload."), Main.pref.getBoolean(PREF_OTHER_UPLOAD, false)); 81 prefOtherUpload.setToolTipText(tr("Show the informational tests in the upload check windows.")); 82 testPanel.add(prefOtherUpload, GBC.eol()); 75 83 76 84 GBC a = GBC.eol().insets(-5,0,0,0); … … 117 125 Main.pref.put( PREF_TESTS_BEFORE_UPLOAD, testsBeforeUpload.toString()); 118 126 Main.pref.put( PREF_USE_IGNORE, prefUseIgnore.isSelected()); 127 Main.pref.put( PREF_OTHER_UPLOAD, prefOtherUpload.isSelected()); 119 128 Main.pref.put( PREF_LAYER, prefUseLayer.isSelected()); 120 129 return false; -
applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/Test.java
r13497 r14015 22 22 * validated. These primitives are always visited in the same order: nodes 23 23 * first, then ways. 24 * 24 * 25 25 * @author frsantos 26 26 */ … … 29 29 /** Name of the test */ 30 30 protected String name; 31 31 32 32 /** Description of the test */ 33 33 protected String description; 34 34 35 35 /** Whether this test is enabled. Enabled by default */ 36 36 protected boolean enabled = true; … … 41 41 /** The preferences check for validation on upload */ 42 42 protected JCheckBox checkBeforeUpload; 43 43 44 44 /** Whether this test must check before upload. Enabled by default */ 45 45 protected boolean testBeforeUpload = true; … … 64 64 this.description = description; 65 65 } 66 66 67 67 /** 68 68 * Constructor … … 73 73 this.name = name; 74 74 } 75 75 76 76 /** 77 77 * Initializes any global data used this tester. 78 78 * @param plugin The plugin 79 79 * @throws Exception When cannot initialize the test 80 */ 80 */ 81 81 public static void initialize(OSMValidatorPlugin plugin) throws Exception {} 82 82 83 83 /** 84 84 * Notification of the start of the test. The tester can initialize the 85 85 * structures it may need for this test 86 */ 87 public void startTest() 86 */ 87 public void startTest() 88 88 { 89 89 errors = new ArrayList<TestError>(30); … … 93 93 * Flag notifying that this test is run over a partial data selection 94 94 * @param partialSelection Whether the test is on a partial selection data 95 */ 96 public void setPartialSelection(boolean partialSelection) 95 */ 96 public void setPartialSelection(boolean partialSelection) 97 97 { 98 98 this.partialSelection = partialSelection; 99 99 } 100 100 101 101 /** 102 102 * Gets the validation errors accumulated until this moment. 103 * @return The list of errors 104 */ 105 public List<TestError> getErrors() 103 * @return The list of errors 104 */ 105 public List<TestError> getErrors() 106 106 { 107 107 return errors; 108 108 } 109 109 110 110 /** 111 111 * Notification of the end of the test. The tester may perform additional 112 * actions and destroy the used structures 112 * actions and destroy the used structures 113 113 */ 114 114 public void endTest() {} … … 117 117 * Visits all primitives to be tested. These primitives are always visited 118 118 * in the same order: nodes first, then ways. 119 * 119 * 120 120 * @param selection The primitives to be tested 121 121 */ 122 public void visit(Collection<OsmPrimitive> selection) 122 public void visit(Collection<OsmPrimitive> selection) 123 123 { 124 124 for (OsmPrimitive p : selection) … … 136 136 137 137 /** 138 * Allow the tester to manage its own preferences 138 * Allow the tester to manage its own preferences 139 139 * @param testPanel The panel to add any preferences component 140 140 */ 141 public void addGui(JPanel testPanel) 141 public void addGui(JPanel testPanel) 142 142 { 143 143 checkEnabled = new JCheckBox(name, enabled); … … 161 161 return false; 162 162 } 163 163 164 164 /** 165 165 * Fixes the error with the appropiate command 166 * 166 * 167 167 * @param testError 168 168 * @return The command to fix the error … … 172 172 return null; 173 173 } 174 174 175 175 /** 176 176 * Returns true if the given error can be fixed automatically 177 * 177 * 178 178 * @param testError The error to check if can be fixed 179 179 * @return true if the error can be fixed -
applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/ValidateUploadHook.java
r13497 r14015 60 60 test.visit(selection); 61 61 test.endTest(); 62 errors.addAll( test.getErrors() ); 62 if(Main.pref.getBoolean(PreferenceEditor.PREF_OTHER_UPLOAD, false)) 63 errors.addAll( test.getErrors() ); 64 else 65 { 66 for(TestError e : test.getErrors()) 67 { 68 if(e.getSeverity() != Severity.OTHER) 69 errors.add(e); 70 } 71 } 63 72 } 64 73 tests = null; -
applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/tests/TagChecker.java
r13918 r14015 15 15 import java.text.MessageFormat; 16 16 import java.util.ArrayList; 17 import java.util.Arrays; 17 18 import java.util.Collection; 18 19 import java.util.Collections; … … 255 256 if(presets != null) 256 257 { 258 Way w = new Way(); 259 w.checkTagged(); 260 w.checkDirectionTagged(); 257 261 presetsValueData = new Bag<String, String>(); 262 for(String a : OsmPrimitive.uninteresting) 263 presetsValueData.add(a); 264 for(String a : OsmPrimitive.directionKeys) 265 presetsValueData.add(a); 266 for(String a : Main.pref.getCollection(PreferenceEditor.PREFIX + ".knownkeys", 267 Arrays.asList(new String[]{"is_in", "int_ref", "fixme", "population"}))) 268 presetsValueData.add(a); 258 269 for(TaggingPreset p : presets) 259 270 { … … 270 281 TaggingPreset.Key k = (TaggingPreset.Key) i; 271 282 presetsValueData.add(k.key, k.value); 283 } 284 else if(i instanceof TaggingPreset.Text) 285 { 286 TaggingPreset.Text k = (TaggingPreset.Text) i; 287 presetsValueData.add(k.key); 288 } 289 else if(i instanceof TaggingPreset.Check) 290 { 291 TaggingPreset.Check k = (TaggingPreset.Check) i; 292 presetsValueData.add(k.key, "yes"); 293 presetsValueData.add(k.key, "no"); 272 294 } 273 295 } … … 369 391 { 370 392 List<String> values = presetsValueData.get(key); 371 if( values == null) 372 { 373 String i = marktr("Key ''{0}'' not in presets."); 374 errors.add( new TestError(this, Severity.OTHER, tr("Presets do not contain property key"), 375 tr(i, key), MessageFormat.format(i, key), INVALID_VALUE, p) ); 376 withErrors.add(p, "UPK"); 377 } 378 else if(!values.contains(prop.getValue())) 393 if(values == null) 394 { 395 Boolean ignore = false; 396 for(String a : Main.pref.getCollection(PreferenceEditor.PREFIX + ".startswithkeys", 397 Arrays.asList(new String[]{"opengeodb","openGeoDB","name:","note:"}))) 398 { 399 if(key.startsWith(a)) 400 ignore = true; 401 } 402 for(String a : Main.pref.getCollection(PreferenceEditor.PREFIX + ".endswithkeys", 403 Arrays.asList(new String[]{":forward",":backward",":left",":right"}))) 404 { 405 if(key.endsWith(a)) 406 ignore = true; 407 } 408 if(!ignore) 409 { 410 String i = marktr("Key ''{0}'' not in presets."); 411 errors.add( new TestError(this, Severity.OTHER, tr("Presets do not contain property key"), 412 tr(i, key), MessageFormat.format(i, key), INVALID_VALUE, p) ); 413 withErrors.add(p, "UPK"); 414 } 415 } 416 else if(values.size() > 0 && !values.contains(prop.getValue())) 379 417 { 380 418 String i = marktr("Value ''{0}'' for key ''{1}'' not in presets."); -
applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/tests/UnconnectedWays.java
r13598 r14015 3 3 import static org.openstreetmap.josm.tools.I18n.tr; 4 4 5 import java.awt.geom.Area; 5 6 import java.awt.geom.Line2D; 6 7 import java.util.Arrays; … … 60 61 public void endTest() 61 62 { 63 Area a = Main.ds.getDataSourceArea(); 62 64 Map<Node, Way> map = new HashMap<Node, Way>(); 63 65 for(Node en : endnodes_highway) … … 65 67 for(MyWaySegment s : ways) 66 68 { 67 if(s.highway && s.nearby(en, mindist) )69 if(s.highway && s.nearby(en, mindist) && (a == null || a.contains(en.coor))) 68 70 map.put(en, s.w); 69 71 } … … 83 85 for(MyWaySegment s : ways) 84 86 { 85 if(!s.highway && s.nearby(en, mindist) && !s.isArea() )87 if(!s.highway && s.nearby(en, mindist) && !s.isArea() && (a == null || a.contains(en.coor))) 86 88 map.put(en, s.w); 87 89 } … … 91 93 for(MyWaySegment s : ways) 92 94 { 93 if(s.nearby(en, mindist) && !s.isArea() )95 if(s.nearby(en, mindist) && !s.isArea() && (a == null || a.contains(en.coor))) 94 96 map.put(en, s.w); 95 97 } … … 112 114 for(MyWaySegment s : ways) 113 115 { 114 if(s.nearby(en, minmiddledist) )116 if(s.nearby(en, minmiddledist) && (a == null || a.contains(en.coor))) 115 117 map.put(en, s.w); 116 118 } … … 130 132 for(MyWaySegment s : ways) 131 133 { 132 if(s.nearby(en, minmiddledist) )134 if(s.nearby(en, minmiddledist) && (a == null || a.contains(en.coor))) 133 135 map.put(en, s.w); 134 136 } -
applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/util/Bag.java
r13497 r14015 48 48 49 49 /** 50 * Adds an element to the bag 51 * @param key The key of the element 52 * @param value The element to add 53 */ 54 public void add(K key) 55 { 56 List<V> values = get(key); 57 if( values == null ) 58 { 59 values = new ArrayList<V>(); 60 put(key, values); 61 } 62 } 63 64 /** 50 65 * Constructor 51 66 */ -
applications/editors/josm/plugins/wmsplugin/build.xml
r14007 r14015 10 10 <target name="compile" depends="init"> 11 11 <echo message="creating ${plugin.jar}"/> 12 <javac srcdir="src" classpath="${josm}" debug=" false" destdir="${plugin.build.dir}">12 <javac srcdir="src" classpath="${josm}" debug="true" destdir="${plugin.build.dir}"> 13 13 <compilerarg value="-Xlint:deprecation"/> 14 14 <compilerarg value="-Xlint:unchecked"/>
Note:
See TracChangeset
for help on using the changeset viewer.