FileDocCategorySizeDatePackage
CompositeGraphicsNodeProxy.javaAPI DocphoneME MR2 API (J2ME)38158Wed May 02 18:00:36 BST 2007com.sun.perseus.model

CompositeGraphicsNodeProxy

public class CompositeGraphicsNodeProxy extends ElementNodeProxy implements com.sun.perseus.j2d.GraphicsProperties, com.sun.perseus.j2d.PaintTarget
A CompositeGraphicsNodeProxy delegates its rendering to a proxied CompositeGraphics object and also keeps a cached transform and inverse transform.
version
$Id: CompositeGraphicsNodeProxy.java,v 1.4 2006/06/29 10:47:30 ln156897 Exp $

Fields Summary
protected com.sun.perseus.j2d.Transform
txf
Cached Transform
protected com.sun.perseus.j2d.Transform
inverseTxf
Cached inverse transform
protected com.sun.perseus.j2d.RGB
color
The current color. The fill and stroke colors may be relative to the current color
protected com.sun.perseus.j2d.PaintServer
fill
The fill paint used to fill this node
protected com.sun.perseus.j2d.PaintServer
stroke
The stroke paint used to stroke the outline of this ShapeNode
protected int
fillRule
The winding rule for this node
protected float
strokeWidth
The stroke width
protected float
strokeMiterLimit
The stroke miter limit
protected float[]
strokeDashArray
The stroke dash array
protected float
strokeDashOffset
The stroke dash offset
protected int
pack
Same structure as the CompositeGraphicsNode pack and pack2 fields.
protected int
pack2
Constructors Summary
protected CompositeGraphicsNodeProxy(CompositeGraphicsNode proxiedNode)

param
proxiedNode ElementNode to proxy


              
     
               
        super(proxiedNode);

        // By default, a CompositeGraphicsNodeProxy is renderable
        canRenderState &= CAN_RENDER_RENDERABLE_MASK;
        canRenderState |= (proxiedNode.canRenderState 
                            & CAN_RENDER_PROXY_BITS_MASK);
        
        // We copy the computed value for all properties upon initialization. 
        // When the node is hooked in the tree, inherited properties will be
        // recomputed.
        fill = proxiedNode.fill;
        stroke = proxiedNode.stroke;
        color = proxiedNode.color;
        pack = proxiedNode.pack;
        pack2 = proxiedNode.pack2;
        strokeWidth = proxiedNode.strokeWidth;
        strokeMiterLimit = proxiedNode.strokeMiterLimit;
        strokeDashArray = proxiedNode.strokeDashArray;
        strokeDashOffset = proxiedNode.strokeDashOffset;
    
Methods Summary
protected booleancontributeBBox()
A CompositeGraphicsNodeProxy contributes to its parent bounding box only if its display property is turned on.

return
true if the node's bounding box should be accounted for.

        return (pack & CompositeGraphicsNode.DISPLAY_MASK) != 0;
    
public org.w3c.dom.svg.SVGRectgetBBox()

        return null;
    
public com.sun.perseus.j2d.RGBgetColor()

return
the context's color property value

        return this.color;
    
public booleangetDisplay()

return
the context' display property value

        return ((pack & CompositeGraphicsNode.DISPLAY_MASK) 
                == CompositeGraphicsNode.DISPLAY_MASK);
    
public com.sun.perseus.j2d.PaintServergetFill()

return
the context's fill property value

        return fill;
    
public floatgetFillOpacity()

return
the context's fill opacity property value

        return ((pack & CompositeGraphicsNode.FILL_OPACITY_MASK) >> 7) / 200.0f;
    
public intgetFillRule()

return
the context's fill rule property value

        if ((pack & CompositeGraphicsNode.FILL_RULE_MASK) 
                == 
            CompositeGraphicsNode.FILL_RULE_MASK) {
            return WIND_NON_ZERO;
        }
        return WIND_EVEN_ODD;
    
protected floatgetFloatPropertyState(int propertyIndex)
Returns the value of the given float-valued property.

