|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdiva.canvas.toolbox.SVGParser
public class SVGParser
A collection of utilities to help parse graphics out of SVG files. For a description of SVG see the specification.
Field Summary | |
---|---|
private static java.lang.Class |
_refClass
|
Constructor Summary | |
---|---|
SVGParser()
|
Method Summary | |
---|---|
private static double |
_getDouble(java.util.Map map,
java.lang.String name)
|
private static double |
_getDouble(java.util.Map map,
java.lang.String name,
double def)
|
static java.lang.String[] |
colorNames()
Return a list of basic color names that are understood. |
static PaintedList |
createPaintedList(XmlElement root)
Given an XmlElement, create a PaintedList. |
static PaintedObject |
createPaintedObject(java.lang.String type,
java.util.Map attributes)
Create a new painted object. |
static PaintedObject |
createPaintedObject(java.lang.String type,
java.util.Map attributes,
java.lang.String content)
Create a new painted object. |
static PaintedObject |
createPaintedObject(java.lang.String type,
java.lang.String attributes,
java.lang.String content)
Create a new painted object. |
static void |
hashAttributes(java.lang.String s,
java.util.Map map)
Given a XML-style attribute string and a hash-table, add each attribute and its value to the table. |
private static java.awt.Color |
lookupColor(java.lang.String color)
Given a string, return a color. |
private static double[] |
parseCoordString(java.lang.String s)
Parse a string of numbers into an array of double. |
private static void |
processPaintedPathAttributes(PaintedPath pp,
java.util.Map attributes)
Set the attributes of a PaintedPath from a hash-table |
private static void |
processPaintedShapeAttributes(PaintedShape ps,
java.util.Map attributes)
Set the attributes of a PaintedShape from a hash-table |
private static void |
processPaintedStringAttributes(PaintedString pp,
java.util.Map attributes)
Set the attributes of a PaintedString from a hash-table |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static java.lang.Class _refClass
Constructor Detail |
---|
public SVGParser()
Method Detail |
---|
public static java.lang.String[] colorNames()
public static PaintedObject createPaintedObject(java.lang.String type, java.lang.String attributes, java.lang.String content)
type
- The element typeattributes
- An XML-style attribute stringcontent
- The content
public static PaintedObject createPaintedObject(java.lang.String type, java.util.Map attributes, java.lang.String content)
public static PaintedObject createPaintedObject(java.lang.String type, java.util.Map attributes)
public static void hashAttributes(java.lang.String s, java.util.Map map)
FIXME: this sucks.
private static java.awt.Color lookupColor(java.lang.String color) throws java.lang.NumberFormatException
java.lang.NumberFormatException
private static double[] parseCoordString(java.lang.String s)
private static void processPaintedShapeAttributes(PaintedShape ps, java.util.Map attributes) throws java.lang.NumberFormatException
java.lang.NumberFormatException
private static void processPaintedPathAttributes(PaintedPath pp, java.util.Map attributes) throws java.lang.NumberFormatException
java.lang.NumberFormatException
private static void processPaintedStringAttributes(PaintedString pp, java.util.Map attributes) throws java.lang.NumberFormatException
java.lang.NumberFormatException
public static PaintedList createPaintedList(XmlElement root)
root
- The XmlElement.
private static double _getDouble(java.util.Map map, java.lang.String name, double def)
private static double _getDouble(java.util.Map map, java.lang.String name)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |