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

CompositeGraphicsNode

public abstract class CompositeGraphicsNode extends ElementNode implements com.sun.perseus.j2d.PaintTarget, GraphicsNode, org.w3c.dom.svg.SVGLocatableElement
CompositeGraphicsNode is the base class for all nodes which are both composites (i.e., they can have children) and have graphic properties (such as fill or stroke).
version
$Id: CompositeGraphicsNode.java,v 1.16 2006/06/29 10:47:29 ln156897 Exp $

Fields Summary
protected static final int
FONT_STYLE_MASK
protected static final int
FONT_WEIGHT_MASK
protected static final int
TEXT_ANCHOR_MASK
protected static final int
STROKE_OPACITY_MASK
protected static final int
FILL_OPACITY_MASK
protected static final int
FILL_RULE_MASK
protected static final int
STROKE_LINE_CAP_MASK
protected static final int
STROKE_LINE_JOIN_MASK
protected static final int
VISIBILITY_MASK
protected static final int
DISPLAY_MASK
protected static final int
OPACITY_MASK
protected static final int
FONT_STYLE_NORMAL_IMPL
protected static final int
FONT_STYLE_ITALIC_IMPL
protected static final int
FONT_STYLE_OBLIQUE_IMPL
protected static final int
FONT_WEIGHT_100_IMPL
protected static final int
FONT_WEIGHT_200_IMPL
protected static final int
FONT_WEIGHT_300_IMPL
protected static final int
FONT_WEIGHT_400_IMPL
protected static final int
FONT_WEIGHT_500_IMPL
protected static final int
FONT_WEIGHT_600_IMPL
protected static final int
FONT_WEIGHT_700_IMPL
protected static final int
FONT_WEIGHT_800_IMPL
protected static final int
FONT_WEIGHT_900_IMPL
protected static final int
FONT_WEIGHT_LIGHTER_IMPL
protected static final int
FONT_WEIGHT_BOLDER_IMPL
protected static final int
TEXT_ANCHOR_MIDDLE_IMPL
protected static final int
TEXT_ANCHOR_START_IMPL
protected static final int
TEXT_ANCHOR_END_IMPL
protected static final int
CAP_BUTT_IMPL
protected static final int
CAP_ROUND_IMPL
protected static final int
CAP_SQUARE_IMPL
protected static final int
JOIN_MITER_IMPL
protected static final int
JOIN_ROUND_IMPL
protected static final int
JOIN_BEVEL_IMPL
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 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
protected static final int
INITIAL_FONT_STYLE_IMPL
protected static final int
INITIAL_FONT_WEIGHT_IMPL
protected static final int
INITIAL_TEXT_ANCHOR_IMPL
protected static final int
INITIAL_STROKE_OPACITY_IMPL
protected static final int
INITIAL_FILL_OPACITY_IMPL
protected static final int
INITIAL_FILL_RULE_IMPL
protected static final int
INITIAL_STROKE_LINE_CAP_IMPL
protected static final int
INITIAL_STROKE_LINE_JOIN_IMPL
protected static final int
INITIAL_VISIBILITY_IMPL
protected static final int
INITIAL_DISPLAY_IMPL
protected static final int
INITIAL_PACK
protected int
pack2
protected static final int
INITIAL_OPACITY_IMPL
protected static final int
INITIAL_PACK2
protected int
markers
Markers are used to keep track of inherited properties, color relative properties and bolder/lighter font weights. 0-20 : property inheritance 21-22 : color relative 23 : is bolder marker 24 : is lighter marker
protected com.sun.perseus.j2d.Transform
txf
Cached Transform. May point to the parent transform.
protected com.sun.perseus.j2d.Transform
inverseTxf
Cached inverse transform. May point to the parent inverse transform.
Constructors Summary
public CompositeGraphicsNode(DocumentNode ownerDocument)
Constructor.

param
ownerDocument this element's owner DocumentNode


                
        
        super(ownerDocument);
        
        // By default, a CompositeGraphicsNode is renderable
        canRenderState &= CAN_RENDER_RENDERABLE_MASK;
    
Methods Summary
voidclearMarker(int marker)
Clears the input marker.

param
marker the marker to clear.

        markers &= ~marker;
    
protected booleancontributeBBox()
A CompositeGraphicsNode 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 & DISPLAY_MASK) != 0;
    
TraitAnimcreateTraitAnimImpl(java.lang.String traitName)

param
traitName the trait name.

        if (SVGConstants.SVG_STROKE_WIDTH_ATTRIBUTE == traitName
            ||
            SVGConstants.SVG_STROKE_MITERLIMIT_ATTRIBUTE == traitName
            ||
            SVGConstants.SVG_STROKE_DASHOFFSET_ATTRIBUTE == traitName
            ||
            SVGConstants.SVG_FILL_OPACITY_ATTRIBUTE == traitName
            ||
            SVGConstants.SVG_STROKE_OPACITY_ATTRIBUTE == traitName
            ||
            SVGConstants.SVG_OPACITY_ATTRIBUTE == traitName) {
            return new FloatTraitAnim(this, traitName, TRAIT_TYPE_FLOAT);
        } else if (SVGConstants.SVG_COLOR_ATTRIBUTE == traitName
                   ||
                   SVGConstants.SVG_FILL_ATTRIBUTE == traitName
                   ||
                   SVGConstants.SVG_STROKE_ATTRIBUTE == traitName) {
            return new FloatTraitAnim(this, traitName, 
                                      TRAIT_TYPE_SVG_RGB_COLOR);
        } else if (SVGConstants.SVG_STROKE_DASHARRAY_ATTRIBUTE == traitName) {
            return new FloatTraitAnim(this, traitName, TRAIT_TYPE_STRING);
        } else if (SVGConstants.SVG_DISPLAY_ATTRIBUTE == traitName
                   ||
                   SVGConstants.SVG_FILL_RULE_ATTRIBUTE == traitName
                   ||
                   SVGConstants.SVG_STROKE_LINECAP_ATTRIBUTE == traitName
                   ||
                   SVGConstants.SVG_STROKE_LINEJOIN_ATTRIBUTE == traitName
                   ||
                   SVGConstants.SVG_VISIBILITY_ATTRIBUTE == traitName) {
            return new StringTraitAnim(this, NULL_NS, traitName);
        } else {
            return super.createTraitAnimImpl(traitName);
        }
    
java.lang.StringfillRuleToStringTrait(int fillRule)
Converts the input fill-rule value to a string trait value.

param
fillRule the fill-rule value to convert. In packed form, but with mask applied.
return
the converted value.

        if (fillRule == CompositeGraphicsNode.FILL_RULE_MASK) {
            return SVGConstants.CSS_NONZERO_VALUE;
        }
        return SVGConstants.CSS_EVENODD_VALUE;
    
public org.w3c.dom.svg.SVGRectgetBBox()

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

return
the current color property. This is not the computed value and does not account for the inherited state.

        return color;
    
public booleangetDisplay()

return
current display property value, exclusive of inheritance

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

return
the current fill property. This is not the computed values, i.e., it does not account for the inherited or color relative states.

        return fill;
    
public floatgetFillOpacity()

return
the current fillOpacity property.

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

return
the current fillRule property, exclusive of the inherited flag.

        if ((pack & FILL_RULE_MASK) == 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 PROPERTY_STROKE_WIDTH:
            return strokeWidth;
        case PROPERTY_STROKE_MITER_LIMIT:
            return strokeMiterLimit;
        case PROPERTY_STROKE_DASH_OFFSET:
            return strokeDashOffset;
        default: 
            return super.getFloatPropertyState(propertyIndex);
        }
    
floatgetFloatTraitImpl(java.lang.String name)
Supported float traits: stroke-width, stroke-miterlimit, stroke-dashoffset, fill-opacity, stroke-opacity, opacity.

param
name the requested trait's name
return
the requested trait's value, as a floating point.
throws
DOMException with error code NOT_SUPPORTED_ERROR if the requested trait is not supported on this element or null.
throws
DOMException with error code TYPE_MISMATCH_ERR if requested trait's computed value cannot be converted to a float
throws
SecurityException if the application does not have the necessary privilege rights to access this (SVG) content.

        if (SVGConstants.SVG_STROKE_WIDTH_ATTRIBUTE == name) {
            return getStrokeWidth();
        } else if (SVGConstants.SVG_STROKE_MITERLIMIT_ATTRIBUTE == name) {
            return getStrokeMiterLimit();
        } else if (SVGConstants.SVG_STROKE_DASHOFFSET_ATTRIBUTE == name) {
            return getStrokeDashOffset();
        } else if (SVGConstants.SVG_FILL_OPACITY_ATTRIBUTE == name) {
            return getFillOpacity();
        } else if (SVGConstants.SVG_STROKE_OPACITY_ATTRIBUTE == name) {
            return getStrokeOpacity();
        } else if (SVGConstants.SVG_OPACITY_ATTRIBUTE == name) {
            return getOpacity();
        } else {
            return super.getFloatTraitImpl(name);
        }
    
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 current opacity property value.

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

return
the value for 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 Object-valued property.

        switch (propertyIndex) {
        case PROPERTY_FILL:
            return fill;
        case PROPERTY_STROKE:
            return stroke;
        case PROPERTY_COLOR:
            return color;
        case PROPERTY_STROKE_DASH_ARRAY:            
            return strokeDashArray;
        default: 
            return super.getPropertyState(propertyIndex);
        }
    
org.w3c.dom.svg.SVGRGBColorgetRGBColorTraitImpl(java.lang.String name)
Supported color traits: color, fill, stroke