return
the value of the given property.

        switch (propertyIndex) {
        case GraphicsNode.PROPERTY_STROKE_WIDTH:
            return strokeWidth;
        case GraphicsNode.PROPERTY_STROKE_MITER_LIMIT:
            return strokeMiterLimit;
        case GraphicsNode.PROPERTY_STROKE_DASH_OFFSET:
            return strokeDashOffset;
        default: 
            return super.getFloatPropertyState(propertyIndex);
        }
    
public com.sun.perseus.j2d.TransformgetInverseTransformState()

return
this node's cached inverse transform.

        if (((canRenderState & CAN_RENDER_NON_INVERTIBLE_TXF_BIT) == 0)) {
            if (inverseTxf == null) {
                // If there is a parent, check if this node's transform is the 
                // same as the parent's in which cahse
                if (parent != null && txf == parent.getTransformState()) {
                    inverseTxf = parent.getInverseTransformState();
                } else {
                    inverseTxf = new Transform(null);
                    try {
                        inverseTxf = (Transform) txf.inverse(inverseTxf);
                    } catch (Exception e) {
                        // If we get an exception, then we have a real error
                        // condition, because we just checked that the 
                        // transform was invertible.
                        throw new Error();
                    }
                }
            }
        } else {
            inverseTxf = null;
        }
        return inverseTxf;
    
public floatgetOpacity()

return
the opacity value

        return (pack2 & CompositeGraphicsNode.OPACITY_MASK) / 200.0f;
    
protected intgetPackedPropertyState(int propertyIndex)
Returns the value of the given packed property.

return
the value of the given property.

        switch (propertyIndex) {
        case GraphicsNode.PROPERTY_FILL_RULE:
            return pack & CompositeGraphicsNode.FILL_RULE_MASK;
        case GraphicsNode.PROPERTY_STROKE_LINE_JOIN:
            return pack & CompositeGraphicsNode.STROKE_LINE_JOIN_MASK;
        case GraphicsNode.PROPERTY_STROKE_LINE_CAP:
            return pack & CompositeGraphicsNode.STROKE_LINE_CAP_MASK;
        case GraphicsNode.PROPERTY_DISPLAY:
            return pack & CompositeGraphicsNode.DISPLAY_MASK;
        case GraphicsNode.PROPERTY_VISIBILITY:
            return pack & CompositeGraphicsNode.VISIBILITY_MASK;
        case GraphicsNode.PROPERTY_FILL_OPACITY:
            return pack & CompositeGraphicsNode.FILL_OPACITY_MASK;
        case GraphicsNode.PROPERTY_STROKE_OPACITY:
            return pack & CompositeGraphicsNode.STROKE_OPACITY_MASK;
        case GraphicsNode.PROPERTY_OPACITY:
            return pack2 & CompositeGraphicsNode.OPACITY_MASK;
        default: 
            return super.getPackedPropertyState(propertyIndex);
        }
    
protected java.lang.ObjectgetPropertyState(int propertyIndex)
Returns the value of the given Object-valued property.

return
the value of the given property.

        switch (propertyIndex) {
        case GraphicsNode.PROPERTY_FILL:
            return fill;
        case GraphicsNode.PROPERTY_STROKE:
            return stroke;
        case GraphicsNode.PROPERTY_COLOR:
            return color;
        case GraphicsNode.PROPERTY_STROKE_DASH_ARRAY:            
            return getStrokeDashArray();
        default: 
            return super.getPropertyState(propertyIndex);
        }
    
public com.sun.perseus.j2d.PaintServergetStroke()

return
the context's stroke property value

        return stroke;
    
public float[]getStrokeDashArray()

return
the stroke dash array property

        return strokeDashArray;
    
public floatgetStrokeDashOffset()

return
the stroke dash offset property

        return strokeDashOffset;
    
public intgetStrokeLineCap()

