Ignore:
Timestamp:
2009-12-19T18:12:03+01:00 (16 years ago)
Author:
jttt
Message:

Minor fixes in mappaint code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyleHandler.java

    r2626 r2659  
    1414public class ElemStyleHandler extends DefaultHandler
    1515{
    16     boolean inDoc, inRule, inCondition, inElemStyle, inLine, inLineMod, inIcon, inArea, inScaleMax, inScaleMin;
     16    boolean inDoc, inRule, inCondition, inLine, inLineMod, inIcon, inArea, inScaleMax, inScaleMin;
    1717    boolean hadLine, hadLineMod, hadIcon, hadArea;
    1818    ElemStyles styles;
     
    4444    public ElemStyleHandler(String name) {
    4545        styleName = name;
    46         inDoc=inRule=inCondition=inElemStyle=inLine=inIcon=inArea=false;
     46        inDoc=inRule=inCondition=inLine=inIcon=inArea=false;
    4747        rule.init();
    4848        styles = MapPaintStyles.getStyles();
     
    105105                line.realWidth=Integer.parseInt(atts.getValue(count));
    106106            } else if (atts.getQName(count).equals("dashed")) {
    107                 try
    108                 {
     107                float[] dashed;
     108                try {
    109109                    String[] parts = atts.getValue(count).split(",");
    110                     line.dashed = new float[parts.length];
     110                    dashed = new float[parts.length];
    111111                    for (int i = 0; i < parts.length; i++) {
    112                         line.dashed[i] = (Integer.parseInt(parts[i]));
     112                        dashed[i] = (Integer.parseInt(parts[i]));
    113113                    }
    114114                } 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);
    120123            } else if (atts.getQName(count).equals("dashedcolour")) {
    121124                line.dashedColor=convertColor(atts.getValue(count));
Note: See TracChangeset for help on using the changeset viewer.