net.sf.latexdraw.parsers.svg.parsers
Class SVGPointsParser
java.lang.Object
net.sf.latexdraw.parsers.CodeParser
net.sf.latexdraw.parsers.svg.parsers.AbstractSVGParser
net.sf.latexdraw.parsers.svg.parsers.SVGPointsParser
- All Implemented Interfaces:
- Parser
public class SVGPointsParser
- extends AbstractSVGParser
Defines a parser that parses points from polygons and polylines.
This file is part of LaTeXDraw.
Copyright (c) 2005-2012 Arnaud BLOUIN
LaTeXDraw is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
LaTeXDraw is distributed without any warranty; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the GNU General Public License for more details.
12/04/08
- Since:
- 2.0.3
- Version:
- 3.0
- Author:
- Arnaud BLOUIN
Field Summary |
protected java.util.List<java.awt.geom.Point2D> |
points
The parsed points. |
Constructor Summary |
SVGPointsParser(java.lang.String code)
Creates and initialises the parser. |
Method Summary |
java.util.List<java.awt.geom.Point2D> |
getPoints()
|
static java.util.List<java.awt.geom.Point2D> |
getPoints(java.lang.String code)
Parses the given code and return the parsed points or null. |
void |
parse()
Launches the parsing. |
double |
readNumber()
Reads a number. |
Methods inherited from class net.sf.latexdraw.parsers.CodeParser |
getChar, getCharAt, getCode, getCodeCore, getLinePosition, getPosition, incLinePosition, initialise, isEOC, isEOL, nextChar, setCode, setCodeCore, setLinePosition, setPosition, skipWSPComments |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
points
protected java.util.List<java.awt.geom.Point2D> points
- The parsed points.
SVGPointsParser
public SVGPointsParser(java.lang.String code)
- Creates and initialises the parser.
- Parameters:
code
- The code to parse.
- Throws:
java.lang.IllegalArgumentException
- If the given code is null.- Since:
- 2.0.3
getPoints
public static java.util.List<java.awt.geom.Point2D> getPoints(java.lang.String code)
- Parses the given code and return the parsed points or null.
- Parameters:
code
- The code to parse.
- Returns:
- The parsed points or null.
- Since:
- 2.0.3
parse
public void parse()
throws java.text.ParseException
- Description copied from interface:
Parser
- Launches the parsing.
- Throws:
java.text.ParseException
- If an error occurs.
readNumber
public double readNumber()
throws java.text.ParseException
- Reads a number.
- Returns:
- The read number.
- Throws:
java.text.ParseException
- If the number is not valid.- Since:
- 2.0.3
getPoints
public java.util.List<java.awt.geom.Point2D> getPoints()
- Returns:
- The points.
- Since:
- 2.0.3