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

PaintElement

public abstract class PaintElement extends ElementNode
Abstract base class for all elements which are paint server implementations.
version
$Id: PaintElement.java,v 1.7 2006/06/29 10:47:33 ln156897 Exp $

Fields Summary
boolean
isObjectBBox
Defines whether the paint is in objectBoundingBox space or in userSpaceOnUse space.
Vector
references
An array holding all current references (References instances) to this PaintElement.
Constructors Summary
public PaintElement(DocumentNode ownerDocument)

ownerDocument
the DocumentNode this element belongs to.


                
        
        super(ownerDocument);
    
Methods Summary
protected abstract com.sun.perseus.j2d.PaintDefcomputePaint()
Computes the paint in user space on use.

return
the computed PaintDef.

public com.sun.perseus.j2d.PaintServergetPaintServer(java.lang.String paintType, com.sun.perseus.j2d.PaintTarget paintTarget)

param
paintType the type of paint for which a PaintServer should be computed. (e.g., "fill" or "stroke");
param
paintTarget the PaintTarget for which the PaintServer should be computed.
return
the PaintDef generated by the server.

        Reference ref = new Reference();
        ref.setPaintTarget(paintType, paintTarget);
        return ref;
    
protected voidnotifyPaintChange()
Notifies all references that the Paint definitions has been modified.

        final int n = references.size();
        for (int i = 0; i < n; i++) {
            Reference ref = (Reference) references.elementAt(i);
            ref.paintTarget.onPaintServerUpdate(ref.paintType, ref);
        }