Changeset 3619 in osm for applications
- Timestamp:
- 2007-07-19T02:03:17+02:00 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/mappaint/src/mappaint/ElemStyles.java
r3590 r3619 8 8 { 9 9 HashMap<String, ElemStyle> styles; 10 static int nr = 0; 11 10 12 11 13 public ElemStyles() … … 16 18 public void add (String k, String v, ElemStyle style) 17 19 { 20 ElemStyle old_style; 18 21 String key = k + "=" + v; 19 22 … … 30 33 key = key + "node"; 31 34 } 32 styles.put(key, style); 35 /* avoid duplicates - for now */ 36 old_style = styles.get(key); 37 if(old_style == null) { 38 /* new key/value, insert */ 39 styles.put(key, style); 40 } else { 41 if(style.getMaxScale() < old_style.getMaxScale()) { 42 /* existing larger scale key/value, replace */ 43 styles.remove(old_style); 44 styles.put(key, style); 45 } 46 } 33 47 } 34 48 … … 38 52 { 39 53 String classname; 54 String kv = null; 40 55 41 56 if(p instanceof org.openstreetmap.josm.data.osm.Node) { … … 48 63 { 49 64 String key = iterator.next(); 50 Stringkv = key + "=" + p.keys.get(key) + classname;65 kv = key + "=" + p.keys.get(key) + classname; 51 66 if(styles.containsKey(kv)) 52 67 { … … 54 69 } 55 70 } 71 72 // not a known key/value combination 73 boolean first_line = true; 74 75 // filter out trivial tags and show the rest 76 iterator = p.keys.keySet().iterator(); 77 while(iterator.hasNext()) 78 { 79 String key = iterator.next(); 80 kv = key + "=" + p.keys.get(key); 81 if( !kv.startsWith("created_by=") && 82 !kv.startsWith("converted_by=") && 83 !kv.startsWith("source=") && 84 !kv.startsWith("note=") && 85 !kv.startsWith("layer=") && 86 !kv.startsWith("bridge=") && 87 !kv.startsWith("tunnel=") && 88 !kv.startsWith("oneway=") && 89 !kv.startsWith("speedlimit=") && 90 !kv.startsWith("motorcar=") && 91 !kv.startsWith("horse=") && 92 !kv.startsWith("bicycle=") && 93 !kv.startsWith("foot=") 94 ) { 95 96 if (first_line) { 97 nr++; 98 //System.out.println("mappaint - rule not found[" + nr + "]: " + kv + " id:" + p.id); 99 } else { 100 //System.out.println("mappaint - rule not found[" + nr + "]: " + kv); 101 } 102 first_line=false; 103 } 104 } 56 105 } 106 57 107 return null; 58 108 }
Note:
See TracChangeset
for help on using the changeset viewer.