Methods Summary |
---|
ElementNodeProxy | buildProxiedProxy()Implementation helper. This handles getting the proxy from the
proxied Use 's proxy's proxied (see comments in the
code).
//
// Here we are in a situation like:
//
// + u -> u2 -> rect
//
// Which we expand into
//
// + rect
// + u2
// +~~> ElementNodeProxy(rect)
// + u
// +~~> UseProxy(u2)
// +~~> ElementNodeProxy(rect)
//
// To understand the following code, we are building
// the equivalent of UseProxy(u2)
//
// proxied.expandedContent[0] is a reference to
// u2's ElementNodeProxy(rect)
//
Use proxiedUse = (Use) proxied;
ElementNodeProxy proxy
= proxiedUse.proxy.getProxied().buildExpandedProxy();
proxy.setParentQuiet(this);
return proxy;
|
protected void | expand()Expand the content. For a use node, we create additional expanded
content to account for the use proxy.
if (expanded) {
return;
}
if (proxied != null) {
//
// The first expanded content comes from the proxied <use>'s
// proxy.
// At the end of this first computation, the firstExpandedChild
// points to a proxy for the <use>'s proxy or is null and the
// lastExpandedChild is equal to the firstExpandedChild
//
Use proxiedUse = (Use) proxied;
if (proxiedUse.proxy != null) {
firstExpandedChild = buildProxiedProxy();
} else {
firstExpandedChild = null;
}
lastExpandedChild = firstExpandedChild;
//
// Now, do the regular expansion, in case the <use> element
// has regular element children.
//
ElementNodeProxy firstRegularProxies =
computeProxiesChain((ElementNode) proxied.getFirstChildNode());
if (firstRegularProxies != null) {
lastExpandedChild = firstRegularProxies.prevSibling;
if (firstExpandedChild == null) {
// The proxied <use> has no proxy
firstExpandedChild = firstRegularProxies;
firstRegularProxies.prevSibling = null;
} else {
// The proxied <use> had a proxy
firstExpandedChild.nextSibling = firstRegularProxies;
firstRegularProxies.prevSibling = firstExpandedChild;
}
}
}
expanded = true;
|
public org.w3c.dom.svg.SVGRect | getBBox()
Transform t = null;
Use proxiedUse = (Use) proxied;
if (proxiedUse != null && (proxiedUse.x != 0 || proxiedUse.y != 0)) {
t = new Transform(1, 0, 0, 1, proxiedUse.x, proxiedUse.y);
}
return addBBox(null, t);
|
protected void | proxiedPropertyStateChange(int propertyIndex, java.lang.Object proxiedComputedValue)Called by the proxied node when the given property's computed value has
changed.
Object inheritValue = proxiedComputedValue;
if (!((CompositeGraphicsNode) proxied).isInherited(propertyIndex)) {
// The property is specified on the proxied node, update the
// state with that specified value.
setPropertyState(propertyIndex, proxiedComputedValue);
} else {
// The property is unspecified on the proxied node. Inherit from
// the proxy's parent (and not the proxied's parent).
inheritValue = getInheritedPropertyState(propertyIndex);
setPropertyState(propertyIndex, inheritValue);
}
// Propagate to children.
ModelNode c = firstExpandedChild;
while (c != null) {
propagatePropertyState(propertyIndex, inheritValue);
c = c.nextSibling;
}
|
protected void | setProxied(ElementNode newProxied)Disallow proxying of anything else than Use nodes.
if (newProxied != null && !(newProxied instanceof Use)) {
throw new IllegalArgumentException();
}
super.setProxied(newProxied);
|
void | useProxySet()Notifies this proxy that the proxied Use's proxy has just been set.
if (!expanded) {
expand();
} else {
ElementNodeProxy newFirstExpandedChild
= buildProxiedProxy();
newFirstExpandedChild.nextSibling = firstExpandedChild;
if (firstExpandedChild != null) {
firstExpandedChild.prevSibling = newFirstExpandedChild;
}
firstExpandedChild = newFirstExpandedChild;
if (lastExpandedChild == null) {
lastExpandedChild = firstExpandedChild;
}
}
|