param
name the requested trait's name.
return
the requested trait's value, as an SVGRGBColor.
throws
DOMException with error code NOT_SUPPORTED_ERROR if the requested trait is not supported on this element or null.
throws
DOMException with error code TYPE_MISMATCH_ERR if requested trait's computed value cannot be converted to {@link org.w3c.dom.svg.SVGRGBColor SVGRGBColor}
throws
SecurityException if the application does not have the necessary privilege rights to access this (SVG) content.

        if (SVGConstants.SVG_FILL_ATTRIBUTE.equals(name)) {
            return toSVGRGBColor(SVGConstants.SVG_FILL_ATTRIBUTE,
                                 getFill());
        } else if (SVGConstants.SVG_STROKE_ATTRIBUTE.equals(name)) {
            return toSVGRGBColor(SVGConstants.SVG_STROKE_ATTRIBUTE,
                                 getStroke());
        } else if (SVGConstants.SVG_COLOR_ATTRIBUTE.equals(name)) {
            return toSVGRGBColor(SVGConstants.SVG_COLOR_ATTRIBUTE,
                                 getColor());
        } else {
            return super.getRGBColorTraitImpl(name);
        }
    
public org.w3c.dom.svg.SVGRectgetScreenBBox()

        return null;
    
java.lang.StringgetSpecifiedTraitImpl(java.lang.String name)
Returns the specified trait value as String. In SVG Tiny only certain traits can be obtained as a String value. Syntax of the returned String matches the syntax of the corresponding attribute. This element is exactly equivalent to {@link org.w3c.dom.svg.SVGElement#getTraitNS getTraitNS} with namespaceURI set to null. The method is meant to be overridden by derived classes. The implementation pattern is that derived classes will override the method and call their super class' implementation. If the ElementNode implementation is called, it means that the trait is either not supported or that it cannot be seen as a String.

param
name the requested trait name.
return
the trait value.
throws
DOMException with error code NOT_SUPPORTED_ERROR if the requested trait is not supported on this element or null.
throws
DOMException with error code TYPE_MISMATCH_ERR if requested trait's computed value cannot be converted to a String (SVG Tiny only).

        if ((SVGConstants.SVG_STROKE_WIDTH_ATTRIBUTE == name
             &&
             isInherited(PROPERTY_STROKE_WIDTH))
            ||
            (SVGConstants.SVG_STROKE_MITERLIMIT_ATTRIBUTE == name
             &&
             isInherited(PROPERTY_STROKE_MITER_LIMIT))
            ||
            (SVGConstants.SVG_STROKE_DASHOFFSET_ATTRIBUTE == name
             &&
             isInherited(PROPERTY_STROKE_DASH_OFFSET))
            ||
            (SVGConstants.SVG_FILL_RULE_ATTRIBUTE == name
             &&
             isInherited(PROPERTY_FILL_RULE))
            ||
            (SVGConstants.SVG_STROKE_LINEJOIN_ATTRIBUTE == name
             &&
             isInherited(PROPERTY_STROKE_LINE_JOIN))
            ||
            (SVGConstants.SVG_STROKE_LINECAP_ATTRIBUTE == name
             &&
             isInherited(PROPERTY_STROKE_LINE_CAP))
            ||
            (SVGConstants.SVG_DISPLAY_ATTRIBUTE == name
             &&
             isInherited(PROPERTY_DISPLAY))
            ||
            (SVGConstants.SVG_VISIBILITY_ATTRIBUTE == name
             &&
             isInherited(PROPERTY_VISIBILITY))
            ||
            (SVGConstants.SVG_COLOR_ATTRIBUTE == name
             &&
             isInherited(PROPERTY_COLOR))
            ||
            (SVGConstants.SVG_FILL_ATTRIBUTE == name
             &&
             isInherited(PROPERTY_FILL))
            ||
            (SVGConstants.SVG_STROKE_ATTRIBUTE == name
             &&
             isInherited(PROPERTY_STROKE))
            ||
            (SVGConstants.SVG_FILL_OPACITY_ATTRIBUTE == name
             &&
             isInherited(PROPERTY_FILL_OPACITY))
            ||
            (SVGConstants.SVG_STROKE_OPACITY_ATTRIBUTE == name
             &&
             isInherited(PROPERTY_STROKE_OPACITY))
            ||
            (SVGConstants.SVG_OPACITY_ATTRIBUTE == name
             &&
             isInherited(PROPERTY_OPACITY))
            ||
            (SVGConstants.SVG_STROKE_DASHARRAY_ATTRIBUTE == name
             &&
             isInherited(PROPERTY_STROKE_DASH_ARRAY))) {
            return SVGConstants.CSS_INHERIT_VALUE;
        } else if ((SVGConstants.SVG_FILL_ATTRIBUTE == name
                    &&
                    isColorRelative(PROPERTY_FILL)) 
                   ||
                   (SVGConstants.SVG_STROKE_ATTRIBUTE == name
                    &&
                    isColorRelative(PROPERTY_STROKE))) {
            return SVGConstants.CSS_CURRENTCOLOR_VALUE;
        } else if (SVGConstants.SVG_DISPLAY_ATTRIBUTE == name) {
            if (getDisplay()) {
                return SVGConstants.CSS_INLINE_VALUE;
            } else {
                return SVGConstants.CSS_NONE_VALUE;
            }
        } else {
            return super.getSpecifiedTraitImpl(name);
        }
    
public com.sun.perseus.j2d.PaintServergetStroke()

return
the stroke property. This is not the computed value as it does not account for the inherited and color relative states.

        return stroke;
    
public float[]getStrokeDashArray()

return
current strokeDashArray, exclusive of the inherited state.

        return strokeDashArray;
    
public floatgetStrokeDashOffset()

return
current strokeDashOffset property value, exclusive of its inherited state.

        return strokeDashOffset;
    
public intgetStrokeLineCap()

return
the strokeLineCap property exclusive of its inherited state

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

return
current strokeLineJoin exclusive of the inherited state

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

return
current strokeMiterLimit, exclusive of the inherited state

        return strokeMiterLimit;
    
public floatgetStrokeOpacity()

return
the current strokeOpacity property.

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

return
current strokeWidth, exclusive of inheritance

        return strokeWidth;
    
public java.lang.StringgetTraitImpl(java.lang.String name)
Supported traits: stroke-width, stroke-miterlimit, stroke-dashoffset, fill-rule, stroke-linejoin, stroke-linecap, display, visibility, color, fill, stroke, fill-opacity, stroke-opacity, stroke-dasharray, opacity

param
name the requested trait's name
return
the requested trait value, as a string.
throws
DOMException with error code NOT_SUPPORTED_ERROR if the requested trait is not supported on this element or null.
throws
DOMException with error code TYPE_MISMATCH_ERR if requested trait's computed value cannot be converted to a String (SVG Tiny only).

        if (SVGConstants.SVG_STROKE_WIDTH_ATTRIBUTE == name) {
            return Float.toString(getStrokeWidth());
        } else if (SVGConstants.SVG_STROKE_MITERLIMIT_ATTRIBUTE == name) {
            return Float.toString
                (getStrokeMiterLimit());
        } else if (SVGConstants.SVG_STROKE_DASHOFFSET_ATTRIBUTE == name) {
            return Float.toString
                (getStrokeDashOffset());
        } else if (SVGConstants.SVG_FILL_RULE_ATTRIBUTE == name) { 
            return fillRuleToStringTrait(pack & FILL_RULE_MASK);
        } else if (SVGConstants.SVG_STROKE_LINEJOIN_ATTRIBUTE == name) {
            return strokeLineJoinToStringTrait
                (pack & STROKE_LINE_JOIN_MASK);
        } else if (SVGConstants.SVG_STROKE_LINECAP_ATTRIBUTE == name) {
            return strokeLineCapToStringTrait
                (pack & STROKE_LINE_CAP_MASK);
        } else if (SVGConstants.SVG_DISPLAY_ATTRIBUTE == name) {
            if (getDisplay()) {
                return SVGConstants.CSS_INLINE_VALUE;
            } else {
                return SVGConstants.CSS_NONE_VALUE;
            }
        } else if (SVGConstants.SVG_VISIBILITY_ATTRIBUTE == name) {
            if (getVisibility()) {
                return SVGConstants.CSS_VISIBLE_VALUE;
            } else {
                return SVGConstants.CSS_HIDDEN_VALUE;
            }
        } else if (SVGConstants.SVG_COLOR_ATTRIBUTE == name) {
            return getColor().toString();
        } else if (SVGConstants.SVG_FILL_ATTRIBUTE == name) {
            return toString(getFill());
        } else if (SVGConstants.SVG_STROKE_ATTRIBUTE == name) {
            return toString(getStroke());
        } else if (SVGConstants.SVG_FILL_OPACITY_ATTRIBUTE == name) {
            return Float.toString(getFillOpacity());
        } else if (SVGConstants.SVG_STROKE_OPACITY_ATTRIBUTE == name) {
            return Float.toString(getStrokeOpacity());
        } else if (SVGConstants.SVG_STROKE_DASHARRAY_ATTRIBUTE == name) {
            return toStringTrait(getStrokeDashArray());
        } else if (SVGConstants.SVG_OPACITY_ATTRIBUTE == name) {
            return Float.toString(getOpacity());
        } else {
            return super.getTraitImpl(name);
        }
    
public com.sun.perseus.j2d.TransformgetTransformState()

return
this node's cached transform.

        return txf;
    
public booleangetVisibility()

return
current visibility property, exclusive of inheritance.

        return ((pack & VISIBILITY_MASK) == VISIBILITY_MASK);
    
public booleanisColorRelative(int propertyIndex)
Returns true if the input property is color relative. False otherwise

param
propertyIndex index for the property whose color relative state should be returned.
return
true if the property at index propertyIndex is relative to the color property.

        return isMarkerSet(propertyIndex << 21);
    
public booleanisColorRelativeProperty(int propertyIndex)
Returns true if the input property can be color-relative.

param
propertyIndex the index of the property which may be color-relative.
return
true if the input property can be color relative. False otherwise.

        switch (propertyIndex) {
            case PROPERTY_FILL:
                return true;
            case PROPERTY_STROKE:
                return true;
            default:
                return false;
        }
    
protected booleanisFloatPropertyState(int propertyIndex, float propertyValue)
Checks the state of the float property value.

param
propertyIndex the property index
param
propertyValue the computed value of 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);
        }
    
