edu.umd.cs.jazz.io
Class ZSVG

java.lang.Object
  |
  +--edu.umd.cs.jazz.io.ZSVG

public class ZSVG
extends java.lang.Object

ZSVG reads SVG format file and load objects into jazz scenegraph.

Author:
Bongwon Suh Usage: ZSVG svg = new ZSVG(input); ZGroup group = svg.getGroup(); or ZSVG svg = new ZSVG(); ZGroup group = svg.read(input); input: can be one of the following java.lang.String uri URI as string e.g. http://my.site/sample.svg java.io.File file opened file descripter e.g. new File("sample.svg") java.io.InputStream is inputstream opened for svg data Limitations: The current SVG reader does not support the following features Clipping Dynamic behavior Anchors Style Limited font support Gradient Ornament on shapes (e.g. dashed/rounded rectangles) Non-numeric unit (e.g. 300px, 2.5in, etc)

Field Summary
protected  ZGroup group
          SVG objects are drawn on this canvas.
 
Constructor Summary
ZSVG()
          Default Constructor
ZSVG(java.io.File file)
          Load SVG data from the file and add objects on the group.
ZSVG(java.io.InputStream in)
          Load SVG data from inputstream and add objects on the group.
ZSVG(java.lang.String url)
          Load SVG data from specified URL (String form) and add objects on my group.
 
Method Summary
 ZGroup getGroup()
          Return ZGroup group, which has all nodes as children
 ZGroup read(java.io.File in)
          Load SVG data from the file and begin to draw objects.
 ZGroup read(java.io.InputStream in)
          Load SVG data from the inputsream and begin to draw objects.
 ZGroup read(java.lang.String url)
          Load SVG data from the url and begin to draw objects.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

group

protected ZGroup group
SVG objects are drawn on this canvas.
Constructor Detail

ZSVG

public ZSVG()
Default Constructor

ZSVG

public ZSVG(java.io.InputStream in)
Load SVG data from inputstream and add objects on the group.
Parameters:
in - read SVG data from the inputstream. Warning: if you use inputstream as SVG input, you might have problems with DTD location. DTD Definition should be specified by URL, not by relative path from the current location

ZSVG

public ZSVG(java.lang.String url)
Load SVG data from specified URL (String form) and add objects on my group.
Parameters:
url - read SVG data from the URL (String form).

ZSVG

public ZSVG(java.io.File file)
Load SVG data from the file and add objects on the group.
Parameters:
file - read SVG data from the file.
Method Detail

read

public ZGroup read(java.io.InputStream in)
Load SVG data from the inputsream and begin to draw objects.
Parameters:
in - read SVG data from the inputstream.

read

public ZGroup read(java.io.File in)
Load SVG data from the file and begin to draw objects.
Parameters:
in - read SVG data from the File in.

read

public ZGroup read(java.lang.String url)
Load SVG data from the url and begin to draw objects.
Parameters:
url - read SVG data from the url (Warning: String url)

getGroup

public ZGroup getGroup()
Return ZGroup group, which has all nodes as children


Copyright © 2001 by University of Maryland, College Park, MD 20742, USA All rights reserved.