Methods Summary |
---|
com.sun.perseus.j2d.Box | addBBox(com.sun.perseus.j2d.Box bbox, com.sun.perseus.j2d.Transform t)
return addNodeBBox(bbox, t);
|
protected com.sun.perseus.j2d.Transform | appendTransform(com.sun.perseus.j2d.Transform tx, com.sun.perseus.j2d.Transform workTx)Appends this node's transform, if it is not null.
if (transform == null && motion == null) {
return tx;
}
tx = recycleTransform(tx, workTx);
if (motion != null) {
tx.mMultiply(motion);
}
if (transform != null) {
tx.mMultiply(transform);
}
return tx;
|
ElementNodeProxy | buildProxy()
return new AbstractRenderingNodeProxy(this);
|
protected void | clearLastRenderedTile()After calling this method, getLastRenderedTile should always return null.
renderingManager.clearLastRenderedTile();
|
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.
|
protected final void | computeRenderingTile(com.sun.perseus.j2d.Tile tile)Computes this node's rendering tile.
computeRenderingTile(tile, txf, this);
|
abstract void | computeRenderingTile(com.sun.perseus.j2d.Tile tile, com.sun.perseus.j2d.Transform t, com.sun.perseus.j2d.GraphicsProperties gp)Computes the rendering tile for the given set of GraphicsProperties.
|
TraitAnim | createTraitAnimImpl(java.lang.String traitName)
if (SVGConstants.SVG_TRANSFORM_ATTRIBUTE == traitName) {
return new TransformTraitAnim(this, traitName);
} else if (SVGConstants.SVG_MOTION_PSEUDO_ATTRIBUTE == traitName) {
return new MotionTraitAnim(this, traitName);
} else {
return super.createTraitAnimImpl(traitName);
}
|
public org.w3c.dom.svg.SVGRect | getBBox()
return addNodeBBox(null, null);
|
protected com.sun.perseus.j2d.Tile | getLastRenderedTile()
return renderingManager.getLastRenderedTile();
|
org.w3c.dom.svg.SVGMatrix | getMatrixTraitImpl(java.lang.String name)AbstractShapeNode handles the transform attribute.
Other attributes are handled by the super class.
if (SVGConstants.SVG_TRANSFORM_ATTRIBUTE.equals(name)) {
return toSVGMatrixTrait(transform);
} else if (SVGConstants.SVG_MOTION_PSEUDO_ATTRIBUTE.equals(name)) {
return toSVGMatrixTrait(motion);
} else {
return super.getMatrixTraitImpl(name);
}
|
public com.sun.perseus.j2d.Transform | getMotion()
return motion;
|
public int | getNumberOfProperties()
return NUMBER_OF_PROPERTIES;
|
protected com.sun.perseus.j2d.Tile | getRenderingTile()
return renderingManager.getRenderingTile();
|
public org.w3c.dom.svg.SVGRect | getScreenBBox()
// There is no screen bounding box if the element is not hooked
// into the main tree.
if (!inDocumentTree()) {
return null;
}
return addNodeBBox(null, txf);
|
public java.lang.String | getTraitImpl(java.lang.String name)AbstractShapeNode handles the transform attribute.
Other attributes are handled by the super class.
if (SVGConstants.SVG_TRANSFORM_ATTRIBUTE == name) {
return toStringTrait(transform);
} else if (SVGConstants.SVG_MOTION_PSEUDO_ATTRIBUTE == name) {
return toStringTrait(motion);
} else {
return super.getTraitImpl(name);
}
|
public com.sun.perseus.j2d.Transform | getTransform()
return transform;
|
public boolean | hasNodeRendering()An AbstractRenderingNode has something to render
return true;
|
abstract boolean | isHitVP(float[] pt)Returns true if this node is hit by the input point. The input point
is in viewport space.
|
abstract boolean | isProxyHitVP(float[] pt, AbstractRenderingNodeProxy proxy)Returns true if this proxy node is hit by the input point. The input
point is in viewport space.
|
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) || !isHitVP(pt)) {
return null;
}
return this;
|
void | nodeHookedInDocumentTree()To be overriddent by derived classes, such as TimedElementNode,
if they need to do special operations when hooked into the
document tree.
super.nodeHookedInDocumentTree();
renderingDirty();
|
protected void | nodeRendered()Simply notifies the RenderingManager.
if (DirtyAreaManager.ON) {
renderingManager.rendered();
}
|
void | nodeUnhookedFromDocumentTree()To be overriddent by derived classes, such as TimedElementNode,
if they need to do special operations when unhooked from the
document tree.
super.nodeUnhookedFromDocumentTree();
renderingDirty();
|
public void | paint(com.sun.perseus.j2d.RenderGraphics rg)Paints this node into the input RenderGraphics .
if ((canRenderState != 0)) {
return;
}
if (DirtyAreaManager.ON) {
Tile primitiveTile = getRenderingTile();
if (primitiveTile == null
||
rg.getRenderingTile().isHit(primitiveTile)) {
// rg.setPrimitiveTile(primitiveTile);
paintRendered(rg, this, this, txf);
// nodeRendered is called seperately from paintRendered
// because paintRendered is used in different contexts,
// for example by proxy nodes to render, using their
// proxied node's paintRendered method.
nodeRendered();
}
} else {
paintRendered(rg, this, this, txf);
}
|
abstract void | paintRendered(com.sun.perseus.j2d.RenderGraphics rg, com.sun.perseus.j2d.GraphicsProperties gp, com.sun.perseus.j2d.PaintTarget pt, com.sun.perseus.j2d.Transform tx)Paints this node into the input RenderGraphics.
|
protected void | propagateFloatPropertyState(int propertyIndex, float parentPropertyValue)Called when the computed value of the given float property has changed.
On a rendering node, as we do not render regular children nor expanded
content, we do not propagate property state changes.
// Propagate to proxies.
if (firstProxy != null) {
ElementNodeProxy proxy = firstProxy;
while (proxy != null) {
((CompositeGraphicsNodeProxy) proxy)
.proxiedFloatPropertyStateChange(propertyIndex,
parentPropertyValue);
proxy = proxy.nextProxy;
}
}
|
protected void | propagatePackedPropertyState(int propertyIndex, int parentPropertyValue)Called when the computed value of the given packed property has changed.
On a rendering node, as we do not render regular children nor expanded
content, we do not propagate property state changes.
// Propagate to proxies.
if (firstProxy != null) {
ElementNodeProxy proxy = firstProxy;
while (proxy != null) {
((CompositeGraphicsNodeProxy) proxy)
.proxiedPackedPropertyStateChange(propertyIndex,
parentPropertyValue);
proxy = proxy.nextProxy;
}
}
|
protected void | propagatePropertyState(int propertyIndex, java.lang.Object parentPropertyValue)Called when the computed value of the given property has changed.
On a rendering node, as we do not render regular children nor expanded
content, we do not propagate property state changes.
// Propagate to proxies.
if (firstProxy != null) {
ElementNodeProxy proxy = firstProxy;
while (proxy != null) {
((CompositeGraphicsNodeProxy) proxy).proxiedPropertyStateChange(
propertyIndex,
parentPropertyValue);
proxy = proxy.nextProxy;
}
}
|
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) ||
!isProxyHitVP(pt, (AbstractRenderingNodeProxy) proxy)) {
return null;
}
return proxy;
|
protected void | recomputeTransformState(com.sun.perseus.j2d.Transform parentTransform)Recomputes the transform cache, if one exists. This should recursively
call recomputeTransformState on children node or expanded content, if
any child is rendered down below.
txf = appendTransform(parentTransform, txf);
inverseTxf = null;
computeCanRenderTransformBit(txf);
renderingDirty();
|
final void | renderingDirty()Should be called whenever this node's rendering becomes dirty.
if (DirtyAreaManager.ON) {
renderingManager.dirty();
}
|
void | setComputedDisplay(boolean newDisplay)
super.setComputedDisplay(newDisplay);
renderingDirty();
|
void | setComputedVisibility(boolean newVisibility)
super.setComputedVisibility(newVisibility);
renderingDirty();
|
void | setFloatArrayTrait(java.lang.String name, float[][] value)Set the trait value as float array.
if (SVGConstants.SVG_TRANSFORM_ATTRIBUTE == name) {
if (transform == null) {
modifyingNode();
transform = new Transform(value[0][0],
value[1][0],
value[2][0],
value[3][0],
value[4][0],
value[5][0]);
} else {
if (!transform.equals(value)) {
modifyingNode();
transform.setTransform(value[0][0],
value[1][0],
value[2][0],
value[3][0],
value[4][0],
value[5][0]);
} else {
return;
}
}
recomputeTransformState();
recomputeProxyTransformState();
modifiedNode();
} else if (SVGConstants.SVG_MOTION_PSEUDO_ATTRIBUTE == name) {
if (motion == null) {
modifyingNode();
motion = new Transform(value[0][0],
value[1][0],
value[2][0],
value[3][0],
value[4][0],
value[5][0]);
} else {
if (!motion.equals(value)) {
modifyingNode();
motion.setTransform(value[0][0],
value[1][0],
value[2][0],
value[3][0],
value[4][0],
value[5][0]);
} else {
return;
}
}
recomputeTransformState();
recomputeProxyTransformState();
modifiedNode();
} else {
super.setFloatArrayTrait(name, value);
}
|
void | setMatrixTraitImpl(java.lang.String name, com.sun.perseus.j2d.Transform matrix)AbstractShapeNode handles the transform attribute.
Other attributes are handled by the super class.
// We use .equals for the transform attribute as the string may not
// have been interned. We use == for the motion pseudo attribute because
// it is only used internally and from the SVGConstants strings.
if (SVGConstants.SVG_TRANSFORM_ATTRIBUTE.equals(name)) {
setTransform(matrix);
} else if (SVGConstants.SVG_MOTION_PSEUDO_ATTRIBUTE == name) {
setMotion(matrix);
} else {
super.setMatrixTraitImpl(name, matrix);
}
|
public void | setMotion(com.sun.perseus.j2d.Transform newMotion)
if (equal(newMotion, motion)) {
return;
}
modifyingNode();
this.motion = newMotion;
recomputeTransformState();
recomputeProxyTransformState();
modifiedNode();
|
public void | setTraitImpl(java.lang.String name, java.lang.String value)AbstractShapeNode handles the transform attribute.
Other attributes are handled by the super class.
if (SVGConstants.SVG_TRANSFORM_ATTRIBUTE == name) {
setTransform(parseTransformTrait(name, value));
} else if (SVGConstants.SVG_MOTION_PSEUDO_ATTRIBUTE == name) {
setMotion(parseTransformTrait(name, value));
} else {
super.setTraitImpl(name, value);
}
|
public void | setTransform(com.sun.perseus.j2d.Transform newTransform)
if (equal(transform, newTransform)) {
return;
}
modifyingNode();
this.transform = newTransform;
recomputeTransformState();
recomputeProxyTransformState();
modifiedNode();
|
boolean | supportsTrait(java.lang.String traitName)AbstractShapeNode handles the transform attribute.
if (SVGConstants.SVG_TRANSFORM_ATTRIBUTE == traitName
||
SVGConstants.SVG_MOTION_PSEUDO_ATTRIBUTE == traitName) {
return true;
} else {
return super.supportsTrait(traitName);
}
|
java.lang.String | toStringTrait(java.lang.String name, float[][] value)
if (SVGConstants.SVG_TRANSFORM_ATTRIBUTE == name) {
Transform transform = new Transform(value[0][0],
value[1][0],
value[2][0],
value[3][0],
value[4][0],
value[5][0]);
return toStringTrait(transform);
} else {
return super.toStringTrait(name, value);
}
|
public float[][] | validateFloatArrayTrait(java.lang.String traitName, java.lang.String value, java.lang.String reqNamespaceURI, java.lang.String reqLocalName, java.lang.String reqTraitNamespace, java.lang.String reqTraitName)Validates the input trait value.
if (SVGConstants.SVG_TRANSFORM_ATTRIBUTE == traitName
||
SVGConstants.SVG_MOTION_PSEUDO_ATTRIBUTE == traitName) {
Transform txf = parseTransformTrait(traitName, value);
return new float[][] {{(float) txf.getComponent(0)},
{(float) txf.getComponent(1)},
{(float) txf.getComponent(2)},
{(float) txf.getComponent(3)},
{(float) txf.getComponent(4)},
{(float) txf.getComponent(5)}};
} else {
return super.validateFloatArrayTrait(traitName,
value,
reqNamespaceURI,
reqLocalName,
reqTraitNamespace,
reqTraitName);
}
|