public final booleanisInherited(int propertyIndex)
Check if the property is inherited.

param
propertyIndex the index of the property for which the inherited state should be returned.
return
true if the input property is inherited. False otherwise

        return isMarkerSet(propertyIndex);
    
final booleanisMarkerSet(int marker)

return
true if the input marker is set.

        return (markers & marker) != 0;
    
protected booleanisPackedPropertyState(int propertyIndex, int propertyValue)
Checks the state of the packed property value.

param
propertyIndex the property index
param
propertyValue the computed value of 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.VISIBILITY_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-valued property.

param
propertyIndex the property index
param
propertyValue the computed value of 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)

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

        if (paintType == SVGConstants.SVG_FILL_ATTRIBUTE) {
            setFill(paintServer);
        } else if (paintType == SVGConstants.SVG_STROKE_ATTRIBUTE) {
            setStroke(paintServer);
        } else {
            throw new Error();
        }
    
protected voidpropagateFloatPropertyState(int propertyIndex, float parentPropertyValue)
Called when the computed value of the given float-valued property has changed.

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

        // Propagate to proxies.
        if (firstProxy != null) {
            ElementNodeProxy proxy = firstProxy;
            while (proxy != null) {
                ((CompositeGraphicsNodeProxy) 
                        proxy).proxiedFloatPropertyStateChange(
                            propertyIndex, parentPropertyValue);
                proxy = proxy.nextProxy;
            }
        }

        // Propagate to regular children.
        ModelNode node = getFirstChildNode();
        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 for the property whose value has changed.
param
parentPropertyValue the value that children of this node should now inherit.

        // Propagate to proxies.
        if (firstProxy != null) {
            ElementNodeProxy proxy = firstProxy;
            while (proxy != null) {
                ((CompositeGraphicsNodeProxy) 
                        proxy).proxiedPackedPropertyStateChange(
                            propertyIndex, parentPropertyValue);
                proxy = proxy.nextProxy;
            }
        }

        // Propagate to regular children.
        ModelNode node = getFirstChildNode();
        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 for the property whose value has changed.
param
parentPropertyValue the value that children of this node should now inherit.

        // Propagate to proxies.
        if (firstProxy != null) {
            ElementNodeProxy proxy = firstProxy;
            while (proxy != null) {
                ((CompositeGraphicsNodeProxy) proxy).proxiedPropertyStateChange(
                        propertyIndex, parentPropertyValue);
                proxy = proxy.nextProxy;
            }
        }

        // Propagate to regular children.
        ModelNode node = getFirstChildNode();
        while (node != null) {
            node.recomputePropertyState(propertyIndex, parentPropertyValue);
            node = node.nextSibling;
        }
    
protected voidrecomputeFloatPropertyState(int propertyIndex, float parentPropertyValue)
Recomputes the given float-valued property's state given the new parent property.