return
the context's stroke-linecap.

        switch (pack & CompositeGraphicsNode.STROKE_LINE_CAP_MASK) {
        case CompositeGraphicsNode.CAP_BUTT_IMPL:
            return CAP_BUTT;
        case CompositeGraphicsNode.CAP_ROUND_IMPL:
            return CAP_ROUND;
        default:
            return CAP_SQUARE;
        }
    
public intgetStrokeLineJoin()

return
the stroke line join property value

        switch (pack & CompositeGraphicsNode.STROKE_LINE_JOIN_MASK) {
        case CompositeGraphicsNode.JOIN_MITER_IMPL:
            return JOIN_MITER;
        case CompositeGraphicsNode.JOIN_ROUND_IMPL:
            return JOIN_ROUND;
        default:
            return JOIN_BEVEL;
        }
    
public floatgetStrokeMiterLimit()

return
the context's stroke miter limit property value

        return strokeMiterLimit;
    
public floatgetStrokeOpacity()

return
the stroke opacity value

        return ((pack & CompositeGraphicsNode.STROKE_OPACITY_MASK) >> 15) 
                / 200.0f;
    
public floatgetStrokeWidth()

return
the context's stroke-width.

        return strokeWidth;
    
public com.sun.perseus.j2d.TransformgetTransformState()

return
this node's cached transform.

        return txf;
    
public booleangetVisibility()

return
the visibility property value.

        return ((pack & CompositeGraphicsNode.VISIBILITY_MASK) 
                == CompositeGraphicsNode.VISIBILITY_MASK);
    
protected booleanisFloatPropertyState(int propertyIndex, float propertyValue)
Checks the state of the float type property value.

param
propertyIndex the property index
param
propertyValue the computed value for the property.

        switch (propertyIndex) {
        case GraphicsNode.PROPERTY_STROKE_WIDTH:
            return strokeWidth == propertyValue;
        case GraphicsNode.PROPERTY_STROKE_MITER_LIMIT:
            return strokeMiterLimit == propertyValue;
        case GraphicsNode.PROPERTY_STROKE_DASH_OFFSET:
            return strokeDashOffset == propertyValue;
        default: 
            return super.isFloatPropertyState(propertyIndex, propertyValue);
        }
    
protected booleanisPackedPropertyState(int propertyIndex, int propertyValue)
Checks the state of the packed property value.

param
propertyIndex the property index
param
propertyValue the computed value for the property.

        switch (propertyIndex) {
        case GraphicsNode.PROPERTY_FILL_RULE:
            return (propertyValue
                    ==
                    (pack & CompositeGraphicsNode.FILL_RULE_MASK));
        case GraphicsNode.PROPERTY_STROKE_LINE_JOIN:
            return (propertyValue
                    ==
                    (pack & CompositeGraphicsNode.STROKE_LINE_JOIN_MASK));
        case GraphicsNode.PROPERTY_STROKE_LINE_CAP:
            return (propertyValue
                    ==
                    (pack & CompositeGraphicsNode.STROKE_LINE_CAP_MASK));
        case GraphicsNode.PROPERTY_DISPLAY:
            return (propertyValue
                    ==
                    (pack & CompositeGraphicsNode.DISPLAY_MASK));
        case GraphicsNode.PROPERTY_VISIBILITY:
            return (propertyValue
                    ==
                    (pack & CompositeGraphicsNode.DISPLAY_MASK));
        case GraphicsNode.PROPERTY_FILL_OPACITY:
            return (propertyValue
                    ==
                    (pack & CompositeGraphicsNode.FILL_OPACITY_MASK));
        case GraphicsNode.PROPERTY_STROKE_OPACITY:
            return (propertyValue
                    ==
                    (pack & CompositeGraphicsNode.STROKE_OPACITY_MASK));
        case GraphicsNode.PROPERTY_OPACITY:
            return (propertyValue
                    ==
                    (pack2 & CompositeGraphicsNode.OPACITY_MASK));
        default: 
            return super.isPackedPropertyState(propertyIndex, propertyValue);
        }
    
protected booleanisPropertyState(int propertyIndex, java.lang.Object propertyValue)
Checks the state of the Object type property value.

