diva.canvas.toolbox
Class SVGUtilities

java.lang.Object
  extended by diva.canvas.toolbox.SVGUtilities

public class SVGUtilities
extends 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:
$Revision: 1.2 $
Author:
John Reekie, Steve Neuendorffer

Constructor Summary
SVGUtilities()
           
 
Method Summary
static Iterator colorNames()
          Get an iterator over the known color names
static Color getColor(String name)
          Given a string representing a color, return a color that represents it.
static double[] parseCoordString(String s)
          Parse a string of numbers into an array of double.
static Map parseStyleString(String style)
          Given a style string, parse it into a map of elements.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SVGUtilities

public SVGUtilities()
Method Detail

colorNames

public static Iterator colorNames()
Get an iterator over the known color names


getColor

public static Color getColor(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 Map parseStyleString(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(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



Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.