public class PathParser extends Object
Modifier and Type | Class and Description |
---|---|
static class |
PathParser.PathData
PathData class is a wrapper around the native PathData object, which contains
the result of parsing a path string.
|
Constructor and Description |
---|
PathParser() |
Modifier and Type | Method and Description |
---|---|
static boolean |
canMorph(PathParser.PathData pathDataFrom,
PathParser.PathData pathDataTo) |
static void |
createPathFromPathData(Path outPath,
PathParser.PathData data)
Interpret PathData as path commands and insert the commands to the given path.
|
static Path |
createPathFromPathData(String pathString) |
static boolean |
interpolatePathData(PathParser.PathData outData,
PathParser.PathData fromData,
PathParser.PathData toData,
float fraction)
Interpolate between the
fromData and toData according to the
fraction , and put the resulting path data into outData . |
public static Path createPathFromPathData(String pathString)
pathString
- The string representing a path, the same as "d" string in svg file.public static void createPathFromPathData(Path outPath, PathParser.PathData data)
data
- The source PathData to be converted.outPath
- The Path object where path commands will be inserted.public static boolean canMorph(PathParser.PathData pathDataFrom, PathParser.PathData pathDataTo)
pathDataFrom
- The source path represented in PathDatapathDataTo
- The target path represented in PathDatanodesFrom
can morph into nodesTo
public static boolean interpolatePathData(PathParser.PathData outData, PathParser.PathData fromData, PathParser.PathData toData, float fraction)
fromData
and toData
according to the
fraction
, and put the resulting path data into outData
.outData
- The resulting PathData of the interpolationfromData
- The start value as a PathData.toData
- The end value as a PathDatafraction
- The fraction to interpolate.