param
propertyIndex the property index
param
propertyValue the computed value for the property.

        switch (propertyIndex) {
        case GraphicsNode.PROPERTY_FILL:
            return fill == propertyValue;
        case GraphicsNode.PROPERTY_STROKE:
            return stroke == propertyValue;
        case GraphicsNode.PROPERTY_COLOR:
            return color == propertyValue;
        case GraphicsNode.PROPERTY_STROKE_DASH_ARRAY:            
            return strokeDashArray == propertyValue;
        default: 
            return super.isPropertyState(propertyIndex, propertyValue);
        }
    
public voidonPaintServerUpdate(java.lang.String paintType, com.sun.perseus.j2d.PaintServer paintServer)
This method is used to implement the PaintTarget interface which is used to compute the rendering area. However, the paint server updates are handled by the proxied node, so this should _never_ be called.

param
paintType the key provided by the PaintTarget when it subscribed to associated PaintServer.
param
paintServer the PaintServer generating the update.

        // Do nothing.
    
protected voidpropagateFloatPropertyState(int propertyIndex, float parentPropertyValue)
Called when the computed value of the given float-valued property has changed.

param
propertyIndex index of the property whose value has changed.
param
parentPropertyValue the value that children of this node should now inherit.

        // Propagate to expanded children.
        ModelNode node = firstExpandedChild;
        while (node != null) {
            node.recomputeFloatPropertyState(propertyIndex, 
                                             parentPropertyValue);
            node = node.nextSibling;
        }
    
protected voidpropagatePackedPropertyState(int propertyIndex, int parentPropertyValue)
Called when the computed value of the given packed property has changed.

param
propertyIndex index of the property whose value has changed.
param
parentPropertyValue the value that children of this node should now inherit.

        // Propagate to expanded children.
        ModelNode node = firstExpandedChild;
        while (node != null) {
            node.recomputePackedPropertyState(propertyIndex, 
                                              parentPropertyValue);
            node = node.nextSibling;
        }
    
protected voidpropagatePropertyState(int propertyIndex, java.lang.Object parentPropertyValue)
Called when the computed value of the given Object-valued property has changed.

param
propertyIndex index of the property whose value has changed.
param
parentPropertyValue the value that children of this node should now inherit.

        // Propagate to expanded children.
        ModelNode node = firstExpandedChild;
        while (node != null) {
            node.recomputePropertyState(propertyIndex, parentPropertyValue);
            node = node.nextSibling;
        }
    
protected final voidproxiedFloatPropertyStateChange(int propertyIndex, float proxiedComputedValue)
Called by the proxied node when the given float-valued property's computed value has changed.

param
propertyIndex index of the property whose value is changing.
param
proxiedComputedValue computed value for the proxied node.

        if (!((CompositeGraphicsNode) proxied).isInherited(propertyIndex)) {
            // The property is specified on the proxied node, update the 
            // state with that specified value.
            setFloatPropertyState(propertyIndex, proxiedComputedValue);
        } else {
            // The property is unspecified on the proxied node. Inherit from
            // the proxy's parent (and not the proxied's parent).
            setFloatPropertyState(
                    propertyIndex, 
                    getInheritedFloatPropertyState(propertyIndex));
        }

        // Do not propagate changes to the proxy children: propagation happens 
        // through the proxied's tree, so children will be notified if needed.
    
protected final voidproxiedPackedPropertyStateChange(int propertyIndex, int proxiedComputedValue)
Called by the proxied node when the given packed property's computed value has changed.

param
propertyIndex index of the property whose value is changing.
param
proxiedComputedValue computed value for the proxied node.

        if (!((CompositeGraphicsNode) proxied).isInherited(propertyIndex)) {
            // The property is specified on the proxied node, update the 
            // state with that specified value.
            setPackedPropertyState(propertyIndex, proxiedComputedValue);
        } else {
            // The property is unspecified on the proxied node. Inherit from
            // the proxy's parent (and not the proxied's parent).
            setPackedPropertyState(propertyIndex, 
                    getInheritedPackedPropertyState(propertyIndex));
        }

        // Do not propagate changes to the proxy children: propagation happens 
        // through the proxied's tree, so children will be notified if needed.
    
