|
TinyLine v2.0 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.tinyline.svg.SVGDocument
The SVGDocument class implements the header object in the SVG object hierarchy.
The SVGDocument class represents the entire SVG document. It has the pointer to the root of the document tree, and provides the primary access to the document's data.
Since SVG nodes cannot exist outside the context of a SVGDocument, the SVGDocument also contains the factory methods needed to create these objects. The SVGNode objects created have a ownerDocument attribute which associates them with the SVGDocument within whose context they were created.
Besides being the header object in the SVG object hierarchy the SVGDocument plays other roles.
It supports fontTable for SVG fonts defined in the current SVG document. It also provides the default SVG font. The default SVG font must be set before any SVG document can be loaded.
SVGDocument doc = loadSVG("helvetica.svg");
SVGFontElem font = SVGDocument.getFont(doc,SVG.VAL_DEFAULT_FONTFAMILY);
SVGDocument.defaultFont = font;
The SVGDocument plays a role of SMIL time container for SVG animations. It has a list of animations targets (animTargets), the current document time (currentTime) and the animations callback. The animations callback (acb) should be registered so playing animations can notify it about SMIL events.
As some devices do not have a pointer device, there is a need to traverse links using keys. For that, the SVGDocument supports a list of linked elements (linkTargets) along with a current selected element (linkIndex).
| Field Summary | |
AnimationCallback |
acb
Posts the SMIL event from an animation element to an interested party. |
TinyVector |
animTargets
The animated targets array |
int |
currentTime
The current Time |
static SVGFontElem |
defaultFont
The static default font |
TinyHash |
fontTable
The font table - cache for SVGFontElem's. |
TinyHash |
idTable
The hashtable for SVGNode's with Ids. |
int |
linkIndex
The index in links targets array |
TinyVector |
linkTargets
The xlink_href links targets array |
int |
nActiveAnimations
The number of active animations |
SVGRaster |
renderer
An SVGDocument renderer. |
SVGNode |
root
The SVG Tree root node. |
| Constructor Summary | |
SVGDocument()
Constructs a new empty SVGDoccument object. |
|
| Method Summary | |
void |
addAnimations(SVGNode node)
Traverses SVG tree nodes and adds animation elements to animTargets array. |
static int |
addFont(SVGDocument document,
SVGFontElem node)
Adds the given SVGNode font object to the font cache table. |
void |
addIds(SVGNode node)
Traverses SVG tree nodes and adds elements with IDs to idTable hash. |
void |
addLinks(SVGNode node)
Traverses SVG tree nodes and adds 'a' elements to linkTargets array. |
TinyRect |
animate(int t)
SMIL: The animation effect function F(t,u) The effect of an animation for any point in the duration of animations. |
SVGNode |
createElement(int qName)
Creates an element for the element handle specified. |
int |
getCurrentTime()
SMIL: Returns the current document time. |
static SVGFontElem |
getFont(SVGDocument document,
TinyString fontFamily)
Returns SVGNode font object for the given fontFamily value or null. |
boolean |
isZoomAndPanAnable()
Returns true if "magnification" is enabled. |
void |
postSMILEvent(int eventType,
TinyString theEvent)
SMIL: Posts the event from an animation element to the registered callback. |
boolean |
resolveEventBased(TinyString id)
SMIL: Resolves event-based times of animation elements. |
boolean |
resolveLinkBased(TinyString id)
SMIL: Resolves link-based times of animation elements. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public SVGNode root
public SVGRaster renderer
public TinyHash fontTable
public static SVGFontElem defaultFont
public TinyHash idTable
public int nActiveAnimations
public TinyVector animTargets
public int currentTime
public AnimationCallback acb
public TinyVector linkTargets
public int linkIndex
| Constructor Detail |
public SVGDocument()
| Method Detail |
public SVGNode createElement(int qName)
qName - The element handle.
public static int addFont(SVGDocument document,
SVGFontElem node)
public static SVGFontElem getFont(SVGDocument document,
TinyString fontFamily)
public boolean isZoomAndPanAnable()
public void addLinks(SVGNode node)
node - The SVGNode nodepublic void addIds(SVGNode node)
node - The SVGNode nodepublic void addAnimations(SVGNode node)
node - The SVGNode nodepublic int getCurrentTime()
public TinyRect animate(int t)
t - The document time (0<=t<).
public void postSMILEvent(int eventType,
TinyString theEvent)
eventType - The SMIL event typetheEvent - The SMIL eventpublic boolean resolveEventBased(TinyString id)
id - The Id-value or eventbase-element.
public boolean resolveLinkBased(TinyString id)
id - The Id-value.
|
TinyLine v2.0 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||