Fields Summary |
---|
protected ElementNode | proxiedThe proxied ModelNode |
protected boolean | expandedControls whether content is expanded or not |
protected ElementNodeProxy | nextProxyThe next proxy, if any. |
protected ElementNodeProxy | prevProxyThe previous proxy, if any. |
protected ModelNode | firstExpandedChildThe first expanded child, if content has been expanded. |
protected ModelNode | lastExpandedChildThe last expanded child, if content has been expanded |
Methods Summary |
---|
protected com.sun.perseus.j2d.Transform | appendTransform(com.sun.perseus.j2d.Transform tx, com.sun.perseus.j2d.Transform workTx)Appends the proxied node's transform, if there is a proxied node.
if (proxied != null) {
return proxied.appendTransform(tx, workTx);
}
return tx;
|
protected void | clearLayouts()Clears the text layouts, if any exist. This is typically
called when the font selection has changed and nodes such
as Text should recompute their layouts.
This should recursively call clearLayouts on children
node or expanded content, if any.
clearLayouts(firstExpandedChild);
|
protected com.sun.perseus.model.ElementNodeProxy | computeProxiesChain(ElementNode proxiedChild)Implementation helper: computes the set of chained proxies
for the input node and return the head of the chain.
ElementNodeProxy firstProxy = null;
ElementNodeProxy proxy = null;
ElementNodeProxy previousProxy = null;
while (proxiedChild != null) {
proxy = proxiedChild.buildProxy();
proxy.setParentQuiet(this);
proxy.expand();
if (previousProxy == null) {
firstProxy = proxy;
} else {
previousProxy.nextSibling = proxy;
proxy.prevSibling = previousProxy;
}
firstProxy.prevSibling = proxy;
previousProxy = proxy;
proxiedChild = (ElementNode) proxiedChild.nextSibling;
}
return firstProxy;
|
protected void | expand()Expand the content. This is done lazilly
if (expanded) {
return;
}
// Expand proxy tree.
//
// NOTE: This implements the SVGElementInstance tree structure,
// as described in the SVG 1.1 specification, section 5.17.
//
if (proxied != null) {
firstExpandedChild = computeProxiesChain(
(ElementNode) proxied.getFirstChildNode());
if (firstExpandedChild != null) {
lastExpandedChild
= firstExpandedChild.prevSibling;
// The prevSibling was set as a way to return both the first
// and last element of the chain. We need to break the circular
// reference.
firstExpandedChild.prevSibling = null;
} else {
firstExpandedChild = null;
}
}
expanded = true;
|
public ModelNode | getFirstChildNode()
return null;
|
public ModelNode | getFirstComputedExpandedChild()Some node types (such as ElementNodeProxy ) have
expanded children that they compute in some specific
way depending on the implementation.
return firstExpandedChild;
|
public ModelNode | getFirstExpandedChild()Some node types (such as ElementNodeProxy ) have
expanded children that they compute in some specific
way depending on the implementation.
expand();
return firstExpandedChild;
|
public ModelNode | getLastChildNode()
return null;
|
public ModelNode | getLastExpandedChild()Some node types (such as ElementNodeProxy ) have
expanded children that they compute in some specific
way depending on the implementation.
expand();
return lastExpandedChild;
|
public ElementNode | getProxied()
return proxied;
|
public boolean | hasDescendants()
if (super.hasDescendants()) {
return true;
} else {
expand();
return firstExpandedChild != null;
}
|
public void | modifiedProxied()Proxied nodes should call this method when they have been modified.
modifiedNode();
|
public void | modifyingProxied()Proxied nodes should call this method when they are being modified.
modifyingNode();
|
public ModelNode | nodeHitAt(float[] pt)Returns the ModelNode , if any, hit by the
point at coordinate x/y.
return proxied.proxyNodeHitAt(pt, this);
|
final void | onHookedInDocumentTree()When a CompositeNode is hooked into the document tree, by default,
it notifies its children and calls its own nodeHookedInDocumentTree
method.
super.onHookedInDocumentTree();
ModelNode c = firstExpandedChild;
while (c != null) {
c.onHookedInDocumentTree();
c = c.nextSibling;
}
|
public void | proxiedChildAdded(ElementNode child)Proxied nodes should call this method they got a new added child.
This is an optimization of the more generic insertion
case. Appending a child is a recursive process which avoids
recomputing all the proxies recursively (a proxy referencing a proxy
referencing a proxy .... referencing a composite on which nodes are
appended). It might be advantageous to consider doing a generic
optimized insertion into the children list.
// If this node is not expanded at all, expand it now
if (!expanded) {
expand();
} else {
ElementNodeProxy newChildProxy = child.buildProxy();
if (firstExpandedChild == null) {
firstExpandedChild = newChildProxy;
lastExpandedChild = newChildProxy;
newChildProxy.nextSibling = null;
newChildProxy.prevSibling = null;
} else {
lastExpandedChild.nextSibling = newChildProxy;
newChildProxy.nextSibling = null;
newChildProxy.prevSibling = lastExpandedChild;
lastExpandedChild = newChildProxy;
}
newChildProxy.setParentQuiet(this);
newChildProxy.expand();
nodeInserted(newChildProxy);
}
|
protected void | setProxied(ElementNode newProxied)Modifies the node proxied by this proxy.
if (this.proxied == newProxied) {
return;
}
// We call modifyingNode because this node's rendering
// may change as a result of changing the proxy.
modifyingNode();
if (this.proxied != null) {
this.proxied.removeProxy(this);
}
unhookQuiet(firstExpandedChild);
this.proxied = newProxied;
firstExpandedChild = null;
lastExpandedChild = null;
expanded = false;
if (newProxied != null) {
newProxied.addProxy(this);
}
// Initialize the requiredFeatures/requiredExtensions/systemLanguage
// bits to the same value as the proxied node.
int oldCanRenderState = canRenderState;
canRenderState &= CAN_RENDER_REQUIRED_FEATURES_MASK;
canRenderState &= CAN_RENDER_REQUIRED_EXTENSIONS_MASK;
canRenderState &= CAN_RENDER_SYSTEM_LANGUAGE_MASK;
if (newProxied != null) {
canRenderState |= (newProxied.canRenderState
& CAN_RENDER_REQUIRED_FEATURES_BIT);
canRenderState |= (newProxied.canRenderState
& CAN_RENDER_REQUIRED_EXTENSIONS_BIT);
canRenderState |= (newProxied.canRenderState
& CAN_RENDER_SYSTEM_LANGUAGE_BIT);
}
propagateCanRenderState(oldCanRenderState, canRenderState);
// We call modifiedNode because this node's rendering
// may have changed as a result of changing the proxy.
modifiedNode();
|
protected void | unhookChildrenQuiet()Does nothing, as there are no children.
|
protected void | unhookExpandedQuiet()Utility method. Unhooks the expanded content.
unhookQuiet(firstExpandedChild);
firstExpandedChild = null;
lastExpandedChild = null;
expanded = false;
|