protected voidproxiedPropertyStateChange(int propertyIndex, java.lang.Object proxiedComputedValue)
Called by the proxied node when the given Object-valued property's computed value has changed.

param
propertyIndex index of the property whose value is changing.
param
proxiedComputedValue computed value for the proxied node.

        if (!((CompositeGraphicsNode) proxied).isInherited(propertyIndex)) {
            // The property is specified on the proxied node, update the 
            // state with that specified value.
            setPropertyState(propertyIndex, proxiedComputedValue);
        } else {
            // The property is unspecified on the proxied node. Inherit from
            // the proxy's parent (and not the proxied's parent).
            setPropertyState(propertyIndex, 
                             getInheritedPropertyState(propertyIndex));
        }

        // Do not propagate changes to the proxy children: propagation happens 
        // through the proxied's tree, so children will be notified if needed.
    
protected voidrecomputeFloatPropertyState(int propertyIndex, float parentPropertyValue)
Recomputes the given float-valued property's state given the new parent property.

param
propertyIndex index of the property whose value is changing.
param
parentPropertyValue the value that children of this node should now inherit.

        // We do not need to recompute the property value if:
        // - the property is _not_ inherited
        // or
        // - the property is inherited by the new parent property computed value
        //   is the same as the current value.
        if (!((CompositeGraphicsNode) proxied).isInherited(propertyIndex) 
            || 
            isFloatPropertyState(propertyIndex, parentPropertyValue)) {
            // If the property is color relative, the propagation happens
            // through the color property changes.  This means that with
            // currentColor, we inherit the computed value, not the specified
            // currentColor indirection.
            return;
        }

        setFloatPropertyState(propertyIndex, parentPropertyValue);
        propagateFloatPropertyState(propertyIndex, parentPropertyValue);
    
voidrecomputeInheritedProperties()
Recomputes all inherited properties.

        ModelNode p = ownerDocument;
        if (parent != null) {
            p = parent;
        }
        recomputePropertyState(
                GraphicsNode.PROPERTY_FILL, 
                p.getPropertyState(GraphicsNode.PROPERTY_FILL));
        recomputePropertyState(
                GraphicsNode.PROPERTY_STROKE, 
                p.getPropertyState(GraphicsNode.PROPERTY_STROKE));
        recomputePropertyState(
                GraphicsNode.PROPERTY_COLOR, 
                p.getPropertyState(GraphicsNode.PROPERTY_COLOR));
        recomputePackedPropertyState(
                GraphicsNode.PROPERTY_FILL_RULE, 
                p.getPackedPropertyState(GraphicsNode.PROPERTY_FILL_RULE));
        recomputeFloatPropertyState(
                GraphicsNode.PROPERTY_STROKE_WIDTH,
                p.getFloatPropertyState(GraphicsNode.PROPERTY_STROKE_WIDTH));
        recomputePackedPropertyState(
                GraphicsNode.PROPERTY_STROKE_LINE_JOIN, 
                p.getPackedPropertyState(
                    GraphicsNode.PROPERTY_STROKE_LINE_JOIN));
        recomputePackedPropertyState(
                GraphicsNode.PROPERTY_STROKE_LINE_CAP,
                p.getPackedPropertyState(
                    GraphicsNode.PROPERTY_STROKE_LINE_CAP));
        recomputeFloatPropertyState(
                GraphicsNode.PROPERTY_STROKE_MITER_LIMIT,
                p.getFloatPropertyState(
                    GraphicsNode.PROPERTY_STROKE_MITER_LIMIT));
        recomputePropertyState(
                GraphicsNode.PROPERTY_STROKE_DASH_ARRAY,
                p.getPropertyState(GraphicsNode.PROPERTY_STROKE_DASH_ARRAY));
        recomputeFloatPropertyState(
                GraphicsNode.PROPERTY_STROKE_DASH_OFFSET, 
                p.getFloatPropertyState(
                    GraphicsNode.PROPERTY_STROKE_DASH_OFFSET));
        recomputePackedPropertyState(
                GraphicsNode.PROPERTY_DISPLAY, 
                p.getPackedPropertyState(GraphicsNode.PROPERTY_DISPLAY));
        recomputePackedPropertyState(
                GraphicsNode.PROPERTY_VISIBILITY, 
                p.getPackedPropertyState(GraphicsNode.PROPERTY_VISIBILITY));
        recomputePackedPropertyState(
                GraphicsNode.PROPERTY_FILL_OPACITY, 
                p.getPackedPropertyState(GraphicsNode.PROPERTY_FILL_OPACITY));
        recomputePackedPropertyState(
                GraphicsNode.PROPERTY_STROKE_OPACITY, 
                p.getPackedPropertyState(GraphicsNode.PROPERTY_STROKE_OPACITY));
        recomputePackedPropertyState(
                GraphicsNode.PROPERTY_OPACITY, 
                p.getPackedPropertyState(GraphicsNode.PROPERTY_OPACITY));
    
