Package diva.canvas.toolbox
Class SVGUtilities
- java.lang.Object
-
- diva.canvas.toolbox.SVGUtilities
-
public class SVGUtilities extends java.lang.Object
A collection of utility functions to aid in figures from SVG, the Scalable Vector Graphics language. For a description of SVG see the specification.- Version:
- $Id$
- Author:
- John Reekie, Steve Neuendorffer
-
-
Constructor Summary
Constructors Constructor Description SVGUtilities()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.Iterator
colorNames()
Get an iterator over the known color namesstatic java.awt.Color
getColor(java.lang.String name)
Given a string representing a color, return a color that represents it.static double[]
parseCoordString(java.lang.String s)
Parse a string of numbers into an array of double.static java.util.Map
parseStyleString(java.lang.String style)
Given a style string, parse it into a map of elements.
-
-
-
Method Detail
-
colorNames
public static java.util.Iterator colorNames()
Get an iterator over the known color names
-
getColor
public static java.awt.Color getColor(java.lang.String name)
Given a string representing a color, return a color that represents it. The string argument can be a hexadecimal or octal number, or a color name. If a color name, then it is first looked up in the default color table. If not found there, then it is looked up in the System properties. If after all that a color is not found, then return black.
-
parseStyleString
public static java.util.Map parseStyleString(java.lang.String style)
Given a style string, parse it into a map of elements. Here is what an example string might look like: "font: ariel; stroke: red; stroke-width: 2". See the SVG specification for more.
-
parseCoordString
public static double[] parseCoordString(java.lang.String s)
Parse a string of numbers into an array of double. The doubles can be delimited by commas and spaces.FIXME this is not correct
-
-