Changeset 2659 in josm for trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyleHandler.java
- Timestamp:
- 2009-12-19T18:12:03+01:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyleHandler.java
r2626 r2659 14 14 public class ElemStyleHandler extends DefaultHandler 15 15 { 16 boolean inDoc, inRule, inCondition, in ElemStyle, inLine, inLineMod, inIcon, inArea, inScaleMax, inScaleMin;16 boolean inDoc, inRule, inCondition, inLine, inLineMod, inIcon, inArea, inScaleMax, inScaleMin; 17 17 boolean hadLine, hadLineMod, hadIcon, hadArea; 18 18 ElemStyles styles; … … 44 44 public ElemStyleHandler(String name) { 45 45 styleName = name; 46 inDoc=inRule=inCondition=in ElemStyle=inLine=inIcon=inArea=false;46 inDoc=inRule=inCondition=inLine=inIcon=inArea=false; 47 47 rule.init(); 48 48 styles = MapPaintStyles.getStyles(); … … 105 105 line.realWidth=Integer.parseInt(atts.getValue(count)); 106 106 } else if (atts.getQName(count).equals("dashed")) { 107 try108 { 107 float[] dashed; 108 try { 109 109 String[] parts = atts.getValue(count).split(","); 110 line.dashed = new float[parts.length];110 dashed = new float[parts.length]; 111 111 for (int i = 0; i < parts.length; i++) { 112 line.dashed[i] = (Integer.parseInt(parts[i]));112 dashed[i] = (Integer.parseInt(parts[i])); 113 113 } 114 114 } catch (NumberFormatException nfe) { 115 boolean dashed=Boolean.parseBoolean(atts.getValue(count)); 116 if(dashed) { 117 line.dashed = new float[]{9}; 118 } 119 } 115 boolean isDashed = Boolean.parseBoolean(atts.getValue(count)); 116 if(isDashed) { 117 dashed = new float[]{9}; 118 } else { 119 dashed = new float[0]; 120 } 121 } 122 line.setDashed(dashed); 120 123 } else if (atts.getQName(count).equals("dashedcolour")) { 121 124 line.dashedColor=convertColor(atts.getValue(count));
Note:
See TracChangeset
for help on using the changeset viewer.
