1 18 package org.apache.batik.parser; 19 20 import java.io.IOException ; 21 22 29 public class PointsParser extends NumberParser { 30 31 34 protected PointsHandler pointsHandler; 35 36 39 protected boolean eRead; 40 41 44 public PointsParser() { 45 pointsHandler = DefaultPointsHandler.INSTANCE; 46 } 47 48 59 public void setPointsHandler(PointsHandler handler) { 60 pointsHandler = handler; 61 } 62 63 66 public PointsHandler getPointsHandler() { 67 return pointsHandler; 68 } 69 70 73 protected void doParse() throws ParseException, IOException { 74 pointsHandler.startPoints(); 75 76 current = reader.read(); 77 skipSpaces(); 78 79 loop: for (;;) { 80 if (current == -1) { 81 break loop; 82 } 83 float x = parseFloat(); 84 skipCommaSpaces(); 85 float y = parseFloat(); 86 87 pointsHandler.point(x, y); 88 skipCommaSpaces(); 89 } 90 91 pointsHandler.endPoints(); 92 } 93 } 94 | Popular Tags |