| java.lang.Object com.sun.perseus.model.ModelNode com.sun.perseus.model.CompositeNode com.sun.perseus.model.Viewport com.sun.perseus.model.DocumentNode
DocumentNode | public class DocumentNode extends Viewport implements Document(Code) | | A DocumentNode represents the root of an SVG document model.
A DocumentNode is a Viewport and centralizes some functions such
as the font data base, tree updates management and event dispatching.
The DocumentNode also manages the RunnableQueue
used to synchronize all access to the SVG document.
version: $Id: DocumentNode.java,v 1.24 2006/06/29 10:47:30 ln156897 Exp $ |
Method Summary | |
public void | addFontFace(FontFace fontFace) Adds a new FontFace to the data base
available to the document. | void | addIdentifiedNode(ElementNode element) Adds the input element to the list of identified nodes. | protected FontFace.Match | addMatch(FontFace.Match firstMatch, FontFace.Match newMatch) Chains newMatch into the chain starting with
firstMatch. | public void | addNamespacePrefix(String prefix, String namespaceURI, ModelNode node) Adds a new prefix to namespace mapping. | public void | addPrototype(ElementNode prototypeElement) To support the creation of elements in the createElementNS
method, we supply prototypes to the DocumentNode so that it
can create nodes of specific data types for the prototype's namespaceURI
and localName.
Parameters: prototypeElement - the ElementNode which will be usedas a prototype in createElementNS . | public void | applyAnimations() Applies all currently active animations. | void | applyMedia() Applies all currently active media if this document is playing. | public void | checkDelayedException() | final void | checkNCName(String name) Checks if the input trait name is valid and throws a DOMException
with error code NOT_SUPPORTED_ERR if not. | public Element | createElementNS(String namespaceURI, String qualifiedName) | public void | dispose() Should be called when a document node is no longer needed
and could be garbage collected. | public void | dump() | static void | dump(ModelNode n, String prefix, PrintStream out) | public Time | getCurrentTime() Returns the current time for the document, i.e., the time at which the
document was last sampled. | public FontFace | getDefaultFontFace() | public DOMException | getDelayedException() | public Element | getDocumentElement() For SVG files this must be
SVGSVGElement , but return type is Element for DOM Core
compatibility and to allow for future extensions. | public Element | getElementById(String id) If no such element exists, this returns null. | Element | getElementByIdAll(String id) Return the Element in the current document with
the given unique ID. | public EventSupport | getEventSupport() | public ModelNode | getFirstComputedExpandedChild() Some node types (such as ElementNodeProxy ) have
expanded children that they compute in some specific
way depending on the implementation. | ModelNode | getFirstExpandedChild() A DocumentNode has no expanded content, so this
returns null. | protected float | getFloatPropertyState(int propertyIndex) Returns the value of the given float property. | public ImageLoader | getImageLoader() Gets the ImageLoader instance. | protected float | getInitialFloatPropertyState(int propertyIndex) Returns the initial value of the given float-valued property. | public FontFace[] | getInitialFontFaces() | protected int | getInitialPackedPropertyState(int propertyIndex) Returns the initial value of the given packed property. | protected Object | getInitialPropertyState(int propertyIndex) Returns the initial value of the given Object-valued property. | ModelNode | getLastExpandedChild() A DocumentNode has no expanded content, so this
returns null. | public String | getLocalName() returns the unprefixed node name. | public String | getNamespaceURI() | protected int | getPackedPropertyState(int propertyIndex) Returns the value of the given packed property. | public Node | getParentNode() Returns the parent Node of this Node .
the parent node or null if there is no parent (i.e. | public float | getPixelMMSize() | protected Object | getPropertyState(int propertyIndex) Returns the value of the given Object-valued property. | public RunnableHandler | getRunnableHandler() | public String | getURIBase() The node's URI base to use to resolve URI references
If a URI base value was set on this node, then that value
is returned. | String | getUnknownTraitsNS(ElementNode element, String namespaceURI, String traitName) Implementation helper. | public UpdateListener | getUpdateListener() | public RunnableQueue | getUpdateQueue() | protected void | growFontFaceDB(Hashtable ffDB, FontFace[] fontFaceSet) Builds a Hashtable of font faces to map font family
names to FontFace instances. | boolean | inDocumentTree() | public void | incrementTime(float seconds) Increments the animation or media timeline for this SVGImage (in
seconds). | ModelEvent | initEngineEvent(String type, ModelNode target) Initializes the ModelEvent's singleton object with the input data. | public void | initializeTimingEngine() Initializes the timing engine. | public void | invokeAndWait(Runnable r) Waits until the given Runnable's run() has returned. | public void | invokeLater(Runnable r) Schedules the given Runnable object for a later invocation in
the document's update thread, and returns.
If there is no updateQueue the Runnable
is run before returning. | protected boolean | isAllowedChild(ElementNode node) Only and SVG child is allowed under a DocumentNode.
Parameters: node - the candidate child node. | final static boolean | isBaseChar(int c) | final static boolean | isCombiningChar(int c) | final static boolean | isExtender(int c) | final static boolean | isIdeographic(int c) | final static boolean | isLetter(int c) | final static boolean | isNCNameChar(char c) | public boolean | isPlaying() | protected boolean | isRemoveChildSupported() | protected FontFace.Match | matchFontFaces(Vector fontFamily, FontFace.Match lastMatch, TextProperties tp) Matches values in the input fontFamily map against the
current context values.
Parameters: fontFamily - the 'candidate' FontFaces Parameters: lastMatch - the last FontFace.Match . | public void | paint(RenderGraphics rg) Paints this node into the input RenderGraphics . | void | removeIdentifiedNode(ElementNode element) | void | reserveId(ElementNode element) Reserves the given id. | protected FontFace.Match | resolveFontFaces(TextProperties tp) This is where font matching happens. | public void | resolveIDRef(IDRef idRef, String id) Invoked by IDRef instances when they need the given
input id reference to be resolved to an ElementNode
reference. | public void | safeInvokeAndWait(Runnable r) Waits until the given Runnable's run() has returned.
Note: safeInvokeAndWait() may be called from any thread.
This method checks if this thread is the update thread, in which case
the Runnable is invoked directly. | public void | sample(Time currentTime) This method is typically called by this element's time container
when it samples.
Note that if this element is not in the waiting or playing
state, this does nothing. | public void | setDefaultFontFace(FontFace newDefaultFontFace) | protected void | setDelayedException(DOMException de) | public void | setDocumentURI(String docURI) | public void | setFontFaceSet(FontFace[] fontFaceSet) Sets the set of FontFaces that this Document uses
to display text. | protected void | setFontFaceSetSilent(FontFace[] fontFaceSet) Sets the set of FontFaces this document uses but does
not generate a modifyingNode notification. | public void | setImageLoader(ImageLoader imageLoader) Sets the ImageLoader for this document. | public void | setInitialFontFaces(FontFace[] newInitialFontFaces) Sets the intial set of FontFaces. | final public void | setLoaded(boolean isLoaded) When the document finishes loading, it notifies the ImageLoader so that
it can start loading raster images, in case it waited for the load
completion to start (e.g., as in SVGImageLoader). | public void | setPixelMMSize(float newPxMMSize) | public void | setPlaying(boolean isPlaying) | public void | setRunnableHandler(RunnableHandler runHandler) | void | setUnknownTraitsNS(ElementNode element, String namespaceURI, String traitName, String value) Implementation helper. | public void | setUpdateListener(UpdateListener updateListener) Sets the UpdateListener associated with this viewport. | public void | setUpdateQueue(RunnableQueue updateQueue) | String | toNamespace(String prefix, ModelNode node) Maps the input prefix name to a namespace value.
Parameters: prefix - the prefix to map. Parameters: node - the node for which the prefix needs to be mapped. | public String | toPrefix(String namespaceURI, Element node) Maps the input namespace value to a prefix.
Parameters: namespaceURI - the URI to map. Parameters: node - the node for which the namespace needs to be mapped. | protected void | unhookExpandedQuiet() Utility method. | protected DOMException | unsupportedTrait(String name) | public void | validate() Invoked at the end of the parsing stage to validate things which cannot
be validated earlier, such as unresolved use references or invalid
animation settings. |
DEFAULT_PIXEL_MM_SIZE | final public static float DEFAULT_PIXEL_MM_SIZE(Code) | | Default spatial resolution value (96dpi);
|
activeMediaElements | protected Vector activeMediaElements(Code) | | Set of currently active MediaElements.
|
activeTraitAnims | protected Vector activeTraitAnims(Code) | | Set of currently active TraitAnimations.
|
bboxChunkTxf | protected Transform bboxChunkTxf(Code) | | Transform used to compute bounding boxes on text chunks.
|
bboxGlyphTxf | protected Transform bboxGlyphTxf(Code) | | Transform used to compute bounding boxes on glyphs.
|
clockParser | final protected ClockParser clockParser(Code) | | Parser used to convert clock values
|
colorParser | final protected ColorParser colorParser(Code) | | Parser used to convert color values
|
defaultNamespaceURI | protected String defaultNamespaceURI(Code) | | The default namespace URI for elements created in that document,
in case the namespace URI in createElementNS is empty.
|
delayedException | protected DOMException delayedException(Code) | | Exceptions can be delayed and later thrown. This is used, for example,
to keep processing an invalid d attribute on a element and only
throw the exception after the corresponding model node has been hooked
to the tree (while the exception was thrown by the path parser during the
processing of the d attribute). This is only used when loading a document
to comply to the error processing required for , and
processing of the 'd' and 'points' attributes.
|
engineEvent | protected ModelEvent engineEvent(Code) | | We use a single instance of ModelEvent per DocumentNode instance.
This allows multiple instances of DocumentNodes to co-exist.
|
eventSupport | protected EventSupport eventSupport(Code) | | EventSupport is used for listener registration and event
dispatching.
|
fontFaceDB | protected Hashtable fontFaceDB(Code) | | The FontFace data base used by this RenderGraphics.
The Hashtable maps font-family names to a Vector
of fonts with that font-family value.
|
hitChunkTxf | protected Transform hitChunkTxf(Code) | | Transform used to perform hit detection on text chunks.
|
hitGlyphTxf | protected Transform hitGlyphTxf(Code) | | Transform used to perform hit testing on glyphs
|
idToElement | protected Hashtable idToElement(Code) | | Maps ids to ElementNode instances
|
imageLoader | protected ImageLoader imageLoader(Code) | | The ImageLoader handles the desired policy
for loading image resources.
|
initialFontFaces | protected FontFace[] initialFontFaces(Code) | | The set of initial FontFace used by this
RenderingGraphics .
NOTE It is the responsibility of the user of the
Perseus software to make sure that the RenderGraphics
initial fontFamiliy value is indeed the same as that
of the various fonts in the initialFontFaces array.
If there is a mismatch, then text content that does not
specify the font-family property will not match against the
initialFontFaces instances and only the defaultFont will be
used.
See Also: com.sun.perseus.builder.DefaultFontFace |
lengthParser | final protected LengthParser lengthParser(Code) | | Parser used to convert unit and unitless floating point
values to floats.
|
namespaceMap | protected Hashtable namespaceMap(Code) | | A map itself containing map of ElementHandlers
namespaceURI -> Hashtable
the contained Hashtable maps:
localName -> ElementNode prototype.
|
namespaces | protected Hashtable namespaces(Code) | | Maps namespaces to prefixes.
|
paintChunkTxf | protected Transform paintChunkTxf(Code) | | Transform used to render text chunks.
|
paintGlyphTxf | protected Transform paintGlyphTxf(Code) | | Transform used to render glyphs.
|
pathParser | final protected PathParser pathParser(Code) | | Parser used to convert path data
|
playing | protected boolean playing(Code) | | Controls whether the document is 'playing'. This is used to disable the
media elements like audio when the document is not playing and allows
sampling the document without having the audio stream played.
|
prefixes | protected Hashtable prefixes(Code) | | Maps prefixes to namespace entries.
|
pxMMSize | protected float pxMMSize(Code) | | Size of a pixel, in millimeters. This is needed in unit
conversion as well.
|
reservedIds | protected Hashtable reservedIds(Code) | | Used to store nodes with ids before they are inserted into
the document tree.
|
runHandler | protected RunnableHandler runHandler(Code) | | The associated RunnableHandler which should be
notified when Runnable acting on this DocumentNode tree are
run.
|
timeConditionParser | final protected TimeConditionParser timeConditionParser(Code) | | Parser used to convert time condition values
|
timeContainerRootSupport | protected TimeContainerRootSupport timeContainerRootSupport(Code) | | A DocumentNode is a root container. This object provides
support for root time container behavior.
|
unicodeParser | protected UnicodeParser unicodeParser(Code) | | Parser used to convert unicode ranges.
|
unknownTraitsNS | protected Hashtable unknownTraitsNS(Code) | | Used to store additional traits NS., i.e., traits
which are not naturally supported by the element.
elt -> Hashtable.
The contained Hashtable maps:
namespace -> Hashtable.
The contained Hashtable maps:
localname -> value.
|
unresolvedIDRefs | protected Hashtable unresolvedIDRefs(Code) | | Map of unresolved IDRefs (id -> Vector of referencing IDRefs)
|
updateListener | protected UpdateListener updateListener(Code) | | The associated UpdateListener is notified of
all mutation events on this DocumentNode tree
|
updateQueue | protected RunnableQueue updateQueue(Code) | | The associated RunnableQueue , if any, is
managing updates to the DocumentNode and any of
its descendants. In effect, the updateQueue provides the
synchronization needed for updates to a document tree.
|
upt | protected float[] upt(Code) | | Coordinate in user space coordinates. This value is used as a working
array for all nodes in the document tree.
|
viewBoxParser | final protected ViewBoxParser viewBoxParser(Code) | | Parser used to convert viewBox values
|
DocumentNode | public DocumentNode()(Code) | | Default constructor
|
addFontFace | public void addFontFace(FontFace fontFace)(Code) | | Adds a new FontFace to the data base
available to the document.
Parameters: fontFace - the new FontFace which is now available. |
addIdentifiedNode | void addIdentifiedNode(ElementNode element)(Code) | | Adds the input element to the list of identified nodes.
Parameters: element - the new element with a non-null identifier throws: NullPointerException - if the input element is null or if itsid is null. |
addMatch | protected FontFace.Match addMatch(FontFace.Match firstMatch, FontFace.Match newMatch)(Code) | | Chains newMatch into the chain starting with
firstMatch. This inserts the new matching font face
according to the CSS2 font matching rules.
Parameters: firstMatch - the first match in the chain of matchingFontFace.Match instances. Parameters: newMatch - the new FontFace.Match object toinsert into the chain. the head of the FontFace.Match chain afterinsertion of the new match. |
addNamespacePrefix | public void addNamespacePrefix(String prefix, String namespaceURI, ModelNode node)(Code) | | Adds a new prefix to namespace mapping. The scope is provided by
the node parameter.
Parameters: prefix - the new namespace prefix. Parameters: uri - the new namespace URI which maps to the prefix. Parameters: node - the scope of the namespace prefix mapping. The mapping applies to all children, unless overridden. |
addPrototype | public void addPrototype(ElementNode prototypeElement)(Code) | | To support the creation of elements in the createElementNS
method, we supply prototypes to the DocumentNode so that it
can create nodes of specific data types for the prototype's namespaceURI
and localName.
Parameters: prototypeElement - the ElementNode which will be usedas a prototype in createElementNS . Should not be null. throws: IllegalArgumentException - If there is already a prototype node forthe given namespace and local name. |
applyAnimations | public void applyAnimations()(Code) | | Applies all currently active animations.
|
applyMedia | void applyMedia()(Code) | | Applies all currently active media if this document is playing.
|
checkNCName | final void checkNCName(String name) throws DOMException(Code) | | Checks if the input trait name is valid and throws a DOMException
with error code NOT_SUPPORTED_ERR if not.
Parameters: name - the name whose syntax should be checked. throws: DOMException - with error code NOT_SUPPORTED_ERR if the trait name is syntactically incorrect (e.g., null or containingcharacters not conforming to the Namespaces in XML specification. See Also: http://www.w3.org/TR/1999/REC-xml-names-19990114/#NT-NCName |
dispose | public void dispose()(Code) | | Should be called when a document node is no longer needed
and could be garbage collected.
|
dump | public void dump()(Code) | | Traces this viewport tree
|
dump | static void dump(ModelNode n, String prefix, PrintStream out)(Code) | | Debug: traces the input ModelNode, using the input prefix
Parameters: n - the node to dump Parameters: prefix - the string used to prefix the node information Parameters: out - the stream where the node structure is dumped. |
getCurrentTime | public Time getCurrentTime()(Code) | | Returns the current time for the document, i.e., the time at which the
document was last sampled.
the time at which the container was last sampled. |
getDefaultFontFace | public FontFace getDefaultFontFace()(Code) | | The default FontFace used by this RenderGraphics |
getDelayedException | public DOMException getDelayedException()(Code) | | the delayed exception, if any |
getDocumentElement | public Element getDocumentElement()(Code) | | For SVG files this must be
SVGSVGElement , but return type is Element for DOM Core
compatibility and to allow for future extensions. Return null if
document does not have an element child.
|
getElementById | public Element getElementById(String id)(Code) | | If no such element exists, this returns null.
If more than one element has an id attribute with that value, what
is returned is undefined.
|
getElementByIdAll | Element getElementByIdAll(String id)(Code) | | Return the Element in the current document with
the given unique ID. The difference with getElementById is
that this method may return a node that is not inserted in
the document tree. This is used in ElementNode.setId().
Parameters: id - the ID of the object to be retrieved. the Element that matches with the given ID ornull if the ID is not present. throws: NullPointerException - if id is null |
getEventSupport | public EventSupport getEventSupport()(Code) | | The EventSupport instance associatedwith this DocumentNode |
getFirstComputedExpandedChild | public ModelNode getFirstComputedExpandedChild()(Code) | | Some node types (such as ElementNodeProxy ) have
expanded children that they compute in some specific
way depending on the implementation.
a reference to the node's first expanded child, or null if thereare no expanded children. |
getFirstExpandedChild | ModelNode getFirstExpandedChild()(Code) | | A DocumentNode has no expanded content, so this
returns null.
a reference to the node's first expanded child, or null if thereare no expanded children. This forces the computation of expandedcontent if needed. |
getFloatPropertyState | protected float getFloatPropertyState(int propertyIndex)(Code) | | Returns the value of the given float property.
the value of the given property, null if the property is unknown. |
getImageLoader | public ImageLoader getImageLoader()(Code) | | Gets the ImageLoader instance.
the ImageLoader associated to thisDocumentNode . |
getInitialFloatPropertyState | protected float getInitialFloatPropertyState(int propertyIndex)(Code) | | Returns the initial value of the given float-valued property.
the initial value of the given property, 0 if the property isunknown. |
getInitialFontFaces | public FontFace[] getInitialFontFaces()(Code) | | The set of FontFaces used to match the initial font-familyvalue |
getInitialPackedPropertyState | protected int getInitialPackedPropertyState(int propertyIndex)(Code) | | Returns the initial value of the given packed property.
the initial value of the given packed property, zero if the property is unknown. |
getInitialPropertyState | protected Object getInitialPropertyState(int propertyIndex)(Code) | | Returns the initial value of the given Object-valued property.
the initial value of the given property, null if the property isunknown. |
getLastExpandedChild | ModelNode getLastExpandedChild()(Code) | | A DocumentNode has no expanded content, so this
returns null.
a reference to the node's last expanded child, or null if thereare no expanded children. This forces the computation of expandedcontent if needed. |
getLocalName | public String getLocalName()(Code) | | returns the unprefixed node name. For an SVGElement, this returnsthe tag name without a prefix. In case of the Document node, stringnull/code> is returned. |
getNamespaceURI | public String getNamespaceURI()(Code) | | null as per the DOM Level 2 specification for Documentnodes. |
getPackedPropertyState | protected int getPackedPropertyState(int propertyIndex)(Code) | | Returns the value of the given packed property.
the value of the given property, null if the property is unknown. |
getParentNode | public Node getParentNode()(Code) | | Returns the parent Node of this Node .
the parent node or null if there is no parent (i.e. if a node hasjust been created and not yet added to the tree, or if it has beenremoved from the tree, this is null). |
getPixelMMSize | public float getPixelMMSize()(Code) | | the size of a px CSS unit in millimeters. |
getPropertyState | protected Object getPropertyState(int propertyIndex)(Code) | | Returns the value of the given Object-valued property.
the value of the given property, null if the property is unknown. |
getRunnableHandler | public RunnableHandler getRunnableHandler()(Code) | | the RunnableQueue.RunnableHandler which is notifiedof Runnable instances ran against this DocumentNode. |
getURIBase | public String getURIBase()(Code) | | The node's URI base to use to resolve URI references
If a URI base value was set on this node, then that value
is returned. Otherwise, this method returns the parent's
URI base. If there is not URI base on this node and if there
is not parent, then this method returns null.
the node's URI base to use to resolve relative URI references. |
getUnknownTraitsNS | String getUnknownTraitsNS(ElementNode element, String namespaceURI, String traitName)(Code) | | Implementation helper. Returns the ElementNode's trait value if
it was ever set.
Parameters: element - the ElementNode on which the trait might be set. Parameters: namespaceURI - the trait's namespace URI Parameters: traitName - the trait's local name. the trait value or null if the value was never set. |
getUpdateQueue | public RunnableQueue getUpdateQueue()(Code) | | the RunnableQueue which managers updates to thisDocumentNode hierarchy. |
growFontFaceDB | protected void growFontFaceDB(Hashtable ffDB, FontFace[] fontFaceSet)(Code) | | Builds a Hashtable of font faces to map font family
names to FontFace instances.
Parameters: ffDB - the font data base to grow Parameters: fontFaceSet - array of FontFace instances to addto the font data base. See Also: DocumentNode.setFontFaceSet |
inDocumentTree | boolean inDocumentTree()(Code) | | true if this node is hooked to the document tree, i.e., if it topmost ancestor is the DocumentNode. |
incrementTime | public void incrementTime(float seconds)(Code) | | Increments the animation or media timeline for this SVGImage (in
seconds). As the name implies, this method is intended to move only
forward in the timeline and typically should be used to animate SVG
content in the "one-shot" rendering mode. Setting negative values will
throw an Exception. It is important to note that setting large increments
of time would result in dropping or skipping of frames as per the SVG
animation model.
throws: IllegalArgumentException - if the specified time is negative. |
initEngineEvent | ModelEvent initEngineEvent(String type, ModelNode target)(Code) | | Initializes the ModelEvent's singleton object with the input data.
Parameters: type - the event type Parameters: target - the event target Parameters: time - the event time |
initializeTimingEngine | public void initializeTimingEngine()(Code) | | Initializes the timing engine.
|
invokeAndWait | public void invokeAndWait(Runnable r) throws InterruptedException(Code) | | Waits until the given Runnable's run() has returned.
Note: invokeAndWait() must not be called from the
current thread (for example from the run() method of the
argument).
Parameters: r - the Runnable to put at the end of the execution list. throws: IllegalStateException - if there is an associated RunnableQueuewhich has exited or was not started. throws: InterruptedException - if the thread is interrupted while waiting for the input Runnable to completeits execution. |
invokeLater | public void invokeLater(Runnable r)(Code) | | Schedules the given Runnable object for a later invocation in
the document's update thread, and returns.
If there is no updateQueue the Runnable
is run before returning. Otherwise, the Runnable
is scheduled in the associated updateQueue
Parameters: r - the Runnable to put at the end of theexecution list. throws: IllegalStateException - if there is an associated RunnableQueue but that one has exitedor was not started. |
isAllowedChild | protected boolean isAllowedChild(ElementNode node)(Code) | | Only and SVG child is allowed under a DocumentNode.
Parameters: node - the candidate child node. true if the input node can be inserted under this CompositeNode |
isBaseChar | final static boolean isBaseChar(int c)(Code) | | |
isCombiningChar | final static boolean isCombiningChar(int c)(Code) | | |
isExtender | final static boolean isExtender(int c)(Code) | | |
isIdeographic | final static boolean isIdeographic(int c)(Code) | | |
isLetter | final static boolean isLetter(int c)(Code) | | |
isNCNameChar | final static boolean isNCNameChar(char c)(Code) | | |
isPlaying | public boolean isPlaying()(Code) | | true if the DocumentNode is in the playing state. |
isRemoveChildSupported | protected boolean isRemoveChildSupported()(Code) | | false, as DocumentNode does not support removing children. |
matchFontFaces | protected FontFace.Match matchFontFaces(Vector fontFamily, FontFace.Match lastMatch, TextProperties tp)(Code) | | Matches values in the input fontFamily map against the
current context values.
Parameters: fontFamily - the 'candidate' FontFaces Parameters: lastMatch - the last FontFace.Match . Any newmatch sub-chain (i.e., for the input fontFamily) will be chained after lastMatch Parameters: tp - the TextProperties defining the applicablefont selection properties the first FontFace.Match node, head ofthe chain of matches, linked in precedence order. See Also: DocumentNode.resolveFontFaces |
paint | public void paint(RenderGraphics rg)(Code) | | Paints this node into the input RenderGraphics .
Parameters: rg - the RenderGraphics where the node should paint itself |
removeIdentifiedNode | void removeIdentifiedNode(ElementNode element)(Code) | | Remove element from the list of identified nodes
Parameters: element - the element to remove from the list of identified nodes throws: NullPointerException - if element is null or if its id is null. |
reserveId | void reserveId(ElementNode element)(Code) | | Reserves the given id. This is used to be able to check for
duplicate identifiers.
Parameters: element - the element reserving the id. Should not be null.The element id should not be null. |
resolveFontFaces | protected FontFace.Match resolveFontFaces(TextProperties tp)(Code) | | This is where font matching happens. This method compares the
font attributes (such as 'font-family' or 'font-weight') with
the corresponding attributes in the FontFace set. At a minimum,
this method returns a single font in the list: the defaultFontFace.
This process follows the algorithm described in section
15.5 of the CSS2 specification (http://www.w3.org/TR/REC-CSS2/)
In SVG Tiny, the font attributes on Text are:
- font-family
- font-size
- font-style
- font-weight
Therefore, font matching is limited to these attributes (i.e.,
font-variant is not used).
IMPORTANT NOTE: The FontFaces data base is built when the
setFontFaceSet method is invoked, from the input array. The
input array is expected to be in document order and the
fontFaceDB hashtable's value Vectors contain values which are
in the same order as in the array passed to setFontFaceSet.
Therefore, the resolveFontFaces returns matches in document
order. This is important for situations where a less specific
FontFace (font-family:Arial, font-style: any) would appear
before (in document order) a more specific FontFace (font-family:Arial,
font-style: italic). In that case, only the less specific FontFace
will be the match for a text with font-family set to Arial
and font-style set to italic.
Parameters: tp - The TextProperties containing the font selectionproperties. a chain of FontFace.Match . The first element isalways the default font face. The next element (if any),is the first match, ordered according to the CSS2 font matchingrules. |
resolveIDRef | public void resolveIDRef(IDRef idRef, String id)(Code) | | Invoked by IDRef instances when they need the given
input id reference to be resolved to an ElementNode
reference. If there is a known ElementNode with the
requested id, the IDRef 's resolve()
method is invoked immediately. Otherwise, the method will be called
as soon as the id reference is resolved.
Parameters: idRef - the IDRef which needs to be resolved. Parameters: id - the id the IDRef needs to resolve to anElementNode reference. |
safeInvokeAndWait | public void safeInvokeAndWait(Runnable r)(Code) | | Waits until the given Runnable's run() has returned.
Note: safeInvokeAndWait() may be called from any thread.
This method checks if this thread is the update thread, in which case
the Runnable is invoked directly. Otherwise, it delegates to the
invokeAndWait method.
Parameters: r - the Runnable to put at the end of the execution list. Should not be null. Parameters: runHandler - the RunnableHandler to notify once the Runnable has finished executing.Should not be null. throws: IllegalStateException - if getThread() is null or if thethread returned by getThread() is the current one. |
sample | public void sample(Time currentTime)(Code) | | This method is typically called by this element's time container
when it samples.
Note that if this element is not in the waiting or playing
state, this does nothing. This method assumes that successive
calls are made with increasing time values.
Parameters: currentTime - the time at which this element should be sampled. |
setDefaultFontFace | public void setDefaultFontFace(FontFace newDefaultFontFace)(Code) | | Sets the default FontFace, i.e., the FontFace which
will always be the last element in the
FontFace array returned from resolveFontFaces
Parameters: newDefaultFontFace - the fall back font throws: IllegalArgumentException - if defaultFontFace is null |
setDelayedException | protected void setDelayedException(DOMException de)(Code) | | Parameters: de - the new delayedException |
setDocumentURI | public void setDocumentURI(String docURI)(Code) | | Sets this document's URI
Parameters: docURI - the new document URI |
setFontFaceSet | public void setFontFaceSet(FontFace[] fontFaceSet)(Code) | | Sets the set of FontFaces that this Document uses
to display text.
Parameters: fontFaceSet - the set of font faces to use |
setFontFaceSetSilent | protected void setFontFaceSetSilent(FontFace[] fontFaceSet)(Code) | | Sets the set of FontFaces this document uses but does
not generate a modifyingNode notification.
Parameters: fontFaceSet - the set of font faces to use |
setImageLoader | public void setImageLoader(ImageLoader imageLoader)(Code) | | Sets the ImageLoader for this document.
Parameters: imageLoader - the new ImageLoader thisDocumentNode should use. |
setInitialFontFaces | public void setInitialFontFaces(FontFace[] newInitialFontFaces)(Code) | | Sets the intial set of FontFaces. The intent for this property
is to provide a set of FontFaces that match the initial
font-family property for varying values of font-weight and
font-style. However, this can also be used to provide support
for the logical font-faces.
The RenderGraphics will keep a reference to the input array which
should not be modified after it has been passed to this RenderGraphics.
Parameters: newInitialFontFaces - should not be null and should not containnull values throws: IllegalArgumentException - if initialFontFaces is null or ifone of the array values is null. |
setLoaded | final public void setLoaded(boolean isLoaded)(Code) | | When the document finishes loading, it notifies the ImageLoader so that
it can start loading raster images, in case it waited for the load
completion to start (e.g., as in SVGImageLoader).
Parameters: isLoaded - the new loaded state |
setPixelMMSize | public void setPixelMMSize(float newPxMMSize)(Code) | | Controls the size of a pixel in millimeters
Parameters: newPxMMSize - the new pixel size value, in millimeter |
setPlaying | public void setPlaying(boolean isPlaying)(Code) | | Parameters: isPlaying - the new playing state. |
setRunnableHandler | public void setRunnableHandler(RunnableHandler runHandler)(Code) | | Parameters: runHandler - the RunnableHandler which listens to Runnable execution for this DocumentNode . |
setUnknownTraitsNS | void setUnknownTraitsNS(ElementNode element, String namespaceURI, String traitName, String value)(Code) | | Implementation helper. Checks that the unknownTraitNS map is not null for
the given ElementNode before using it, for the requested namespaceURI.
Parameters: element - the ElementNode for which a table should be created for the given namespace URI. Parameters: namespaceURI - the trait's namespace URI Parameters: traitName - the trait's local name. Parameters: value - the trait value. the namespaceURI's unknown traits table. |
setUpdateListener | public void setUpdateListener(UpdateListener updateListener)(Code) | | Sets the UpdateListener associated with this viewport.
All updates made to this tree will be reported to the input
UpdateListener
Parameters: updateListener - the new UpdateListener which willreceive notifications for updates on this tree. |
setUpdateQueue | public void setUpdateQueue(RunnableQueue updateQueue)(Code) | | Parameters: updateQueue - the RunnableQueue which manages updates to this document tree. |
toNamespace | String toNamespace(String prefix, ModelNode node)(Code) | | Maps the input prefix name to a namespace value.
Parameters: prefix - the prefix to map. Parameters: node - the node for which the prefix needs to be mapped. the namespace the prefix maps to for the node, or null if there is no such namespace prefix. |
toPrefix | public String toPrefix(String namespaceURI, Element node)(Code) | | Maps the input namespace value to a prefix.
Parameters: namespaceURI - the URI to map. Parameters: node - the node for which the namespace needs to be mapped. the namespace the prefix maps to for the node, or null if there is no such namespace prefix. |
unhookExpandedQuiet | protected void unhookExpandedQuiet()(Code) | | Utility method. Unhooks the expanded content.
|
unsupportedTrait | protected DOMException unsupportedTrait(String name)(Code) | | Parameters: name - the trait name a DOMException describing the unsupported trait error. |
validate | public void validate() throws DOMException(Code) | | Invoked at the end of the parsing stage to validate things which cannot
be validated earlier, such as unresolved use references or invalid
animation settings.
throws: DOMException - if there are validation errors. |
Methods inherited from com.sun.perseus.model.ModelNode | Box addBBox(Box bbox, Transform t)(Code)(Java Doc) static Box addBBox(Box bbox, float x, float y, float width, float height)(Code)(Java Doc) public void addEventListener(String type, EventListener listener, boolean useCapture) throws DOMException(Code)(Java Doc) Box addNodeBBox(Box bbox, Transform t)(Code)(Java Doc) static Box addShapeBBox(Box bbox, Path path, Transform t)(Code)(Java Doc) static Box addTransformedBBox(Box bbox, float x, float y, float width, float height, Transform m)(Code)(Java Doc) protected Transform appendTransform(Transform tx, Transform workTx)(Code)(Java Doc) protected void clearLastRenderedTile()(Code)(Java Doc) abstract protected void clearLayouts()(Code)(Java Doc) void clearLayouts(ModelNode node)(Code)(Java Doc) final void computeCanRenderDisplayBit(boolean display)(Code)(Java Doc) final void computeCanRenderEmptyPathBit(Path path)(Code)(Java Doc) final void computeCanRenderEmptyViewBoxBit(float[][] viewBox)(Code)(Java Doc) final void computeCanRenderFontSizeBit(float fontSize)(Code)(Java Doc) final void computeCanRenderHeightBit(float height)(Code)(Java Doc) final void computeCanRenderRequiredExtensionsBit(String[] requiredExtensions)(Code)(Java Doc) final void computeCanRenderRequiredFeaturesBit(String[] requiredFeatures)(Code)(Java Doc) final void computeCanRenderSystemLanguageBit(String[] systemLanguage)(Code)(Java Doc) final void computeCanRenderTransformBit(Transform transform)(Code)(Java Doc) final void computeCanRenderWidthBit(float width)(Code)(Java Doc) protected void computeRenderingTile(Tile tile)(Code)(Java Doc) protected boolean contributeBBox()(Code)(Java Doc) public void dispatchEvent(ModelEvent evt)(Code)(Java Doc) abstract public ModelNode getFirstChildNode()(Code)(Java Doc) abstract ModelNode getFirstComputedExpandedChild()(Code)(Java Doc) abstract ModelNode getFirstExpandedChild()(Code)(Java Doc) protected float getFloatPropertyState(int propertyIndex)(Code)(Java Doc) final protected float getInheritedFloatPropertyState(int propertyIndex)(Code)(Java Doc) final protected int getInheritedPackedPropertyState(int propertyIndex)(Code)(Java Doc) final protected Object getInheritedPropertyState(int propertyIndex)(Code)(Java Doc) Transform getInverseTransformState()(Code)(Java Doc) abstract public ModelNode getLastChildNode()(Code)(Java Doc) abstract ModelNode getLastExpandedChild()(Code)(Java Doc) protected Tile getLastRenderedTile()(Code)(Java Doc) public ModelNode getNextSiblingNode()(Code)(Java Doc) public DocumentNode getOwnerDocument()(Code)(Java Doc) protected int getPackedPropertyState(int propertyIndex)(Code)(Java Doc) boolean getPaintNeedsLoad()(Code)(Java Doc) public ModelNode getParent()(Code)(Java Doc) public ModelNode getPreviousSiblingNode()(Code)(Java Doc) protected Object getPropertyState(int propertyIndex)(Code)(Java Doc) protected Tile getRenderingTile()(Code)(Java Doc) public SVGMatrix getScreenCTM()(Code)(Java Doc) public Transform getTransformState()(Code)(Java Doc) protected String getURIBase()(Code)(Java Doc) protected UpdateListener getUpdateListener()(Code)(Java Doc) public boolean hasDescendants()(Code)(Java Doc) protected boolean hasNodeRendering()(Code)(Java Doc) boolean inDocumentTree()(Code)(Java Doc) protected boolean isFloatPropertyState(int propertyIndex, float propertyValue)(Code)(Java Doc) protected boolean isInDocumentTree()(Code)(Java Doc) final public boolean isLoaded()(Code)(Java Doc) protected boolean isPackedPropertyState(int propertyIndex, int propertyValue)(Code)(Java Doc) protected boolean isPropertyState(int propertyIndex, Object propertyValue)(Code)(Java Doc) protected void modifiedNode()(Code)(Java Doc) protected void modifyingNode()(Code)(Java Doc) protected void modifyingNodeRendering()(Code)(Java Doc) public ModelNode nodeHitAt(float[] pt)(Code)(Java Doc) final protected ModelNode nodeHitAt(ModelNode node, float[] pt)(Code)(Java Doc) protected static void nodeInserted(ModelNode node)(Code)(Java Doc) protected void nodeRendered()(Code)(Java Doc) void onHookedInDocumentTree()(Code)(Java Doc) void onUnhookedFromDocumentTree()(Code)(Java Doc) static void paint(ModelNode node, RenderGraphics rg)(Code)(Java Doc) public void paint(RenderGraphics rg)(Code)(Java Doc) protected void propagateCanRenderState(int oldCanRenderState, int newCanRenderState)(Code)(Java Doc) protected void propagateFloatPropertyState(int propertyIndex, float parentPropertyValue)(Code)(Java Doc) protected void propagatePackedPropertyState(int propertyIndex, int parentPropertyValue)(Code)(Java Doc) protected void propagatePropertyState(int propertyIndex, Object parentPropertyValue)(Code)(Java Doc) protected void recomputeFloatPropertyState(int propertyIndex, float parentPropertyValue)(Code)(Java Doc) void recomputeInheritedProperties()(Code)(Java Doc) protected void recomputePackedPropertyState(int propertyIndex, int parentPropertyValue)(Code)(Java Doc) protected void recomputePropertyState(int propertyIndex, Object parentPropertyValue)(Code)(Java Doc) protected void recomputeTransformState()(Code)(Java Doc) protected void recomputeTransformState(Transform parentTransform)(Code)(Java Doc) void recomputeTransformState(Transform parentTransform, ModelNode node)(Code)(Java Doc) final protected Transform recycleTransform(Transform tx, Transform workTx)(Code)(Java Doc) public void removeEventListener(String type, EventListener listener, boolean useCapture) throws DOMException(Code)(Java Doc) protected void setFloatPropertyState(int propertyIndex, float propertyValue)(Code)(Java Doc) public void setLoaded(boolean isLoaded)(Code)(Java Doc) protected void setPackedPropertyState(int propertyIndex, int propertyValue)(Code)(Java Doc) protected void setParent(ModelNode newParent)(Code)(Java Doc) protected void setParentQuiet(ModelNode newParent)(Code)(Java Doc) protected void setPropertyState(int propertyIndex, Object propertyValue)(Code)(Java Doc) abstract protected void unhookChildrenQuiet()(Code)(Java Doc) abstract protected void unhookExpandedQuiet()(Code)(Java Doc) final protected void unhookQuiet(ModelNode node)(Code)(Java Doc)
|
|
|