Fields Summary |
---|
public static final float | DEFAULT_PIXEL_MM_SIZEDefault spatial resolution value (96dpi); |
protected float | pxMMSizeSize of a pixel, in millimeters. This is needed in unit
conversion as well. |
protected float[] | uptCoordinate in user space coordinates. This value is used as a working
array for all nodes in the document tree. |
protected Hashtable | namespaceMapA map itself containing map of ElementHandlers
namespaceURI -> Hashtable
the contained Hashtable maps:
localName -> ElementNode prototype. |
protected Hashtable | unknownTraitsNSUsed 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. |
protected final com.sun.perseus.parser.ClockParser | clockParserParser used to convert clock values |
protected final com.sun.perseus.parser.LengthParser | lengthParserParser used to convert unit and unitless floating point
values to floats. |
protected final com.sun.perseus.parser.TimeConditionParser | timeConditionParserParser used to convert time condition values |
protected com.sun.perseus.parser.NumberListParser | numberListParserParser used to convert number list values |
protected com.sun.perseus.parser.TransformListParser | transformListParserParser used to convert transform values |
protected final com.sun.perseus.parser.ColorParser | colorParserParser used to convert color values |
protected final com.sun.perseus.parser.ViewBoxParser | viewBoxParserParser used to convert viewBox values |
protected final com.sun.perseus.parser.PathParser | pathParserParser used to convert path data |
protected com.sun.perseus.parser.UnicodeParser | unicodeParserParser used to convert unicode ranges. |
protected ImageLoader | imageLoaderThe ImageLoader handles the desired policy
for loading image resources. |
protected FontFace | defaultFontFaceThe default FontFace used by this RenderGraphics. |
protected DOMException | delayedExceptionExceptions 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. |
protected String | defaultNamespaceURIThe default namespace URI for elements created in that document,
in case the namespace URI in createElementNS is empty. |
protected String | docURIThe Document URI |
protected FontFace[] | initialFontFacesThe 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. |
protected Hashtable | fontFaceDBThe FontFace data base used by this RenderGraphics.
The Hashtable maps font-family names to a Vector
of fonts with that font-family value. |
protected Vector | activeTraitAnimsSet of currently active TraitAnimations. |
protected Vector | activeMediaElementsSet of currently active MediaElements. |
protected boolean | playingControls 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. |
protected EventSupport | eventSupportEventSupport is used for listener registration and event
dispatching. |
protected UpdateListener | updateListenerThe associated UpdateListener is notified of
all mutation events on this DocumentNode tree |
protected com.sun.perseus.util.RunnableQueue | updateQueueThe 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. |
protected com.sun.perseus.util.RunnableQueue.RunnableHandler | runHandlerThe associated RunnableHandler which should be
notified when Runnable acting on this DocumentNode tree are
run. |
protected Hashtable | idToElementMaps ids to ElementNode instances |
protected Hashtable | reservedIdsUsed to store nodes with ids before they are inserted into
the document tree. |
protected Hashtable | prefixesMaps prefixes to namespace entries. |
protected Hashtable | namespacesMaps namespaces to prefixes. |
protected TimeContainerRootSupport | timeContainerRootSupportA DocumentNode is a root container. This object provides
support for root time container behavior. |
protected Hashtable | unresolvedIDRefsMap of unresolved IDRefs (id -> Vector of referencing IDRefs) |
protected Vector | animationsVector of animations. This is used only at parse time. |
protected ModelEvent | engineEventWe use a single instance of ModelEvent per DocumentNode instance.
This allows multiple instances of DocumentNodes to co-exist. |
protected com.sun.perseus.j2d.Transform | hitChunkTxfTransform used to perform hit detection on text chunks. |
protected com.sun.perseus.j2d.Transform | bboxChunkTxfTransform used to compute bounding boxes on text chunks. |
protected com.sun.perseus.j2d.Transform | paintChunkTxfTransform used to render text chunks. |
protected com.sun.perseus.j2d.Transform | paintGlyphTxfTransform used to render glyphs. |
protected com.sun.perseus.j2d.Transform | bboxGlyphTxfTransform used to compute bounding boxes on glyphs. |
protected com.sun.perseus.j2d.Transform | hitGlyphTxfTransform used to perform hit testing on glyphs |
Methods Summary |
---|
public void | addFontFace(FontFace fontFace)Adds a new FontFace to the data base
available to the document.
if (fontFaceDB == null) {
// This initializes the data base
setFontFaceSetSilent(null);
}
growFontFaceDB(fontFaceDB, new FontFace[] {fontFace});
clearLayouts();
|
void | addIdentifiedNode(ElementNode element)Adds the input element to the list of identified nodes.
// Add element to id map
idToElement.put(element.getId(), element);
// Check if there are any unresolved references for
// the newly identified node.
if (unresolvedIDRefs != null) {
Vector idRefs = (Vector) unresolvedIDRefs.get(element.getId());
if (idRefs != null) {
int n = idRefs.size();
for (int i = 0; i < n; i++) {
IDRef idRef = (IDRef) idRefs.elementAt(i);
idRef.resolveTo(element);
}
unresolvedIDRefs.remove(element.getId());
}
}
// If the id was in the reserved map, remove it.
reservedIds.remove(element.getId());
|
protected FontFace.Match | addMatch(FontFace.Match firstMatch, FontFace.Match newMatch)Chains newMatch into the chain starting with
firstMatch. This inserts the new matching font face
according to the CSS2 font matching rules.
if (firstMatch == null) {
return newMatch;
}
FontFace.Match curMatch = firstMatch;
FontFace.Match prevMatch = null;
while (curMatch != null && curMatch.distance <= newMatch.distance) {
prevMatch = curMatch;
curMatch = curMatch.next;
}
if (curMatch == null) {
// We reached the end of the list, simply append newMatch
prevMatch.next = newMatch;
return firstMatch;
} else {
// We need to insert newMatch before curMatch
if (prevMatch == null) {
// Inserted at the start of the list
newMatch.next = firstMatch;
return newMatch;
} else {
// Insert somewhere in the middle of the list
prevMatch.next = newMatch;
newMatch.next = curMatch;
return firstMatch;
}
}
|
public void | addNamespacePrefix(java.lang.String prefix, java.lang.String namespaceURI, ModelNode node)Adds a new prefix to namespace mapping. The scope is provided by
the node parameter.
if (prefix == null) {
throw new NullPointerException();
}
// First, check if there are already mappings for the
// prefix.
Object[][] namespaceEntry = (Object[][]) prefixes.get(prefix);
if (namespaceEntry == null) {
// Simple case: there is not entry yet. Create a new one.
namespaceEntry = new Object[][] {
{namespaceURI, node} };
} else {
// There is an existing entry. Add the new one ahead of the
// other ones.
Object[][] newNamespaceEntry =
new Object[namespaceEntry.length + 1][];
newNamespaceEntry[0] = new Object[] {namespaceURI, node};
System.arraycopy(namespaceEntry, 0, newNamespaceEntry, 1,
namespaceEntry.length);
namespaceEntry = newNamespaceEntry;
}
prefixes.put(prefix, namespaceEntry);
// Now, update the namespaces map.
Object[][] prefixEntry = (Object[][]) namespaces.get(namespaceURI);
if (prefixEntry == null) {
// Simple case: there is no entry yet. Create a new one.
prefixEntry = new Object[][] {
{prefix, node} };
} else {
// There is an existing entry. Add the new one ahead of the other
// ones.
Object[][] newPrefixEntry = new Object[prefixEntry.length + 1][];
newPrefixEntry[0] = new Object[] {prefix, node};
System.arraycopy(prefixEntry, 0, newPrefixEntry, 1,
prefixEntry.length);
prefixEntry = newPrefixEntry;
}
namespaces.put(namespaceURI, prefixEntry);
|
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.
// Get the namespace map
String namespaceURI = prototypeElement.getNamespaceURI();
Hashtable lmap = (Hashtable) namespaceMap.get(namespaceURI);
if (lmap == null) {
lmap = new Hashtable();
namespaceMap.put(namespaceURI, lmap);
}
lmap.put(prototypeElement.getLocalName(), prototypeElement);
|
public void | applyAnimations()Applies all currently active animations.
int n = activeTraitAnims.size();
// System.err.println(">>>>>>>>>>>>>>>>>> There are : " + n
// + " active animations");
for (int i = 0; i < n; i++) {
// System.err.println("Applying TraitAnim [" + i + "]");
((TraitAnim) activeTraitAnims.elementAt(i)).apply();
}
|
void | applyMedia()Applies all currently active media if this document is playing.
/*
if (playing) {
int n = activeMediaElements.size();
for (int i = n - 1; i >= 0; i--) {
((MediaElement) activeMediaElements.elementAt(i)).playMedia();
}
} else {
int n = activeMediaElements.size();
for (int i = n - 1; i >= 0; i--) {
((MediaElement) activeMediaElements.elementAt(i)).endMedia();
}
}
*/
|
public void | checkDelayedException()
if (delayedException != null) {
throw delayedException;
}
|
final void | checkNCName(java.lang.String name)Checks if the input trait name is valid and throws a DOMException
with error code NOT_SUPPORTED_ERR if not.
if (name == null || name.length() == 0) {
throw unsupportedTrait(name);
}
// NCName ::= (Letter | '_') (NCNameChar)*
// NCNameChar ::= Letter | Digit | '.' | '-' | '_' | CombiningChar
// | Extender
char c = name.charAt(0);
if (!isLetter(c) && c != '_") {
throw unsupportedTrait(name);
}
for (int i = 1; i < name.length(); i++) {
c = name.charAt(i);
if (!isNCNameChar(c)) {
throw unsupportedTrait(name);
}
}
|
public org.w3c.dom.Element | createElementNS(java.lang.String namespaceURI, java.lang.String qualifiedName)
if (namespaceURI == null || qualifiedName == null) {
throw new NullPointerException();
}
// Extract qualified name from the local name.
String localName = qualifiedName;
int pi = qualifiedName.indexOf(':");
if (pi != -1) {
if (pi == localName.length() - 1) {
// Namepace prefix separator is at the end of the qualified name
localName = "";
} else {
localName = qualifiedName.substring(pi + 1);
}
}
//
// If the namespaceURI is empty, we have two cases:
// 1. (extremely rare) the content maps some prefix, or the default
// namespace, to the "" namespace URI.
// 2. (extremely common) the content does not have an xmlns declaration
// on its root element and the parser reported the root element
// and children as being in the "" namespace URI.
//
// The following code means that the situation 1. is _not_ handled. If
// the author mapped a prefix or the default prefix to the
// empty string URI, that will be overriddent by the default namespace.
if (namespaceURI.length() == 0) {
namespaceURI = defaultNamespaceURI;
}
Hashtable lmap = (Hashtable) namespaceMap.get(namespaceURI);
ElementNode en = null;
if (lmap != null) {
en = (ElementNode) lmap.get(localName);
if (en != null) {
en = en.newInstance(this);
}
}
if (en == null) {
checkNCName(localName);
en = new GenericElementNode(namespaceURI, localName, this);
}
return en;
|
public void | dispose()Should be called when a document node is no longer needed
and could be garbage collected.
clearLayouts();
|
public void | dump()Traces this viewport tree
dump(this, "", System.err);
|
static void | dump(ModelNode n, java.lang.String prefix, java.io.PrintStream out)Debug: traces the input ModelNode, using the input prefix
out.print(prefix + " " + n);
if (n instanceof ElementNode) {
ElementNode e = (ElementNode) n;
String pfx = n.ownerDocument.toPrefix(e.getNamespaceURI(), e);
if (pfx == null || pfx.length() == 0) {
out.println(" <" + e.getLocalName() + ">");
} else {
out.println(" <" + pfx + ":" + e.getLocalName() + ">");
}
} else {
out.println();
}
ModelNode child = n.getFirstChildNode();
while (child != null) {
dump(child, prefix + "+-->", out);
child = child.nextSibling;
}
child = n.getFirstExpandedChild();
while (child != null) {
dump(child, prefix + "*~~>", out);
child = child.nextSibling;
}
|
public Time | getCurrentTime()Returns the current time for the document, i.e., the time at which the
document was last sampled.
return timeContainerRootSupport.lastSampleTime;
|
public FontFace | getDefaultFontFace()
return defaultFontFace;
|
public org.w3c.dom.DOMException | getDelayedException()
return delayedException;
|
public org.w3c.dom.Element | getDocumentElement()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.
return firstChild;
|
public org.w3c.dom.Element | getElementById(java.lang.String id)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.
return (ElementNode) idToElement.get(id);
|
org.w3c.dom.Element | getElementByIdAll(java.lang.String id)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().
ElementNode n = (ElementNode) idToElement.get(id);
if (n == null) {
n = (ElementNode) reservedIds.get(id);
}
return n;
|
public EventSupport | getEventSupport()
return eventSupport;
|
public ModelNode | getFirstComputedExpandedChild()Some node types (such as ElementNodeProxy ) have
expanded children that they compute in some specific
way depending on the implementation.
return null;
|
ModelNode | getFirstExpandedChild()A DocumentNode has no expanded content, so this
returns null.
return null;
|
protected float | getFloatPropertyState(int propertyIndex)Returns the value of the given float property.
return getInitialFloatPropertyState(propertyIndex);
|
public ImageLoader | getImageLoader()Gets the ImageLoader instance.
if (imageLoader == null) {
imageLoader = new DefaultImageLoader();
}
return imageLoader;
|
protected float | getInitialFloatPropertyState(int propertyIndex)Returns the initial value of the given float-valued property.
switch (propertyIndex) {
case GraphicsNode.PROPERTY_STROKE_WIDTH:
return GraphicsNode.INITIAL_STROKE_WIDTH;
case GraphicsNode.PROPERTY_STROKE_MITER_LIMIT:
return GraphicsNode.INITIAL_STROKE_MITER_LIMIT;
case GraphicsNode.PROPERTY_STROKE_DASH_OFFSET:
return GraphicsNode.INITIAL_STROKE_DASH_OFFSET;
case TextNode.PROPERTY_FONT_SIZE:
return TextNode.INITIAL_FONT_SIZE;
default:
return 0;
}
|
public FontFace[] | getInitialFontFaces()
return initialFontFaces;
|
protected int | getInitialPackedPropertyState(int propertyIndex)Returns the initial value of the given packed property.
switch (propertyIndex) {
case GraphicsNode.PROPERTY_FILL_RULE:
return CompositeGraphicsNode.INITIAL_FILL_RULE_IMPL;
case GraphicsNode.PROPERTY_STROKE_LINE_JOIN:
return CompositeGraphicsNode.INITIAL_STROKE_LINE_JOIN_IMPL;
case GraphicsNode.PROPERTY_STROKE_LINE_CAP:
return CompositeGraphicsNode.INITIAL_STROKE_LINE_CAP_IMPL;
case GraphicsNode.PROPERTY_DISPLAY:
return CompositeGraphicsNode.INITIAL_DISPLAY_IMPL;
case GraphicsNode.PROPERTY_VISIBILITY:
return CompositeGraphicsNode.INITIAL_VISIBILITY_IMPL;
case GraphicsNode.PROPERTY_FILL_OPACITY:
return CompositeGraphicsNode.INITIAL_FILL_OPACITY_IMPL;
case GraphicsNode.PROPERTY_STROKE_OPACITY:
return CompositeGraphicsNode.INITIAL_STROKE_OPACITY_IMPL;
case GraphicsNode.PROPERTY_OPACITY:
return CompositeGraphicsNode.INITIAL_OPACITY_IMPL;
case TextNode.PROPERTY_FONT_STYLE:
return StructureNode.INITIAL_FONT_STYLE_IMPL;
case TextNode.PROPERTY_FONT_WEIGHT:
return StructureNode.INITIAL_FONT_WEIGHT_IMPL;
case TextNode.PROPERTY_TEXT_ANCHOR:
return StructureNode.INITIAL_TEXT_ANCHOR_IMPL;
default:
return 0;
}
|
protected java.lang.Object | getInitialPropertyState(int propertyIndex)Returns the initial value of the given Object-valued property.
switch (propertyIndex) {
case GraphicsNode.PROPERTY_FILL:
return GraphicsProperties.INITIAL_FILL;
case GraphicsNode.PROPERTY_STROKE:
return GraphicsProperties.INITIAL_STROKE;
case GraphicsNode.PROPERTY_COLOR:
return GraphicsProperties.INITIAL_COLOR;
case GraphicsNode.PROPERTY_STROKE_DASH_ARRAY:
return GraphicsProperties.INITIAL_STROKE_DASH_ARRAY;
case TextNode.PROPERTY_FONT_FAMILY:
return TextNode.INITIAL_FONT_FAMILY;
default:
return null;
}
|
ModelNode | getLastExpandedChild()A DocumentNode has no expanded content, so this
returns null.
return null;
|
public java.lang.String | getLocalName()
return null;
|
public java.lang.String | getNamespaceURI()
return null;
|
protected int | getPackedPropertyState(int propertyIndex)Returns the value of the given packed property.
return getInitialPackedPropertyState(propertyIndex);
|
public org.w3c.dom.Node | getParentNode()Returns the parent Node of this Node .
return null;
|
public float | getPixelMMSize()
return pxMMSize;
|
protected java.lang.Object | getPropertyState(int propertyIndex)Returns the value of the given Object-valued property.
return getInitialPropertyState(propertyIndex);
|
public com.sun.perseus.util.RunnableQueue.RunnableHandler | getRunnableHandler()
return runHandler;
|
public java.lang.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. 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.
return docURI;
|
java.lang.String | getUnknownTraitsNS(ElementNode element, java.lang.String namespaceURI, java.lang.String traitName)Implementation helper. Returns the ElementNode's trait value if
it was ever set.
if (unknownTraitsNS == null) {
return null;
}
Hashtable eltMap = (Hashtable) unknownTraitsNS.get(element);
if (eltMap == null) {
return null;
}
Hashtable nsMap = (Hashtable) eltMap.get(namespaceURI);
if (nsMap == null) {
return null;
}
return (String) nsMap.get(traitName);
|
public UpdateListener | getUpdateListener()
if (parent == null || parent == this) {
return updateListener;
} else {
return parent.getUpdateListener();
}
|
public com.sun.perseus.util.RunnableQueue | getUpdateQueue()
return updateQueue;
|
protected void | growFontFaceDB(java.util.Hashtable ffDB, FontFace[] fontFaceSet)Builds a Hashtable of font faces to map font family
names to FontFace instances.
if (fontFaceSet == null) {
return;
}
// Grow the font data base from the new fontFaceSet
for (int i = 0; i < fontFaceSet.length; i++) {
FontFace ff = fontFaceSet[i];
String[] fontFamilies = ff.getFontFamilies();
if (fontFamilies != null) {
// null is actually a CSS error. But CSS is silent
// about errors, so we should not break or halt on
// such a condition which should be expected
for (int j = 0; j < fontFamilies.length; j++) {
Vector v = (Vector) ffDB.get(fontFamilies[j]);
if (v == null) {
v = new Vector(1);
ffDB.put(fontFamilies[j], v);
v.addElement(ff);
} else {
if (!v.contains(ff)) {
v.addElement(ff);
}
}
}
}
}
|
boolean | inDocumentTree()
return true;
|
public void | incrementTime(float seconds)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.
if (seconds < 0) {
throw new IllegalArgumentException();
}
long lastSampleTime = timeContainerRootSupport
.lastSampleTime.value;
timeContainerRootSupport.sample
(new Time(lastSampleTime + (long) (seconds*1000)));
|
ModelEvent | initEngineEvent(java.lang.String type, ModelNode target)Initializes the ModelEvent's singleton object with the input data.
ModelEvent engineEvent = new ModelEvent(type, target);
engineEvent.type = type;
engineEvent.target = target;
engineEvent.currentTarget = null;
engineEvent.anchor = null;
engineEvent.stopPropagation = false;
engineEvent.repeatCount = 0;
engineEvent.keyChar = ModelEvent.CHAR_UNDEFINED;
return engineEvent;
|
public void | initializeTimingEngine()Initializes the timing engine.
timeContainerRootSupport.initialize();
|
public void | invokeAndWait(java.lang.Runnable r)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).
if (updateQueue == null) {
r.run();
} else {
updateQueue.invokeAndWait(r, runHandler);
}
|
public void | invokeLater(java.lang.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. Otherwise, the Runnable
is scheduled in the associated updateQueue
if (updateQueue == null) {
r.run();
} else {
updateQueue.invokeLater(r, runHandler);
}
|
protected boolean | isAllowedChild(ElementNode node)Only and SVG child is allowed under a DocumentNode.
if (node instanceof SVG) {
return true;
}
return false;
|
static final boolean | isBaseChar(int c)
return (c >= 0x0041 && c <= 0x005A)
|| (c >= 0x0061 && c <= 0x007A)
|| (c >= 0x00C0 && c <= 0x00D6)
|| (c >= 0x00D8 && c <= 0x00F6)
|| (c >= 0x00F8 && c <= 0x00FF)
|| (c >= 0x0100 && c <= 0x0131)
|| (c >= 0x0134 && c <= 0x013E)
|| (c >= 0x0141 && c <= 0x0148)
|| (c >= 0x014A && c <= 0x017E)
|| (c >= 0x0180 && c <= 0x01C3)
|| (c >= 0x01CD && c <= 0x01F0)
|| (c >= 0x01F4 && c <= 0x01F5)
|| (c >= 0x01FA && c <= 0x0217)
|| (c >= 0x0250 && c <= 0x02A8)
|| (c >= 0x02BB && c <= 0x02C1)
|| c == 0x0386
|| (c >= 0x0388 && c <= 0x038A)
|| c == 0x038C
|| (c >= 0x038E && c <= 0x03A1)
|| (c >= 0x03A3 && c <= 0x03CE)
|| (c >= 0x03D0 && c <= 0x03D6)
|| c == 0x03DA
|| c == 0x03DC
|| c == 0x03DE
|| c == 0x03E0
|| (c >= 0x03E2 && c <= 0x03F3)
|| (c >= 0x0401 && c <= 0x040C)
|| (c >= 0x040E && c <= 0x044F)
|| (c >= 0x0451 && c <= 0x045C)
|| (c >= 0x045E && c <= 0x0481)
|| (c >= 0x0490 && c <= 0x04C4)
|| (c >= 0x04C7 && c <= 0x04C8)
|| (c >= 0x04CB && c <= 0x04CC)
|| (c >= 0x04D0 && c <= 0x04EB)
|| (c >= 0x04EE && c <= 0x04F5)
|| (c >= 0x04F8 && c <= 0x04F9)
|| (c >= 0x0531 && c <= 0x0556)
|| c == 0x0559
|| (c >= 0x0561 && c <= 0x0586)
|| (c >= 0x05D0 && c <= 0x05EA)
|| (c >= 0x05F0 && c <= 0x05F2)
|| (c >= 0x0621 && c <= 0x063A)
|| (c >= 0x0641 && c <= 0x064A)
|| (c >= 0x0671 && c <= 0x06B7)
|| (c >= 0x06BA && c <= 0x06BE)
|| (c >= 0x06C0 && c <= 0x06CE)
|| (c >= 0x06D0 && c <= 0x06D3)
|| c == 0x06D5
|| (c >= 0x06E5 && c <= 0x06E6)
|| (c >= 0x0905 && c <= 0x0939)
|| c == 0x093D
|| (c >= 0x0958 && c <= 0x0961)
|| (c >= 0x0985 && c <= 0x098C)
|| (c >= 0x098F && c <= 0x0990)
|| (c >= 0x0993 && c <= 0x09A8)
|| (c >= 0x09AA && c <= 0x09B0)
|| c == 0x09B2
|| (c >= 0x09B6 && c <= 0x09B9)
|| (c >= 0x09DC && c <= 0x09DD)
|| (c >= 0x09DF && c <= 0x09E1)
|| (c >= 0x09F0 && c <= 0x09F1)
|| (c >= 0x0A05 && c <= 0x0A0A)
|| (c >= 0x0A0F && c <= 0x0A10)
|| (c >= 0x0A13 && c <= 0x0A28)
|| (c >= 0x0A2A && c <= 0x0A30)
|| (c >= 0x0A32 && c <= 0x0A33)
|| (c >= 0x0A35 && c <= 0x0A36)
|| (c >= 0x0A38 && c <= 0x0A39)
|| (c >= 0x0A59 && c <= 0x0A5C)
|| c == 0x0A5E
|| (c >= 0x0A72 && c <= 0x0A74)
|| (c >= 0x0A85 && c <= 0x0A8B)
|| c == 0x0A8D
|| (c >= 0x0A8F && c <= 0x0A91)
|| (c >= 0x0A93 && c <= 0x0AA8)
|| (c >= 0x0AAA && c <= 0x0AB0)
|| (c >= 0x0AB2 && c <= 0x0AB3)
|| (c >= 0x0AB5 && c <= 0x0AB9)
|| c == 0x0ABD
|| c == 0x0AE0
|| (c >= 0x0B05 && c <= 0x0B0C)
|| (c >= 0x0B0F && c <= 0x0B10)
|| (c >= 0x0B13 && c <= 0x0B28)
|| (c >= 0x0B2A && c <= 0x0B30)
|| (c >= 0x0B32 && c <= 0x0B33)
|| (c >= 0x0B36 && c <= 0x0B39)
|| c == 0x0B3D
|| (c >= 0x0B5C && c <= 0x0B5D)
|| (c >= 0x0B5F && c <= 0x0B61)
|| (c >= 0x0B85 && c <= 0x0B8A)
|| (c >= 0x0B8E && c <= 0x0B90)
|| (c >= 0x0B92 && c <= 0x0B95)
|| (c >= 0x0B99 && c <= 0x0B9A)
|| c == 0x0B9C
|| (c >= 0x0B9E && c <= 0x0B9F)
|| (c >= 0x0BA3 && c <= 0x0BA4)
|| (c >= 0x0BA8 && c <= 0x0BAA)
|| (c >= 0x0BAE && c <= 0x0BB5)
|| (c >= 0x0BB7 && c <= 0x0BB9)
|| (c >= 0x0C05 && c <= 0x0C0C)
|| (c >= 0x0C0E && c <= 0x0C10)
|| (c >= 0x0C12 && c <= 0x0C28)
|| (c >= 0x0C2A && c <= 0x0C33)
|| (c >= 0x0C35 && c <= 0x0C39)
|| (c >= 0x0C60 && c <= 0x0C61)
|| (c >= 0x0C85 && c <= 0x0C8C)
|| (c >= 0x0C8E && c <= 0x0C90)
|| (c >= 0x0C92 && c <= 0x0CA8)
|| (c >= 0x0CAA && c <= 0x0CB3)
|| (c >= 0x0CB5 && c <= 0x0CB9)
|| c == 0x0CDE
|| (c >= 0x0CE0 && c <= 0x0CE1)
|| (c >= 0x0D05 && c <= 0x0D0C)
|| (c >= 0x0D0E && c <= 0x0D10)
|| (c >= 0x0D12 && c <= 0x0D28)
|| (c >= 0x0D2A && c <= 0x0D39)
|| (c >= 0x0D60 && c <= 0x0D61)
|| (c >= 0x0E01 && c <= 0x0E2E)
|| c == 0x0E30
|| (c >= 0x0E32 && c <= 0x0E33)
|| (c >= 0x0E40 && c <= 0x0E45)
|| (c >= 0x0E81 && c <= 0x0E82)
|| c == 0x0E84
|| (c >= 0x0E87 && c <= 0x0E88)
|| c == 0x0E8A
|| c == 0x0E8D
|| (c >= 0x0E94 && c <= 0x0E97)
|| (c >= 0x0E99 && c <= 0x0E9F)
|| (c >= 0x0EA1 && c <= 0x0EA3)
|| c == 0x0EA5
|| c == 0x0EA7
|| (c >= 0x0EAA && c <= 0x0EAB)
|| (c >= 0x0EAD && c <= 0x0EAE)
|| c == 0x0EB0
|| (c >= 0x0EB2 && c <= 0x0EB3)
|| c == 0x0EBD
|| (c >= 0x0EC0 && c <= 0x0EC4)
|| (c >= 0x0F40 && c <= 0x0F47)
|| (c >= 0x0F49 && c <= 0x0F69)
|| (c >= 0x10A0 && c <= 0x10C5)
|| (c >= 0x10D0 && c <= 0x10F6)
|| c == 0x1100
|| (c >= 0x1102 && c <= 0x1103)
|| (c >= 0x1105 && c <= 0x1107)
|| c == 0x1109
|| (c >= 0x110B && c <= 0x110C)
|| (c >= 0x110E && c <= 0x1112)
|| c == 0x113C
|| c == 0x113E
|| c == 0x1140
|| c == 0x114C
|| c == 0x114E
|| c == 0x1150
|| (c >= 0x1154 && c <= 0x1155)
|| c == 0x1159
|| (c >= 0x115F && c <= 0x1161)
|| c == 0x1163
|| c == 0x1165
|| c == 0x1167
|| c == 0x1169
|| (c >= 0x116D && c <= 0x116E)
|| (c >= 0x1172 && c <= 0x1173)
|| c == 0x1175
|| c == 0x119E
|| c == 0x11A8
|| c == 0x11AB
|| (c >= 0x11AE && c <= 0x11AF)
|| (c >= 0x11B7 && c <= 0x11B8)
|| c == 0x11BA
|| (c >= 0x11BC && c <= 0x11C2)
|| c == 0x11EB
|| c == 0x11F0
|| c == 0x11F9
|| (c >= 0x1E00 && c <= 0x1E9B)
|| (c >= 0x1EA0 && c <= 0x1EF9)
|| (c >= 0x1F00 && c <= 0x1F15)
|| (c >= 0x1F18 && c <= 0x1F1D)
|| (c >= 0x1F20 && c <= 0x1F45)
|| (c >= 0x1F48 && c <= 0x1F4D)
|| (c >= 0x1F50 && c <= 0x1F57)
|| c == 0x1F59
|| c == 0x1F5B
|| c == 0x1F5D
|| (c >= 0x1F5F && c <= 0x1F7D)
|| (c >= 0x1F80 && c <= 0x1FB4)
|| (c >= 0x1FB6 && c <= 0x1FBC)
|| c == 0x1FBE
|| (c >= 0x1FC2 && c <= 0x1FC4)
|| (c >= 0x1FC6 && c <= 0x1FCC)
|| (c >= 0x1FD0 && c <= 0x1FD3)
|| (c >= 0x1FD6 && c <= 0x1FDB)
|| (c >= 0x1FE0 && c <= 0x1FEC)
|| (c >= 0x1FF2 && c <= 0x1FF4)
|| (c >= 0x1FF6 && c <= 0x1FFC)
|| c == 0x2126
|| (c >= 0x212A && c <= 0x212B)
|| c == 0x212E
|| (c >= 0x2180 && c <= 0x2182)
|| (c >= 0x3041 && c <= 0x3094)
|| (c >= 0x30A1 && c <= 0x30FA)
|| (c >= 0x3105 && c <= 0x312C)
|| (c >= 0xAC00 && c <= 0xD7A3);
|
static final boolean | isCombiningChar(int c)
return (c >= 0x0300 && c <= 0x0345)
|| (c >= 0x0360 && c <= 0x0361)
|| (c >= 0x0483 && c <= 0x0486)
|| (c >= 0x0591 && c <= 0x05A1)
|| (c >= 0x05A3 && c <= 0x05B9)
|| (c >= 0x05BB && c <= 0x05BD)
|| c == 0x05BF
|| (c >= 0x05C1 && c <= 0x05C2)
|| c == 0x05C4
|| (c >= 0x064B && c <= 0x0652)
|| c == 0x0670
|| (c >= 0x06D6 && c <= 0x06DC)
|| (c >= 0x06DD && c <= 0x06DF)
|| (c >= 0x06E0 && c <= 0x06E4)
|| (c >= 0x06E7 && c <= 0x06E8)
|| (c >= 0x06EA && c <= 0x06ED)
|| (c >= 0x0901 && c <= 0x0903)
|| c == 0x093C
|| (c >= 0x093E && c <= 0x094C)
|| c == 0x094D
|| (c >= 0x0951 && c <= 0x0954)
|| (c >= 0x0962 && c <= 0x0963)
|| (c >= 0x0981 && c <= 0x0983)
|| c == 0x09BC
|| c == 0x09BE
|| c == 0x09BF
|| (c >= 0x09C0 && c <= 0x09C4)
|| (c >= 0x09C7 && c <= 0x09C8)
|| (c >= 0x09CB && c <= 0x09CD)
|| c == 0x09D7
|| (c >= 0x09E2 && c <= 0x09E3)
|| c == 0x0A02
|| c == 0x0A3C
|| c == 0x0A3E
|| c == 0x0A3F
|| (c >= 0x0A40 && c <= 0x0A42)
|| (c >= 0x0A47 && c <= 0x0A48)
|| (c >= 0x0A4B && c <= 0x0A4D)
|| (c >= 0x0A70 && c <= 0x0A71)
|| (c >= 0x0A81 && c <= 0x0A83)
|| c == 0x0ABC
|| (c >= 0x0ABE && c <= 0x0AC5)
|| (c >= 0x0AC7 && c <= 0x0AC9)
|| (c >= 0x0ACB && c <= 0x0ACD)
|| (c >= 0x0B01 && c <= 0x0B03)
|| c == 0x0B3C
|| (c >= 0x0B3E && c <= 0x0B43)
|| (c >= 0x0B47 && c <= 0x0B48)
|| (c >= 0x0B4B && c <= 0x0B4D)
|| (c >= 0x0B56 && c <= 0x0B57)
|| (c >= 0x0B82 && c <= 0x0B83)
|| (c >= 0x0BBE && c <= 0x0BC2)
|| (c >= 0x0BC6 && c <= 0x0BC8)
|| (c >= 0x0BCA && c <= 0x0BCD)
|| c == 0x0BD7
|| (c >= 0x0C01 && c <= 0x0C03)
|| (c >= 0x0C3E && c <= 0x0C44)
|| (c >= 0x0C46 && c <= 0x0C48)
|| (c >= 0x0C4A && c <= 0x0C4D)
|| (c >= 0x0C55 && c <= 0x0C56)
|| (c >= 0x0C82 && c <= 0x0C83)
|| (c >= 0x0CBE && c <= 0x0CC4)
|| (c >= 0x0CC6 && c <= 0x0CC8)
|| (c >= 0x0CCA && c <= 0x0CCD)
|| (c >= 0x0CD5 && c <= 0x0CD6)
|| (c >= 0x0D02 && c <= 0x0D03)
|| (c >= 0x0D3E && c <= 0x0D43)
|| (c >= 0x0D46 && c <= 0x0D48)
|| (c >= 0x0D4A && c <= 0x0D4D)
|| c == 0x0D57
|| c == 0x0E31
|| (c >= 0x0E34 && c <= 0x0E3A)
|| (c >= 0x0E47 && c <= 0x0E4E)
|| c == 0x0EB1
|| (c >= 0x0EB4 && c <= 0x0EB9)
|| (c >= 0x0EBB && c <= 0x0EBC)
|| (c >= 0x0EC8 && c <= 0x0ECD)
|| (c >= 0x0F18 && c <= 0x0F19)
|| c == 0x0F35
|| c == 0x0F37
|| c == 0x0F39
|| c == 0x0F3E
|| c == 0x0F3F
|| (c >= 0x0F71 && c <= 0x0F84)
|| (c >= 0x0F86 && c <= 0x0F8B)
|| (c >= 0x0F90 && c <= 0x0F95)
|| c == 0x0F97
|| (c >= 0x0F99 && c <= 0x0FAD)
|| (c >= 0x0FB1 && c <= 0x0FB7)
|| c == 0x0FB9
|| (c >= 0x20D0 && c <= 0x20DC)
|| c == 0x20E1
|| (c >= 0x302A && c <= 0x302F)
|| c == 0x3099
|| c == 0x309A;
|
static final boolean | isExtender(int c)
return c == 0x00B7
|| c == 0x02D0
|| c == 0x02D1
|| c == 0x0387
|| c == 0x0640
|| c == 0x0E46
|| c == 0x0EC6
|| c == 0x3005
|| (c >= 0x3031 && c <= 0x3035)
|| (c >= 0x309D && c <= 0x309E)
|| (c >= 0x30FC && c <= 0x30FE);
|
static final boolean | isIdeographic(int c)
return (c >= 0x4E00 && c <= 0x9FA5)
|| c == 0x3007
|| (c >= 0x3021 && c <= 0x3029);
|
static final boolean | isLetter(int c)
return isIdeographic(c) || isBaseChar(c);
|
static final boolean | isNCNameChar(char c)
return isLetter(c)
|| Character.isDigit(c)
|| c == '."
|| c == '-"
|| c == '_"
|| isCombiningChar(c)
|| isExtender(c);
|
public boolean | isPlaying()
return playing;
|
protected boolean | isRemoveChildSupported()
return false;
|
protected FontFace.Match | matchFontFaces(java.util.Vector fontFamily, FontFace.Match lastMatch, com.sun.perseus.j2d.TextProperties tp)Matches values in the input fontFamily map against the
current context values.
if (fontFamily == null) {
return lastMatch;
}
int n = fontFamily.size();
int fontStyle = tp.getFontStyle();
float fontSize = tp.getFontSize();
int fontWeight = tp.getFontWeight();
FontFace.Match match = null, firstMatch = null;
for (int i = 0; i < n; i++) {
FontFace ff = (FontFace) fontFamily.elementAt(i);
// First, match on font-style.
if ((ff.getFontStyles() & fontStyle) != 0
||
(
(fontStyle == TextNode.FONT_STYLE_ITALIC)
&&
((ff.getFontStyles() & TextNode.FONT_STYLE_OBLIQUE) != 0))) {
// Match on font-size
if (ff.getFontSizes() == null) {
match = new FontFace.Match(ff);
match.distance = ff.fontWeightDistance(fontWeight);
firstMatch = addMatch(firstMatch, match);
} else {
float[] fs = ff.getFontSizes();
for (int j = 0; j < fs.length; j++) {
if (fs[j] == fontSize) {
match = new FontFace.Match(ff);
match.distance = ff.fontWeightDistance(fontWeight);
firstMatch = addMatch(firstMatch, match);
break;
}
}
}
}
}
if (match == null) {
return lastMatch;
} else {
if (lastMatch != null) {
lastMatch.next = firstMatch;
}
while (match.next != null) {
match = match.next;
}
return match;
}
|
public void | paint(com.sun.perseus.j2d.RenderGraphics rg)Paints this node into the input RenderGraphics .
if (canRenderState != 0) {
return;
}
paint(getFirstChildNode(), rg);
|
void | removeIdentifiedNode(ElementNode element)Remove element from the list of identified nodes
String id = element.getId();
if (idToElement.get(id) == element) {
idToElement.remove(element.getId());
}
|
void | reserveId(ElementNode element)Reserves the given id. This is used to be able to check for
duplicate identifiers.
reservedIds.put(element.getId(), element);
|
protected FontFace.Match | resolveFontFaces(com.sun.perseus.j2d.TextProperties tp)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.
// If no default font face has been set, set the default one now.
if (defaultFontFace == null) {
setDefaultFontFace(DefaultFontFace.getDefaultFontFace());
}
// If no initial font face has been set, set the default one now.
if (initialFontFaces == null) {
setInitialFontFaces(DefaultFontFace.getInitialFontFaces());
}
// Build the font face data base if it has not been
// built already
if (fontFaceDB == null) {
setFontFaceSetSilent(null);
}
// Iterate over each matching font-family name
Vector fontFamilyMatch = null;
String[] fontFamily = tp.getFontFamily();
int nff = 0;
if (fontFamily != null) {
nff = fontFamily.length;
}
FontFace.Match firstMatch = new FontFace.Match(defaultFontFace);
FontFace.Match lastMatch = firstMatch;
for (int i = 0; i < nff; i++) {
fontFamilyMatch = (Vector) fontFaceDB.get(fontFamily[i]);
lastMatch = matchFontFaces(fontFamilyMatch, lastMatch, tp);
}
return firstMatch;
|
public void | resolveIDRef(IDRef idRef, java.lang.String id)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.
ElementNode ref = (ElementNode) getElementById(id);
if (ref != null) {
idRef.resolveTo(ref);
} else {
if (unresolvedIDRefs != null) {
Vector idRefs = (Vector) unresolvedIDRefs.get(id);
if (idRefs == null) {
idRefs = new Vector(1);
unresolvedIDRefs.put(id, idRefs);
}
idRefs.addElement(idRef);
}
}
|
public void | safeInvokeAndWait(java.lang.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. Otherwise, it delegates to the
invokeAndWait method.
if (updateQueue == null) {
r.run();
} else {
updateQueue.safeInvokeAndWait(r, runHandler);
}
|
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. This method assumes that successive
calls are made with increasing time values.
timeContainerRootSupport.sample(currentTime);
// System.err.println(">>>>>>>>>>>>>>>>>> currentTime : "
// + currentTime);
// timeContainerRootSupport.dump();
|
public void | setDefaultFontFace(FontFace newDefaultFontFace)Sets the default FontFace, i.e., the FontFace which
will always be the last element in the
FontFace array returned from resolveFontFaces
if (newDefaultFontFace == null) {
throw new IllegalArgumentException();
}
if (defaultFontFace == newDefaultFontFace) {
return;
}
this.defaultFontFace = newDefaultFontFace;
clearLayouts();
|
protected void | setDelayedException(org.w3c.dom.DOMException de)
delayedException = de;
|
public void | setDocumentURI(java.lang.String docURI)Sets this document's URI
if (ElementNode.equal(docURI, this.docURI)) {
return;
}
modifyingNode();
this.docURI = docURI;
modifiedNode();
|
public void | setFontFaceSet(FontFace[] fontFaceSet)Sets the set of FontFaces that this Document uses
to display text.
setFontFaceSetSilent(fontFaceSet);
clearLayouts();
|
protected void | setFontFaceSetSilent(FontFace[] fontFaceSet)Sets the set of FontFaces this document uses but does
not generate a modifyingNode notification.
fontFaceDB = new Hashtable();
growFontFaceDB(fontFaceDB, fontFaceSet);
growFontFaceDB(fontFaceDB, initialFontFaces);
|
public void | setImageLoader(ImageLoader imageLoader)Sets the ImageLoader for this document.
this.imageLoader = imageLoader;
|
public void | setInitialFontFaces(FontFace[] newInitialFontFaces)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.
if (newInitialFontFaces == null) {
throw new IllegalArgumentException();
}
if (initialFontFaces == newInitialFontFaces) {
return;
}
for (int i = 0; i < newInitialFontFaces.length; i++) {
if (newInitialFontFaces[i] == null) {
throw new IllegalArgumentException();
}
}
this.initialFontFaces = newInitialFontFaces;
clearLayouts();
|
public final 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).
super.setLoaded(isLoaded);
if (isLoaded == true) {
getImageLoader().documentLoaded(this);
}
|
public void | setPixelMMSize(float newPxMMSize)Controls the size of a pixel in millimeters
this.pxMMSize = newPxMMSize;
|
public void | setPlaying(boolean isPlaying)
this.playing = isPlaying;
|
public void | setRunnableHandler(com.sun.perseus.util.RunnableQueue.RunnableHandler runHandler)
this.runHandler = runHandler;
|
void | setUnknownTraitsNS(ElementNode element, java.lang.String namespaceURI, java.lang.String traitName, java.lang.String value)Implementation helper. Checks that the unknownTraitNS map is not null for
the given ElementNode before using it, for the requested namespaceURI.
// Make sure we do have a table for storing unknown traits.
if (unknownTraitsNS == null) {
unknownTraitsNS = new Hashtable();
}
// Make sure we do have a table for storing unknown traits for
// the requested element.
Hashtable eltMap = (Hashtable) unknownTraitsNS.get(element);
if (eltMap == null) {
eltMap = new Hashtable();
unknownTraitsNS.put(element, eltMap);
}
// If there is already a map for the given namespace, use that.
// Otherwise, create a new map.
Hashtable nsMap = (Hashtable) eltMap.get(namespaceURI);
if (nsMap == null) {
nsMap = new Hashtable();
eltMap.put(namespaceURI, nsMap);
}
nsMap.put(traitName, value);
|
public void | setUpdateListener(UpdateListener updateListener)Sets the UpdateListener associated with this viewport.
All updates made to this tree will be reported to the input
UpdateListener
this.updateListener = updateListener;
|
public void | setUpdateQueue(com.sun.perseus.util.RunnableQueue updateQueue)
this.updateQueue = updateQueue;
|
java.lang.String | toNamespace(java.lang.String prefix, ModelNode node)Maps the input prefix name to a namespace value.
Object[][] namespaceEntry = (Object[][]) prefixes.get(prefix);
if (namespaceEntry == null) {
// No namespace entry
return null;
} else {
// Note that namespaceEntry.length == 0 should _never_ happen.
// There are multiple prefix that map to entries.
// Walk up the parent tree and match with the
// first parent that is found in an entry.
ModelNode cur = node;
final int n = namespaceEntry.length;
while (cur != null && cur != this) {
for (int i = 0; i < n; i++) {
if (namespaceEntry[i][1] == cur) {
return (String) namespaceEntry[i][0];
}
}
cur = cur.parent;
}
// If we are here, it means we have not found a
// matching namespace in the document tree. Check
// if there are any default mapping on the document
// node itself.
for (int i = 0; i < n; i++) {
if (namespaceEntry[i][1] == this) {
return (String) namespaceEntry[i][0];
}
}
// Did not find any matching namespace prefix.
return null;
}
|
public java.lang.String | toPrefix(java.lang.String namespaceURI, org.w3c.dom.Element node)Maps the input namespace value to a prefix.
Object[][] prefixEntry = (Object[][]) namespaces.get(namespaceURI);
if (prefixEntry == null) {
// No prefix entry
return null;
} else {
// Note that prefixEntry.length == 0 should _never_ happen.
// There are multiple prefixEntries that map to entries.
// Walk up the parent tree and match with the
// first parent that is found in an entry.
ModelNode cur = (ElementNode) node;
final int n = prefixEntry.length;
while (cur != null && cur != this) {
for (int i = 0; i < n; i++) {
if (prefixEntry[i][1] == cur) {
return (String) prefixEntry[i][0];
}
}
cur = cur.parent;
}
// If we are here, it means we have not found a
// matching prefix in the document tree. Check
// if there are any default mapping on the document
// node itself.
for (int i = 0; i < n; i++) {
if (prefixEntry[i][1] == this) {
return (String) prefixEntry[i][0];
}
}
// Did not find any matching prefix.
return null;
}
|
protected void | unhookExpandedQuiet()Utility method. Unhooks the expanded content.
|
protected org.w3c.dom.DOMException | unsupportedTrait(java.lang.String name)
return new DOMException(DOMException.NOT_SUPPORTED_ERR,
Messages.formatMessage
(Messages.ERROR_UNSUPPORTED_TRAIT,
new String[] {name,
null,
getLocalName(),
getNamespaceURI()}));
|
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.
// First, check unresolved ID references.
if (unresolvedIDRefs != null && unresolvedIDRefs.size() > 0) {
// There are unresolved ID references, this is a validation error.
Enumeration iter = unresolvedIDRefs.keys();
StringBuffer buf = new StringBuffer();
while (iter.hasMoreElements()) {
buf.append('[");
buf.append(iter.nextElement());
buf.append(']");
}
String message
= Messages.formatMessage
(Messages.ERROR_UNRESOLVED_REFERENCES,
new Object[] {buf.toString()});
throw new DOMException(DOMException.INVALID_ACCESS_ERR,
message);
}
unresolvedIDRefs = null;
// Now, validate animation elements. At this stage, we know that the
// animation elements either had no xlink:href or had one which has
// been resolved.
if (animations != null) {
int n = animations.size();
for (int i = 0; i < n; i++) {
Animation animation = (Animation) animations.elementAt(i);
if (animation.parent != null) {
// The prototypes Set may have a null parent, so we account
// for that situation here.
animation.validate();
}
}
}
animations = null;
|