|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.kitfox.svg.SVGUniverse
public class SVGUniverse
Many SVG files can be loaded at one time. These files will quite likely need to reference one another. The SVG universe provides a container for all these files and the means for them to relate to each other.
Field Summary | |
---|---|
protected double |
curTime
Current time in this universe. |
static java.lang.String |
INPUTSTREAM_SCHEME
|
static long |
serialVersionUID
|
Constructor Summary | |
---|---|
SVGUniverse()
Creates a new instance of SVGUniverse |
Method Summary | |
---|---|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener l)
|
void |
clear()
Release all loaded SVG document from memory |
double |
getCurTime()
Returns the current animation time in milliseconds. |
Font |
getDefaultFont()
|
SVGDiagram |
getDiagram(java.net.URI xmlBase)
|
SVGDiagram |
getDiagram(java.net.URI xmlBase,
boolean loadIfAbsent)
Returns the diagram that has been loaded from this root. |
SVGElement |
getElement(java.net.URI path)
Returns the element of the document at the given URI. |
SVGElement |
getElement(java.net.URI path,
boolean loadIfAbsent)
Looks up a href within our universe. |
SVGElement |
getElement(java.net.URL path)
|
Font |
getFont(java.lang.String fontName)
|
java.net.URI |
getStreamBuiltURI(java.lang.String name)
Synthesize a URI for an SVGDiagram constructed from a stream. |
boolean |
isVerbose()
|
java.net.URI |
loadSVG(java.io.InputStream is,
java.lang.String name)
|
java.net.URI |
loadSVG(java.io.Reader reader,
java.lang.String name)
This routine allows you to create SVG documents from data streams that may not necessarily have a URL to load from. |
protected java.net.URI |
loadSVG(java.net.URI xmlBase,
java.io.Reader is)
|
java.net.URI |
loadSVG(java.net.URL docRoot)
Loads an SVG file and all the files it references from the URL provided. |
static void |
main(java.lang.String[] argv)
|
void |
removePropertyChangeListener(java.beans.PropertyChangeListener l)
|
void |
setCurTime(double curTime)
|
void |
setVerbose(boolean verbose)
|
void |
updateTime()
Updates all time influenced style and presentation attributes in all SVG documents in this universe. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final long serialVersionUID
public static final java.lang.String INPUTSTREAM_SCHEME
protected double curTime
Constructor Detail |
---|
public SVGUniverse()
Method Detail |
---|
public void addPropertyChangeListener(java.beans.PropertyChangeListener l)
public void removePropertyChangeListener(java.beans.PropertyChangeListener l)
public void clear()
public double getCurTime()
public void setCurTime(double curTime)
public void updateTime() throws SVGException
SVGException
public Font getDefaultFont()
public Font getFont(java.lang.String fontName)
public SVGElement getElement(java.net.URI path)
public SVGElement getElement(java.net.URL path)
public SVGElement getElement(java.net.URI path, boolean loadIfAbsent)
public SVGDiagram getDiagram(java.net.URI xmlBase)
public SVGDiagram getDiagram(java.net.URI xmlBase, boolean loadIfAbsent)
public java.net.URI loadSVG(java.net.URL docRoot)
docRoot
- - URL to the location where this SVG file can be found.
public java.net.URI loadSVG(java.io.InputStream is, java.lang.String name)
public java.net.URI loadSVG(java.io.Reader reader, java.lang.String name)
reader
- - A stream containing a valid SVG documentname
- - A unique name for this document. It will be used to construct a unique URI to refer to this document and perform resolution with relative URIs within this document.
For example, a name of "/myScene" will produce the URI svgSalamander:/myScene. "/maps/canada/toronto" will produce svgSalamander:/maps/canada/toronto. If this second document then contained the href "../uk/london", it would resolve by default to svgSalamander:/maps/uk/london. That is, SVG Salamander defines the URI scheme svgSalamander for it's own internal use and uses it for uniquely identfying documents loaded by stream.
If you need to link to documents outside of this scheme, you can either supply full hrefs (eg, href="url(http://www.kitfox.com/index.html)") or put the xml:base attribute in a tag to change the defaultbase URIs are resolved against
If a name does not start with the character '/', it will be automatically prefixed to it.
public java.net.URI getStreamBuiltURI(java.lang.String name)
name
- - Name given the document constructed from a stream.protected java.net.URI loadSVG(java.net.URI xmlBase, java.io.Reader is)
public static void main(java.lang.String[] argv)
public boolean isVerbose()
public void setVerbose(boolean verbose)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |