FileDocCategorySizeDatePackage
AbstractRenderingNodeProxy.javaAPI DocphoneME MR2 API (J2ME)8308Wed May 02 18:00:34 BST 2007com.sun.perseus.model

AbstractRenderingNodeProxy

public class AbstractRenderingNodeProxy extends CompositeGraphicsNodeProxy
An AbstractRenderingNodeProxy delegates its rendering to a proxied AbstractRenderingNode and also has its own rendering manager.
version
$Id: AbstractRenderingNodeProxy.java,v 1.4 2006/06/29 10:47:29 ln156897 Exp $

Fields Summary
protected RenderingManager
renderingManager
Used to track the node's rendering area and the rendered areas.
Constructors Summary
protected AbstractRenderingNodeProxy(AbstractRenderingNode proxiedNode)

param
proxiedNode AbstractRenderingNode to proxy

        super(proxiedNode);
        if (DirtyAreaManager.ON) {
            renderingManager = new RenderingManager(this);
        }
    
Methods Summary
com.sun.perseus.j2d.BoxaddBBox(com.sun.perseus.j2d.Box bbox, com.sun.perseus.j2d.Transform t)

param
bbox the bounding box to which this node's bounding box should be appended. That bounding box is in the target coordinate space. It may be null, in which case this node should create a new one.
param
t the transform to apply from the node's coordinate space to the target coordinate space. May be null for the identity transform.
return
the node's bounding box in the target coordinate space.

        return addNodeBBox(bbox, t);
    
com.sun.perseus.j2d.BoxaddNodeBBox(com.sun.perseus.j2d.Box bbox, com.sun.perseus.j2d.Transform t)

param
bbox the bounding box to which this node's bounding box should be appended. That bounding box is in the target coordinate space. It may be null, in which case this node should create a new one.
param
t the transform from the node coordinate system to the coordinate system into which the bounds should be computed.
return
the bounding box of this node, in the target coordinate space,

        return proxied.addNodeBBox(bbox, t);
    
protected voidclearLastRenderedTile()
After calling this method, getLastRenderedTile should always return null.

        renderingManager.clearLastRenderedTile();
    
protected voidclearLayouts()
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 voidcomputeRenderingTile(com.sun.perseus.j2d.Tile tile)
Computes this node's rendering tile.

param
tile the Tile instance whose bounds should be set.
return
the device space rendering tile.

        ((AbstractRenderingNode) proxied).computeRenderingTile(tile, txf, this);
    
public org.w3c.dom.svg.SVGRectgetBBox()

return
the tight bounding box in current user coordinate space.

        return addNodeBBox(null, null);
    
protected com.sun.perseus.j2d.TilegetLastRenderedTile()

return
the tile which encompasses the node's last actual rendering.

        return renderingManager.getLastRenderedTile();
    
protected final com.sun.perseus.j2d.TilegetRenderingTile()

return
the bounding box, in screen coordinate, which encompasses the node's rendering.

        return renderingManager.getRenderingTile();
    
public booleanhasNodeRendering()
An AbstractNodeRendering has something to render.

return
true

        return true;
    
public voidmodifyingProxied()
Proxied nodes should call this method when they are being modified.

        super.modifyingProxied();
        renderingDirty();
    
voidnodeHookedInDocumentTree()
To be overriddent by derived classes, such as TimedElementNode, if they need to do special operations when hooked into the document tree.

        renderingDirty();
    
protected voidnodeRendered()
Simply notifies the RenderingManager.

        if (DirtyAreaManager.ON) {
            renderingManager.rendered();
        }
    
voidnodeUnhookedFromDocumentTree()
To be overriddent by derived classes, such as TimedElementNode, if they need to do special operations when unhooked from the document tree.

        renderingDirty();
    
public voidpaint(com.sun.perseus.j2d.RenderGraphics rg)
Paints this node into the input RenderGraphics.

param
rg the RenderGraphics where the node should paint itself

        if (canRenderState != 0) {
            return;
        }

        if (DirtyAreaManager.ON) {
            Tile primitiveTile = getRenderingTile();
            if (primitiveTile == null 
                || 
                rg.getRenderingTile().isHit(primitiveTile)) {
                // rg.setPrimitiveTile(primitiveTile);
                ((AbstractRenderingNode) proxied).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 {
            ((AbstractRenderingNode) proxied).paintRendered(rg, this, this, 
                                                            txf);
        }
    
protected voidrecomputeTransformState(com.sun.perseus.j2d.Transform parentTransform)
Recomputes the transform cache, if one exists.

param
parentTransform the Transform applied to this node's parent.

        super.recomputeTransformState(parentTransform);
        renderingDirty();
    
final voidrenderingDirty()
Should be called whenever this node's rendering becomes dirty.

        if (DirtyAreaManager.ON) {
            renderingManager.dirty();
        }
    
public voidsetDisplay(boolean newDisplay)

param
newDisplay the new computed display value

        super.setDisplay(newDisplay);

        renderingDirty();
    
protected voidsetProxied(ElementNode newProxied)
Modifies the node proxied by this proxy.

param
newProxied this node's new proxied node

        if (this.proxied == newProxied) {
            return;
        }

        super.setProxied(newProxied);
        renderingDirty();
    
public voidsetVisibility(boolean newVisibility)

param
newVisibility the new computed visibility property.

        super.setVisibility(newVisibility);

        renderingDirty();