Example #1
0
 public void init() {
   conditions = null;
   scaleMax = 1000000000;
   scaleMin = 0;
   line.init();
   cond.init();
   linemod.init();
   area.init();
   icon.init();
 }
Example #2
0
 private void startElementLine(String qName, Attributes atts, LinePrototype line) {
   for (int count = 0; count < atts.getLength(); count++) {
     if (atts.getQName(count).equals("width")) {
       String val = atts.getValue(count);
       if (!(val.startsWith("+") || val.startsWith("-") || val.endsWith("%"))) {
         line.setWidth(Integer.parseInt(val));
       }
     } else if (atts.getQName(count).equals("colour")) {
       line.color = convertColor(atts.getValue(count));
     } else if (atts.getQName(count).equals("realwidth")) {
       line.realWidth = Integer.parseInt(atts.getValue(count));
     } else if (atts.getQName(count).equals("dashed")) {
       float[] dashed;
       try {
         String[] parts = atts.getValue(count).split(",");
         dashed = new float[parts.length];
         for (int i = 0; i < parts.length; i++) {
           dashed[i] = (Integer.parseInt(parts[i]));
         }
       } catch (NumberFormatException nfe) {
         boolean isDashed = Boolean.parseBoolean(atts.getValue(count));
         if (isDashed) {
           dashed = new float[] {9};
         } else {
           dashed = new float[0];
         }
       }
       line.setDashed(dashed);
     } else if (atts.getQName(count).equals("dashedcolour")) {
       line.dashedColor = convertColor(atts.getValue(count));
     } else if (atts.getQName(count).equals("priority")) {
       line.priority = Integer.parseInt(atts.getValue(count));
     } else if (!(atts.getQName(count).equals("mode") && line instanceof LinemodPrototype)) {
       error(
           "The element \""
               + qName
               + "\" has unknown attribute \""
               + atts.getQName(count)
               + "\"!");
     }
   }
 }