protected voidrecomputePackedPropertyState(int propertyIndex, int parentPropertyValue)
Recomputes the given packed property's state given the new parent property.

param
propertyIndex index of the property whose value is changing.
param
parentPropertyValue the value that children of this node should now inherit.

        // We do not need to recompute the property value if:
        // - the property is _not_ inherited
        // or
        // - the property is inherited by the new parent property computed value
        //   is the same as the current value.
        if (!((CompositeGraphicsNode) proxied).isInherited(propertyIndex) 
            || 
            isPackedPropertyState(propertyIndex, parentPropertyValue)) {
            // If the property is color relative, the propagation happens
            // through the color property changes.  This means that with
            // currentColor, we inherit the computed value, not the specified
            // currentColor indirection.
            return;
        }

        setPackedPropertyState(propertyIndex, parentPropertyValue);
        propagatePackedPropertyState(propertyIndex, parentPropertyValue);
    
protected voidrecomputePropertyState(int propertyIndex, java.lang.Object parentPropertyValue)
Recomputes the given Object-valued property's state given the new parent property.

param
propertyIndex index of the property whose value is changing.
param
parentPropertyValue the value that children of this node should now inherit.

        // We do not need to recompute the property value if:
        // - the property is _not_ inherited
        // or
        // - the property is inherited by the new parent property computed value
        //   is the same as the current value.
        if (!((CompositeGraphicsNode) proxied).isInherited(propertyIndex) 
            || 
            isPropertyState(propertyIndex, parentPropertyValue)) {
            // If the property is color relative, the propagation happens
            // through the color property changes.  This means that with
            // currentColor, we inherit the computed value, not the specified
            // currentColor indirection.
            return;
        }

        setPropertyState(propertyIndex, parentPropertyValue);
        propagatePropertyState(propertyIndex, parentPropertyValue);
    
