Class PathParser
java.lang.Object
com.mxgraph.util.svg.AbstractParser
com.mxgraph.util.svg.NumberParser
com.mxgraph.util.svg.PathParser
- All Implemented Interfaces:
Parser
This class implements an event-based parser for the SVG path's d
attribute values.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected PathHandlerThe path handler used to report parse events.Fields inherited from class AbstractParser
BUNDLE_CLASSNAME, current, errorHandler, reader -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void_parsel(boolean expectNumber) protected void_parseL(boolean expectNumber) protected voiddoParse()Method responsible for actually parsing data after AbstractParser has initialized itself.Returns the path handler in use.protected voidparsea()Parses a 'a' command.protected voidparseA()Parses a 'A' command.protected voidparsec()Parses a 'c' command.protected voidparseC()Parses a 'C' command.protected voidparseh()Parses a 'h' command.protected voidparseH()Parses a 'H' command.protected voidparsel()Parses a 'l' command.protected voidparseL()Parses a 'L' command.protected voidparsem()Parses a 'm' command.protected voidparseM()Parses a 'M' command.protected voidparseq()Parses a 'q' command.protected voidparseQ()Parses a 'Q' command.protected voidparses()Parses a 's' command.protected voidparseS()Parses a 'S' command.protected voidparset()Parses a 't' command.protected voidparseT()Parses a 'T' command.protected voidparsev()Parses a 'v' command.protected voidparseV()Parses a 'V' command.protected voidreportUnexpected(int ch) voidsetPathHandler(PathHandler handler) Allows an application to register a path handler.protected booleanSkips the whitespaces and an optional comma.protected voidSkips a sub-path.Methods inherited from class NumberParser
buildFloat, parseFloatMethods inherited from class AbstractParser
createErrorMessage, getBundleClassName, getCurrent, parse, reportCharacterExpectedError, reportError, reportUnexpectedCharacterError, setErrorHandler, skipCommaSpaces, skipSpaces
-
Field Details
-
pathHandler
The path handler used to report parse events.
-
-
Constructor Details
-
PathParser
Creates a new PathParser.
-
-
Method Details
-
setPathHandler
Allows an application to register a path handler.If the application does not register a handler, all events reported by the parser will be silently ignored.
Applications may register a new or different handler in the middle of a parse, and the parser must begin using the new handler immediately.
- Parameters:
handler- The transform list handler.
-
getPathHandler
Returns the path handler in use. -
doParse
Description copied from class:AbstractParserMethod responsible for actually parsing data after AbstractParser has initialized itself.- Specified by:
doParsein classAbstractParser- Throws:
ParseExceptionIOException
-
parsem
Parses a 'm' command.- Throws:
ParseExceptionIOException
-
parseM
Parses a 'M' command.- Throws:
ParseExceptionIOException
-
parsel
Parses a 'l' command.- Throws:
ParseExceptionIOException
-
_parsel
- Throws:
ParseExceptionIOException
-
parseL
Parses a 'L' command.- Throws:
ParseExceptionIOException
-
_parseL
- Throws:
ParseExceptionIOException
-
parseh
Parses a 'h' command.- Throws:
ParseExceptionIOException
-
parseH
Parses a 'H' command.- Throws:
ParseExceptionIOException
-
parsev
Parses a 'v' command.- Throws:
ParseExceptionIOException
-
parseV
Parses a 'V' command.- Throws:
ParseExceptionIOException
-
parsec
Parses a 'c' command.- Throws:
ParseExceptionIOException
-
parseC
Parses a 'C' command.- Throws:
ParseExceptionIOException
-
parseq
Parses a 'q' command.- Throws:
ParseExceptionIOException
-
parseQ
Parses a 'Q' command.- Throws:
ParseExceptionIOException
-
parses
Parses a 's' command.- Throws:
ParseExceptionIOException
-
parseS
Parses a 'S' command.- Throws:
ParseExceptionIOException
-
parset
Parses a 't' command.- Throws:
ParseExceptionIOException
-
parseT
Parses a 'T' command.- Throws:
ParseExceptionIOException
-
parsea
Parses a 'a' command.- Throws:
ParseExceptionIOException
-
parseA
Parses a 'A' command.- Throws:
ParseExceptionIOException
-
skipSubPath
Skips a sub-path.- Throws:
ParseExceptionIOException
-
reportUnexpected
- Throws:
ParseExceptionIOException
-
skipCommaSpaces2
Skips the whitespaces and an optional comma.- Returns:
- true if comma was skipped.
- Throws:
IOException
-