Methods Summary |
---|
public com.sun.perseus.j2d.Box | addBBox(com.sun.perseus.j2d.Box bbox, com.sun.perseus.j2d.Transform t)
ModelNode c = getFirstChildNode();
while (c != null) {
if ((c.canRenderState & CAN_RENDER_CONDITIONS_MET_BITS)
== 0) {
bbox = c.addBBox(bbox, c.appendTransform(t, null));
break;
}
c = c.nextSibling;
}
return bbox;
|
public java.lang.String | getLocalName()
return SVGConstants.SVG_SWITCH_TAG;
|
public ElementNode | newInstance(DocumentNode doc)Used by DocumentNode to create a new instance from
a prototype Switch .
return new Switch(doc);
|
public ModelNode | nodeHitAt(float[] pt)Returns the ModelNode , if any, hit by the
point at coordinate x/y.
// If a node does not render, it is never hit
if (canRenderState != 0) {
return null;
}
// Check for a hit on children
ModelNode c = lastChild;
while (c != null) {
if ((c.canRenderState & CAN_RENDER_CONDITIONS_MET_BITS)
== 0) {
return c.nodeHitAt(pt);
}
c = c.prevSibling;
}
return null;
|
public void | paint(com.sun.perseus.j2d.RenderGraphics rg)
if (canRenderState != 0) {
return;
}
if (firstChild == null) {
return;
}
//
// Only go up to the first child which
// renders
//
ElementNode c = firstChild;
while (c != null) {
// Paint child
c.paint(rg);
// Exit the loop if the child rendered
if ((c.canRenderState & CAN_RENDER_CONDITIONS_MET_BITS)
== 0) {
break;
}
c = (ElementNode) c.nextSibling;
}
|
ModelNode | proxyNodeHitAt(float[] pt, ElementNodeProxy proxy)Returns the ModelNode , if any, hit by the
point at coordinate x/y in the proxy tree starting at
proxy.
// If a node does not render, it is never hit
if (canRenderState != 0) {
return null;
}
// Check for a hit on the proxy's expanded children
ElementNodeProxy c = (ElementNodeProxy) proxy.getLastExpandedChild();
while (c != null) {
if ((c.proxied.canRenderState & CAN_RENDER_CONDITIONS_MET_BITS)
== 0) {
return c.nodeHitAt(pt);
}
c = (ElementNodeProxy) c.prevSibling;
}
return null;
|