protected voidrecomputeTransformState(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. By default, because a ModelNode has no transform and no cached transform, this only does a pass down.

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

        txf = proxied.appendTransform(parentTransform, txf);        
        computeCanRenderTransformBit(txf);
        inverseTxf = null;
        // inverseTxf = computeInverseTransform(txf, parentTransform, 
        //                                      inverseTxf);
        recomputeTransformState(txf, firstExpandedChild);
    
public voidsetColor(com.sun.perseus.j2d.RGB newColor)

param
newColor the new computed color property.

        color = newColor;
    
public voidsetDisplay(boolean newDisplay)

param
newDisplay the new computed display value

        if (newDisplay) {
            pack |= CompositeGraphicsNode.DISPLAY_MASK;
        } else {
            pack &= ~CompositeGraphicsNode.DISPLAY_MASK;
        }

        computeCanRenderDisplayBit(newDisplay);
    
public voidsetFill(com.sun.perseus.j2d.PaintServer newFill)

param
newFill the new computed fill property.

        this.fill = newFill;
    
public voidsetFillOpacity(float newFillOpacity)

param
newFillOpacity the new computed value for the fill opacity property.

                
        pack &= ~CompositeGraphicsNode.FILL_OPACITY_MASK;
        pack |= ((((int) (newFillOpacity * 200)) << 7) 
                & CompositeGraphicsNode.FILL_OPACITY_MASK);
    
public final voidsetFillRule(int newFillRule)

param
newFillRule the new computed fillRule property value.

        if (newFillRule == WIND_NON_ZERO) {
            pack |= CompositeGraphicsNode.FILL_RULE_MASK;
        } else {
            pack &= ~CompositeGraphicsNode.FILL_RULE_MASK;
        }
    
protected voidsetFloatPropertyState(int propertyIndex, float propertyValue)
Sets the computed value of the given float-valued property.

param
propertyIndex the property index
param
propertyValue the computed value of the property.

        switch (propertyIndex) {
        case GraphicsNode.PROPERTY_STROKE_WIDTH:
            setStrokeWidth(propertyValue);
            break;
        case GraphicsNode.PROPERTY_STROKE_MITER_LIMIT:
            setStrokeMiterLimit(propertyValue);
            break;
        case GraphicsNode.PROPERTY_STROKE_DASH_OFFSET:
            setStrokeDashOffset(propertyValue);
            break;
        default: 
            super.setFloatPropertyState(propertyIndex, propertyValue);
            break;
        }
    
public voidsetOpacity(float newOpacity)

param
newOpacity the new computed opacity property.

        pack2 &= ~CompositeGraphicsNode.OPACITY_MASK;
        pack2 |= (((int) (newOpacity * 200)) 
                & CompositeGraphicsNode.OPACITY_MASK);
    
protected voidsetPackedPropertyState(int propertyIndex, int propertyValue)
Sets the computed value of the given packed property.

param
propertyIndex the property index
param
propertyValue the computed value for the property.

        switch (propertyIndex) {
        case GraphicsNode.PROPERTY_FILL_RULE:
            if (propertyValue == 0) {
                setFillRule(WIND_EVEN_ODD);
            } else {
                setFillRule(WIND_NON_ZERO);
            }
            break;
        case GraphicsNode.PROPERTY_STROKE_LINE_JOIN:
            switch (propertyValue) {
                case CompositeGraphicsNode.JOIN_MITER_IMPL:
                    setStrokeLineJoin(JOIN_MITER);
                    break;
                case CompositeGraphicsNode.JOIN_ROUND_IMPL:
                    setStrokeLineJoin(JOIN_ROUND);
                    break;
                case CompositeGraphicsNode.JOIN_BEVEL_IMPL:
                default:
                    setStrokeLineJoin(JOIN_BEVEL);
                    break;
            }
            break;
        case GraphicsNode.PROPERTY_STROKE_LINE_CAP:
            switch (propertyValue) {
                case CompositeGraphicsNode.CAP_BUTT_IMPL:
                    setStrokeLineCap(CAP_BUTT);
                    break;
                case CompositeGraphicsNode.CAP_ROUND_IMPL:
                    setStrokeLineCap(CAP_ROUND);
                    break;
                case CompositeGraphicsNode.CAP_SQUARE_IMPL:
                default:
                    setStrokeLineCap(CAP_SQUARE);
                    break;
            }
            break;
        case GraphicsNode.PROPERTY_DISPLAY:
            if (propertyValue != 0) {
                setDisplay(true);
            } else {
                setDisplay(false);
            }
            break;
        case GraphicsNode.PROPERTY_VISIBILITY:
            if (propertyValue != 0) {
                setVisibility(true);
            } else {
                setVisibility(false);
            }
            break;
        case GraphicsNode.PROPERTY_FILL_OPACITY:
            setFillOpacity((propertyValue >> 7) / 200.0f);
            break;
        case GraphicsNode.PROPERTY_STROKE_OPACITY:
            setStrokeOpacity((propertyValue >> 15) / 200.0f);
            break;
        case GraphicsNode.PROPERTY_OPACITY:
            setOpacity(propertyValue / 200.0f);
            break;
        default: 
            super.setPackedPropertyState(propertyIndex, propertyValue);
            break;
        }
    
protected voidsetPropertyState(int propertyIndex, java.lang.Object propertyValue)
Sets the computed value of the given Object-valued property.

param
propertyIndex the property index
param
propertyValue the computed value of the property.

        switch (propertyIndex) {
        case GraphicsNode.PROPERTY_FILL:
            setFill((PaintServer) propertyValue);
            break;
        case GraphicsNode.PROPERTY_STROKE:
            setStroke((PaintServer) propertyValue);
            break;
        case GraphicsNode.PROPERTY_COLOR:
            setColor((RGB) propertyValue);
            break;
        case GraphicsNode.PROPERTY_STROKE_DASH_ARRAY:            
            setStrokeDashArray((float[]) propertyValue);
            break;
        default: 
            super.setPropertyState(propertyIndex, propertyValue);
            break;
        }
    
public voidsetStroke(com.sun.perseus.j2d.PaintServer newStroke)

param
newStroke the new computed stroke property.

        this.stroke = newStroke;
    
public voidsetStrokeDashArray(float[] newStrokeDashArray)

param
newStrokeDashArray the new computed stroke-dasharray property value.

        strokeDashArray = newStrokeDashArray;
    
public voidsetStrokeDashOffset(float newStrokeDashOffset)

param
newStrokeDashOffset the new stroke-dashoffset computed property value.

        strokeDashOffset = newStrokeDashOffset;
    
public voidsetStrokeLineCap(int newStrokeLineCap)

param
newStrokeLineCap the new value for the stroke-linecap property.

        // Clear stroke-linecap
        pack &= ~CompositeGraphicsNode.STROKE_LINE_CAP_MASK;

        switch (newStrokeLineCap) {
        case CAP_BUTT:
            pack |= CompositeGraphicsNode.CAP_BUTT_IMPL;
            break;
        case CAP_ROUND:
            pack |= CompositeGraphicsNode.CAP_ROUND_IMPL;
            break;
        default:
            pack |= CompositeGraphicsNode.CAP_SQUARE_IMPL;
            break;
        }
    
public voidsetStrokeLineJoin(int newStrokeLineJoin)

param
newStrokeLineJoin the new computed value for stroke-line-join

        // Clear stroke-linejoin
        pack &= ~CompositeGraphicsNode.STROKE_LINE_JOIN_MASK;

        switch (newStrokeLineJoin) {
        case JOIN_MITER:
            pack |= CompositeGraphicsNode.JOIN_MITER_IMPL;
            break;
        case JOIN_ROUND:
            pack |= CompositeGraphicsNode.JOIN_ROUND_IMPL;
            break;
        default:
            pack |= CompositeGraphicsNode.JOIN_BEVEL_IMPL;
            break;
        }
    
public voidsetStrokeMiterLimit(float newStrokeMiterLimit)

param
newStrokeMiterLimit the new computed stroke-miterlimit property.

        strokeMiterLimit = newStrokeMiterLimit;        
    
public voidsetStrokeOpacity(float newStrokeOpacity)

param
newStrokeOpacity the new computed stroke-opacity property.

        pack &= ~CompositeGraphicsNode.STROKE_OPACITY_MASK;
        pack |= ((((int) (newStrokeOpacity * 200)) << 15) 
                & CompositeGraphicsNode.STROKE_OPACITY_MASK);
    
public voidsetStrokeWidth(float newStrokeWidth)

param
newStrokeWidth the new computed stroke-width property value.

        strokeWidth = newStrokeWidth;
    
public voidsetVisibility(boolean newVisibility)

param
newVisibility the new computed visibility property.

        if (newVisibility) {
            pack |= CompositeGraphicsNode.VISIBILITY_MASK;
        } else {
            pack &= ~CompositeGraphicsNode.VISIBILITY_MASK;
        }