param
propertyIndex index for 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 (!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(PROPERTY_FILL, 
                               p.getPropertyState(PROPERTY_FILL));
        recomputePropertyState(PROPERTY_STROKE, 
                               p.getPropertyState(PROPERTY_STROKE));
        recomputePropertyState(PROPERTY_COLOR, 
                               p.getPropertyState(PROPERTY_COLOR));
        recomputePackedPropertyState(PROPERTY_FILL_RULE, 
                               p.getPackedPropertyState(PROPERTY_FILL_RULE));
        recomputeFloatPropertyState(PROPERTY_STROKE_WIDTH,
                               p.getFloatPropertyState(PROPERTY_STROKE_WIDTH));
        recomputePackedPropertyState(PROPERTY_STROKE_LINE_JOIN, 
                               p.getPackedPropertyState(
                                    PROPERTY_STROKE_LINE_JOIN));
        recomputePackedPropertyState(PROPERTY_STROKE_LINE_CAP,
                               p.getPackedPropertyState(
                                    PROPERTY_STROKE_LINE_CAP));
        recomputeFloatPropertyState(PROPERTY_STROKE_MITER_LIMIT,
                               p.getFloatPropertyState(
                                    PROPERTY_STROKE_MITER_LIMIT));
        recomputePropertyState(PROPERTY_STROKE_DASH_ARRAY,
                               p.getPropertyState(PROPERTY_STROKE_DASH_ARRAY));
        recomputeFloatPropertyState(PROPERTY_STROKE_DASH_OFFSET, 
                               p.getFloatPropertyState(
                                    PROPERTY_STROKE_DASH_OFFSET));
        recomputePackedPropertyState(PROPERTY_DISPLAY, 
                               p.getPackedPropertyState(PROPERTY_DISPLAY));
        recomputePackedPropertyState(PROPERTY_VISIBILITY, 
                               p.getPackedPropertyState(PROPERTY_VISIBILITY));
        recomputePackedPropertyState(PROPERTY_FILL_OPACITY, 
                               p.getPackedPropertyState(PROPERTY_FILL_OPACITY));
        recomputePackedPropertyState(PROPERTY_STROKE_OPACITY, 
                               p.getPackedPropertyState(
                                     PROPERTY_STROKE_OPACITY));
        recomputePackedPropertyState(PROPERTY_OPACITY, 
                               p.getPackedPropertyState(
                                     PROPERTY_OPACITY));
    
protected voidrecomputePackedPropertyState(int propertyIndex, int parentPropertyValue)
Recomputes the given packed property's state given the new parent property.

param
propertyIndex index for 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 (!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 for 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 (!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 = appendTransform(parentTransform, txf);
        computeCanRenderTransformBit(txf);
        inverseTxf = null;
        // inverseTxf = computeInverseTransform(txf, parentTransform, 
        //                                      inverseTxf);
        recomputeTransformState(txf, getFirstChildNode());
    
public voidsetColor(com.sun.perseus.j2d.RGB newColor)
Setting the color property clears this property's inherited flag.

param
newColor new color property.

        if (!isInherited(PROPERTY_COLOR) && equal(newColor, color)) {
            return;
        }
        modifyingNode();
        setComputedColor(newColor);
        setInheritedQuiet(PROPERTY_COLOR, false);
        propagatePropertyState(PROPERTY_COLOR, color);
        modifiedNode();
    
public voidsetColorRelative(int propertyIndex, boolean isColorRelative)
Sets the input property as a color-relative property

param
propertyIndex index of the property for which the color relative state is set.
param
isColorRelative the new color relative state for the property at propertyIndex.

        if (isColorRelative && !isColorRelativeProperty(propertyIndex)) {
            throw new IllegalArgumentException();
        }
        
        if (isColorRelative(propertyIndex) == isColorRelative) {
            return;
        }

        modifyingNode();
        setColorRelativeQuiet(propertyIndex,
                              isColorRelative);

        if (isColorRelative) {
            // The property is now color relative. We store the relative
            // value in the on the node, i.e., the computed value.
            setPropertyState(propertyIndex, color);

            // Notify children that the inherited value has changed.
            propagatePropertyState(propertyIndex, color);
        }

        modifiedNode();
    
protected voidsetColorRelativeQuiet(int propertyIndex, boolean isColorRelative)
Implementation. Sets the input property as a color-relative property but does not generate modification events.

param
propertyIndex index of the property for which the color relative state is set.
param
isColorRelative the new color relative state for the property at propertyIndex.

        if (isColorRelative) {
            setMarker(propertyIndex << 21);
        } else {
            clearMarker(propertyIndex << 21);
        }
    
voidsetComputedColor(com.sun.perseus.j2d.RGB newColor)

param
newColor the new computed color property.

        color = newColor;

        // We need to recompute the fill and stroke colors if they are 
        // color-relative.
        if (isColorRelative(PROPERTY_FILL)) {
            setComputedFill(newColor);
            propagatePropertyState(PROPERTY_FILL, fill);
        }

        if (isColorRelative(PROPERTY_STROKE)) {
            setComputedStroke(newColor);
            propagatePropertyState(PROPERTY_STROKE, stroke);
        }
    
voidsetComputedDisplay(boolean newDisplay)

param
newDisplay the new computed display value

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

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

param
newFill the new computed fill property.

        this.fill = newFill;
    
voidsetComputedFillOpacity(float newFillOpacity)

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

                
        pack &= ~FILL_OPACITY_MASK;
        pack |= ((((int) (newFillOpacity * 200)) << 7) & FILL_OPACITY_MASK);
    
final voidsetComputedFillRule(int newFillRule)

param
newFillRule the new computed fillRule property value.

        if (newFillRule == WIND_NON_ZERO) {
            pack |= FILL_RULE_MASK;
        } else {
            pack &= ~FILL_RULE_MASK;
        }
    
voidsetComputedOpacity(float newOpacity)

param
newOpacity the new computed opacity property.

        pack2 &= ~OPACITY_MASK;
        pack2 |= (((int) (newOpacity * 200)) & OPACITY_MASK);
    
voidsetComputedStroke(com.sun.perseus.j2d.PaintServer newStroke)

param
newStroke the new computed stroke property.

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

param
newStrokeDashArray the new computed stroke-dasharray property value.

        strokeDashArray = newStrokeDashArray;
    
voidsetComputedStrokeDashOffset(float newStrokeDashOffset)

param
newStrokeDashOffset the new stroke-dashoffset computed property value.

        strokeDashOffset = newStrokeDashOffset;
    
voidsetComputedStrokeLineCap(int newStrokeLineCap)

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

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

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

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

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

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

param
newStrokeMiterLimit the new computed stroke-miterlimit property.

        strokeMiterLimit = newStrokeMiterLimit;        
    
voidsetComputedStrokeOpacity(float newStrokeOpacity)

param
newStrokeOpacity the new computed stroke-opacity property.

        pack &= ~STROKE_OPACITY_MASK;
        pack |= ((((int) (newStrokeOpacity * 200)) << 15) 
                & STROKE_OPACITY_MASK);
    
voidsetComputedStrokeWidth(float newStrokeWidth)

param
newStrokeWidth the new computed stroke-width property value.

        strokeWidth = newStrokeWidth;
    
voidsetComputedVisibility(boolean newVisibility)

param
newVisibility the new computed visibility property.

        if (newVisibility) {
            pack |= VISIBILITY_MASK;
        } else {
            pack &= ~VISIBILITY_MASK;
        }        
    
public voidsetDisplay(boolean newDisplay)
Setting the display property clears its inherited flag.

param
newDisplay new display property value

        if (!isInherited(PROPERTY_DISPLAY) 
            && newDisplay == getDisplay()) {
            return;
        }
        modifyingNode();
        setInheritedQuiet(PROPERTY_DISPLAY, false);
        setComputedDisplay(newDisplay);
        propagatePackedPropertyState(PROPERTY_DISPLAY, pack & DISPLAY_MASK);
        modifiedNode();
    
public voidsetFill(com.sun.perseus.j2d.PaintServer newFill)
Setting the fill property clears the inherited and color relative states (they are set to false).

param
newFill the new fill property

        if (!isInherited(PROPERTY_FILL) && equal(newFill, fill)) {
            return;
        }

        modifyingNode();
        if (fill != null) {
            fill.dispose();
        }
        
        setComputedFill(newFill);
        setInheritedQuiet(PROPERTY_FILL, false);
        setColorRelativeQuiet(PROPERTY_FILL, false);
        propagatePropertyState(PROPERTY_FILL, fill);
        modifiedNode();
    
public voidsetFillOpacity(float newFillOpacity)
Setting the fillOpacity property clears the inherited and color relative states (they are set to false).

param
newFillOpacity the new fill property

        if (!isInherited(PROPERTY_FILL_OPACITY) 
            && 
            newFillOpacity == getFillOpacity()) {
            return;
        }
        modifyingNode();
        if (newFillOpacity > 1) {
            newFillOpacity = 1;
        } else if (newFillOpacity < 0) {
            newFillOpacity = 0;
        }
        setInheritedQuiet(PROPERTY_FILL_OPACITY, false);
        setComputedFillOpacity(newFillOpacity);
        propagatePackedPropertyState(PROPERTY_FILL_OPACITY, 
                                     pack & FILL_OPACITY_MASK);
        modifiedNode();
    
public voidsetFillRule(int newFillRule)
Setting the fillRule property clears its inherited flag

param
newFillRule new fillRule property

        if (!isInherited(PROPERTY_FILL_RULE) 
            && 
            newFillRule == getFillRule()) {
            return;
        }

        modifyingNode();
        setInheritedQuiet(PROPERTY_FILL_RULE, false);
        setComputedFillRule(newFillRule);
        propagatePackedPropertyState(PROPERTY_FILL_RULE, pack & FILL_RULE_MASK);
        modifiedNode();
    
voidsetFloatArrayTrait(java.lang.String name, float[][] value)
Set the trait value as float array.

param
name the trait's name.
param
value the trait's value.
throws
DOMException with error code NOT_SUPPORTED_ERROR if the requested trait is not supported on this element.
throws
DOMException with error code TYPE_MISMATCH_ERR if the requested trait's value cannot be specified as a float
throws
DOMException with error code INVALID_ACCESS_ERR if the input value is an invalid value for the given trait.

        if (SVGConstants.SVG_STROKE_WIDTH_ATTRIBUTE == name) {
            checkPositive(name, value[0][0]);
            setStrokeWidth(value[0][0]);
        } else if (SVGConstants.SVG_STROKE_MITERLIMIT_ATTRIBUTE
                   .equals(name)) {
            if (value[0][0] < 1) {
                throw illegalTraitValue(name, Float.toString(value[0][0]));
            }

            setStrokeMiterLimit(value[0][0]);
        } else if (SVGConstants.SVG_STROKE_DASHOFFSET_ATTRIBUTE
                   .equals(name)) {
            setStrokeDashOffset(value[0][0]);
        } else if (SVGConstants.SVG_COLOR_ATTRIBUTE == name) {
            setColor(toRGB(name, value));
        } else if (SVGConstants.SVG_FILL_ATTRIBUTE == name) {
            setFill(toRGB(name, value));
        } else if (SVGConstants.SVG_STROKE_ATTRIBUTE == name) {
            setStroke(toRGB(name, value));
        } else if (SVGConstants.SVG_FILL_OPACITY_ATTRIBUTE == name) {
            setFillOpacity(value[0][0]);
        } else if (SVGConstants.SVG_STROKE_OPACITY_ATTRIBUTE == name) {
            setStrokeOpacity(value[0][0]);
        } else if (SVGConstants.SVG_STROKE_DASHARRAY_ATTRIBUTE
                   .equals(name)) {
            setStrokeDashArray(value[0]);
        } else if (SVGConstants.SVG_OPACITY_ATTRIBUTE == name) {
            setOpacity(value[0][0]);
         } else {
            super.setFloatArrayTrait(name, value);
        }    
    
public voidsetFloatInherited(int propertyIndex, boolean inherit)
Sets the given float-valued property's inheritance status

param
propertyIndex the index for the property whose inherited state is set
param
inherit the new property's state

        if (isInherited(propertyIndex) == inherit) {
            return;
        }
        modifyingNode();
        setInheritedQuiet(propertyIndex, inherit);

        if (inherit) {
            // The property is now inherited. We store the inherited
            // value on the node, which means we keep the computed value
            // on the node.
            float inheritedValue = 
                    getInheritedFloatPropertyState(propertyIndex);
            setFloatPropertyState(propertyIndex, inheritedValue);

            // Notify children that the inherited value has changed.
            propagateFloatPropertyState(propertyIndex, inheritedValue);
        }

        // If the value is not inherited, it means that we are in the middle of
        // specifying a value on the node. So we do not notify descendants, 
        // because this is done in the corresponding methods, e.g., setFill.

        modifiedNode();
    
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 PROPERTY_STROKE_WIDTH:
            setComputedStrokeWidth(propertyValue);
            break;
        case PROPERTY_STROKE_MITER_LIMIT:
            setComputedStrokeMiterLimit(propertyValue);
            break;
        case PROPERTY_STROKE_DASH_OFFSET:
            setComputedStrokeDashOffset(propertyValue);
            break;
        default: 
            super.setFloatPropertyState(propertyIndex, propertyValue);
            break;
        }
    
public voidsetFloatTraitImpl(java.lang.String name, float value)
Set the trait value as float. Supported float traits: stroke-width, stroke-miterlimit, stroke-dashoffset, fill-opacity, stroke-opacity, opacity.

param
name the name of the trait to set.
param
value the value of the trait to set.
throws
DOMException with error code NOT_SUPPORTED_ERROR if the requested trait is not supported on this element.
throws
DOMException with error code TYPE_MISMATCH_ERR if the requested trait's value cannot be specified as a float
throws
DOMException with error code INVALID_ACCESS_ERR if the input value is an invalid value for the given trait.
throws
SecurityException if the application does not have the necessary privilege rights to access this (SVG) content.

        if (SVGConstants.SVG_STROKE_WIDTH_ATTRIBUTE == name) {
            checkPositive(name, value);
            setStrokeWidth(value);
        } else if (SVGConstants.SVG_STROKE_MITERLIMIT_ATTRIBUTE == name) {
            if (value < 1) {
                throw illegalTraitValue(name, Float.toString(value));
            }
            setStrokeMiterLimit(value);
        } else if (SVGConstants.SVG_STROKE_DASHOFFSET_ATTRIBUTE == name) {
            setStrokeDashOffset(value);
        } else if (SVGConstants.SVG_FILL_OPACITY_ATTRIBUTE == name) {
            setFillOpacity(value);
        } else if (SVGConstants.SVG_STROKE_OPACITY_ATTRIBUTE == name) {
            setStrokeOpacity(value);
        } else if (SVGConstants.SVG_OPACITY_ATTRIBUTE == name) {
            setOpacity(value);
        } else {
            super.setFloatTraitImpl(name, value);
        }
    
public voidsetInherited(int propertyIndex, boolean inherit)
Sets the given Object-valued property's inheritance status

param
propertyIndex the index for the property whose inherited state is set
param
inherit the new property's state

        if (isInherited(propertyIndex) == inherit) {
            return;
        }
        modifyingNode();
        setInheritedQuiet(propertyIndex, inherit);

        if (inherit) {
            // The property is now inherited. We store the inherited
            // value on the node, which means we keep the computed value
            // on the node.
            Object inheritedValue = getInheritedPropertyState(propertyIndex);
            setPropertyState(propertyIndex, inheritedValue);

            // Notify children that the inherited value has changed.
            propagatePropertyState(propertyIndex, inheritedValue);
        }

        // If the value is not inherited, it means that we are in the middle of
        // specifying a value on the node. So we do not notify descendants, 
        // because this is done in the corresponding methods, e.g., setFill.

        modifiedNode();
    
protected voidsetInheritedQuiet(int propertyIndex, boolean inherit)
Implementation. Sets the input property's inheritance status, but does not send modification events.

param
propertyIndex the index for the property whose inherited state is set
param
inherit the new property's state

        if (inherit) {
            setMarker(propertyIndex);
        } else {
            clearMarker(propertyIndex);
        }
    
voidsetMarker(int marker)
Sets the input marker.

param
marker the marker to set.

        markers |= marker;
    
public voidsetOpacity(float newOpacity)
Setting the opacity property clears the inherited and color relative states (they are set to false).

param
newOpacity the new opacity property


        if (!isInherited(PROPERTY_OPACITY) && newOpacity == getOpacity()) {
            return;
        }

        modifyingNode();
        if (newOpacity > 1) {
            newOpacity = 1;
        } else if (newOpacity < 0) {
            newOpacity = 0;
        }

        setInheritedQuiet(PROPERTY_OPACITY, false);
        setComputedOpacity(newOpacity);
        propagatePackedPropertyState(PROPERTY_OPACITY, 
                                     pack2 & OPACITY_MASK);
        modifiedNode();
    
public voidsetPackedInherited(int propertyIndex, boolean inherit)
Sets the input packed property's inheritance status

param
propertyIndex the index for the property whose inherited state is set
param
inherit the new property's state

        if (isInherited(propertyIndex) == inherit) {
            return;
        }
        modifyingNode();
        setInheritedQuiet(propertyIndex, inherit);

        if (inherit) {
            // The property is now inherited. We store the inherited
            // value on the node, which means we keep the computed value
            // on the node.
            int inheritedValue = getInheritedPackedPropertyState(propertyIndex);
            setPackedPropertyState(propertyIndex, inheritedValue);

            // Notify children that the inherited value has changed.
            propagatePackedPropertyState(propertyIndex, inheritedValue);
        }

        // If the value is not inherited, it means that we are in the middle of
        // specifying a value on the node. So we do not notify descendants, 
        // because this is done in the corresponding methods, e.g., setFill.

        modifiedNode();
    
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 of the property.

        switch (propertyIndex) {
        case GraphicsNode.PROPERTY_FILL_RULE:
            if (propertyValue == 0) {
                setComputedFillRule(WIND_EVEN_ODD);
            } else {
                setComputedFillRule(WIND_NON_ZERO);
            }
            break;
        case GraphicsNode.PROPERTY_STROKE_LINE_JOIN:
            switch (propertyValue) {
                case CompositeGraphicsNode.JOIN_MITER_IMPL:
                    setComputedStrokeLineJoin(JOIN_MITER);
                    break;
                case CompositeGraphicsNode.JOIN_ROUND_IMPL:
                    setComputedStrokeLineJoin(JOIN_ROUND);
                    break;
                case CompositeGraphicsNode.JOIN_BEVEL_IMPL:
                default:
                    setComputedStrokeLineJoin(JOIN_BEVEL);
                    break;
            }
            break;
        case GraphicsNode.PROPERTY_STROKE_LINE_CAP:
            switch (propertyValue) {
                case CompositeGraphicsNode.CAP_BUTT_IMPL:
                    setComputedStrokeLineCap(CAP_BUTT);
                    break;
                case CompositeGraphicsNode.CAP_ROUND_IMPL:
                    setComputedStrokeLineCap(CAP_ROUND);
                    break;
                case CompositeGraphicsNode.CAP_SQUARE_IMPL:
                default:
                    setComputedStrokeLineCap(CAP_SQUARE);
                    break;
            }
            break;
        case GraphicsNode.PROPERTY_DISPLAY:
            if (propertyValue != 0) {
                setComputedDisplay(true);
            } else {
                setComputedDisplay(false);
            }
            break;
        case GraphicsNode.PROPERTY_VISIBILITY:
            if (propertyValue != 0) {
                setComputedVisibility(true);
            } else {
                setComputedVisibility(false);
            }
            break;
        case GraphicsNode.PROPERTY_FILL_OPACITY:
            setComputedFillOpacity((propertyValue >> 7) / 200.0f);
            break;
        case GraphicsNode.PROPERTY_STROKE_OPACITY:
            setComputedStrokeOpacity((propertyValue >> 15) / 200.0f);
            break;
        case GraphicsNode.PROPERTY_OPACITY:
            setComputedOpacity(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 PROPERTY_FILL:
            setComputedFill((PaintServer) propertyValue);
            break;
        case PROPERTY_STROKE:
            setComputedStroke((PaintServer) propertyValue);
            break;
        case PROPERTY_COLOR:
            setComputedColor((RGB) propertyValue);
            break;
        case PROPERTY_STROKE_DASH_ARRAY:            
            setComputedStrokeDashArray((float[]) propertyValue);
            break;
        default: 
            super.setPropertyState(propertyIndex, propertyValue);
            break;
        }
    
voidsetRGBColorTraitImpl(java.lang.String name, org.w3c.dom.svg.SVGRGBColor color)
Set the trait value as {@link org.w3c.dom.svg.SVGRGBColor SVGRGBColor}. Supported color traits: color, fill, stroke

param
name the name of the trait to set.
param
value the value of the trait to set.
throws
DOMException with error code NOT_SUPPORTED_ERROR if the requested trait is not supported on this element or null.
throws
DOMException with error code TYPE_MISMATCH_ERR if the requested trait's value cannot be specified as an {@link org.w3c.dom.svg.SVGRGBColor SVGRGBColor}
throws
DOMException with error code INVALID_ACCESS_ERR if the input value is null.
throws
SecurityException if the application does not have the necessary privilege rights to access this (SVG) content.

        try {
            // We use .equals here because the name string may not have been
            // interned.
            if (SVGConstants.SVG_FILL_ATTRIBUTE.equals(name)) {
                setFill((RGB) color);
            } else if (SVGConstants.SVG_STROKE_ATTRIBUTE .equals(name)) {
                setStroke((RGB) color);
            } else if (SVGConstants.SVG_COLOR_ATTRIBUTE .equals(name)) {
                setColor((RGB) color);
            } else {
                super.setRGBColorTraitImpl(name, color);
            } 
        } catch (IllegalArgumentException iae) {
            throw new DOMException(DOMException.INVALID_ACCESS_ERR, 
                                   iae.getMessage());
        }
    
public voidsetStroke(com.sun.perseus.j2d.PaintServer newStroke)
Setting the stroke clears the inherited and color relative states (i.e., they are set to false).

param
newStroke new stroke property.

        if (!isInherited(PROPERTY_STROKE) && equal(newStroke, stroke)) {
            return;
        }

        modifyingNode();
        if (newStroke != stroke) {
            if (stroke != null) {
                stroke.dispose();
            }
        }
        setInheritedQuiet(PROPERTY_STROKE, false);
        setColorRelativeQuiet(PROPERTY_STROKE, false);
        setComputedStroke(newStroke);
        propagatePropertyState(PROPERTY_STROKE, stroke);
        modifiedNode();
    
public voidsetStrokeDashArray(float[] newStrokeDashArray)
Setting the strokeDashArray property clears its inherited flag.

param
newStrokeDashArray new strokeDashArray property.

        if (!isInherited(PROPERTY_STROKE_DASH_ARRAY) 
                && equal(newStrokeDashArray, strokeDashArray)) {
            return;
        }
        modifyingNode();
        setComputedStrokeDashArray(newStrokeDashArray);
        setInheritedQuiet(PROPERTY_STROKE_DASH_ARRAY, false);
        propagatePropertyState(PROPERTY_STROKE_DASH_ARRAY, newStrokeDashArray);
        modifiedNode();
    
public voidsetStrokeDashOffset(float newStrokeDashOffset)
Setting the strokeDashOffset property clears its inherited flag.

param
newStrokeDashOffset new strokeDashOffset value

        if (!isInherited(PROPERTY_STROKE_DASH_OFFSET) 
                && newStrokeDashOffset == strokeDashOffset) {
            return;
        }

        modifyingNode();
        setComputedStrokeDashOffset(newStrokeDashOffset);
        setInheritedQuiet(PROPERTY_STROKE_DASH_OFFSET, false);
        propagateFloatPropertyState(PROPERTY_STROKE_DASH_OFFSET, 
                                    strokeDashOffset);
        modifiedNode();
    
public voidsetStrokeLineCap(int newStrokeLineCap)
Setting the strokeLineCap property clears the inherited flag

param
newStrokeLineCap new strokeLineCap property

        if (!isInherited(PROPERTY_STROKE_LINE_CAP) 
            && newStrokeLineCap == getStrokeLineCap()) {
            return;
        }
        modifyingNode();        
        setInheritedQuiet(PROPERTY_STROKE_LINE_CAP, false);
        setComputedStrokeLineCap(newStrokeLineCap);
        propagatePackedPropertyState(PROPERTY_STROKE_LINE_CAP, 
                                     pack & STROKE_LINE_CAP_MASK);
        modifiedNode();
    
public voidsetStrokeLineJoin(int newStrokeLineJoin)
Setting the strokeLineJoin property clears the inherited flag

param
newStrokeLineJoin new strokeLineJoin property

        if (!isInherited(PROPERTY_STROKE_LINE_JOIN) 
            && newStrokeLineJoin == getStrokeLineJoin()) {
            return;
        }
        modifyingNode();
        setInheritedQuiet(PROPERTY_STROKE_LINE_JOIN, false);
        setComputedStrokeLineJoin(newStrokeLineJoin);
        propagatePackedPropertyState(PROPERTY_STROKE_LINE_JOIN, 
                                     pack & STROKE_LINE_JOIN_MASK);
        modifiedNode();
    
public voidsetStrokeMiterLimit(float newStrokeMiterLimit)
Setting the strokeMiterLimit clears its inherited flag.

param
newStrokeMiterLimit new strokeMiterLimit property

        if (newStrokeMiterLimit < 1) {
            throw new IllegalArgumentException();
        }

        if (!isInherited(PROPERTY_STROKE_MITER_LIMIT) 
                && newStrokeMiterLimit == strokeMiterLimit) {
            return;
        }

        modifyingNode();
        setComputedStrokeMiterLimit(newStrokeMiterLimit);
        setInheritedQuiet(PROPERTY_STROKE_MITER_LIMIT, false);
        propagateFloatPropertyState(PROPERTY_STROKE_MITER_LIMIT, 
                                    strokeMiterLimit);
        modifiedNode();
    
public voidsetStrokeOpacity(float newStrokeOpacity)
Setting the strokeOpacity property clears the inherited and color relative states (they are set to false).

param
newStrokeOpacity the new stroke property

        if (!isInherited(PROPERTY_STROKE_OPACITY) && 
            newStrokeOpacity == getStrokeOpacity()) {
            return;
        }

        modifyingNode();
        if (newStrokeOpacity > 1) {
            newStrokeOpacity = 1;
        } else if (newStrokeOpacity < 0) {
            newStrokeOpacity = 0;
        }
        setInheritedQuiet(PROPERTY_STROKE_OPACITY, false);
        setComputedStrokeOpacity(newStrokeOpacity);
        propagatePackedPropertyState(PROPERTY_STROKE_OPACITY, 
                                     pack & STROKE_OPACITY_MASK);
        modifiedNode();
    
public voidsetStrokeWidth(float newStrokeWidth)
Setting the strokeWidth property clears its inherited flag.

param
newStrokeWidth new strokeWidth property. Should be positive or zero.

        if (newStrokeWidth < 0) {
            throw new IllegalArgumentException();
        }

        if (!isInherited(PROPERTY_STROKE_WIDTH) 
                && newStrokeWidth == strokeWidth) {
            return;
        }

        modifyingNode();
        setInheritedQuiet(PROPERTY_STROKE_WIDTH, false);
        setComputedStrokeWidth(newStrokeWidth);
        propagateFloatPropertyState(PROPERTY_STROKE_WIDTH, newStrokeWidth);
        modifiedNode();
    
public voidsetTraitImpl(java.lang.String name, java.lang.String value)
CompositeGraphicsNode handles the graphics node traits. Other attributes are handled by the super class. Supported traits: stroke-width, stroke-miterlimit, stroke-dashoffset, fill-rule, stroke-linejoin, stroke-linecap, display, visibility, color, fill, stroke, fill-opacity, stroke-opacity, stroke-dasharray, opacity

param
name the name of the trait to set.
param
value the value of the trait to set.
throws
DOMException with error code NOT_SUPPORTED_ERROR if the requested trait is not supported on this element or null.
throws
DOMException with error code TYPE_MISMATCH_ERR if the requested trait's value cannot be specified as a String
throws
DOMException with error code INVALID_ACCESS_ERR if the input value is an invalid value for the given trait or null.
throws
DOMException with error code NO_MODIFICATION_ALLOWED_ERR: if attempt is made to change readonly trait.

        if (SVGConstants.SVG_STROKE_WIDTH_ATTRIBUTE == name) {

            // ======================= stroke-width ===================== //

            if (SVGConstants.CSS_INHERIT_VALUE.equals(value)) {
                setFloatInherited(PROPERTY_STROKE_WIDTH, true);
            } else {
                setStrokeWidth(parsePositiveFloatTrait(name, value));
            }
        } else if (SVGConstants.SVG_STROKE_MITERLIMIT_ATTRIBUTE
                   .equals(name)) {

            // ===================== stroke-miterlimit ================== //

            if (SVGConstants.CSS_INHERIT_VALUE.equals(value)) {
                setFloatInherited(PROPERTY_STROKE_MITER_LIMIT, true);
            } else {
                float miter = parseFloatTrait(name, value);
                if (miter < 1) {
                    throw illegalTraitValue(name, value);
                }
                setStrokeMiterLimit(miter);
            }

        } else if (SVGConstants.SVG_STROKE_DASHOFFSET_ATTRIBUTE
                   .equals(name)) {

            // ===================== stroke-dashoffset ================== //

            if (SVGConstants.CSS_INHERIT_VALUE.equals(value)) {
                setFloatInherited(PROPERTY_STROKE_DASH_OFFSET, true);
            } else {
                setStrokeDashOffset(parseFloatTrait(name, value));
            }
        } else if (SVGConstants.SVG_FILL_RULE_ATTRIBUTE == name) { 

            // ========================= fill-rule ====================== //

            if (SVGConstants.CSS_NONZERO_VALUE.equals(value)) {
                setFillRule(GraphicsProperties.WIND_NON_ZERO);
            } else if (SVGConstants.CSS_EVENODD_VALUE.equals(value)) {
                setFillRule(GraphicsProperties.WIND_EVEN_ODD);
            } else if (SVGConstants.CSS_INHERIT_VALUE.equals(value)) {
                setPackedInherited(PROPERTY_FILL_RULE, true);
            } else {
                throw illegalTraitValue(name, value);
            }
        } else if (SVGConstants.SVG_STROKE_LINEJOIN_ATTRIBUTE == name) {

            // ==================== stroke-linejoin ===================== //

            if (SVGConstants.CSS_MITER_VALUE.equals(value)) {
                setStrokeLineJoin(GraphicsProperties.JOIN_MITER);
            } else if (SVGConstants.CSS_ROUND_VALUE.equals(value)) {
                setStrokeLineJoin(GraphicsProperties.JOIN_ROUND);
            } else if (SVGConstants.CSS_BEVEL_VALUE.equals(value)) {
                setStrokeLineJoin(GraphicsProperties.JOIN_BEVEL);
            } else if (SVGConstants.CSS_INHERIT_VALUE.equals(value)) {
                setPackedInherited(PROPERTY_STROKE_LINE_JOIN, true);
            } else {
                throw illegalTraitValue(name, value);
            }
        } else if (SVGConstants.SVG_STROKE_LINECAP_ATTRIBUTE == name) {

            // ====================== stroke-linecap ==================== //

            if (SVGConstants.CSS_BUTT_VALUE.equals(value)) {
                setStrokeLineCap(GraphicsProperties.CAP_BUTT);
            } else if (SVGConstants.CSS_ROUND_VALUE.equals(value)) {
                setStrokeLineCap(GraphicsProperties.CAP_ROUND);
            } else if (SVGConstants.CSS_SQUARE_VALUE.equals(value)) {
                setStrokeLineCap(GraphicsProperties.CAP_SQUARE);
            } else if (SVGConstants.CSS_INHERIT_VALUE.equals(value)) {
                setPackedInherited(PROPERTY_STROKE_LINE_CAP, true);
            } else {
                throw illegalTraitValue(name, value);
            }
        } else if (SVGConstants.SVG_DISPLAY_ATTRIBUTE == name) {

            // ======================== display ========================= //

            if (SVGConstants.CSS_NONE_VALUE.equals(value)) {
                setDisplay(false);
            } else if (SVGConstants.CSS_INHERIT_VALUE.equals(value)) {
                if (!isInherited(PROPERTY_DISPLAY)) {
                    setPackedInherited(PROPERTY_DISPLAY, true);
                }
            } else if (SVGConstants.CSS_BLOCK_VALUE.equals(value)
                       ||
                       SVGConstants.CSS_COMPACT_VALUE.equals(value)
                       ||
                       SVGConstants.CSS_INLINE_TABLE_VALUE.equals(value)
                       ||
                       SVGConstants.CSS_INLINE_VALUE.equals(value)
                       ||
                       SVGConstants.CSS_LIST_ITEM_VALUE.equals(value)
                       ||
                       SVGConstants.CSS_MARKER_VALUE.equals(value)
                       ||
                       SVGConstants.CSS_RUN_IN_VALUE.equals(value)
                       ||
                       SVGConstants.CSS_TABLE_VALUE.equals(value)
                       ||
                       SVGConstants.CSS_TABLE_ROW_GROUP_VALUE.equals(value)
                       ||
                       SVGConstants.CSS_TABLE_HEADER_GROUP_VALUE.equals(value)
                       ||
                       SVGConstants.CSS_TABLE_FOOTER_GROUP_VALUE.equals(value)
                       ||
                       SVGConstants.CSS_TABLE_ROW_VALUE.equals(value)
                       ||
                       SVGConstants.CSS_TABLE_COLUMN_GROUP_VALUE.equals(value)
                       ||
                       SVGConstants.CSS_TABLE_COLUMN_VALUE.equals(value)
                       ||
                       SVGConstants.CSS_TABLE_CELL_VALUE.equals(value)
                       ||
                       SVGConstants.CSS_TABLE_CAPTION_VALUE.equals(value)) {
                setDisplay(true);
            } else {
                throw illegalTraitValue(name, value);
            }
        } else if (SVGConstants.SVG_VISIBILITY_ATTRIBUTE == name) {

            // ======================= visibility ======================= //

            if (SVGConstants.CSS_INHERIT_VALUE.equals(value)) {
                setPackedInherited(PROPERTY_VISIBILITY, true);
            } else if (SVGConstants.CSS_HIDDEN_VALUE.equals(value)
                       ||
                       SVGConstants.CSS_COLLAPSE_VALUE.equals(value)) {
                setVisibility(false);
            } else if (SVGConstants.CSS_VISIBLE_VALUE.equals(value)) {
                setVisibility(true);
            } else {
                throw illegalTraitValue(name, value);
            }
        } else if (SVGConstants.SVG_COLOR_ATTRIBUTE == name) {

            // ========================= color ========================== //

            if (SVGConstants.CSS_INHERIT_VALUE.equals(value)) {
                setInherited(PROPERTY_COLOR, true);
            } else if (SVGConstants.CSS_NONE_VALUE.equals(value)) {
                // 'none' is not a legal value for 'color'
                throw illegalTraitValue(name, value);
            } else {
                RGB color = parseColorTrait
                    (SVGConstants.SVG_COLOR_ATTRIBUTE, value);
                setColor(color);
            }
        } else if (SVGConstants.SVG_FILL_ATTRIBUTE == name) {

            // ========================= fill =========================== //

            if (SVGConstants.CSS_INHERIT_VALUE.equals(value)) {
                setInherited(PROPERTY_FILL, true);
                setColorRelative(PROPERTY_FILL, false);
            } else if (SVGConstants.CSS_NONE_VALUE.equals(value)) {
                setFill(null);
            } else if (SVGConstants.CSS_CURRENTCOLOR_VALUE.equals(value)) {
                setColorRelative(PROPERTY_FILL, true);
                setInherited(PROPERTY_FILL, false);
            } else {
                PaintServer fill = parsePaintTrait
                    (SVGConstants.SVG_FILL_ATTRIBUTE, this, value);
                if (fill != null) {
                    setFill(fill);
                }
            }
        } else if (SVGConstants.SVG_STROKE_ATTRIBUTE == name) {

            // ========================= stroke ========================= //

            if (SVGConstants.CSS_INHERIT_VALUE.equals(value)) {
                setInherited(PROPERTY_STROKE, true);
                setColorRelative(PROPERTY_STROKE, false);
            } else if (SVGConstants.CSS_NONE_VALUE.equals(value)) {
                setStroke(null);
            } else if (SVGConstants.CSS_CURRENTCOLOR_VALUE.equals(value)) {
                setColorRelative(PROPERTY_STROKE, true);
                setInherited(PROPERTY_STROKE, false);
            } else {
                PaintServer stroke = parsePaintTrait
                    (SVGConstants.SVG_STROKE_ATTRIBUTE, this, value);
                if (stroke != null) {
                    setStroke(stroke);
                }
            }
        } else if (SVGConstants.SVG_FILL_OPACITY_ATTRIBUTE == name) {

            // ====================== fill-opacity ======================= //

            if (SVGConstants.CSS_INHERIT_VALUE.equals(value)) {
                setPackedInherited(PROPERTY_FILL_OPACITY, true);
            } else {
                setFillOpacity(parseFloatTrait(name, value));
            }
        } else if (SVGConstants.SVG_STROKE_OPACITY_ATTRIBUTE
                   .equals(name)) {

            // ================= stroke-opacity ========================= //

            if (SVGConstants.CSS_INHERIT_VALUE.equals(value)) {
                setPackedInherited(PROPERTY_STROKE_OPACITY, true);
            } else {
                setStrokeOpacity(parseFloatTrait(name, value));
            }
        } else if (SVGConstants.SVG_STROKE_DASHARRAY_ATTRIBUTE
                   .equals(name)) {

            // ==================== stroke-dasharray ==================== //

            if (SVGConstants.CSS_INHERIT_VALUE.equals(value)) {
                setInherited(PROPERTY_STROKE_DASH_ARRAY, true);
            } else if (SVGConstants.CSS_NONE_VALUE.equals(value)) {
                setStrokeDashArray(null);
            } else {
                setStrokeDashArray(parsePositiveFloatArrayTrait(name, value));
            }
        } else if (SVGConstants.SVG_OPACITY_ATTRIBUTE
                   .equals(name)) {

            // ================= opacity ========================= //

            if (SVGConstants.CSS_INHERIT_VALUE.equals(value)) {
                setPackedInherited(PROPERTY_OPACITY, true);
            } else {
                setOpacity(parseFloatTrait(name, value));
            }
        } else {
            super.setTraitImpl(name, value);
        }
    
public voidsetVisibility(boolean newVisibility)
Setting the visibility clears its inherited flag.

param
newVisibility the new visibility value

        if (!isInherited(PROPERTY_VISIBILITY) 
            && newVisibility == getVisibility()) {
            return;
        }
        modifyingNode();
        setComputedVisibility(newVisibility);
        setInheritedQuiet(PROPERTY_VISIBILITY, false);
        propagatePackedPropertyState(PROPERTY_VISIBILITY, 
                                     pack & VISIBILITY_MASK);
        modifiedNode();
    
java.lang.StringstrokeLineCapToStringTrait(int strokeLineCap)

param
strokeLineCap the value to convert.
return
the converted value.

        switch (strokeLineCap) {
        case CompositeGraphicsNode.CAP_BUTT_IMPL:
            return SVGConstants.CSS_BUTT_VALUE;
        case CompositeGraphicsNode.CAP_ROUND_IMPL:
            return SVGConstants.CSS_ROUND_VALUE;
        case CompositeGraphicsNode.CAP_SQUARE_IMPL:
        default:
            return SVGConstants.CSS_SQUARE_VALUE;
        }
    
java.lang.StringstrokeLineJoinToStringTrait(int strokeLineJoin)

param
strokeLineJoin the value to convert. In packed form, but with mask applied.
return
the converted value.

        switch (strokeLineJoin) {
        case CompositeGraphicsNode.JOIN_MITER_IMPL:
            return SVGConstants.CSS_MITER_VALUE;
        case CompositeGraphicsNode.JOIN_ROUND_IMPL:
            return SVGConstants.CSS_ROUND_VALUE;
        default:
            return SVGConstants.CSS_BEVEL_VALUE;
        }
    
booleansupportsTrait(java.lang.String traitName)
Supported traits: stroke-width, stroke-miterlimit, stroke-dashoffset, fill-rule, stroke-linejoin, stroke-linecap, display, visibility, color, fill, stroke, fill-opacity, stroke-opacity, stroke-dasharray, opacity

param
traitName the name of the trait which the element may support.
return
true if this element supports the given trait in one of the trait accessor methods.

        if (SVGConstants.SVG_STROKE_WIDTH_ATTRIBUTE == traitName
            ||
            SVGConstants.SVG_STROKE_MITERLIMIT_ATTRIBUTE == traitName
            ||
            SVGConstants.SVG_STROKE_DASHOFFSET_ATTRIBUTE == traitName
            ||
            SVGConstants.SVG_FILL_RULE_ATTRIBUTE == traitName
            || 
            SVGConstants.SVG_STROKE_LINEJOIN_ATTRIBUTE == traitName
            ||
            SVGConstants.SVG_STROKE_LINECAP_ATTRIBUTE == traitName
            ||
            SVGConstants.SVG_DISPLAY_ATTRIBUTE == traitName
            ||
            SVGConstants.SVG_VISIBILITY_ATTRIBUTE == traitName
            ||
            SVGConstants.SVG_COLOR_ATTRIBUTE == traitName
            ||
            SVGConstants.SVG_FILL_ATTRIBUTE == traitName
            ||
            SVGConstants.SVG_STROKE_ATTRIBUTE == traitName
            ||
            SVGConstants.SVG_FILL_OPACITY_ATTRIBUTE == traitName
            ||
            SVGConstants.SVG_STROKE_OPACITY_ATTRIBUTE == traitName
            ||
            SVGConstants.SVG_STROKE_DASHARRAY_ATTRIBUTE == traitName
            ||
            SVGConstants.SVG_OPACITY_ATTRIBUTE == traitName)  {
            return true;
        } else {
            return super.supportsTrait(traitName);
        }
    
java.lang.StringtoStringTrait(java.lang.String name, float[][] value)

param
name the name of the trait to convert.
param
value the float trait value to convert.

        if (SVGConstants.SVG_STROKE_WIDTH_ATTRIBUTE == name
            ||
            SVGConstants.SVG_STROKE_MITERLIMIT_ATTRIBUTE == name
            ||
            SVGConstants.SVG_STROKE_DASHOFFSET_ATTRIBUTE == name
            ||
            SVGConstants.SVG_FILL_OPACITY_ATTRIBUTE == name
            ||
            SVGConstants.SVG_STROKE_OPACITY_ATTRIBUTE == name
            ||
            SVGConstants.SVG_OPACITY_ATTRIBUTE == name) {
            return Float.toString(value[0][0]);
        } else if (SVGConstants.SVG_COLOR_ATTRIBUTE == name
                   ||
                   SVGConstants.SVG_FILL_ATTRIBUTE == name
                   ||
                   SVGConstants.SVG_STROKE_ATTRIBUTE == name) {
            return toRGBString(name, value);
        } else if (SVGConstants.SVG_STROKE_DASHARRAY_ATTRIBUTE == name) {
            return toStringTrait(value[0]);
        } 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 float input trait value.

param
traitName the name of the trait to be validated.
param
value the value to be validated
param
reqNamespaceURI the namespace of the element requesting validation.
param
reqLocalName the local name of the element requesting validation.
param
reqTraitNamespace the namespace of the trait which has the values value on the requesting element.
param
reqTraitName the name of the trait which has the values value on the requesting element.
throws
DOMException with error code INVALID_ACCESS_ERR if the input value is incompatible with the given trait.

        if (SVGConstants.SVG_STROKE_WIDTH_ATTRIBUTE == traitName) {
            return new float[][] { 
                        {parsePositiveFloatTrait(traitName, value)} 
                    };
        } else if (SVGConstants.SVG_STROKE_MITERLIMIT_ATTRIBUTE
                   .equals(traitName)) {
            float miter = parseFloatTrait(traitName, value);
            if (miter < 1) {
                throw illegalTraitValue(traitName, value);
            }
            return new float[][] { {miter} };
        } else if (SVGConstants.SVG_STROKE_DASHOFFSET_ATTRIBUTE
                   .equals(traitName)) {
            return new float[][] { {parseFloatTrait(traitName, value)} };
        } else if (SVGConstants.SVG_FILL_RULE_ATTRIBUTE == traitName
                   ||
                   SVGConstants.SVG_STROKE_LINEJOIN_ATTRIBUTE == traitName
                   ||
                   SVGConstants.SVG_STROKE_LINECAP_ATTRIBUTE == traitName
                   ||
                   SVGConstants.SVG_DISPLAY_ATTRIBUTE == traitName
                   ||
                   SVGConstants.SVG_VISIBILITY_ATTRIBUTE == traitName)  {
            throw unsupportedTraitType(traitName, TRAIT_TYPE_FLOAT);
        } else if (SVGConstants.SVG_COLOR_ATTRIBUTE == traitName) {
            RGB color = GraphicsProperties.INITIAL_COLOR;
            if (SVGConstants.CSS_INHERIT_VALUE.equals(value)) {
                color = (RGB) getInheritedPropertyState(PROPERTY_COLOR);
            } else {
                color = parseColorTrait
                    (SVGConstants.SVG_COLOR_ATTRIBUTE, value);
            }

            if (color == null) {
                throw illegalTraitValue(traitName, value);
            }
            return new float[][] {
                        {color.getRed(), color.getGreen(), color.getBlue()}
                    };
        } else if (SVGConstants.SVG_FILL_ATTRIBUTE == traitName) {
            RGB color = GraphicsProperties.INITIAL_FILL;
            if (SVGConstants.CSS_INHERIT_VALUE.equals(value)) {
                color = (RGB) getInheritedPropertyState(PROPERTY_FILL);
            } else if (SVGConstants.CSS_CURRENTCOLOR_VALUE.equals(value)) {
                color = this.color;
            } else {
                color = parseColorTrait
                    (SVGConstants.SVG_FILL_ATTRIBUTE, value);
            }

            if (color == null) {
                throw illegalTraitValue(traitName, value);
            }
            return new float[][] {
                        {color.getRed(), color.getGreen(), color.getBlue()}
                    };
        } else if (SVGConstants.SVG_STROKE_ATTRIBUTE == traitName) {
            RGB color = GraphicsProperties.INITIAL_STROKE;
            if (SVGConstants.CSS_INHERIT_VALUE.equals(value)) {
                color = (RGB) getInheritedPropertyState(PROPERTY_STROKE);
            } else if (SVGConstants.CSS_CURRENTCOLOR_VALUE.equals(value)) {
                color = getColor();
            } else {
                color = parseColorTrait
                    (SVGConstants.SVG_STROKE_ATTRIBUTE, value);
            }

            if (color == null) {
                throw illegalTraitValue(traitName, value);
            }
            return new float[][] {
                        {color.getRed(), color.getGreen(), color.getBlue()}
                    };
        } else if (SVGConstants.SVG_FILL_OPACITY_ATTRIBUTE == traitName) {
            float v = GraphicsNode.INITIAL_FILL_OPACITY;
            if (SVGConstants.CSS_INHERIT_VALUE.equals(value)) {
                if (parent != null) {
                    v = (getInheritedPackedPropertyState(PROPERTY_FILL_OPACITY)
                            >> 7) / 200.0f;
                }
            } else {
                v = parseFloatTrait(traitName, value);
                if (v < 0) {
                    v = 0;
                } else if (v > 1) {
                    v = 1;
                }
            }
            return new float[][] {{v}};
        } else if (SVGConstants.SVG_STROKE_OPACITY_ATTRIBUTE == traitName) {
            float v = GraphicsProperties.INITIAL_STROKE_OPACITY;
            if (SVGConstants.CSS_INHERIT_VALUE.equals(value)) {
                v = (getInheritedPackedPropertyState(PROPERTY_STROKE_OPACITY) 
                        >> 15) / 200.0f;
            } else {
                v = parseFloatTrait(traitName, value);
                if (v < 0) {
                    v = 0;
                } else if (v > 1) {
                    v = 1;
                }
            }
            return new float[][] {{v}};
        } else if (SVGConstants.SVG_STROKE_DASHARRAY_ATTRIBUTE
                   .equals(traitName)) {
            float[] da = parsePositiveFloatArrayTrait(traitName, value);
            if (da == null) {
                throw illegalTraitValue(traitName, value);
            } else {
                return new float[][] {da};
            }
        } else if (SVGConstants.SVG_OPACITY_ATTRIBUTE == traitName) {
            float v = GraphicsProperties.INITIAL_OPACITY;
            if (SVGConstants.CSS_INHERIT_VALUE.equals(value)) {
                v = getInheritedPackedPropertyState(PROPERTY_OPACITY) / 
                        200.0f;
            } else {
                v = parseFloatTrait(traitName, value);
                if (v < 0) {
                    v = 0;
                } else if (v > 1) {
                    v = 1;
                }
            }
            return new float[][] {{v}};
        } else {
            return super.validateFloatArrayTrait(traitName,
                                                 value,
                                                 reqNamespaceURI,
                                                 reqLocalName,
                                                 reqTraitNamespace,
                                                 reqTraitName);
        }
                      
    
java.lang.StringvalidateTraitNS(java.lang.String namespaceURI, 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.

param
namespaceURI the trait's namespace URI.
param
traitName the name of the trait to be validated.
param
value the value to be validated
param
reqNamespaceURI the namespace of the element requesting validation.
param
reqLocalName the local name of the element requesting validation.
param
reqTraitNamespace the namespace of the trait which has the values value on the requesting element.
param
reqTraitName the name of the trait which has the values value on the requesting element.
throws
DOMException with error code INVALID_ACCESS_ERR if the input value is incompatible with the given trait.

        if (namespaceURI != null && namespaceURI != NULL_NS) {
            return super.validateTraitNS(namespaceURI,
                                         traitName,
                                         value,
                                         reqNamespaceURI,
                                         reqLocalName,
                                         reqTraitNamespace,
                                         reqTraitName);
        }

        if (SVGConstants.SVG_STROKE_WIDTH_ATTRIBUTE == traitName
            ||
            SVGConstants.SVG_STROKE_MITERLIMIT_ATTRIBUTE == traitName
            ||
            SVGConstants.SVG_STROKE_DASHOFFSET_ATTRIBUTE == traitName
            ||
            SVGConstants.SVG_COLOR_ATTRIBUTE == traitName
            ||
            SVGConstants.SVG_FILL_ATTRIBUTE == traitName
            ||
            SVGConstants.SVG_STROKE_ATTRIBUTE == traitName
            ||
            SVGConstants.SVG_FILL_OPACITY_ATTRIBUTE == traitName
            ||
            SVGConstants.SVG_STROKE_OPACITY_ATTRIBUTE == traitName
            ||
            SVGConstants.SVG_STROKE_DASHARRAY_ATTRIBUTE
            .equals(traitName)
            ||
            SVGConstants.SVG_OPACITY_ATTRIBUTE == traitName) {
            throw unsupportedTraitType(traitName, TRAIT_TYPE_FLOAT);
        } else if (SVGConstants.SVG_FILL_RULE_ATTRIBUTE == traitName) {
            if (SVGConstants.CSS_INHERIT_VALUE.equals(value)) {
                return fillRuleToStringTrait
                        (getInheritedPackedPropertyState(PROPERTY_FILL_RULE));
            }

            if (!SVGConstants.CSS_NONZERO_VALUE.equals(value)
                &&
                !SVGConstants.CSS_EVENODD_VALUE.equals(value)) {
                throw illegalTraitValue(traitName, value);
            }

            return value;
        } else if (SVGConstants.SVG_STROKE_LINEJOIN_ATTRIBUTE == traitName) {
            if (SVGConstants.CSS_INHERIT_VALUE.equals(value)) {
                return strokeLineJoinToStringTrait(
                        getInheritedPackedPropertyState(
                            PROPERTY_STROKE_LINE_JOIN));
            }

            if (!SVGConstants.CSS_MITER_VALUE.equals(value)
                &&
                !SVGConstants.CSS_ROUND_VALUE.equals(value)
                &&
                !SVGConstants.CSS_BEVEL_VALUE.equals(value)) {
                throw illegalTraitValue(traitName, value);
            }

            return value;
        } else if (SVGConstants.SVG_STROKE_LINECAP_ATTRIBUTE == traitName) {
            if (SVGConstants.CSS_INHERIT_VALUE.equals(value)) {
                return strokeLineCapToStringTrait(
                        getInheritedPackedPropertyState(
                            PROPERTY_STROKE_LINE_CAP));
            }

            if (!SVGConstants.CSS_BUTT_VALUE.equals(value)
                &&
                !SVGConstants.CSS_ROUND_VALUE.equals(value)
                &&
                !SVGConstants.CSS_SQUARE_VALUE.equals(value)) {
                throw illegalTraitValue(traitName, value);
            }

            return value;
        } else if (SVGConstants.SVG_DISPLAY_ATTRIBUTE == traitName) {
            if (SVGConstants.CSS_INHERIT_VALUE.equals(value)) {
                if (getInheritedPackedPropertyState(PROPERTY_DISPLAY) != 0) {
                    return SVGConstants.CSS_INLINE_VALUE;
                }
                return SVGConstants.CSS_NONE_VALUE;
            }

            if (!SVGConstants.CSS_INLINE_VALUE.equals(value)
                &&
                !SVGConstants.CSS_NONE_VALUE.equals(value)) {
                throw illegalTraitValue(traitName, value);
            }

            return value;
        } else if (SVGConstants.SVG_VISIBILITY_ATTRIBUTE == traitName) {
            if (SVGConstants.CSS_INHERIT_VALUE.equals(value)) {
                if (getInheritedPackedPropertyState(PROPERTY_VISIBILITY) != 0) {
                    return SVGConstants.CSS_VISIBLE_VALUE;
                } else {
                    return SVGConstants.CSS_HIDDEN_VALUE;
                }
            }

            if (!SVGConstants.CSS_VISIBLE_VALUE.equals(value)
                &&
                !SVGConstants.CSS_HIDDEN_VALUE.equals(value)) {
                throw illegalTraitValue(traitName, value);
            }

            return value;
        } 

        return super.validateTraitNS(namespaceURI,
                                     traitName,
                                     value,
                                     reqNamespaceURI,
                                     reqLocalName,
                                     reqTraitNamespace,
                                     reqTraitName);