Changeset 3590 in osm for applications/editors/josm/plugins/mappaint/src
- Timestamp:
- 2007-07-14T23:25:09+02:00 (18 years ago)
- Location:
- applications/editors/josm/plugins/mappaint/src/mappaint
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/mappaint/src/mappaint/ElemStyleHandler.java
r2807 r3590 16 16 { 17 17 boolean inDoc, inRule, inCondition, inElemStyle, inLine, inIcon, inArea; 18 ElemStyle curStyle; 18 ElemStyle curLineStyle=null; 19 ElemStyle curIconStyle=null; 20 ElemStyle curAreaStyle=null; 19 21 ElemStyles styles; 20 22 String curKey, curValue ; … … 140 142 { 141 143 inRule = false; 142 styles.add (curKey, curValue, curStyle); 144 if(curLineStyle != null) 145 { 146 styles.add (curKey, curValue, curLineStyle); 147 curLineStyle = null; 148 } 149 if(curIconStyle != null) 150 { 151 styles.add (curKey, curValue, curIconStyle); 152 curIconStyle = null; 153 } 154 if(curAreaStyle != null) 155 { 156 styles.add (curKey, curValue, curAreaStyle); 157 curAreaStyle = null; 158 } 143 159 } 144 160 else if (inCondition && qName.equals("condition")) … … 147 163 { 148 164 inLine = false; 149 cur Style = new LineElemStyle(curWidth,curRealWidth, curColour,165 curLineStyle = new LineElemStyle(curWidth,curRealWidth, curColour, 150 166 curMinZoom); 151 167 curWidth=1; … … 155 171 { 156 172 inIcon = false; 157 cur Style = new IconElemStyle(curIcon,curAnnotate,curMinZoom);173 curIconStyle = new IconElemStyle(curIcon,curAnnotate,curMinZoom); 158 174 } 159 175 else if (inArea && qName.equals("area")) 160 176 { 161 177 inArea = false; 162 cur Style = new AreaElemStyle (curColour,curMinZoom);178 curAreaStyle = new AreaElemStyle (curColour,curMinZoom); 163 179 } 164 180 -
applications/editors/josm/plugins/mappaint/src/mappaint/ElemStyles.java
r1501 r3590 17 17 { 18 18 String key = k + "=" + v; 19 20 /* unfortunately, there don't seem to be an efficient way to */ 21 /* find out, if a given OsmPrimitive is an area or not, */ 22 /* so distinguish only between way and node here - for now */ 23 if(style instanceof AreaElemStyle) { 24 key = key + "way"; 25 } 26 else if(style instanceof LineElemStyle) { 27 key = key + "way"; 28 } 29 else if(style instanceof IconElemStyle) { 30 key = key + "node"; 31 } 19 32 styles.put(key, style); 20 33 } … … 24 37 if(p.keys!=null) 25 38 { 39 String classname; 40 41 if(p instanceof org.openstreetmap.josm.data.osm.Node) { 42 classname = "node"; 43 } else { 44 classname = "way"; 45 } 26 46 Iterator<String> iterator = p.keys.keySet().iterator(); 27 47 while(iterator.hasNext()) 28 48 { 29 49 String key = iterator.next(); 30 String kv = key + "=" + p.keys.get(key) ;50 String kv = key + "=" + p.keys.get(key) + classname; 31 51 if(styles.containsKey(kv)) 32 52 {
Note:
See TracChangeset
for help on using the changeset viewer.