2002/css-validator/org/w3c/css/properties/svg AlignmentBaseline.java,NONE,1.1 AtRuleColorProfile.java,NONE,1.1 ClipPath.java,NONE,1.1 ClipRule.java,NONE,1.1 ColorInterpolation.java,NONE,1.1 ColorInterpolationFilters.java,NONE,1.1 ColorProfile.java,NONE,1.1 ColorProfileName.java,NONE,1.1 ColorProfileSrc.java,NONE,1.1 ColorRendering.java,NONE,1.1 CssRenderIntent.java,NONE,1.1 DominantBaseLine.java,NONE,1.1 EnableBackground.java,NONE,1.1 Fill.java,NONE,1.1 FillOpacity.java,NONE,1.1 FillRule.java,NONE,1.1 Filter.java,NONE,1.1 FloodColor.java,NONE,1.1 FloodOpacity.java,NONE,1.1 ImageRendering.java,NONE,1.1 Kerning.java,NONE,1.1 LightingColor.java,NONE,1.1 Marker.java,NONE,1.1 MarkerEnd.java,NONE,1.1 MarkerMid.java,NONE,1.1 MarkerStart.java,NONE,1.1 Mask.java,NONE,1.1 PointerEvents.java,NONE,1.1 SVGBasicStyle.java,NONE,1.1 SVGStyle.java,NONE,1.1 SVGTinyStyle.java,NONE,1.1 ShapeRendering.java,NONE,1.1 SolidColor.java,NONE,1.1 SolidOpacity.java,NONE,1.1 StopColor.java,NONE,1.1 StopOpacity.java,NONE,1.1 Str

Update of /sources/public/2002/css-validator/org/w3c/css/properties/svg
In directory hutz:/tmp/cvs-serv7360/properties/svg

Added Files:
	AlignmentBaseline.java AtRuleColorProfile.java ClipPath.java 
	ClipRule.java ColorInterpolation.java 
	ColorInterpolationFilters.java ColorProfile.java 
	ColorProfileName.java ColorProfileSrc.java ColorRendering.java 
	CssRenderIntent.java DominantBaseLine.java 
	EnableBackground.java Fill.java FillOpacity.java FillRule.java 
	Filter.java FloodColor.java FloodOpacity.java 
	ImageRendering.java Kerning.java LightingColor.java 
	Marker.java MarkerEnd.java MarkerMid.java MarkerStart.java 
	Mask.java PointerEvents.java SVGBasicStyle.java SVGStyle.java 
	SVGTinyStyle.java ShapeRendering.java SolidColor.java 
	SolidOpacity.java StopColor.java StopOpacity.java Stroke.java 
	StrokeDashArray.java StrokeDashOffset.java StrokeLineCap.java 
	StrokeLinejoin.java StrokeMiterLimit.java StrokeOpacity.java 
	StrokeWidth.java TextAnchor.java TextRendering.java 
	WritingModeSVG.java 
Log Message:
Patch by Jean-Guilhem Rouel

Better handling of media and properties files
Major reorganization of those properties files



--- NEW FILE: DominantBaseLine.java ---
//
// $Id: DominantBaseLine.java,v 1.1 2005/08/23 16:25:02 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, Keio University)
// Please first read the full copyright statement at
// http://www.w3.org/Consortium/Legal/copyright-software-19980720

package org.w3c.css.properties.svg;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssIdent;
import org.w3c.css.values.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> auto || use-script || no-change || reset-size ||
 *  ideographic || alphabetic || hanging || mathematical ||
 *  central || middle || text-after-edge || text-before-edge || text-top ||
 * text-bottom || inherit <BR>
 *  <EM>Initial:</EM>auto<BR>
 *  <EM>Applies to:</EM>inline-level elements<BR>
 *  <EM>Inherited:</EM>no<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 *  <P>
 *  The 'dominant-baseline' property is used:
 *   <UL>
 *     <LI>to determine the dominant baseline
 *     <LI>to select the baseline-table
 *     <LI>to establish the font-size used with the baseline-table
 *   </UL>
 */

public class DominantBaseLine extends CssProperty {
    
    CssValue dombaseline;
    
    static CssIdent auto = new CssIdent("auto");
    
    private static String[] values = {
	"auto", "use-script", "no-change", "reset-size",
	"ideographic", "alphabetic", "hanging", "mathematical",
	"central", "middle", "text-after-edge", "text-before-edge",
	"text-top", "text-bottom", "inherit"
    };
    
    /**
     * Create a new DominantBaseLine
     */
    public DominantBaseLine() {
	dombaseline = auto;
    }
    
    /**
     * Create a new DominantBaseLine
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public DominantBaseLine(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	
	setByUser();
	CssValue val = expression.getValue();
	
	int i = 0;
	for (; i < values.length; i++) {
	    if (val.toString().equals(values[i])) {
		dombaseline = val;
		expression.next();
		break;
	    }
	}
	if (i == values.length) {
	    throw new InvalidParamException("value", expression.getValue(),
		    getPropertyName(), ac);
	}
    }
    
    public DominantBaseLine(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((SVGStyle) style).dominantBaseLine != null)
	    style.addRedefinitionWarning(ac, this);
	((SVGStyle) style).dominantBaseLine = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((SVGStyle) style).getDominantBaseLineSVG();
	}
	else {
	    return ((SVGStyle) style).dominantBaseLine;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof DominantBaseLine &&
		dombaseline.equals(((DominantBaseLine) property).dombaseline));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "dominant-baseline";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return dombaseline;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return dombaseline.equals(inherit);
    }
    
    /**
     * Returns a string representation of the object
     */
    public String toString() {
	return dombaseline.toString();
    }
    
    /**
     * Is the value of this property a default value
     * It is used by alle macro for the function <code>print</code>
     */
    public boolean isDefault() {
	return (dombaseline == auto);
    }
    
}



--- NEW FILE: ImageRendering.java ---
//
// $Id: ImageRendering.java,v 1.1 2005/08/23 16:25:02 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, Keio University)
// Please first read the full copyright statement at
// http://www.w3.org/Consortium/Legal/copyright-software-19980720

package org.w3c.css.properties.svg;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssIdent;
import org.w3c.css.values.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> auto || optimizeSpeed || optimizeQuality || inherit<BR>
 *  <EM>Initial:</EM>auto<BR>
 *  <EM>Applies to:</EM>images<BR>
 *  <EM>Inherited:</EM>yes<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 */

public class ImageRendering extends CssProperty {
    
    CssValue rendering;
    ApplContext ac;
    
    CssIdent auto = new CssIdent("auto");
    CssIdent optimizeSpeed = new CssIdent("optimizeSpeed");
    CssIdent optimizeQuality = new CssIdent("optimizeQuality");
    
    /**
     * Create a new Rendering
     */
    public ImageRendering() {
	//nothing to do
    }
    
    /**
     * Create a new ImageRendering
     *
     * @param expression The expression for this property     
     * @exception InvalidParamException Values are incorrect
     */
    public ImageRendering(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	this.ac = ac;
	setByUser(); // tell this property is set by the user
	CssValue val = expression.getValue();
	
	if (val.equals(inherit)) {
	    rendering = inherit;
	    expression.next();
	} else if (val.equals(optimizeSpeed)) {
	    rendering = val;
	    expression.next();
	} else if (val.equals(optimizeQuality)) {
	    rendering = val;
	    expression.next();
	} else if (val.equals(auto)) {
	    rendering = auto;
	    expression.next();
	}
	else {
	    throw new InvalidParamException("value", val.toString(), getPropertyName(), ac);
	}
    }
    
    public ImageRendering(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((SVGStyle) style).imageRendering != null)
	    style.addRedefinitionWarning(ac, this);
	((SVGStyle) style).imageRendering = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */  
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((SVGStyle) style).getImageRendering();
	} else {
	    return ((SVGStyle) style).imageRendering;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */  
    public boolean equals(CssProperty property) {
	return (property instanceof ImageRendering && 
		rendering.equals( ((ImageRendering) property).rendering));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "image-rendering";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return rendering;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return rendering.equals(inherit);
    }
    
    /**
     * Returns a string representation of the object
     */
    public String toString() {
	return rendering.toString();
    }
    
    /**
     * Is the value of this property a default value
     * It is used by all macro for the function <code>print</code>
     */
    public boolean isDefault() {	
	return (rendering == auto);
    }
    
}

--- NEW FILE: LightingColor.java ---
//
// $Id: LightingColor.java,v 1.1 2005/08/23 16:25:02 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, Keio University)
// Please first read the full copyright statement at
// http://www.w3.org/Consortium/Legal/copyright-software-19980720

package org.w3c.css.properties.svg;

import java.util.Vector;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssColor;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssFunction;
import org.w3c.css.values.CssIdent;
import org.w3c.css.values.CssNumber;
import org.w3c.css.values.CssOperator;
import org.w3c.css.values.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> currentColor |
                    <color> [icc-color(<name>[,<icccolorvalue>]*)] | inherit<BR>
 *  <EM>Initial:</EM>none<BR>
 *  <EM>Applies to:</EM>all elements<BR>
 *  <EM>Inherited:</EM>no<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 */

public class LightingColor extends CssProperty implements CssOperator {
    
    CssValue lightingColor;
    ApplContext ac;
    Vector values = new Vector();
    
    CssIdent currentColor = new CssIdent("currentColor");
    
    /**
     * Create a new LightingColor
     */
    public LightingColor() {
	//nothing to do
    }
    
    /**
     * Create a new LightingColor
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public LightingColor(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	this.ac = ac;
	setByUser(); // tell this property is set by the user
	CssValue val = expression.getValue();
	
	boolean correct = true;
	String errorval = "";
	char op = expression.getOperator();
	CssColor color;
	
	if (val.equals(inherit)) {
	    lightingColor = inherit;
	    expression.next();
	} else if (val.equals(currentColor)) {
	    lightingColor = currentColor;
	    expression.next();
	} else {
	    try {
		color = new CssColor(ac, expression);
		values.addElement(val);
		//expression.next();
	    } catch (InvalidParamException e) {
		correct = false;
		errorval = val.toString();
	    }
	    
	    op = expression.getOperator();
	    val = expression.getValue();
	    
	    if (val != null) {
		if (val instanceof CssFunction) { // icc-color(<name>[,<icccolorvalue>]*)]
		    CssValue function = val;
		    if (!((CssFunction) val).getName().equals("icc-color")) {
			correct = false;
			errorval = val.toString();
		    } else {
			CssExpression params = ((CssFunction) val).getParameters();
			
			op = params.getOperator();
			val = params.getValue();
			
			if (!(val instanceof CssIdent)) {
			    correct = false;
			    errorval = val.toString();
			}
			
			params.next();
			op = params.getOperator();
			val = params.getValue();
			
			if (!params.end()) { // there are more parameters left
			    int counter = 0;
			    
			    while ((op == COMMA || op == SPACE)
				    && (counter < (params.getCount() - 1) && correct == true)) {
				
				if ((!(val instanceof CssNumber)) || (((CssNumber) val).getValue() < 0)) {
				    correct = false;
				    errorval = val.toString();
				}
				
				params.next();
				counter++;
				val = params.getValue();
				op = params.getOperator();
			    }
			}
			
			if (correct) {
			    params.starts();
			    values.addElement(function);
			}
		    }
		} else {
		    correct = false;
		    errorval = val.toString();
		}
	    } else {
		correct = false;
		errorval = new String("");
	    }
	    
	    expression.next();
	    
	}
	
	if (!correct) {
	    throw new InvalidParamException("value", errorval, getPropertyName(), ac);
	}
    }
    
    public LightingColor(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((SVGStyle) style).lightingColor != null)
	    style.addRedefinitionWarning(ac, this);
	((SVGStyle) style).lightingColor = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((SVGStyle) style).getLightingColor();
	} else {
	    return ((SVGStyle) style).lightingColor;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof LightingColor &&
		lightingColor.equals( ((LightingColor) property).lightingColor));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "lighting-color";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	if (lightingColor != null)
	    return lightingColor;
	else
	    return values;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return lightingColor.equals(inherit);
    }
    
    /**
     * Returns a string representation of the object
     */
    public String toString() {
	if (lightingColor != null) {
	    return lightingColor.toString();
	} else {
	    String ret = "";
	    for (int i = 0; i < values.size(); i++) {
		ret += " " + values.elementAt(i).toString();
	    }
	    return ret;
	}
    }
    
    /**
     * Is the value of this property a default value
     * It is used by all macro for the function <code>print</code>
     */
    public boolean isDefault() {
	return false;
    }
    
}

--- NEW FILE: Filter.java ---
//
// $Id: Filter.java,v 1.1 2005/08/23 16:25:02 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, Keio University)
// Please first read the full copyright statement at
// http://www.w3.org/Consortium/Legal/copyright-software-19980720

package org.w3c.css.properties.svg;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssIdent;
import org.w3c.css.values.CssURL;
import org.w3c.css.values.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> &lt;uri&gt; || none || inherit<BR>
 *  <EM>Initial:</EM>none<BR>
 *  <EM>Applies to:</EM>graphics and container elements<BR>
 *  <EM>Inherited:</EM>no<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 */

public class Filter extends CssProperty {
    
    CssValue value;
    ApplContext ac;
    
    CssIdent none = new CssIdent("none");
    
    /**
     * Create a new Filter
     */
    public Filter() {
	// nothing to do
    }
    
    /**
     * Create a new Filter
     *
     * @param expression The expression for this property     
     * @exception InvalidParamException Values are incorrect
     */
    public Filter(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	this.ac = ac;
	setByUser(); // tell this property is set by the user
	CssValue val = expression.getValue();
	if (val instanceof CssURL) {
	    value = val;
	    expression.next();
	}
	else if (val instanceof CssIdent) {
	    if (val.equals(inherit)) {
		value = inherit;
		expression.next();
	    } else if (val.equals(none)) {
		value = none;
		expression.next();
	    }
	}
	else {
	    throw new InvalidParamException("value", val.toString(), getPropertyName(), ac);
	}
    }
    
    public Filter(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((SVGStyle) style).filter != null)
	    style.addRedefinitionWarning(ac, this);
	((SVGStyle) style).filter = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */  
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((SVGStyle) style).getFilter();
	} else {
	    return ((SVGStyle) style).filter;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */  
    public boolean equals(CssProperty property) {
	return (property instanceof Filter && 
		value.equals( ((Filter) property).value));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "filter";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return value;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return value.equals(inherit);
    }
    
    /**
     * Returns a string representation of the object
     */
    public String toString() {
	return value.toString();
    }
    
    /**
     * Is the value of this property a default value
     * It is used by all macro for the function <code>print</code>
     */
    public boolean isDefault() {	
	return value == none;
    }
    
}


--- NEW FILE: ColorProfileName.java ---
//
// $Id: ColorProfileName.java,v 1.1 2005/08/23 16:25:02 ylafon Exp $
// From Sijtsche Smeman (sijtsche@wisdom.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, Keio University)
// Please first read the full copyright statement at
// http://www.w3.org/Consortium/Legal/copyright-software-19980720

package org.w3c.css.properties.svg;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssIdent;
import org.w3c.css.values.CssOperator;
import org.w3c.css.values.CssValue;

/**
 * This property sets the preferred media for this stylesheet
 */

public class ColorProfileName extends CssProperty implements CssOperator {

    CssValue cpName;
    
    /**
     * Create a new ColorProfileName
     */
    public ColorProfileName() {
	// no initial value
    }
    
    /**
     * Create a new ColorProfileName
     */
    public ColorProfileName(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	
	CssValue val = expression.getValue();
	
	if (val instanceof CssIdent) {
	    cpName = val;
	    expression.next();
	} else {
	    throw new InvalidParamException("value",
		    val, getPropertyName(), ac);
	}
    }
    
    public ColorProfileName(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((SVGStyle) style).cpName != null)
	    style.addRedefinitionWarning(ac, this);
	((SVGStyle) style).cpName = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((SVGStyle) style).getColorProfileName();
	} else {
	    return ((SVGStyle) style).cpName;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param cpName The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof ColorProfileName &&
		cpName.equals( ((ColorProfileName) property).cpName));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "name";
    }
    
    /**
     * Returns the cpName of this property
     */
    public Object get() {
	return cpName;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return false;
    }
    
    /**
     * Returns a string representation of the object
     */
    public String toString() {
	return cpName.toString();
    }
    
    /**
     * Is the cpName of this property a default cpName
     * It is used by all macro for the function <code>print</code>
     */
    public boolean isDefault() {
	return false;
    }
    
}

--- NEW FILE: ClipRule.java ---
//
// $Id: ClipRule.java,v 1.1 2005/08/23 16:25:02 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, Keio University)
// Please first read the full copyright statement at
// http://www.w3.org/Consortium/Legal/copyright-software-19980720

package org.w3c.css.properties.svg;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssIdent;
import org.w3c.css.values.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> nonzero || evenodd || inherit<BR>
 *  <EM>Initial:</EM>nonzero<BR>
 *  <EM>Applies to:</EM>all elements<BR>
 *  <EM>Inherited:</EM>no<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 */

public class ClipRule extends CssProperty {
    
    CssValue cliprule;
    ApplContext ac;
    
    CssIdent nonzero = new CssIdent("nonzero");
    CssIdent evenodd = new CssIdent("evenodd");
    
    /**
     * Create a new Cliprule
     */
    public ClipRule() {
	//nothing to do
    }
    
    /**
     * Create a new Cliprule
     *
     * @param expression The expression for this property     
     * @exception InvalidParamException Values are incorrect
     */
    public ClipRule(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	this.ac = ac;
	setByUser(); // tell this property is set by the user
	CssValue val = expression.getValue();
	
	if (val.equals(inherit)) {
	    cliprule = inherit;
	    expression.next();
	} else if (val.equals(nonzero)) {
	    cliprule = nonzero;
	    expression.next();
	} else if (val.equals(evenodd)) {
	    cliprule = evenodd;
	    expression.next();
	}
	else {
	    throw new InvalidParamException("value", val.toString(), getPropertyName(), ac);
	}
    }
    
    public ClipRule(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((SVGStyle) style).clipRule != null)
	    style.addRedefinitionWarning(ac, this);
	((SVGStyle) style).clipRule = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */  
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((SVGStyle) style).getClipRule();
	} else {
	    return ((SVGStyle) style).clipRule;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */  
    public boolean equals(CssProperty property) {
	return (property instanceof ClipRule && 
		cliprule.equals( ((ClipRule) property).cliprule));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "clip-rule";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return cliprule;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return cliprule.equals(inherit);
    }
    
    /**
     * Returns a string representation of the object
     */
    public String toString() {
	return cliprule.toString();
    }
    
    /**
     * Is the value of this property a default value
     * It is used by all macro for the function <code>print</code>
     */
    public boolean isDefault() {	
	return (cliprule == nonzero);
    }
    
}

--- NEW FILE: StrokeOpacity.java ---
//
// $Id: StrokeOpacity.java,v 1.1 2005/08/23 16:25:02 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, Keio University)
// Please first read the full copyright statement at
// http://www.w3.org/Consortium/Legal/copyright-software-19980720

package org.w3c.css.properties.svg;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.properties.css3.CssOpacity;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssNumber;
import org.w3c.css.values.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> &lt;opacityvalue&gt; || inherit<BR>
 *  <EM>Initial:</EM>1<BR>
 *  <EM>Applies to:</EM>all elements<BR>
 *  <EM>Inherited:</EM>no<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 */

public class StrokeOpacity extends CssProperty {
    
    CssValue value;
    ApplContext ac;
    
    /**
     * Create a new Value
     */
    public StrokeOpacity() {
	//nothing to do
    }
    
    /**
     * Create a new Value
     *
     * @param expression The expression for this property     
     * @exception InvalidParamException Values are incorrect
     */
    public StrokeOpacity(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	this.ac = ac;
	setByUser(); // tell this property is set by the user
	CssValue val = expression.getValue();
	boolean correct = false;
	
	if (val.equals(inherit)) {
	    value = inherit;
	    expression.next();
	    correct = true;
	} else {
	    try {
		CssOpacity opac = new CssOpacity(ac, expression);
		value = val;
		expression.next();
		correct = true;
	    } catch (InvalidParamException e) {
		correct = false;
	    }
	}
	if (!correct) {
	    throw new InvalidParamException("value", val.toString(), getPropertyName(), ac);
	}
    }
    
    public StrokeOpacity(ApplContext ac, CssExpression expression)
    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((SVGStyle) style).strokeOpacity != null)
	    style.addRedefinitionWarning(ac, this);
	((SVGStyle) style).strokeOpacity = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */  
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((SVGStyle) style).getStrokeOpacity();
	} else {
	    return ((SVGStyle) style).strokeOpacity;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */  
    public boolean equals(CssProperty property) {
	return (property instanceof StrokeOpacity && 
		value.equals( ((StrokeOpacity) property).value));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "stroke-opacity";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return value;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return value.equals(inherit);
    }
    
    /**
     * Returns a string representation of the object
     */
    public String toString() {
	return value.toString();
    }
    
    /**
     * Is the value of this property a default value
     * It is used by all macro for the function <code>print</code>
     */
    public boolean isDefault() {	
	CssNumber cssnum = new CssNumber(ac, (float) 1.0);
	return value == cssnum;
    }
}

--- NEW FILE: Kerning.java ---
//
// $Id: Kerning.java,v 1.1 2005/08/23 16:25:02 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, Keio University)
// Please first read the full copyright statement at
// http://www.w3.org/Consortium/Legal/copyright-software-19980720

package org.w3c.css.properties.svg;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssIdent;
import org.w3c.css.values.CssLength;
import org.w3c.css.values.CssValue;

/**
 *   <H4>
 *     &nbsp;&nbsp; 'kerning'
 *   </H4>
 *   <P>
 *   <EM>Value:</EM> auto | &lt;length&gt; <BR>
 *   <EM>Initial:</EM> auto<BR>
 *   <EM>Applies to:</EM> all elements<BR>
 *   <EM>Inherited:</EM> yes<BR>
 *   <EM>Percentage values:</EM> N/A<BR>
 */
public class Kerning extends CssProperty {
    
    CssValue value;
    static CssIdent auto = new CssIdent("auto");

    /**
     * Create a new Kerning
     */
    public Kerning() {
	//nothing to do
    }  
    
    /**
     * Create a new Kerning
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */  
    public Kerning(ApplContext ac, CssExpression expression,
	    boolean check) 
	throws InvalidParamException {
	
	setByUser();
	CssValue val = expression.getValue();

	if (val instanceof CssLength) {
	    value = val;
	    expression.next();
	} else if (val.equals(inherit)) {
	    value = inherit;
	    expression.next();
	} else if (val.equals(auto)) {
	    value = auto;
	    expression.next();
	} else {
	    throw new InvalidParamException("value", 
					    expression.getValue(), 
					    getPropertyName(), ac);
	}
    }
    
    public Kerning(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return value;
    }
    
    /**
     * Returns the name of this property
     */  
    public String getPropertyName() {
	return "kerning";
    }

    /**
     * Returns true if this property is "softly" inherited
     * e.g. his value equals inherit
     */
    public boolean isSoftlyInherited() {
	return value == inherit;
    }
    
    /**
     * Returns a string representation of the object.
     */
    public String toString() {
	return value.toString();
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	SVGStyle style0 = (SVGStyle) style;
	if (style0.kerning != null)
	    style0.addRedefinitionWarning(ac, this);
	style0.kerning = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */  
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((SVGStyle) style).getKerning();
	} else {
	    return ((SVGStyle) style).kerning;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */  
    public boolean equals(CssProperty property) {
	return (property instanceof Kerning && 
		value.equals(((Kerning) property).value));
    }
    
}

--- NEW FILE: SVGBasicStyle.java ---
//
// $Id: SVGBasicStyle.java,v 1.1 2005/08/23 16:25:02 ylafon Exp $
// From Sijtsche de Jong
//
// COPYRIGHT (c) 1995-2002 World Wide Web Consortium, (MIT, INRIA, Keio University)
// Please first read the full copyright statement at
// http://www.w3.org/Consortium/Legal/copyright-software-19980720

package org.w3c.css.properties.svg;

import org.w3c.css.parser.CssPrinterStyle;

public class SVGBasicStyle extends org.w3c.css.properties.css3.Css3Style {

    AlignmentBaseline alignmentBaseline;
    ClipPath clipPath;
    ClipRule clipRule;
    ColorInterpolation colorInterpolation;
    ColorInterpolationFilters colorInterpolationFilters;
    ColorRendering colorRendering;
    EnableBackground enableBackground;
    WritingModeSVG writingModeSVG;
    FloodOpacity floodOpacity;
    Filter filter;
    FillRule fillRule;
    FillOpacity fillOpacity;
    ImageRendering imageRendering;
    Mask mask;
    StopOpacity stopOpacity;
    Kerning kerning;
    PointerEvents pointerEvents;
    ShapeRendering shapeRendering;
    TextRendering textRendering;
    TextAnchor textAnchor;
    StrokeLinejoin strokeLinejoin;
    StrokeLineCap strokeLineCap;
    StrokeMiterLimit strokeMiterLimit;
    StrokeOpacity strokeOpacity;
    StrokeWidth strokeWidth;
    StrokeDashOffset strokeDashOffset;
    StrokeDashArray strokeDashArray;
    StopColor stopColor;
    SolidColor solidColor;
    FloodColor floodColor;
    Stroke stroke;
    ColorProfile colorProfile;
	DominantBaseLine dominantBaseLine;
	SolidOpacity solidOpacity;
	Fill fill;

    public AlignmentBaseline getAlignmentBaseline() {
	if (alignmentBaseline == null) {
	    alignmentBaseline =
		(AlignmentBaseline) style.CascadingOrder (
			    new AlignmentBaseline(), style, selector);
	}
	return alignmentBaseline;
    }

    public DominantBaseLine getDominantBaseLineSVG() {
	if (dominantBaseLine == null) {
	    dominantBaseLine =
		(DominantBaseLine) style.CascadingOrder (
			    new DominantBaseLine(), style, selector);
	}
	return dominantBaseLine;
    }

    public ClipPath getClipPath() {
	if (clipPath == null) {
	    clipPath =
		(ClipPath) style.CascadingOrder (
			    new ClipPath(), style, selector);
	}
	return clipPath;
    }

    public ClipRule getClipRule() {
	if (clipRule == null) {
	    clipRule =
		(ClipRule) style.CascadingOrder (
			    new ClipRule(), style, selector);
	}
	return clipRule;
    }

    public ColorInterpolation getColorInterpolation() {
	if (colorInterpolation == null) {
	    colorInterpolation =
		(ColorInterpolation) style.CascadingOrder (
			    new ColorInterpolation(), style, selector);
	}
	return colorInterpolation;
    }

    public ColorInterpolationFilters getColorInterpolationFilters() {
	if (colorInterpolationFilters == null) {
	    colorInterpolationFilters =
		(ColorInterpolationFilters) style.CascadingOrder (
			    new ColorInterpolationFilters(), style, selector);
	}
	return colorInterpolationFilters;
    }

    public ColorRendering getColorRendering() {
	if (colorRendering == null) {
	    colorRendering =
		(ColorRendering) style.CascadingOrder (
			    new ColorRendering(), style, selector);
	}
	return colorRendering;
    }

    public EnableBackground getEnableBackground() {
	if (enableBackground == null) {
	    enableBackground =
		(EnableBackground) style.CascadingOrder (
			    new EnableBackground(), style, selector);
	}
	return enableBackground;
    }

    public WritingModeSVG getWritingModeSVG() {
	if (writingModeSVG == null) {
	    writingModeSVG =
		(WritingModeSVG) style.CascadingOrder (
			   new WritingModeSVG(), style, selector);
	}
	return writingModeSVG;
    }

    public FloodOpacity getFloodOpacity() {
	if (floodOpacity == null) {
	    floodOpacity =
		(FloodOpacity) style.CascadingOrder (
			   new FloodOpacity(), style, selector);
	}
	return floodOpacity;
    }

    public Filter getFilter() {
	if (filter == null) {
	    filter =
		(Filter) style.CascadingOrder (
			   new Filter(), style, selector);
	}
	return filter;
    }

    public FillRule getFillRule() {
	if (fillRule == null) {
	    fillRule =
		(FillRule) style.CascadingOrder (
			   new FillRule(), style, selector);
	}
	return fillRule;
    }

    public FillOpacity getFillOpacity() {
	if (fillOpacity == null) {
	    fillOpacity =
		(FillOpacity) style.CascadingOrder (
			   new FillOpacity(), style, selector);
	}
	return fillOpacity;
    }

    public ImageRendering getImageRendering() {
	if (imageRendering == null) {
	    imageRendering =
		(ImageRendering) style.CascadingOrder (
			   new ImageRendering(), style, selector);
	}
	return imageRendering;
    }

    public Mask getMask() {
	if (mask == null) {
	    mask =
		(Mask) style.CascadingOrder (
			   new ImageRendering(), style, selector);
	}
	return mask;
    }

    public StopOpacity getStopOpacity() {
	if (stopOpacity == null) {
	    stopOpacity =
		(StopOpacity) style.CascadingOrder (
			   new StopOpacity(), style, selector);
	}
	return stopOpacity;
    }

    public Kerning getKerning() {
	if (kerning == null) {
	    kerning =
		(Kerning) style.CascadingOrder (
			   new Kerning(), style, selector);
	}
	return kerning;
    }

    public PointerEvents getPointerEvents() {
	if (pointerEvents == null) {
	    pointerEvents =
		(PointerEvents) style.CascadingOrder (
			    new PointerEvents(), style, selector);
	}
	return pointerEvents;
    }

    public ShapeRendering getShapeRendering() {
	if (shapeRendering == null) {
	    shapeRendering =
		(ShapeRendering) style.CascadingOrder (
			    new ShapeRendering(), style, selector);
	}
	return shapeRendering;
    }

    public TextRendering getTextRendering() {
	if (textRendering == null) {
	    textRendering =
		(TextRendering) style.CascadingOrder (
			    new TextRendering(), style, selector);
	}
	return textRendering;
    }

    public TextAnchor getTextAnchor() {
	if (textAnchor == null) {
	    textAnchor =
		(TextAnchor) style.CascadingOrder (
			     new TextAnchor(), style, selector);
	}
	return textAnchor;
    }

    public StrokeLinejoin getStrokeLinejoin() {
	if (strokeLinejoin == null) {
	    strokeLinejoin =
		(StrokeLinejoin) style.CascadingOrder (
			     new StrokeLinejoin(), style, selector);
	}
	return strokeLinejoin;
    }

    public StrokeLineCap getStrokeLineCap() {
	if (strokeLineCap == null) {
	    strokeLineCap =
		(StrokeLineCap) style.CascadingOrder (
			     new StrokeLineCap(), style, selector);
	}
	return strokeLineCap;
    }

    public StrokeMiterLimit getStrokeMiterLimit() {
	if (strokeMiterLimit == null) {
	    strokeMiterLimit =
		(StrokeMiterLimit) style.CascadingOrder (
			     new StrokeMiterLimit(), style, selector);
	}
	return strokeMiterLimit;
    }

    public StrokeOpacity getStrokeOpacity() {
	if (strokeOpacity == null) {
	    strokeOpacity =
		(StrokeOpacity) style.CascadingOrder (
			      new StrokeOpacity(), style, selector);
	}
	return strokeOpacity;
    }

    public StrokeWidth getStrokeWidth() {
	if (strokeWidth == null) {
	    strokeWidth =
		(StrokeWidth) style.CascadingOrder (
			      new StrokeWidth(), style, selector);
	}
	return strokeWidth;
    }

    public StrokeDashOffset getStrokeDashOffset() {
	if (strokeDashOffset == null) {
	    strokeDashOffset =
		(StrokeDashOffset) style.CascadingOrder (
			      new StrokeDashOffset(), style, selector);
	}
	return strokeDashOffset;
    }

    public StrokeDashArray getStrokeDashArray() {
	if (strokeDashArray == null) {
	    strokeDashArray =
		(StrokeDashArray) style.CascadingOrder (
			      new StrokeDashArray(), style, selector);
	}
	return strokeDashArray;
    }

    public StopColor getStopColor() {
	if (stopColor == null) {
	    stopColor =
		(StopColor) style.CascadingOrder (
			       new StopColor(), style, selector);
	}
	return stopColor;
    }

    public SolidColor getSolidColor() {
	if (solidColor == null) {
	    solidColor =
		(SolidColor) style.CascadingOrder (
			       new SolidColor(), style, selector);
	}
	return solidColor;
    }

    public FloodColor getFloodColor() {
	if (floodColor == null) {
	    floodColor =
		(FloodColor) style.CascadingOrder (
			       new FloodColor(), style, selector);
	}
	return floodColor;
    }

    public ColorProfile getColorProfileSVG() {
	if (colorProfile == null) {
	    colorProfile =
		(ColorProfile) style.CascadingOrder (
			       new ColorProfile(), style, selector);
	}
	return colorProfile;
    }

    public Stroke getStroke() {
	if (stroke == null) {
	    stroke =
		(Stroke) style.CascadingOrder (
			       new Stroke(), style, selector);
	}
	return stroke;
    }

	public SolidOpacity getSolidOpacity() {
		if (solidOpacity == null) {
			solidOpacity =
				(SolidOpacity) style.CascadingOrder (
					new SolidOpacity(), style, selector);
		}
		return solidOpacity;
	}

	public Fill getFill() {
		if (fill == null) {
			fill =
				(Fill) style.CascadingOrder (
					new Fill(), style, selector);
		}
		return fill;
	}

    /**
     * Print this style
     *
     * @param printer The printer interface
     */
    public void print(CssPrinterStyle printer) {
	super.print(printer);

	if (alignmentBaseline != null) {
	    alignmentBaseline.print(printer);
	}
	if (dominantBaseLine != null) {
		dominantBaseLine.print(printer);
	}
	if (clipPath != null) {
	    clipPath.print(printer);
	}
	if (clipRule != null) {
	    clipRule.print(printer);
	}
	if (colorInterpolation != null) {
	    colorInterpolation.print(printer);
	}
	if (colorRendering != null) {
	    colorRendering.print(printer);
	}
	if (enableBackground != null) {
	    enableBackground.print(printer);
	}
	if (writingModeSVG != null) {
	    writingModeSVG.print(printer);
	}
	if (floodOpacity != null) {
	    floodOpacity.print(printer);
	}
	if (filter != null) {
	    filter.print(printer);
	}
	if (fillRule != null) {
	    fillRule.print(printer);
	}
	if (fillOpacity != null) {
	    fillOpacity.print(printer);
	}
	if (imageRendering != null) {
	    imageRendering.print(printer);
	}
	if (mask != null) {
	    mask.print(printer);
	}
	if (stopOpacity != null) {
	    stopOpacity.print(printer);
	}
	if (kerning != null) {
	    kerning.print(printer);
	}
	if (pointerEvents != null) {
	    pointerEvents.print(printer);
	}
	if (shapeRendering != null) {
	    shapeRendering.print(printer);
	}
	if (textRendering != null) {
	    textRendering.print(printer);
	}
	if (textAnchor != null) {
	    textAnchor.print(printer);
	}
	if (strokeLinejoin != null) {
	    strokeLinejoin.print(printer);
	}
	if (strokeLineCap != null) {
	    strokeLineCap.print(printer);
	}
	if (strokeMiterLimit != null) {
	    strokeMiterLimit.print(printer);
	}
	if (strokeOpacity != null) {
	    strokeOpacity.print(printer);
	}
	if (strokeWidth != null) {
	    strokeWidth.print(printer);
	}
	if (strokeDashOffset != null) {
	    strokeDashOffset.print(printer);
	}
	if (strokeDashArray != null) {
	    strokeDashArray.print(printer);
	}
	if (stopColor != null) {
	    stopColor.print(printer);
	}
	if (solidColor != null) {
		solidColor.print(printer);
	}
	if (floodColor != null) {
	    floodColor.print(printer);
	}
	if (stroke != null) {
	    stroke.print(printer);
	}
	if (colorProfile != null) {
	    colorProfile.print(printer);
	}
	if (solidOpacity != null) {
		solidOpacity.print(printer);
	}
	if (fill != null) {
		fill.print(printer);
	}
    }

    /**
     * Returns the name of the actual selector
     */
    public String getSelector()
    {
	return (selector.getElement().toLowerCase());
    }

}

--- NEW FILE: MarkerMid.java ---
//
// $Id: MarkerMid.java,v 1.1 2005/08/23 16:25:02 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, Keio University)
// Please first read the full copyright statement at
// http://www.w3.org/Consortium/Legal/copyright-software-19980720

package org.w3c.css.properties.svg;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssIdent;
import org.w3c.css.values.CssURL;
import org.w3c.css.values.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> &lt;uri&gt; || none || inherit<BR>
 *  <EM>Initial:</EM>none<BR>
 *  <EM>Applies to:</EM>all elements<BR>
 *  <EM>Inherited:</EM>no<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 */

public class MarkerMid extends CssProperty {
    
    CssValue markerMid;
    ApplContext ac;
    
    CssIdent none = new CssIdent("none");
    
    /**
     * Create a new MarkerMid
     */
    public MarkerMid() {
	//nothing to do
    }
    
    /**
     * Create a new MarkerMid
     *
     * @param expression The expression for this property     
     * @exception InvalidParamException Values are incorrect
     */
    public MarkerMid(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	this.ac = ac;
	setByUser(); // tell this property is set by the user
	CssValue val = expression.getValue();
	if (val instanceof CssURL) {
	    markerMid = val;
	    expression.next();
	}
	else if (val instanceof CssIdent) {
	    if (val.equals(inherit)) {
		markerMid = inherit;
		expression.next();
	    } else if (val.equals(none)) {
		markerMid = none;
		expression.next();
	    }
	}
	else {
	    throw new InvalidParamException("value", val.toString(), getPropertyName(), ac);
	}
    }
    
    public MarkerMid(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((SVGStyle) style).markerMid != null)
	    style.addRedefinitionWarning(ac, this);
	((SVGStyle) style).markerMid = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */  
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((SVGStyle) style).getMarkerMid();
	} else {
	    return ((SVGStyle) style).markerMid;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */  
    public boolean equals(CssProperty property) {
	return (property instanceof MarkerMid && 
		markerMid.equals( ((MarkerMid) property).markerMid));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "marker-mid";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return markerMid;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return markerMid.equals(inherit);
    }
    
    /**
     * Returns a string representation of the object
     */
    public String toString() {
	return markerMid.toString();
    }
    
    /**
     * Is the value of this property a default value
     * It is used by all macro for the function <code>print</code>
     */
    public boolean isDefault() {	
	return (markerMid == none);
    }
    
}

--- NEW FILE: Fill.java ---
//
// $Id: Fill.java,v 1.1 2005/08/23 16:25:02 ylafon Exp $
// From Sijtsche de Jong
//
// (c) COPYRIGHT 1995-2002  World Wide Web Consortium (MIT, INRIA, Keio University)
// Please first read the full copyright statement at
// http://www.w3.org/Consortium/Legal/copyright-software-19980720

package org.w3c.css.properties.svg;

import java.util.Vector;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssColor;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssFunction;
import org.w3c.css.values.CssIdent;
import org.w3c.css.values.CssNumber;
import org.w3c.css.values.CssOperator;
import org.w3c.css.values.CssURL;
import org.w3c.css.values.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> &lt;paint&gt; | inherit<BR>
 *  <EM>Initial:</EM>none<BR>
 *  <EM>Applies to:</EM>all elements<BR>
 *  <EM>Inherited:</EM>no<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 */

public class Fill extends CssProperty implements CssOperator {
    
    CssValue fill;
    ApplContext ac;
    Vector values = new Vector();
    
    CssIdent currentColor = new CssIdent("currentColor");
    CssIdent none = new CssIdent("none");
    
    /**
     * Create a new Fill
     */
    public Fill() {
	//nothing to do
    }
    
    /**
     * Create a new Fill
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public Fill(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	this.ac = ac;
	setByUser(); // tell this property is set by the user
	CssValue val = expression.getValue();
	boolean correct = true;
	String errorval = "";
	char op = expression.getOperator();
	
	if (val.equals(inherit)) {
	    fill = inherit;
	    expression.next();
	} else if (val.equals(currentColor)) {
	    fill = currentColor;
	    expression.next();
	} else if (val.equals(none)) {
	    fill = none;
	    expression.next();
	} else {
	    try {
		CssColor color = new CssColor(ac, expression);
		values.addElement(val);
		//expression.next();
		
		op = expression.getOperator();
		val = expression.getValue();
		
		
		if (val instanceof CssFunction) { // icc-color(<name>[,<icccolorvalue>]*)]
		    CssValue function = val;
		    if (!((CssFunction) val).getName().equals("icc-color")) {
			correct = false;
			errorval = val.toString();
		    } else {
			CssExpression params = ((CssFunction) val).getParameters();
			
			op = params.getOperator();
			val = params.getValue();
			
			if (!(val instanceof CssIdent)) {
			    correct = false;
			    errorval = val.toString();
			}
			
			params.next();
			op = params.getOperator();
			val = params.getValue();
			
			if (!params.end()) { // there are more parameters left
			    int counter = 0;
			    
			    while ((op == COMMA || op == SPACE)
				    && (counter < (params.getCount() - 1) && correct == true)) {
				
				if ((!(val instanceof CssNumber)) || (((CssNumber) val).getValue() < 0)) {
				    correct = false;
				    errorval = val.toString();
				}
				
				params.next();
				counter++;
				val = params.getValue();
				op = params.getOperator();
			    }
			}
			
			if (correct) {
			    params.starts();
			    values.addElement(function);
			}
			else {
			    correct = false;
			    errorval = val.toString();
			}
		    }
		}
	    } catch (InvalidParamException e) {
		correct = false;
		errorval = val.toString();
	    }
	    
	    if (val instanceof CssURL) {
		values.addElement(val);
		correct = true;
		errorval = null;
		
		expression.next();
		op = expression.getOperator();
		val = expression.getValue();
		
		if (val.equals(none) || val.equals(currentColor)) {
		    values.addElement(val);
		    expression.next();
		} else {
		    //-------------
		    
		    try {
			CssColor color = new CssColor(ac, expression);
			values.addElement(val);
			//expression.next();
			
			op = expression.getOperator();
			val = expression.getValue();
			
			
			if (val instanceof CssFunction) { // icc-color(<name>[,<icccolorvalue>]*)]
			    CssValue function = val;
			    if (!((CssFunction) val).getName().equals("icc-color")) {
				correct = false;
				errorval = val.toString();
			    } else {
				CssExpression params = ((CssFunction) val).getParameters();
				
				op = params.getOperator();
				val = params.getValue();
				
				if (!(val instanceof CssIdent)) {
				    correct = false;
				    errorval = val.toString();
				}
				
				params.next();
				op = params.getOperator();
				val = params.getValue();
				
				if (!params.end()) { // there are more parameters left
				    int counter = 0;
				    
				    while ((op == COMMA || op == SPACE)
					    && (counter < (params.getCount() - 1) && correct == true)) {
					
					if ((!(val instanceof CssNumber)) || (((CssNumber) val).getValue() < 0)) {
					    correct = false;
					    errorval = val.toString();
					}
					
					params.next();
					counter++;
					val = params.getValue();
					op = params.getOperator();
				    }
				}
				
				if (correct) {
				    params.starts();
				    values.addElement(function);
				}
				else {
				    correct = false;
				    errorval = val.toString();
				}
			    }
			}
		    } catch (InvalidParamException e) {
			correct = false;
			errorval = val.toString();
		    }
		    
		    //-----------------
		}
	    } else {
		correct = false;
		errorval = val.toString();
	    }
	    
	}
	
	expression.next();
	
	if (!correct) {
	    throw new InvalidParamException("value", errorval, getPropertyName(), ac);
	}
    }
    
    public Fill(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((SVGStyle) style).fill != null)
	    style.addRedefinitionWarning(ac, this);
	((SVGStyle) style).fill = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((SVGStyle) style).getFill();
	} else {
	    return ((SVGStyle) style).fill;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof Fill &&
		fill.equals( ((Fill) property).fill));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "fill";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	if (fill != null)
	    return fill;
	else
	    return values;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return fill.equals(inherit);
    }
    
    /**
     * Returns a string representation of the object
     */
    public String toString() {
	if (fill != null) {
	    return fill.toString();
	} else {
	    String ret = "";
	    for (int i = 0; i < values.size(); i++) {
		ret += " " + values.elementAt(i).toString();
	    }
	    return ret;
	}
    }
    
    /**
     * Is the value of this property a default value
     * It is used by all macro for the function <code>print</code>
     */
    public boolean isDefault() {
	return fill == none;
    }
    
}

--- NEW FILE: SolidColor.java ---
//
// $Id: SolidColor.java,v 1.1 2005/08/23 16:25:02 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, Keio University)
// Please first read the full copyright statement at
// http://www.w3.org/Consortium/Legal/copyright-software-19980720

package org.w3c.css.properties.svg;

import java.util.Vector;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssColor;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssFunction;
import org.w3c.css.values.CssIdent;
import org.w3c.css.values.CssNumber;
import org.w3c.css.values.CssOperator;
import org.w3c.css.values.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> currentColor || &lt;color&gt;[icc-color(
 *   &lt;name&gt;[&lt;icccolorvalue&gt;]*)] || inherit<BR>
 *  <EM>Initial:</EM>none<BR>
 *  <EM>Applies to:</EM>all elements<BR>
 *  <EM>Inherited:</EM>no<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 */

public class SolidColor extends CssProperty implements CssOperator {
    
    CssValue solidColor;
    ApplContext ac;
    Vector values = new Vector();
    
    CssIdent currentColor = new CssIdent("currentColor");
    
    /**
     * Create a new SolidColor
     */
    public SolidColor() {
	//nothing to do
    }
    
    /**
     * Create a new SolidColor
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public SolidColor(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	this.ac = ac;
	setByUser(); // tell this property is set by the user
	CssValue val = expression.getValue();
	boolean correct = true;
	String errorval = "";
	char op = expression.getOperator();
	
	if (val.equals(inherit)) {
	    solidColor = inherit;
	    expression.next();
	} else if (val.equals(currentColor)) {
	    solidColor = currentColor;
	    expression.next();
	} else {
	    try {
		CssColor color = new CssColor(ac, expression);
		values.addElement(val);
		//expression.next();
	    } catch (InvalidParamException e) {
		correct = false;
		errorval = val.toString();
	    }
	    
	    op = expression.getOperator();
	    val = expression.getValue();
	    
	    if (val != null) {
		
		if (val instanceof CssFunction) { // icc-color(<name>[,<icccolorvalue>]*)]
		    CssValue function = val;
		    if (!((CssFunction) val).getName().equals("icc-color")) {
			correct = false;
			errorval = val.toString();
		    } else {
			CssExpression params = ((CssFunction) val).getParameters();
			
			op = params.getOperator();
			val = params.getValue();
			
			if (!(val instanceof CssIdent)) {
			    correct = false;
			    errorval = val.toString();
			}
			
			params.next();
			op = params.getOperator();
			val = params.getValue();
			
			if (!params.end()) { // there are more parameters left
			    int counter = 0;
			    
			    while ((op == COMMA || op == SPACE)
				    && (counter < (params.getCount() - 1) && correct == true)) {
				
				if ((!(val instanceof CssNumber)) || (((CssNumber) val).getValue() < 0)) {
				    correct = false;
				    errorval = val.toString();
				}
				
				params.next();
				counter++;
				val = params.getValue();
				op = params.getOperator();
			    }
			}
			
			if (correct) {
			    params.starts();
			    values.addElement(function);
			}
		    }
		} else {
		    correct = false;
		    errorval = val.toString();
		}
	    } else {
		correct = false;
		errorval = new String("");
	    }
	    
	    
	    expression.next();
	    
	}
	
	if (!correct) {
	    throw new InvalidParamException("value", errorval, getPropertyName(), ac);
	}
    }
    
    public SolidColor(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((SVGStyle) style).solidColor != null)
	    style.addRedefinitionWarning(ac, this);
	((SVGStyle) style).solidColor = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((SVGStyle) style).getSolidColor();
	} else {
	    return ((SVGStyle) style).solidColor;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof SolidColor &&
		solidColor.equals( ((SolidColor) property).solidColor));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "solid-color";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	if (solidColor != null)
	    return solidColor;
	else
	    return values;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return solidColor.equals(inherit);
    }
    
    /**
     * Returns a string representation of the object
     */
    public String toString() {
	if (solidColor != null) {
	    return solidColor.toString();
	} else {
	    String ret = "";
	    for (int i = 0; i < values.size(); i++) {
		ret += " " + values.elementAt(i).toString();
	    }
	    return ret;
	}
    }
    
    /**
     * Is the value of this property a default value
     * It is used by all macro for the function <code>print</code>
     */
    public boolean isDefault() {
	return false;
    }
    
}

--- NEW FILE: EnableBackground.java ---
//
// $Id: EnableBackground.java,v 1.1 2005/08/23 16:25:02 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, Keio University)
// Please first read the full copyright statement at
// http://www.w3.org/Consortium/Legal/copyright-software-19980720

package org.w3c.css.properties.svg;

import java.util.Vector;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.properties.css1.CssWidth;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssIdent;
import org.w3c.css.values.CssNumber;
import org.w3c.css.values.CssOperator;
import org.w3c.css.values.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> accumulate || new [ &lt;x&gt; &lt;y&gt; 
 *  &lt;width&gt; &lt;height&gt; || inherit<BR>
 *  <EM>Initial:</EM>accumulate<BR>
 *  <EM>Applies to:</EM>container elements<BR>
 *  <EM>Inherited:</EM>no<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 */

public class EnableBackground extends CssProperty implements CssOperator {
    
    CssValue value;
    Vector values = new Vector();
    ApplContext ac;
    
    CssIdent accumulate = new CssIdent("accumulate");
    
    /**
     * Create a new Value
     */
    public EnableBackground() {
	//nothing to do
    }
    
    /**
     * Create a new Value
     *
     * @param expression The expression for this property     
     * @exception InvalidParamException Values are incorrect
     */
    public EnableBackground(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	
	this.ac = ac;
	setByUser(); // tell this property is set by the user
	CssValue val = expression.getValue();
	char op = SPACE;
	
	if (val instanceof CssIdent) {
	    if (val.equals(inherit)) {
		value = inherit;
		expression.next();
	    } else if (val.equals(accumulate)) {
		value = accumulate;
		expression.next();
	    } else {
		throw new InvalidParamException("value", val.toString(), 
			getPropertyName(), ac);
	    }
	}
	else if (val instanceof CssNumber) {
	    // first value
	    values.addElement(val);
	    expression.next();
	    val = expression.getValue();
	    op = expression.getOperator();
	    
	    // second value
	    if (val instanceof CssNumber) {
		values.addElement(val);
		expression.next();
	    } else {
		throw new InvalidParamException("value", val.toString(), 
			getPropertyName(), ac);
	    }
	    val = expression.getValue();
	    op = expression.getOperator();
	    
	    // third value
	    try {
		CssWidth width = new CssWidth(ac, expression);
		values.addElement(width);
		//expression.next();
	    } catch (InvalidParamException e) {
		throw new InvalidParamException("value", val.toString(), 
			getPropertyName(), ac);
	    }
	    
	    val = expression.getValue(); 
	    op = expression.getOperator();
	    
	    // fourth value
	    try {
		CssWidth width = new CssWidth(ac, expression);
		values.addElement(width);
		expression.next();
	    } catch (InvalidParamException e) {
		throw new InvalidParamException("value", val.toString(), 
			getPropertyName(), ac);
	    }
	    
	}
	else {
	    throw new InvalidParamException("value", val.toString(), 
		    getPropertyName(), ac);
	}
    }
    
    public EnableBackground(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((SVGStyle) style).enableBackground != null)
	    style.addRedefinitionWarning(ac, this);
	((SVGStyle) style).enableBackground = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */  
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((SVGStyle) style).getEnableBackground();
	} else {
	    return ((SVGStyle) style).enableBackground;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */  
    public boolean equals(CssProperty property) {
	return (property instanceof EnableBackground && 
		value.equals( ((EnableBackground) property).value));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "enable-background";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	if (value != null) {
	    return value;
	} else {
	    return values;
	}
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	if (value != null) {
	    return value.equals(inherit);
	} else {
	    return false;
	}
    }
    
    /**
     * Returns a string representation of the object
     */
    public String toString() {
	if (value != null) {
	    return value.toString();
	} else {
	    String ret = "";
	    for (int i = 0; i < values.size(); i++) {
		ret += " " + values.elementAt(i).toString();
	    }
	    return ret;
	}
	
    }
    
    /**
     * Is the value of this property a default value
     * It is used by all macro for the function <code>print</code>
     */
    public boolean isDefault() {	
	return (value == accumulate);
    }
    
}

--- NEW FILE: ColorProfile.java ---
//
// $Id: ColorProfile.java,v 1.1 2005/08/23 16:25:02 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, Keio University)
// Please first read the full copyright statement at
// http://www.w3.org/Consortium/Legal/copyright-software-19980720

package org.w3c.css.properties.svg;

import java.util.Vector;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssFunction;
import org.w3c.css.values.CssIdent;
import org.w3c.css.values.CssOperator;
import org.w3c.css.values.CssURL;
import org.w3c.css.values.CssValue;

/**
 *  <PRE>
 *  Value:      auto | sRGB | (<uri> | <local-profile>)+ | inherit
 *  Initial:    auto
 *  Applies to: 'image' elements that refer to raster images
 *  Inherited:  yes
 *  Percentages: N/A
 *  Media:      visual
 * </PRE>
 */

public class ColorProfile extends CssProperty implements CssOperator {

    CssValue value;
    Vector values = new Vector();

    CssIdent auto = new CssIdent("auto");
    CssIdent sRGB = new CssIdent("sRGB");
    CssIdent none = new CssIdent("none");

    /**
     * Create a new ColorProfile
     */
    public ColorProfile() {
	// nothing to do
    }

    /** 
     * Create a new ColorProfile
     */
    public ColorProfile(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	
	//setByUser();
	char op = SPACE;
	CssValue val = expression.getValue();
	int counter = 0;
	boolean correct = true;
	String errorval = new String();

	if (val.equals(inherit)) {
	    value = inherit;
	    expression.next();
	} else if (val.equals(auto)) {
	    value = none;
	    expression.next();
	} else if (val.equals(sRGB)) {
	    value = sRGB;
	    expression.next();
	} else {
	    while ((op == SPACE)
		    && (counter < expression.getCount() && correct == true)) {
		
		if (val instanceof CssURL) {
		    values.addElement(val);
		}
		else if (val instanceof CssFunction) {
		    if (((CssFunction) val).getName().equals("local")) {
			if ((((CssFunction) val).getParameters().getCount() == 1) &&
				(((CssFunction) val).getParameters().getValue() instanceof CssURL)) {
			    values.addElement(val);
			} else {
			    correct = false;
			    errorval = val.toString();
			}
		    } else {
			correct = false;
			errorval = val.toString();
		    }
		} else {
		    correct = false;
		    errorval = val.toString();
		}

		expression.next();
		counter++;
		val = expression.getValue();
		op = expression.getOperator();
	    }
	    
	    if (!correct) {
		throw new InvalidParamException("value", val.toString(), 
			getPropertyName(), ac);
	    }
	}
    }
    
    public ColorProfile(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((SVGStyle) style).colorProfile != null)
	    style.addRedefinitionWarning(ac, this);
	((SVGStyle) style).colorProfile = this;

    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */  
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((SVGStyle) style).getColorProfileSVG();
	} else {
	    return ((SVGStyle) style).colorProfile;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */  
    public boolean equals(CssProperty property) {
	return false;
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "color-profile";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	if (value != null) {
	    return value;
	}
	else {
	    return values;
	}
    }
    
    /**
     * Returns true if this property is "softly" inherited
     * This property can't be inherited, it's only for @preference
     */
    public boolean isSoftlyInherited() {
	return value == inherit; 
    }
    
    /**
     * Returns a string representation of the object
     */
    public String toString() {
	if (value != null) {
	    return value.toString();
	}
	else {
	    String ret = "";
	    for (int i = 0; i < values.size(); i++) {
		ret += " " + values.elementAt(i).toString();
	    }
	    return ret;
	}
    }
    
    /**
     * Is the value of this property a default value
     * It is used by all macro for the function <code>print</code>
     */
    public boolean isDefault() {	
	return value == auto;
    }
    
}

--- NEW FILE: FillOpacity.java ---
//
// $Id: FillOpacity.java,v 1.1 2005/08/23 16:25:02 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, Keio University)
// Please first read the full copyright statement at
// http://www.w3.org/Consortium/Legal/copyright-software-19980720

package org.w3c.css.properties.svg;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.properties.css3.CssOpacity;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssNumber;
import org.w3c.css.values.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> &lt;opacityvalue&gt; || inherit<BR>
 *  <EM>Initial:</EM>1<BR>
 *  <EM>Applies to:</EM>all elements<BR>
 *  <EM>Inherited:</EM>no<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 */

public class FillOpacity extends CssProperty {
    
    CssValue value;
    ApplContext ac;
    
    /**
     * Create a new Value
     */
    public FillOpacity() {
	//nothing to do
    }
    
    /**
     * Create a new Value
     *
     * @param expression The expression for this property     
     * @exception InvalidParamException Values are incorrect
     */
    public FillOpacity(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	this.ac = ac;
	setByUser(); // tell this property is set by the user
	CssValue val = expression.getValue();
	boolean correct = false;
	
	if (val.equals(inherit)) {
	    value = inherit;
	    expression.next();
	    correct = true;
	} else {
	    try {
		CssOpacity opac = new CssOpacity(ac, expression);
		value = val;
		expression.next();
		correct = true;
	    } catch (InvalidParamException e) {
		correct = false;
	    }
	}
	if (!correct) {
	    throw new InvalidParamException("value", val.toString(), getPropertyName(), ac);
	}
    }
    
    public FillOpacity(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((SVGStyle) style).fillOpacity != null)
	    style.addRedefinitionWarning(ac, this);
	((SVGStyle) style).fillOpacity = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */  
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((SVGStyle) style).getFillOpacity();
	} else {
	    return ((SVGStyle) style).fillOpacity;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */  
    public boolean equals(CssProperty property) {
	return (property instanceof FillOpacity && 
		value.equals( ((FillOpacity) property).value));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "fill-opacity";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return value;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return value.equals(inherit);
    }
    
    /**
     * Returns a string representation of the object
     */
    public String toString() {
	return value.toString();
    }
    
    /**
     * Is the value of this property a default value
     * It is used by all macro for the function <code>print</code>
     */
    public boolean isDefault() {	
	CssNumber cssnum = new CssNumber(ac, (float) 1.0);
	return value == cssnum;
    }
}

--- NEW FILE: AlignmentBaseline.java ---
//
// $Id: AlignmentBaseline.java,v 1.1 2005/08/23 16:25:02 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, Keio University)
// Please first read the full copyright statement at
// http://www.w3.org/Consortium/Legal/copyright-software-19980720

package org.w3c.css.properties.svg;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> auto | baseline | before-edge |
 *  text-before-edge | middle | after-edge |
 *  text-after-edge | ideographic | alphabetic | lower | hanging | mathematical
 *  | inherit <BR>
 *  <EM>Initial:</EM>see property description<BR>
 *  <EM>Applies to:</EM>text, tspan, tref, altGlyph, textPath elements<BR>
 *  <EM>Inherited:</EM>no<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 */
public class AlignmentBaseline extends CssProperty {
    
    CssValue albaseline;
    
    private static String[] values = {
	"auto", "baseline", "before-edge",
	"text-before-edge", "middle", "after-edge",
	"text-after-edge", "ideographic", "alphabetic", "hanging", "mathematical",
	"inherit"
    };
    
    /**
     * Create a new CssAlignmentBaseline
     */
    public AlignmentBaseline() {
	//nothing to do
    }
    
    /**
     * Create a new CssAlignmentBaseline
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public AlignmentBaseline(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	
	setByUser();
	CssValue val = expression.getValue();
	
	int i = 0;
	for (; i < values.length; i++) {
	    if (val.toString().equals(values[i])) {
		albaseline = val;
		expression.next();
		break;
	    }
	}
	if (i == values.length) {
	    throw new InvalidParamException("value", expression.getValue(),
		    getPropertyName(), ac);
	}
    }
    
    public AlignmentBaseline(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((SVGStyle) style).alignmentBaseline != null)
	    style.addRedefinitionWarning(ac, this);
	((SVGStyle) style).alignmentBaseline = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((SVGStyle) style).getAlignmentBaseline();
	}
	else {
	    return ((SVGStyle) style).alignmentBaseline;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof AlignmentBaseline &&
		albaseline.equals(((AlignmentBaseline) property).albaseline));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "alignment-baseline";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return albaseline;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return albaseline.equals(inherit);
    }
    
    /**
     * Returns a string representation of the object
     */
    public String toString() {
	return albaseline.toString();
    }
    
    /**
     * Is the value of this property a default value
     * It is used by alle macro for the function <code>print</code>
     */
    public boolean isDefault() {
	return false;
    }
    
}

--- NEW FILE: ColorInterpolationFilters.java ---
//
// $Id: ColorInterpolationFilters.java,v 1.1 2005/08/23 16:25:02 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, Keio University)
// Please first read the full copyright statement at
// http://www.w3.org/Consortium/Legal/copyright-software-19980720

package org.w3c.css.properties.svg;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssIdent;
import org.w3c.css.values.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> auto || sRGB || linearRGB || inherit<BR>
 *  <EM>Initial:</EM>sRGB<BR>
 *  <EM>Applies to:</EM>all elements<BR>
 *  <EM>Inherited:</EM>yes<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 */

public class ColorInterpolationFilters extends CssProperty {
    
    CssValue interp;
    ApplContext ac;
    
    CssIdent auto = new CssIdent("auto");
    CssIdent sRGB = new CssIdent("sRGB");
    CssIdent linearRGB = new CssIdent("linearRGB");
    
    /**
     * Create a new InterpolationFilters
     */
    public ColorInterpolationFilters() {
	//nothing to do
    }
    
    /**
     * Create a new ColorInterpolationFilters
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public ColorInterpolationFilters(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	this.ac = ac;
	setByUser(); // tell this property is set by the user
	CssValue val = expression.getValue();
	
	if (val.equals(inherit)) {
	    interp = inherit;
	    expression.next();
	} else if (val.equals(sRGB)) {
	    interp = sRGB;
	    expression.next();
	} else if (val.equals(linearRGB)) {
	    interp = linearRGB;
	    expression.next();
	} else if (val.equals(auto)) {
	    interp = auto;
	    expression.next();
	}
	else {
	    throw new InvalidParamException("value", val.toString(), 
		    getPropertyName(), ac);
	}
    }
    
    public ColorInterpolationFilters(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((SVGStyle) style).colorInterpolationFilters != null)
	    style.addRedefinitionWarning(ac, this);
	((SVGStyle) style).colorInterpolationFilters = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((SVGStyle) style).getColorInterpolationFilters();
	} else {
	    return ((SVGStyle) style).colorInterpolationFilters;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof ColorInterpolationFilters &&
		interp.equals( ((ColorInterpolationFilters) property).interp));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "color-interpolation-filters";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return interp;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return interp.equals(inherit);
    }
    
    /**
     * Returns a string representation of the object
     */
    public String toString() {
	return interp.toString();
    }
    
    /**
     * Is the value of this property a default value
     * It is used by all macro for the function <code>print</code>
     */
    public boolean isDefault() {
	return (interp == linearRGB);
    }
    
}

--- NEW FILE: AtRuleColorProfile.java ---
//
// $Id: AtRuleColorProfile.java,v 1.1 2005/08/23 16:25:02 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, Keio University)
// Please first read the full copyright statement at
// http://www.w3.org/Consortium/Legal/copyright-software-19980720
package org.w3c.css.properties.svg;

import org.w3c.css.parser.AtRule;


public class AtRuleColorProfile extends AtRule {

    static int internal = 0;
    int hash;

    /**
     * Create a new AtRuleColorProfile
     */
    public AtRuleColorProfile() {
	hash = ++internal;
    }

    /**
     * Returns the at rule keyword
     */
    public String keyword() {
	return "color-profile";
    }

    /**
     * The second must be exactly the same as this one
     */
    public boolean canApply(AtRule atRule) {
	return (atRule instanceof AtRuleColorProfile);
    }

    /**
     * Return true if other is an instance of AtRuleColorProfile
     */
    public boolean equals(Object other) {
	return (other instanceof AtRuleColorProfile);
    }

    /**
     * The second must only match this one
     */
    public boolean canMatched(AtRule atRule) {
	return (atRule instanceof AtRuleColorProfile);
    }

    /**
     * Returns a string representation of the object
     */
    public String toString() {
	return "@" + keyword();
    }

    public int hashCode() {
	return hash;
    }

}

--- NEW FILE: SVGTinyStyle.java ---
//
// $Id: SVGTinyStyle.java,v 1.1 2005/08/23 16:25:02 ylafon Exp $
// From Sijtsche de Jong
//
// COPYRIGHT (c) 1995-2002 World Wide Web Consortium, (MIT, INRIA, Keio University)
// Please first read the full copyright statement at
// http://www.w3.org/Consortium/Legal/copyright-software-19980720

package org.w3c.css.properties.svg;

import org.w3c.css.parser.CssPrinterStyle;

public class SVGTinyStyle extends org.w3c.css.properties.css3.Css3Style {
    
    FillRule fillRule;
    StrokeLinejoin strokeLinejoin;
    StrokeLineCap strokeLineCap;
    StrokeMiterLimit strokeMiterLimit;
    StrokeWidth strokeWidth;
    StrokeDashOffset strokeDashOffset;
    StrokeDashArray strokeDashArray;
    Stroke stroke;
    Fill fill;
    
    public FillRule getFillRule() {
	if (fillRule == null) {
	    fillRule =
		(FillRule) style.CascadingOrder (
			new FillRule(), style, selector);
	}
	return fillRule;
    }
    
    public StrokeLinejoin getStrokeLinejoin() {
	if (strokeLinejoin == null) {
	    strokeLinejoin =
		(StrokeLinejoin) style.CascadingOrder (
			new StrokeLinejoin(), style, selector);
	}
	return strokeLinejoin;
    }
    
    public StrokeLineCap getStrokeLineCap() {
	if (strokeLineCap == null) {
	    strokeLineCap =
		(StrokeLineCap) style.CascadingOrder (
			new StrokeLineCap(), style, selector);
	}
	return strokeLineCap;
    }
    
    public StrokeMiterLimit getStrokeMiterLimit() {
	if (strokeMiterLimit == null) {
	    strokeMiterLimit =
		(StrokeMiterLimit) style.CascadingOrder (
			new StrokeMiterLimit(), style, selector);
	}
	return strokeMiterLimit;
    }
    
    public StrokeWidth getStrokeWidth() {
	if (strokeWidth == null) {
	    strokeWidth =
		(StrokeWidth) style.CascadingOrder (
			new StrokeWidth(), style, selector);
	}
	return strokeWidth;
    }
    
    public StrokeDashOffset getStrokeDashOffset() {
	if (strokeDashOffset == null) {
	    strokeDashOffset =
		(StrokeDashOffset) style.CascadingOrder (
			new StrokeDashOffset(), style, selector);
	}
	return strokeDashOffset;
    }
    
    public StrokeDashArray getStrokeDashArray() {
	if (strokeDashArray == null) {
	    strokeDashArray =
		(StrokeDashArray) style.CascadingOrder (
			new StrokeDashArray(), style, selector);
	}
	return strokeDashArray;
    }
    
    public Stroke getStroke() {
	if (stroke == null) {
	    stroke =
		(Stroke) style.CascadingOrder (
			new Stroke(), style, selector);
	}
	return stroke;
    }
    
    public Fill getFill() {
	if (fill == null) {
	    fill =
		(Fill) style.CascadingOrder (
			new Fill(), style, selector);
	}
	return fill;
    }
    
    /**
     * Print this style
     *
     * @param printer The printer interface
     */
    public void print(CssPrinterStyle printer) {
	super.print(printer);
	
	if (fillRule != null) {
	    fillRule.print(printer);
	}
	if (strokeLinejoin != null) {
	    strokeLinejoin.print(printer);
	}
	if (strokeLineCap != null) {
	    strokeLineCap.print(printer);
	}
	if (strokeMiterLimit != null) {
	    strokeMiterLimit.print(printer);
	}
	if (strokeWidth != null) {
	    strokeWidth.print(printer);
	}
	if (strokeDashOffset != null) {
	    strokeDashOffset.print(printer);
	}
	if (strokeDashArray != null) {
	    strokeDashArray.print(printer);
	}
	if (stroke != null) {
	    stroke.print(printer);
	}
	if (fill != null) {
	    fill.print(printer);
	}
    }
    
    /**
     * Returns the name of the actual selector
     */
    public String getSelector()
    {
	return (selector.getElement().toLowerCase());
    }

}

--- NEW FILE: FloodColor.java ---
//
// $Id: FloodColor.java,v 1.1 2005/08/23 16:25:02 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, Keio University)
// Please first read the full copyright statement at
// http://www.w3.org/Consortium/Legal/copyright-software-19980720

package org.w3c.css.properties.svg;

import java.util.Vector;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssColor;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssFunction;
import org.w3c.css.values.CssIdent;
import org.w3c.css.values.CssNumber;
import org.w3c.css.values.CssOperator;
import org.w3c.css.values.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> currentColor |
                    <color> [icc-color(<name>[,<icccolorvalue>]*)] | inherit<BR>
 *  <EM>Initial:</EM>none<BR>
 *  <EM>Applies to:</EM>all elements<BR>
 *  <EM>Inherited:</EM>no<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 */

public class FloodColor extends CssProperty implements CssOperator {
    
    CssValue floodColor;
    ApplContext ac;
    Vector values = new Vector();
    
    CssIdent currentColor = new CssIdent("currentColor");
    
    /**
     * Create a new FloodColor
     */
    public FloodColor() {
	//nothing to do
    }
    
    /**
     * Create a new FloodColor
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public FloodColor(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	this.ac = ac;
	setByUser(); // tell this property is set by the user
	CssValue val = expression.getValue();
	boolean correct = true;
	String errorval = "";
	char op = expression.getOperator();
	
	if (val.equals(inherit)) {
	    floodColor = inherit;
	    expression.next();
	} else if (val.equals(currentColor)) {
	    floodColor = currentColor;
	    expression.next();
	} else {
	    try {
		CssColor color = new CssColor(ac, expression);
		values.addElement(val);
		//expression.next();
	    } catch (InvalidParamException e) {
		correct = false;
		errorval = val.toString();
	    }
	    
	    op = expression.getOperator();
	    val = expression.getValue();
	    
	    if (val != null) {
		
		if (val instanceof CssFunction) { // icc-color(<name>[,<icccolorvalue>]*)]
		    CssValue function = val;
		    if (!((CssFunction) val).getName().equals("icc-color")) {
			correct = false;
			errorval = val.toString();
		    } else {
			CssExpression params = ((CssFunction) val).getParameters();
			
			op = params.getOperator();
			val = params.getValue();
			
			if (!(val instanceof CssIdent)) {
			    correct = false;
			    errorval = val.toString();
			}
			
			params.next();
			op = params.getOperator();
			val = params.getValue();
			
			if (!params.end()) { // there are more parameters left
			    int counter = 0;
			    
			    while ((op == COMMA || op == SPACE)
				    && (counter < (params.getCount() - 1) && correct == true)) {
				
				if ((!(val instanceof CssNumber)) || (((CssNumber) val).getValue() < 0)) {
				    correct = false;
				    errorval = val.toString();
				}
				
				params.next();
				counter++;
				val = params.getValue();
				op = params.getOperator();
			    }
			}
			
			if (correct) {
			    params.starts();
			    values.addElement(function);
			}
		    }
		} else {
		    correct = false;
		    errorval = val.toString();
		}
	    } else {
		correct = false;
		errorval = new String("");
	    }
	    
	    expression.next();
	    
	}
	
	if (!correct) {
	    throw new InvalidParamException("value", errorval, getPropertyName(), ac);
	}
    }
    
    public FloodColor(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((SVGStyle) style).floodColor != null)
	    style.addRedefinitionWarning(ac, this);
	((SVGStyle) style).floodColor = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((SVGStyle) style).getFloodColor();
	} else {
	    return ((SVGStyle) style).floodColor;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof FloodColor &&
		floodColor.equals( ((FloodColor) property).floodColor));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "flood-color";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	if (floodColor != null)
	    return floodColor;
	else
	    return values;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return floodColor.equals(inherit);
    }
    
    /**
     * Returns a string representation of the object
     */
    public String toString() {
	if (floodColor != null) {
	    return floodColor.toString();
	} else {
	    String ret = "";
	    for (int i = 0; i < values.size(); i++) {
		ret += " " + values.elementAt(i).toString();
	    }
	    return ret;
	}
    }
    
    /**
     * Is the value of this property a default value
     * It is used by all macro for the function <code>print</code>
     */
    public boolean isDefault() {
	return false;
    }
    
}

--- NEW FILE: SolidOpacity.java ---
//
// $Id: SolidOpacity.java,v 1.1 2005/08/23 16:25:02 ylafon Exp $
// From Sijtsche de Jong
//
// (c) COPYRIGHT 1995-2002  World Wide Web Consortium (MIT, INRIA, Keio University)
// Please first read the full copyright statement at
// http://www.w3.org/Consortium/Legal/copyright-software-19980720

package org.w3c.css.properties.svg;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.util.Util;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssIdent;
import org.w3c.css.values.CssNumber;
import org.w3c.css.values.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> &lt; alphavalue&gt; || inherit<BR>
 *  <EM>Initial:</EM>1<BR>
 *  <EM>Applies to:</EM>all elements<BR>
 *  <EM>Inherited:</EM>no<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 *  <P>
 *  This property sets the opacity of an element.
 *  <PRE>
 *  H1 { opacity: 0}
 *  </PRE>
 */

public class SolidOpacity extends CssProperty {
    
    CssValue opaclevel;
    ApplContext ac;
    
    /**
     * Create a new SolidOpacity
     */
    public SolidOpacity() {
	CssNumber cssnum =  new CssNumber((float) 1.0);
	opaclevel = cssnum;
    }
    
    /**
     * Create a new SolidOpacity
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public SolidOpacity(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	this.ac = ac;
	setByUser(); // tell this property is set by the user
	CssValue val = expression.getValue();
	if (val instanceof CssNumber) {
	    
	    CssNumber cssnum = new CssNumber(clampedValue(ac, 
		    ((CssNumber) val).getValue()));
	    opaclevel = cssnum;
	    expression.next();
	}
	else if (val instanceof CssIdent) {
	    if (val.equals(inherit)) {
		opaclevel = inherit;
		expression.next();
	    }
	}
	else {
	    throw new InvalidParamException("value", val.toString(),
		    getPropertyName(), ac);
	}
    }
    
    public SolidOpacity(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Brings all values back between 0 and 1
     *
     * @param opac The value to be modified if necessary
     */
    private float clampedValue(ApplContext ac, float opac) {
	if (opac < 0 || opac > 1) {
	    ac.getFrame().addWarning("out-of-range", Util.displayFloat(opac));
	    return ((opac<0)?0:1);
	}
	else return(opac);
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((SVGStyle) style).solidOpacity != null)
	    style.addRedefinitionWarning(ac, this);
	((SVGStyle) style).solidOpacity = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((SVGStyle) style).getSolidOpacity();
	} else {
	    return ((SVGStyle) style).solidOpacity;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof SolidOpacity &&
		opaclevel.equals( ((SolidOpacity) property).opaclevel));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "solid-opacity";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return opaclevel;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return opaclevel.equals(inherit);
    }
    
    /**
     * Returns a string representation of the object
     */
    public String toString() {
	return opaclevel.toString();
    }
    
    /**
     * Is the value of this property a default value
     * It is used by all macro for the function <code>print</code>
     */
    public boolean isDefault() {
	CssNumber cssnum = new CssNumber(ac, (float) 1.0);
	return opaclevel == cssnum;
    }
    
}


--- NEW FILE: ColorProfileSrc.java ---
//
// $Id: ColorProfileSrc.java,v 1.1 2005/08/23 16:25:02 ylafon Exp $
// From Sijtsche Smeman (sijtsche@wisdom.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, Keio University)
// Please first read the full copyright statement at
// http://www.w3.org/Consortium/Legal/copyright-software-19980720

package org.w3c.css.properties.svg;

import java.util.Vector;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssFunction;
import org.w3c.css.values.CssIdent;
import org.w3c.css.values.CssOperator;
import org.w3c.css.values.CssURL;
import org.w3c.css.values.CssValue;

/**
 * This property sets the preferred media for this stylesheet
 */

public class ColorProfileSrc extends CssProperty implements CssOperator {
    
    CssValue cpSrc;
    Vector cpSrcs = new Vector();
    
    CssIdent sRGB = new CssIdent("sRGB");
    
    /**
     * Create a new ColorProfileSrc
     */
    public ColorProfileSrc() {
	cpSrc = sRGB;
    }
    
    /**
     * Create a new ColorProfileSrc
     */
    public ColorProfileSrc(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	
	//setByUser();
	char op = expression.getOperator();
	CssValue val = expression.getValue();
	
	if ((val.toString().toLowerCase()).equals("srgb")) {
	    cpSrc = sRGB;
	    expression.next();
	} else if (val instanceof CssFunction) {
	    CssFunction fun = (CssFunction) val;
	    CssExpression params = fun.getParameters();
	    if (fun.getName().equals("local")) {
		if ((params.getCount() == 1)) {
		    cpSrc = val;
		    expression.next();
		} else {
		    throw new InvalidParamException("value",
			    params.getValue(), getPropertyName(), ac);
		}
	    } else {
		throw new InvalidParamException("value",
			val, getPropertyName(), ac);
	    }
	    
	    val = expression.getValue();
	    
	    if (val != null) {
		
		if (op != SPACE) {
		    throw new InvalidParamException("operator",
			    new Character(op), getPropertyName(), ac);
		}
		
		if (val instanceof CssURL) {
		    cpSrcs.addElement(cpSrc);
		    cpSrcs.addElement(val);
		    cpSrc = null;
		    expression.next();
		}
	    }
	    
	} else if (val instanceof CssURL) {
	    cpSrc = val;
	    expression.next();
	} else {
	    throw new InvalidParamException("cpSrc",expression.getValue(),
		    getPropertyName(), ac);
	}
	
    }
    
    public ColorProfileSrc(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((SVGStyle) style).cpSrc != null)
	    style.addRedefinitionWarning(ac, this);
	((SVGStyle) style).cpSrc = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((SVGStyle) style).getColorProfileSrc();
	} else {
	    return ((SVGStyle) style).cpSrc;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param cpSrc The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof ColorProfileSrc &&
		cpSrc.equals( ((ColorProfileSrc) property).cpSrc));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "src";
    }
    
    /**
     * Returns the cpSrc of this property
     */
    public Object get() {
	if (cpSrc != null)
	    return cpSrc;
	else
	    return cpSrcs;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return cpSrc.equals(inherit);
    }
    
    /**
     * Returns a string representation of the object
     */
    public String toString() {
	if (cpSrc != null) {
	    return cpSrc.toString();
	} else {
	    String ret = "";
	    for (int i = 0; i < cpSrcs.size(); i++) {
		ret += " " + cpSrcs.elementAt(i).toString();
	    }
	    return ret;
	}
    }
    
    /**
     * Is the cpSrc of this property a default cpSrc
     * It is used by all macro for the function <code>print</code>
     */
    public boolean isDefault() {
	return cpSrc == sRGB;
    }
    
}

--- NEW FILE: StopColor.java ---
//
// $Id: StopColor.java,v 1.1 2005/08/23 16:25:02 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, Keio University)
// Please first read the full copyright statement at
// http://www.w3.org/Consortium/Legal/copyright-software-19980720

package org.w3c.css.properties.svg;

import java.util.Vector;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssColor;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssFunction;
import org.w3c.css.values.CssIdent;
import org.w3c.css.values.CssNumber;
import org.w3c.css.values.CssOperator;
import org.w3c.css.values.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> currentColor || &lt;color&gt;[icc-color(
 *   &lt;name&gt;[&lt;icccolorvalue&gt;]*)] || inherit<BR>
 *  <EM>Initial:</EM>none<BR>
 *  <EM>Applies to:</EM>all elements<BR>
 *  <EM>Inherited:</EM>no<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 */

public class StopColor extends CssProperty implements CssOperator {
    
    CssValue stopColor;
    ApplContext ac;
    Vector values = new Vector();
    
    CssIdent currentColor = new CssIdent("currentColor");
    
    /**
     * Create a new StopColor
     */
    public StopColor() {
	//nothing to do
    }
    
    /**
     * Create a new StopColor
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public StopColor(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	this.ac = ac;
	setByUser(); // tell this property is set by the user
	CssValue val = expression.getValue();
	boolean correct = true;
	String errorval = "";
	char op = expression.getOperator();
	
	if (val.equals(inherit)) {
	    stopColor = inherit;
	    expression.next();
	} else if (val.equals(currentColor)) {
	    stopColor = currentColor;
	    expression.next();
	} else {
	    try {
		CssColor color = new CssColor(ac, expression);
		values.addElement(val);
		//expression.next();
	    } catch (InvalidParamException e) {
		correct = false;
		errorval = val.toString();
	    }
	    
	    op = expression.getOperator();
	    val = expression.getValue();
	    
	    if (val != null) {
		
		if (val instanceof CssFunction) { // icc-color(<name>[,<icccolorvalue>]*)]
		    CssValue function = val;
		    if (!((CssFunction) val).getName().equals("icc-color")) {
			correct = false;
			errorval = val.toString();
		    } else {
			CssExpression params = ((CssFunction) val).getParameters();
			
			op = params.getOperator();
			val = params.getValue();
			
			if (!(val instanceof CssIdent)) {
			    correct = false;
			    errorval = val.toString();
			}
			
			params.next();
			op = params.getOperator();
			val = params.getValue();
			
			if (!params.end()) { // there are more parameters left
			    int counter = 0;
			    
			    while ((op == COMMA || op == SPACE)
				    && (counter < (params.getCount() - 1) && correct == true)) {
				
				if ((!(val instanceof CssNumber)) || (((CssNumber) val).getValue() < 0)) {
				    correct = false;
				    errorval = val.toString();
				}
				
				params.next();
				counter++;
				val = params.getValue();
				op = params.getOperator();
			    }
			}
			
			if (correct) {
			    params.starts();
			    values.addElement(function);
			}
		    }
		} else {
		    correct = false;
		    errorval = val.toString();
		}
	    } else {
		correct = false;
		errorval = new String("");
	    }
	    
	    expression.next();
	    
	}
	
	if (!correct) {
	    throw new InvalidParamException("value", errorval, getPropertyName(), ac);
	}
    }
    
    public StopColor(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((SVGStyle) style).stopColor != null)
	    style.addRedefinitionWarning(ac, this);
	((SVGStyle) style).stopColor = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((SVGStyle) style).getStopColor();
	} else {
	    return ((SVGStyle) style).stopColor;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof StopColor &&
		stopColor.equals( ((StopColor) property).stopColor));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "stop-color";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	if (stopColor != null)
	    return stopColor;
	else
	    return values;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return stopColor.equals(inherit);
    }
    
    /**
     * Returns a string representation of the object
     */
    public String toString() {
	if (stopColor != null) {
	    return stopColor.toString();
	} else {
	    String ret = "";
	    for (int i = 0; i < values.size(); i++) {
		ret += " " + values.elementAt(i).toString();
	    }
	    return ret;
	}
    }
    
    /**
     * Is the value of this property a default value
     * It is used by all macro for the function <code>print</code>
     */
    public boolean isDefault() {
	return false;
    }
    
}

--- NEW FILE: MarkerEnd.java ---
//
// $Id: MarkerEnd.java,v 1.1 2005/08/23 16:25:02 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, Keio University)
// Please first read the full copyright statement at
// http://www.w3.org/Consortium/Legal/copyright-software-19980720

package org.w3c.css.properties.svg;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssIdent;
import org.w3c.css.values.CssURL;
import org.w3c.css.values.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> &lt;uri&gt; || none || inherit<BR>
 *  <EM>Initial:</EM>none<BR>
 *  <EM>Applies to:</EM>all elements<BR>
 *  <EM>Inherited:</EM>no<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 */

public class MarkerEnd extends CssProperty {
    
    CssValue markerEnd;
    ApplContext ac;
    
    CssIdent none = new CssIdent("none");
    
    /**
     * Create a new MarkerEnd
     */
    public MarkerEnd() {
	//nothing to do
    }
    
    /**
     * Create a new MarkerEnd
     *
     * @param expression The expression for this property     
     * @exception InvalidParamException Values are incorrect
     */
    public MarkerEnd(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	this.ac = ac;
	setByUser(); // tell this property is set by the user
	CssValue val = expression.getValue();
	if (val instanceof CssURL) {
	    markerEnd = val;
	    expression.next();
	}
	else if (val instanceof CssIdent) {
	    if (val.equals(inherit)) {
		markerEnd = inherit;
		expression.next();
	    } else if (val.equals(none)) {
		markerEnd = none;
		expression.next();
	    }
	}
	else {
	    throw new InvalidParamException("value", val.toString(), getPropertyName(), ac);
	}
    }
    
    public MarkerEnd(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((SVGStyle) style).markerEnd != null)
	    style.addRedefinitionWarning(ac, this);
	((SVGStyle) style).markerEnd = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */  
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((SVGStyle) style).getMarkerEnd();
	} else {
	    return ((SVGStyle) style).markerEnd;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */  
    public boolean equals(CssProperty property) {
	return (property instanceof MarkerEnd && 
		markerEnd.equals( ((MarkerEnd) property).markerEnd));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "marker-end";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return markerEnd;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return markerEnd.equals(inherit);
    }
    
    /**
     * Returns a string representation of the object
     */
    public String toString() {
	return markerEnd.toString();
    }
    
    /**
     * Is the value of this property a default value
     * It is used by all macro for the function <code>print</code>
     */
    public boolean isDefault() {	
	return (markerEnd == none);
    }
    
}

--- NEW FILE: Mask.java ---
//
// $Id: Mask.java,v 1.1 2005/08/23 16:25:02 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, Keio University)
// Please first read the full copyright statement at
// http://www.w3.org/Consortium/Legal/copyright-software-19980720

package org.w3c.css.properties.svg;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssIdent;
import org.w3c.css.values.CssURL;
import org.w3c.css.values.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> &lt;uri&gt; || none || inherit<BR>
 *  <EM>Initial:</EM>none<BR>
 *  <EM>Applies to:</EM>all elements<BR>
 *  <EM>Inherited:</EM>no<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 */

public class Mask extends CssProperty {
    
    CssValue mask;
    ApplContext ac;
    
    CssIdent none = new CssIdent("none");
    
    /**
     * Create a new Mask
     */
    public Mask() {
	//nothing to do
    }
    
    /**
     * Create a new Mask
     *
     * @param expression The expression for this property     
     * @exception InvalidParamException Values are incorrect
     */
    public Mask(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	this.ac = ac;
	setByUser(); // tell this property is set by the user
	CssValue val = expression.getValue();
	if (val instanceof CssURL) {
	    mask = val;
	    expression.next();
	}
	else if (val instanceof CssIdent) {
	    if (val.equals(inherit)) {
		mask = inherit;
		expression.next();
	    } else if (val.equals(none)) {
		mask = none;
		expression.next();
	    }
	}
	else {
	    throw new InvalidParamException("value", val.toString(), getPropertyName(), ac);
	}
    }
    
    public Mask(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((SVGStyle) style).mask != null)
	    style.addRedefinitionWarning(ac, this);
	((SVGStyle) style).mask = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */  
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((SVGStyle) style).getMask();
	} else {
	    return ((SVGStyle) style).mask;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */  
    public boolean equals(CssProperty property) {
	return (property instanceof Mask && 
		mask.equals( ((Mask) property).mask));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "mask";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return mask;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return mask.equals(inherit);
    }
    
    /**
     * Returns a string representation of the object
     */
    public String toString() {
	return mask.toString();
    }
    
    /**
     * Is the value of this property a default value
     * It is used by all macro for the function <code>print</code>
     */
    public boolean isDefault() {	
	return (mask == none);
    }
    
}

--- NEW FILE: SVGStyle.java ---
//
// $Id: SVGStyle.java,v 1.1 2005/08/23 16:25:02 ylafon Exp $
// From Sijtsche de Jong
//
// COPYRIGHT (c) 1995-2002 World Wide Web Consortium, (MIT, INRIA, Keio University)
// Please first read the full copyright statement at
// http://www.w3.org/Consortium/Legal/copyright-software-19980720

package org.w3c.css.properties.svg;

import org.w3c.css.parser.CssPrinterStyle;

public class SVGStyle extends org.w3c.css.properties.css3.Css3Style {
    
    AlignmentBaseline alignmentBaseline;
    ClipPath clipPath;
    ClipRule clipRule;
    ColorInterpolation colorInterpolation;
    ColorInterpolationFilters colorInterpolationFilters;
    ColorRendering colorRendering;
    EnableBackground enableBackground;
    WritingModeSVG writingModeSVG;
    FloodOpacity floodOpacity;
    Filter filter;
    FillRule fillRule;
    FillOpacity fillOpacity;
    ImageRendering imageRendering;
    Mask mask;
    StopOpacity stopOpacity;
    Kerning kerning;
    Marker marker;
    MarkerStart markerStart;
    MarkerEnd markerEnd;
    MarkerMid markerMid;
    PointerEvents pointerEvents;
    ShapeRendering shapeRendering;
    TextRendering textRendering;
    TextAnchor textAnchor;
    StrokeLinejoin strokeLinejoin;
    StrokeLineCap strokeLineCap;
    StrokeMiterLimit strokeMiterLimit;
    StrokeOpacity strokeOpacity;
    StrokeWidth strokeWidth;
    StrokeDashOffset strokeDashOffset;
    StrokeDashArray strokeDashArray;
    StopColor stopColor;
    SolidColor solidColor;
    LightingColor lightingColor;
    FloodColor floodColor;
    Stroke stroke;
    ColorProfile colorProfile;
    DominantBaseLine dominantBaseLine;
    SolidOpacity solidOpacity;
    Fill fill;
    ColorProfileSrc cpSrc;
    ColorProfileName cpName;
    CssRenderIntent cssRenderIntent;
    
    public AlignmentBaseline getAlignmentBaseline() {
	if (alignmentBaseline == null) {
	    alignmentBaseline =
		(AlignmentBaseline) style.CascadingOrder (
			new AlignmentBaseline(), style, selector);
	}
	return alignmentBaseline;
    }
    
    public DominantBaseLine getDominantBaseLineSVG() {
	if (dominantBaseLine == null) {
	    dominantBaseLine =
		(DominantBaseLine) style.CascadingOrder (
			new DominantBaseLine(), style, selector);
	}
	return dominantBaseLine;
    }
    
    public ClipPath getClipPath() {
	if (clipPath == null) {
	    clipPath =
		(ClipPath) style.CascadingOrder (
			new ClipPath(), style, selector);
	}
	return clipPath;
    }
    
    public ClipRule getClipRule() {
	if (clipRule == null) {
	    clipRule =
		(ClipRule) style.CascadingOrder (
			new ClipRule(), style, selector);
	}
	return clipRule;
    }
    
    public ColorInterpolation getColorInterpolation() {
	if (colorInterpolation == null) {
	    colorInterpolation =
		(ColorInterpolation) style.CascadingOrder (
			new ColorInterpolation(), style, selector);
	}
	return colorInterpolation;
    }
    
    public ColorInterpolationFilters getColorInterpolationFilters() {
	if (colorInterpolationFilters == null) {
	    colorInterpolationFilters =
		(ColorInterpolationFilters) style.CascadingOrder (
			new ColorInterpolationFilters(), style, selector);
	}
	return colorInterpolationFilters;
    }
    
    public ColorRendering getColorRendering() {
	if (colorRendering == null) {
	    colorRendering =
		(ColorRendering) style.CascadingOrder (
			new ColorRendering(), style, selector);
	}
	return colorRendering;
    }
    
    public EnableBackground getEnableBackground() {
	if (enableBackground == null) {
	    enableBackground =
		(EnableBackground) style.CascadingOrder (
			new EnableBackground(), style, selector);
	}
	return enableBackground;
    }
    
    public WritingModeSVG getWritingModeSVG() {
	if (writingModeSVG == null) {
	    writingModeSVG =
		(WritingModeSVG) style.CascadingOrder (
			new WritingModeSVG(), style, selector);
	}
	return writingModeSVG;
    }
    
    public FloodOpacity getFloodOpacity() {
	if (floodOpacity == null) {
	    floodOpacity =
		(FloodOpacity) style.CascadingOrder (
			new FloodOpacity(), style, selector);
	}
	return floodOpacity;
    }
    
    public Filter getFilter() {
	if (filter == null) {
	    filter =
		(Filter) style.CascadingOrder (
			new Filter(), style, selector);
	}
	return filter;
    }
    
    public FillRule getFillRule() {
	if (fillRule == null) {
	    fillRule =
		(FillRule) style.CascadingOrder (
			new FillRule(), style, selector);
	}
	return fillRule;
    }
    
    public FillOpacity getFillOpacity() {
	if (fillOpacity == null) {
	    fillOpacity =
		(FillOpacity) style.CascadingOrder (
			new FillOpacity(), style, selector);
	}
	return fillOpacity;
    }
    
    public ImageRendering getImageRendering() {
	if (imageRendering == null) {
	    imageRendering =
		(ImageRendering) style.CascadingOrder (
			new ImageRendering(), style, selector);
	}
	return imageRendering;
    }
    
    public Mask getMask() {
	if (mask == null) {
	    mask =
		(Mask) style.CascadingOrder (
			new ImageRendering(), style, selector);
	}
	return mask;
    }
    
    public StopOpacity getStopOpacity() {
	if (stopOpacity == null) {
	    stopOpacity =
		(StopOpacity) style.CascadingOrder (
			new StopOpacity(), style, selector);
	}
	return stopOpacity;
    }
    
    public Kerning getKerning() {
	if (kerning == null) {
	    kerning =
		(Kerning) style.CascadingOrder (
			new Kerning(), style, selector);
	}
	return kerning;
    }
    
    public Marker getMarker() {
	if (marker == null) {
	    marker =
		(Marker) style.CascadingOrder (
			new Marker(), style, selector);
	}
	return marker;
    }
    
    public MarkerStart getMarkerStart() {
	if (markerStart == null) {
	    markerStart =
		(MarkerStart) style.CascadingOrder (
			new MarkerStart(), style, selector);
	}
	return markerStart;
    }
    
    public MarkerEnd getMarkerEnd() {
	if (markerEnd == null) {
	    markerEnd =
		(MarkerEnd) style.CascadingOrder (
			new MarkerEnd(), style, selector);
	}
	return markerEnd;
    }
    
    public MarkerMid getMarkerMid() {
	if (markerMid == null) {
	    markerMid =
		(MarkerMid) style.CascadingOrder (
			new MarkerMid(), style, selector);
	}
	return markerMid;
    }
    
    public PointerEvents getPointerEvents() {
	if (pointerEvents == null) {
	    pointerEvents =
		(PointerEvents) style.CascadingOrder (
			new PointerEvents(), style, selector);
	}
	return pointerEvents;
    }
    
    public ShapeRendering getShapeRendering() {
	if (shapeRendering == null) {
	    shapeRendering =
		(ShapeRendering) style.CascadingOrder (
			new ShapeRendering(), style, selector);
	}
	return shapeRendering;
    }
    
    public TextRendering getTextRendering() {
	if (textRendering == null) {
	    textRendering =
		(TextRendering) style.CascadingOrder (
			new TextRendering(), style, selector);
	}
	return textRendering;
    }
    
    public TextAnchor getTextAnchor() {
	if (textAnchor == null) {
	    textAnchor =
		(TextAnchor) style.CascadingOrder (
			new TextAnchor(), style, selector);
	}
	return textAnchor;
    }
    
    public StrokeLinejoin getStrokeLinejoin() {
	if (strokeLinejoin == null) {
	    strokeLinejoin =
		(StrokeLinejoin) style.CascadingOrder (
			new StrokeLinejoin(), style, selector);
	}
	return strokeLinejoin;
    }
    
    public StrokeLineCap getStrokeLineCap() {
	if (strokeLineCap == null) {
	    strokeLineCap =
		(StrokeLineCap) style.CascadingOrder (
			new StrokeLineCap(), style, selector);
	}
	return strokeLineCap;
    }
    
    public StrokeMiterLimit getStrokeMiterLimit() {
	if (strokeMiterLimit == null) {
	    strokeMiterLimit =
		(StrokeMiterLimit) style.CascadingOrder (
			new StrokeMiterLimit(), style, selector);
	}
	return strokeMiterLimit;
    }
    
    public StrokeOpacity getStrokeOpacity() {
	if (strokeOpacity == null) {
	    strokeOpacity =
		(StrokeOpacity) style.CascadingOrder (
			new StrokeOpacity(), style, selector);
	}
	return strokeOpacity;
    }
    
    public StrokeWidth getStrokeWidth() {
	if (strokeWidth == null) {
	    strokeWidth =
		(StrokeWidth) style.CascadingOrder (
			new StrokeWidth(), style, selector);
	}
	return strokeWidth;
    }
    
    public StrokeDashOffset getStrokeDashOffset() {
	if (strokeDashOffset == null) {
	    strokeDashOffset =
		(StrokeDashOffset) style.CascadingOrder (
			new StrokeDashOffset(), style, selector);
	}
	return strokeDashOffset;
    }
    
    public StrokeDashArray getStrokeDashArray() {
	if (strokeDashArray == null) {
	    strokeDashArray =
		(StrokeDashArray) style.CascadingOrder (
			new StrokeDashArray(), style, selector);
	}
	return strokeDashArray;
    }
    
    public StopColor getStopColor() {
	if (stopColor == null) {
	    stopColor =
		(StopColor) style.CascadingOrder (
			new StopColor(), style, selector);
	}
	return stopColor;
    }
    
    public SolidColor getSolidColor() {
	if (solidColor == null) {
	    solidColor =
		(SolidColor) style.CascadingOrder (
			new SolidColor(), style, selector);
	}
	return solidColor;
    }
    
    public LightingColor getLightingColor() {
	if (lightingColor == null) {
	    lightingColor =
		(LightingColor) style.CascadingOrder(
			new LightingColor(), style, selector);
	}
	return lightingColor;
    }
    
    public FloodColor getFloodColor() {
	if (floodColor == null) {
	    floodColor =
		(FloodColor) style.CascadingOrder (
			new FloodColor(), style, selector);
	}
	return floodColor;
    }
    
    public ColorProfile getColorProfileSVG() {
	if (colorProfile == null) {
	    colorProfile =
		(ColorProfile) style.CascadingOrder (
			new ColorProfile(), style, selector);
	}
	return colorProfile;
    }
    
    public Stroke getStroke() {
	if (stroke == null) {
	    stroke =
		(Stroke) style.CascadingOrder (
			new Stroke(), style, selector);
	}
	return stroke;
    }
    
    public SolidOpacity getSolidOpacity() {
	if (solidOpacity == null) {
	    solidOpacity =
		(SolidOpacity) style.CascadingOrder (
			new SolidOpacity(), style, selector);
	}
	return solidOpacity;
    }
    
    public Fill getFill() {
	if (fill == null) {
	    fill =
		(Fill) style.CascadingOrder (
			new Fill(), style, selector);
	}
	return fill;
    }
    
    public ColorProfileSrc getColorProfileSrc() {
	if (cpSrc == null) {
	    cpSrc =
		(ColorProfileSrc) style.CascadingOrder (
			new ColorProfileSrc(), style, selector);
	}
	return cpSrc;
    }
    
    public ColorProfileName getColorProfileName() {
	if (cpName == null) {
	    cpName =
		(ColorProfileName) style.CascadingOrder (
			new ColorProfileName(), style, selector);
	}
	return cpName;
    }
    
    public CssRenderIntent getCssRenderIntent() {
	if (cssRenderIntent == null) {
	    cssRenderIntent =
		(CssRenderIntent) style.CascadingOrder (
			new CssRenderIntent(), style, selector);
	}
	return cssRenderIntent;
    }
    
    /**
     * Print this style
     *
     * @param printer The printer interface
     */
    public void print(CssPrinterStyle printer) {
	super.print(printer);
	
	if (alignmentBaseline != null) {
	    alignmentBaseline.print(printer);
	}
	if (dominantBaseLine != null) {
	    dominantBaseLine.print(printer);
	}
	if (clipPath != null) {
	    clipPath.print(printer);
	}
	if (clipRule != null) {
	    clipRule.print(printer);
	}
	if (colorInterpolation != null) {
	    colorInterpolation.print(printer);
	}
	if (colorRendering != null) {
	    colorRendering.print(printer);
	}
	if (enableBackground != null) {
	    enableBackground.print(printer);
	}
	if (writingModeSVG != null) {
	    writingModeSVG.print(printer);
	}
	if (floodOpacity != null) {
	    floodOpacity.print(printer);
	}
	if (filter != null) {
	    filter.print(printer);
	}
	if (fillRule != null) {
	    fillRule.print(printer);
	}
	if (fillOpacity != null) {
	    fillOpacity.print(printer);
	}
	if (imageRendering != null) {
	    imageRendering.print(printer);
	}
	if (mask != null) {
	    mask.print(printer);
	}
	if (stopOpacity != null) {
	    stopOpacity.print(printer);
	}
	if (kerning != null) {
	    kerning.print(printer);
	}
	if (marker != null) {
	    marker.print(printer);
	}
	if (markerStart != null) {
	    markerStart.print(printer);
	}
	if (markerEnd != null) {
	    markerEnd.print(printer);
	}
	if (markerMid != null) {
	    markerMid.print(printer);
	}
	if (pointerEvents != null) {
	    pointerEvents.print(printer);
	}
	if (shapeRendering != null) {
	    shapeRendering.print(printer);
	}
	if (textRendering != null) {
	    textRendering.print(printer);
	}
	if (textAnchor != null) {
	    textAnchor.print(printer);
	}
	if (strokeLinejoin != null) {
	    strokeLinejoin.print(printer);
	}
	if (strokeLineCap != null) {
	    strokeLineCap.print(printer);
	}
	if (strokeMiterLimit != null) {
	    strokeMiterLimit.print(printer);
	}
	if (strokeOpacity != null) {
	    strokeOpacity.print(printer);
	}
	if (strokeWidth != null) {
	    strokeWidth.print(printer);
	}
	if (strokeDashOffset != null) {
	    strokeDashOffset.print(printer);
	}
	if (strokeDashArray != null) {
	    strokeDashArray.print(printer);
	}
	if (stopColor != null) {
	    stopColor.print(printer);
	}
	if (solidColor != null) {
	    solidColor.print(printer);
	}
	if (lightingColor != null) {
	    lightingColor.print(printer);
	}
	if (floodColor != null) {
	    floodColor.print(printer);
	}
	if (stroke != null) {
	    stroke.print(printer);
	}
	if (colorProfile != null) {
	    colorProfile.print(printer);
	}
	if (solidOpacity != null) {
	    solidOpacity.print(printer);
	}
	if (fill != null) {
	    fill.print(printer);
	}
	if (cpSrc != null) {
	    cpSrc.print(printer);
	}
	if (cpName != null) {
	    cpName.print(printer);
	}
	if (cssRenderIntent != null) {
	    cssRenderIntent.print(printer);
	}
    }
    
    /**
     * Returns the name of the actual selector
     */
    public String getSelector()
    {
	return (selector.getElement().toLowerCase());
    }
    
}

--- NEW FILE: WritingModeSVG.java ---
//
// $Id: WritingModeSVG.java,v 1.1 2005/08/23 16:25:02 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, Keio University)
// Please first read the full copyright statement at
// http://www.w3.org/Consortium/Legal/copyright-software-19980720

package org.w3c.css.properties.svg;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssIdent;
import org.w3c.css.values.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> lr-tb || rl-tb || tb-rl || bt-rl || lr || rl || tb || inherit<BR>
 *  <EM>Initial:</EM>lr-tb<BR>
 *  <EM>Applies to:</EM>all elements<BR>
 *  <EM>Inherited:</EM>yes<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 *  <P>
 *  This property sets the primary text advance direction
 */

public class WritingModeSVG extends CssProperty {

    CssValue mode;
    
    static CssIdent lrtb = new CssIdent("lr-tb");
    static CssIdent rltb = new CssIdent("rl-tb");
    static CssIdent tbrl = new CssIdent("tb-rl");
    static CssIdent lr = new CssIdent("lr");
    static CssIdent rl = new CssIdent("rl");
    static CssIdent tb = new CssIdent("tb");
    
    /**
     * Create a new WritingModeSVG
     */
    public WritingModeSVG() {
	mode = lrtb;
    }

    /**
     * Create a new CssWritingModeSVG
     */
    public WritingModeSVG(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {

	setByUser();
	CssValue val = expression.getValue();

	if (val.equals(lrtb)) {
	    mode = lrtb;
	    expression.next();
	}
	else if (val.equals(rltb)) {
	    mode = rltb;
	    expression.next();
	}
	else if (val.equals(tbrl)) {
	    mode = tbrl;
	    expression.next();
	}
	else if (val.equals(lr)) {
	    mode = lr;
	    expression.next();
	}
	else if (val.equals(rl)) {
	    mode = rl;
	    expression.next();
	}
	else if (val.equals(tb)) {
	    mode = tb;
	    expression.next();
	}
	else if (val.equals(inherit)) {
	    mode = inherit;
	    expression.next();
	}
	else {
	    throw new InvalidParamException("value", expression.getValue(),
					    getPropertyName(), ac);
	}
    }

    public WritingModeSVG(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((SVGStyle) style).writingModeSVG != null)
	    style.addRedefinitionWarning(ac, this);
	((SVGStyle) style).writingModeSVG = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((SVGStyle) style).getWritingModeSVG();
	}
	else {
	    return ((SVGStyle) style).writingModeSVG;
	}
    }

    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof WritingModeSVG &&
		mode.equals(((WritingModeSVG) property).mode));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "writing-mode";
    }

    /**
     * Returns the value of this property
     */
    public Object get() {
	return mode;
    }

    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return mode.equals(inherit);
    }

    /**
     * Returns a string representation of the object
     */
    public String toString() {
	return mode.toString();
    }

    /**
     * Is the value of this property a default value
     * It is used by alle macro for the function <code>print</code>
     */
    public boolean isDefault() {
	return mode == lrtb;
    }

}

--- NEW FILE: PointerEvents.java ---
//
// $Id: PointerEvents.java,v 1.1 2005/08/23 16:25:02 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, Keio University)
// Please first read the full copyright statement at
// http://www.w3.org/Consortium/Legal/copyright-software-19980720

package org.w3c.css.properties.svg;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssIdent;
import org.w3c.css.values.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> visiblePainted | visibleFill | visibleStroke |
 *  visible | painted | fill | stroke | all | none | inherit <BR>
 *  <EM>Initial:</EM>visiblePainted<BR>
 *  <EM>Applies to:</EM>container and graphics elements<BR>
 *  <EM>Inherited:</EM>yes<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual 
 */

public class PointerEvents extends CssProperty {
    
    CssValue events;
    
    static CssIdent visiblePainted = new CssIdent("visiblePainted");
    
    private static String[] values = {
	"visiblePainted", "visibleFill", "visibleStroke",
	"visible", "painted", "fill", "stroke", "all", "none", "inherit"
    };
    
    /**
     * Create a new PointerEvents
     */
    public PointerEvents() {
	// nothing to do
    }
    
    /**
     * Create a new PointerEvents
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public PointerEvents(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	
	setByUser();
	CssValue val = expression.getValue();
	
	int i = 0;
	for (; i < values.length; i++) {
	    if (val.toString().equals(values[i])) {
		events = val;
		expression.next();
		break;
	    }
	}
	if (i == values.length) {
	    throw new InvalidParamException("value", expression.getValue(),
		    getPropertyName(), ac);
	}
    }
    
    public PointerEvents(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((SVGStyle) style).pointerEvents != null)
	    style.addRedefinitionWarning(ac, this);
	((SVGStyle) style).pointerEvents = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((SVGStyle) style).getPointerEvents();
	}
	else {
	    return ((SVGStyle) style).pointerEvents;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof PointerEvents &&
		events.equals(((PointerEvents) property).events));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "pointer-events";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return events;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return events.equals(inherit);
    }
    
    /**
     * Returns a string representation of the object
     */
    public String toString() {
	return events.toString();
    }
    
    /**
     * Is the value of this property a default value
     * It is used by alle macro for the function <code>print</code>
     */
    public boolean isDefault() {
	return (events == visiblePainted);
    }
    
}

--- NEW FILE: ClipPath.java ---
//
// $Id: ClipPath.java,v 1.1 2005/08/23 16:25:02 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, Keio University)
// Please first read the full copyright statement at
// http://www.w3.org/Consortium/Legal/copyright-software-19980720

package org.w3c.css.properties.svg;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssIdent;
import org.w3c.css.values.CssURL;
import org.w3c.css.values.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> &lt;uri&gt; || none || inherit<BR>
 *  <EM>Initial:</EM>none<BR>
 *  <EM>Applies to:</EM>all elements<BR>
 *  <EM>Inherited:</EM>no<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 */

public class ClipPath extends CssProperty {
    
    CssValue clippath;
    ApplContext ac;

    CssIdent none = new CssIdent("none");

    /**
     * Create a new ClipPath
     */
    public ClipPath() {
	//nothing to do
    }
    
    /**
     * Create a new ClipPath
     *
     * @param expression The expression for this property     
     * @exception InvalidParamException Values are incorrect
     */
    public ClipPath(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	this.ac = ac;
	setByUser(); // tell this property is set by the user
	CssValue val = expression.getValue();
	if (val instanceof CssURL) {
	    clippath = val;
	    expression.next();
	}
	else if (val instanceof CssIdent) {
	    if (val.equals(inherit)) {
		clippath = inherit;
		expression.next();
	    } else if (val.equals(none)) {
		clippath = none;
		expression.next();
	    }
	}
	else {
	    throw new InvalidParamException("value", val.toString(), getPropertyName(), ac);
	}
    }
    
    public ClipPath(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((SVGStyle) style).clipPath != null)
	    style.addRedefinitionWarning(ac, this);
	((SVGStyle) style).clipPath = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */  
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((SVGStyle) style).getClipPath();
	} else {
	    return ((SVGStyle) style).clipPath;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */  
    public boolean equals(CssProperty property) {
	return (property instanceof ClipPath && 
		clippath.equals( ((ClipPath) property).clippath));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "clip-path";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return clippath;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return clippath.equals(inherit);
    }
    
    /**
     * Returns a string representation of the object
     */
    public String toString() {
	return clippath.toString();
    }
    
    /**
     * Is the value of this property a default value
     * It is used by all macro for the function <code>print</code>
     */
    public boolean isDefault() {	
	return (clippath == none);
    }
    
}

--- NEW FILE: StrokeWidth.java ---
//
// $Id: StrokeWidth.java,v 1.1 2005/08/23 16:25:02 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, Keio University)
// Please first read the full copyright statement at
// http://www.w3.org/Consortium/Legal/copyright-software-19980720

package org.w3c.css.properties.svg;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.properties.css1.CssWidth;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssNumber;
import org.w3c.css.values.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> &lt;opacityvalue&gt; || inherit<BR>
 *  <EM>Initial:</EM>1<BR>
 *  <EM>Applies to:</EM>all elements<BR>
 *  <EM>Inherited:</EM>no<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 */
public class StrokeWidth extends CssProperty {
    
    CssValue value;
    ApplContext ac;
    
    /**
     * Create a new Value
     */
    public StrokeWidth() {
	//nothing to do
    }
    
    /**
     * Create a new Value
     *
     * @param expression The expression for this property     
     * @exception InvalidParamException Values are incorrect
     */
    public StrokeWidth(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	this.ac = ac;
	setByUser(); // tell this property is set by the user
	CssValue val = expression.getValue();
	boolean correct = false;
	
	if (val.equals(inherit)) {
	    value = inherit;
	    expression.next();
	    correct = true;
	} else {
	    try {
		CssWidth width = new CssWidth(ac, expression);
		value = val;
		expression.next();
		correct = true;
	    } catch (InvalidParamException e) {
		correct = false;
	    }
	}
	if (!correct) {
	    throw new InvalidParamException("value", val.toString(), getPropertyName(), ac);
	}
    }
    
    public StrokeWidth(ApplContext ac, CssExpression expression)
    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((SVGStyle) style).strokeWidth != null)
	    style.addRedefinitionWarning(ac, this);
	((SVGStyle) style).strokeWidth = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */  
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((SVGStyle) style).getStrokeWidth();
	} else {
	    return ((SVGStyle) style).strokeWidth;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */  
    public boolean equals(CssProperty property) {
	return (property instanceof StrokeWidth && 
		value.equals( ((StrokeWidth) property).value));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "stroke-width";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return value;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return value.equals(inherit);
    }
    
    /**
     * Returns a string representation of the object
     */
    public String toString() {
	return value.toString();
    }
    
    /**
     * Is the value of this property a default value
     * It is used by all macro for the function <code>print</code>
     */
    public boolean isDefault() {	
	CssNumber cssnum = new CssNumber(ac, (float) 1.0);
	return value == cssnum;
    }
}

--- NEW FILE: Marker.java ---
//
// $Id: Marker.java,v 1.1 2005/08/23 16:25:02 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// COPYRIGHT (c) 1995-2000 World Wide Web Consortium, (MIT, INRIA, Keio University)
// Please first read the full copyright statement at
// http://www.w3.org/Consortium/Legal/copyright-software-19980720

package org.w3c.css.properties.svg;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssOperator;
import org.w3c.css.values.CssValue;

/**
 * <P>
 * <EM>Value:</EM> &lt;marker-end&gt; || &lt;marker-mid&gt; ||
 *  &lt;marker-start&gt; || inherit<BR>
 * <EM>Initial:</EM>see individual properties<BR>
 * <EM>Applies to:</EM>path, line, polyline and polygon elements<BR>
 * <EM>Inherited</EM>see Inheritance of Painting Properties<BR>
 * <EM>Percentages:</EM>no<BR>
 * <EM>Media:</EM>visual
 */

public class Marker extends CssProperty
implements CssOperator {
    
    CssValue value;
    MarkerEnd markerEnd;
    MarkerMid markerMid;
    MarkerStart markerStart;
    
    /**
     * Creates a new Marker
     */
    public Marker() {
	// nothing to do
    }
    
    /**
     * Creates a new Marker
     *
     * @param expression The expression for this property
     * @exception InvalidParamException The expression is incorrect
     */
    public Marker(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	
	CssValue val = expression.getValue();
	int maxvalues = 3;
	boolean correct = true;
	char op = SPACE;
	
	while (correct && (val != null) && (maxvalues-- > 0)) {
	    
	    correct = false;
	    
	    if (markerStart == null) {
		try {
		    markerStart = new MarkerStart(ac, expression);
		    correct = true;
		} catch (InvalidParamException e) { }
	    } else if (markerEnd == null) {
		try {
		    markerEnd = new MarkerEnd(ac, expression);
		    correct = true;
		} catch (InvalidParamException e) { }
	    } else if (markerMid == null) {
		try {
		    markerMid = new MarkerMid(ac, expression);
		    correct = true;
		} catch (InvalidParamException e) { }
	    }
	    if (!correct) {
		throw new InvalidParamException("value", expression.getValue(),
			getPropertyName(), ac);
	    }
	    
	    val = expression.getValue();
	    op = expression.getOperator();
	    
	}
	
    }
    
    public Marker(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((SVGStyle) style).marker != null)
	    style.addRedefinitionWarning(ac, this);
	((SVGStyle) style).marker = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((SVGStyle) style).getMarker();
	}
	else {
	    return ((SVGStyle) style).marker;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return false;
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "marker";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return null;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    //    public boolean isSoftlyInherited() {
    //	return value.equals(inherit);
    //}
    
    /**
     * Returns a string representation of the object
     */
    public String toString() {
	String ret = "";
	
	if (markerStart != null) {
	    if (markerStart.isByUser()) {
		ret += " " + markerStart;
	    }
	}
	
	if (markerEnd != null) {
	    if (markerEnd.isByUser()) {
		ret += " " + markerEnd;
	    }
	}
	
	if (markerMid != null) {
	    if (markerMid.isByUser()) {
		ret += " " + markerMid;
	    }
	}
	
	return ret.substring(1);
	
    }
    
}

--- NEW FILE: FillRule.java ---
//
// $Id: FillRule.java,v 1.1 2005/08/23 16:25:02 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, Keio University)
// Please first read the full copyright statement at
// http://www.w3.org/Consortium/Legal/copyright-software-19980720

package org.w3c.css.properties.svg;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssIdent;
import org.w3c.css.values.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> nonzero || evenodd || inherit<BR>
 *  <EM>Initial:</EM>nonzero<BR>
 *  <EM>Applies to:</EM>all elements<BR>
 *  <EM>Inherited:</EM>yes<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 */

public class FillRule extends CssProperty {
    
    CssValue fillrule;
    ApplContext ac;
    
    CssIdent nonzero = new CssIdent("nonzero");
    CssIdent evenodd = new CssIdent("evenodd");
    
    /**
     * Create a new Fillrule
     */
    public FillRule() {
	//nothing to do
    }
    
    /**
     * Create a new Fillrule
     *
     * @param expression The expression for this property     
     * @exception InvalidParamException Values are incorrect
     */
    public FillRule(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	this.ac = ac;
	setByUser(); // tell this property is set by the user
	CssValue val = expression.getValue();
	
	if (val.equals(inherit)) {
	    fillrule = inherit;
	    expression.next();
	} else if (val.equals(nonzero)) {
	    fillrule = nonzero;
	    expression.next();
	} else if (val.equals(evenodd)) {
	    fillrule = evenodd;
	    expression.next();
	}
	else {
	    throw new InvalidParamException("value", val.toString(), getPropertyName(), ac);
	}
    }
    
    public FillRule(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((SVGStyle) style).fillRule != null)
	    style.addRedefinitionWarning(ac, this);
	((SVGStyle) style).fillRule = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */  
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((SVGStyle) style).getFillRule();
	} else {
	    return ((SVGStyle) style).fillRule;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */  
    public boolean equals(CssProperty property) {
	return (property instanceof FillRule && 
		fillrule.equals( ((FillRule) property).fillrule));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "fill-rule";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return fillrule;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return fillrule.equals(inherit);
    }
    
    /**
     * Returns a string representation of the object
     */
    public String toString() {
	return fillrule.toString();
    }
    
    /**
     * Is the value of this property a default value
     * It is used by all macro for the function <code>print</code>
     */
    public boolean isDefault() {	
	return (fillrule == nonzero);
    }
    
}

--- NEW FILE: StrokeDashOffset.java ---
//
// $Id: StrokeDashOffset.java,v 1.1 2005/08/23 16:25:02 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, Keio University)
// Please first read the full copyright statement at
// http://www.w3.org/Consortium/Legal/copyright-software-19980720

package org.w3c.css.properties.svg;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssLength;
import org.w3c.css.values.CssValue;

/**
 *   <H4>
 *     &nbsp;&nbsp; 'stroke-dashoffset'
 *   </H4>
 *   <P>
 *   <EM>Value:</EM> inherit | &lt;dashoffset&gt; <BR>
 *   <EM>Initial:</EM>0<BR>
 *   <EM>Applies to:</EM> all elements<BR>
 *   <EM>Inherited:</EM> yes<BR>
 *   <EM>Percentage values:</EM> N/A<BR>
 */
public class StrokeDashOffset extends CssProperty {
    
    CssValue value;

    /**
     * Create a new StrokeDashOffset
     */
    public StrokeDashOffset() {
	//nothing to do
    }  
    
    /**
     * Create a new StrokeDashOffset
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */  
    public StrokeDashOffset(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	
	setByUser();
	CssValue val = expression.getValue();

	if (val instanceof CssLength) {
	    value = val;
	    expression.next();
	} else if (val.equals(inherit)) {
	    value = inherit;
	    expression.next();
	} else {
	    throw new InvalidParamException("value", 
					    expression.getValue(), 
					    getPropertyName(), ac);
	}
    }
    
    public StrokeDashOffset(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return value;
    }
    
    /**
     * Returns the name of this property
     */  
    public String getPropertyName() {
	return "stroke-dashoffset";
    }

    /**
     * Returns true if this property is "softly" inherited
     * e.g. his value equals inherit
     */
    public boolean isSoftlyInherited() {
	return value == inherit;
    }
    
    /**
     * Returns a string representation of the object.
     */
    public String toString() {
	return value.toString();
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	SVGStyle style0 = (SVGStyle) style;
	if (style0.strokeDashOffset != null)
	    style0.addRedefinitionWarning(ac, this);
	style0.strokeDashOffset = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */  
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((SVGStyle) style).getStrokeDashOffset();
	} else {
	    return ((SVGStyle) style).strokeDashOffset;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */  
    public boolean equals(CssProperty property) {
	return (property instanceof StrokeDashOffset && 
		value.equals(((StrokeDashOffset) property).value));
    }
    
}

--- NEW FILE: StrokeLineCap.java ---
//
// $Id: StrokeLineCap.java,v 1.1 2005/08/23 16:25:02 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, Keio University)
// Please first read the full copyright statement at
// http://www.w3.org/Consortium/Legal/copyright-software-19980720

package org.w3c.css.properties.svg;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssIdent;
import org.w3c.css.values.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> butt | round | square | inherit<BR>
 *  <EM>Initial:</EM>butt<BR>
 *  <EM>Applies to:</EM><BR>
 *  <EM>Inherited:</EM>yes<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual 
 */

public class StrokeLineCap extends CssProperty {

    CssValue value;

    static CssIdent butt = new CssIdent("butt");

    private static String[] values = {
	"butt", "round", "square", "inherit"
    };

    /**
     * Create a new StrokeLineCap
     */
    public StrokeLineCap() {
	// nothing to do
    }

    /**
     * Create a new StrokeLineCap
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public StrokeLineCap(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {

	setByUser();
	CssValue val = expression.getValue();

	int i = 0;
	for (; i < values.length; i++) {
	    if (val.toString().equals(values[i])) {
		value = val;
		expression.next();
		break;
	    }
	}
	if (i == values.length) {
	    throw new InvalidParamException("value", expression.getValue(),
					    getPropertyName(), ac);
	}
    }

    public StrokeLineCap(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((SVGStyle) style).strokeLineCap != null)
	    style.addRedefinitionWarning(ac, this);
	((SVGStyle) style).strokeLineCap = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((SVGStyle) style).getStrokeLineCap();
	}
	else {
	    return ((SVGStyle) style).strokeLineCap;
	}
    }

    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof StrokeLineCap &&
		value.equals(((StrokeLineCap) property).value));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "stroke-linecap";
    }

    /**
     * Returns the value of this property
     */
    public Object get() {
	return value;
    }

    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return value.equals(inherit);
    }

    /**
     * Returns a string representation of the object
     */
    public String toString() {
	return value.toString();
    }

    /**
     * Is the value of this property a default value
     * It is used by alle macro for the function <code>print</code>
     */
    public boolean isDefault() {
	return (value == butt);
    }

}

--- NEW FILE: StopOpacity.java ---
//
// $Id: StopOpacity.java,v 1.1 2005/08/23 16:25:02 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, Keio University)
// Please first read the full copyright statement at
// http://www.w3.org/Consortium/Legal/copyright-software-19980720

package org.w3c.css.properties.svg;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.properties.css3.CssOpacity;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssNumber;
import org.w3c.css.values.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> &lt;opacityvalue&gt; || inherit<BR>
 *  <EM>Initial:</EM>1<BR>
 *  <EM>Applies to:</EM>all elements<BR>
 *  <EM>Inherited:</EM>no<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 */
public class StopOpacity extends CssProperty {
    
    CssValue value;
    ApplContext ac;
    
    /**
     * Create a new Value
     */
    public StopOpacity() {
	//nothing to do
    }
    
    /**
     * Create a new Value
     *
     * @param expression The expression for this property     
     * @exception InvalidParamException Values are incorrect
     */
    public StopOpacity(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	this.ac = ac;
	setByUser(); // tell this property is set by the user
	CssValue val = expression.getValue();
	boolean correct = false;
	
	if (val.equals(inherit)) {
	    value = inherit;
	    expression.next();
	    correct = true;
	} else {
	    try {
		CssOpacity opac = new CssOpacity(ac, expression);
		value = val;
		expression.next();
		correct = true;
	    } catch (InvalidParamException e) {
		correct = false;
	    }
	}
	if (!correct) {
	    throw new InvalidParamException("value", val.toString(), getPropertyName(), ac);
	}
    }
    
    public StopOpacity(ApplContext ac, CssExpression expression)
    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((SVGStyle) style).stopOpacity != null)
	    style.addRedefinitionWarning(ac, this);
	((SVGStyle) style).stopOpacity = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */  
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((SVGStyle) style).getStopOpacity();
	} else {
	    return ((SVGStyle) style).stopOpacity;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */  
    public boolean equals(CssProperty property) {
	return (property instanceof StopOpacity && 
		value.equals( ((StopOpacity) property).value));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "stop-opacity";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return value;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return value.equals(inherit);
    }
    
    /**
     * Returns a string representation of the object
     */
    public String toString() {
	return value.toString();
    }
    
    /**
     * Is the value of this property a default value
     * It is used by all macro for the function <code>print</code>
     */
    public boolean isDefault() {	
	CssNumber cssnum = new CssNumber(ac, (float) 1.0);
	return value == cssnum;
    }
}

--- NEW FILE: ColorInterpolation.java ---
//
// $Id: ColorInterpolation.java,v 1.1 2005/08/23 16:25:02 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, Keio University)
// Please first read the full copyright statement at
// http://www.w3.org/Consortium/Legal/copyright-software-19980720

package org.w3c.css.properties.svg;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssIdent;
import org.w3c.css.values.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> auto || sRGB || linearRGB || inherit<BR>
 *  <EM>Initial:</EM>sRGB<BR>
 *  <EM>Applies to:</EM>all elements<BR>
 *  <EM>Inherited:</EM>yes<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 */

public class ColorInterpolation extends CssProperty {
    
    CssValue interp;
    ApplContext ac;
    
    CssIdent auto = new CssIdent("auto");
    CssIdent sRGB = new CssIdent("sRGB");
    CssIdent linearRGB = new CssIdent("linearRGB");
    
    /**
     * Create a new Interp
     */
    public ColorInterpolation() {
	//nothing to do
    }
    
    /**
     * Create a new ColorInterpolation
     *
     * @param expression The expression for this property     
     * @exception InvalidParamException Values are incorrect
     */
    public ColorInterpolation(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	this.ac = ac;
	setByUser(); // tell this property is set by the user
	CssValue val = expression.getValue();
	
	if (val.equals(inherit)) {
	    interp = inherit;
	    expression.next();
	} else if (val.equals(sRGB)) {
	    interp = sRGB;
	    expression.next();
	} else if (val.equals(linearRGB)) {
	    interp = linearRGB;
	    expression.next();
	} else if (val.equals(auto)) {
	    interp = auto;
	    expression.next();
	}
	else {
	    throw new InvalidParamException("value", val.toString(),
		    getPropertyName(), ac);
	}
    }
    
    public ColorInterpolation(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((SVGStyle) style).colorInterpolation != null)
	    style.addRedefinitionWarning(ac, this);
	((SVGStyle) style).colorInterpolation = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */  
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((SVGStyle) style).getColorInterpolation();
	} else {
	    return ((SVGStyle) style).colorInterpolation;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */  
    public boolean equals(CssProperty property) {
	return (property instanceof ColorInterpolation && 
		interp.equals( ((ColorInterpolation) property).interp));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "color-interpolation";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return interp;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return interp.equals(inherit);
    }
    
    /**
     * Returns a string representation of the object
     */
    public String toString() {
	return interp.toString();
    }
    
    /**
     * Is the value of this property a default value
     * It is used by all macro for the function <code>print</code>
     */
    public boolean isDefault() {	
	return (interp == sRGB);
    }
    
}

--- NEW FILE: StrokeDashArray.java ---
//
// $Id: StrokeDashArray.java,v 1.1 2005/08/23 16:25:02 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, Keio University)
// Please first read the full copyright statement at
// http://www.w3.org/Consortium/Legal/copyright-software-19980720

package org.w3c.css.properties.svg;

import java.util.Vector;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssIdent;
import org.w3c.css.values.CssNumber;
import org.w3c.css.values.CssOperator;
import org.w3c.css.values.CssValue;


/**
 * This is the stroke-dasharray property for SVG
 */

public class StrokeDashArray extends CssProperty implements CssOperator {

    CssValue value;
    Vector values = new Vector();

    CssIdent none = new CssIdent("none");

    /**
     * Create a new StrokeDashArray
     */
    public StrokeDashArray() {
	// nothing to do
    }

    /** 
     * Create a new StrokeDashArray
     */
    public StrokeDashArray(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {

	//setByUser();
	char op = COMMA;
	CssValue val = expression.getValue();
	int counter = 0;
	boolean correct = true;

	if (val.equals(inherit)) {
	    value = inherit;
	    expression.next();
	} else if (val.equals(none)) {
	    value = none;
	    expression.next();
	} else if (val instanceof CssNumber) {
	    while ((op == COMMA || op == SPACE)
		   && (counter < expression.getCount() && correct == true)) {
		
		if ((!(val instanceof CssNumber)) || (((CssNumber) val).getValue() < 0))
		    correct = false;
		
		values.addElement(val);
		expression.next();
		counter++;
		val = expression.getValue();
		op = expression.getOperator();
	    }
	} else {
	    correct = false;
	}

	if (!correct) {
	    throw new InvalidParamException("value", val.toString(), 
					    getPropertyName(), ac);
	}
    }

    public StrokeDashArray(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((SVGStyle) style).strokeDashArray != null)
	    style.addRedefinitionWarning(ac, this);
	((SVGStyle) style).strokeDashArray = this;

    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */  
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((SVGStyle) style).getStrokeDashArray();
	} else {
	    return ((SVGStyle) style).strokeDashArray;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */  
    public boolean equals(CssProperty property) {
	return false;
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "stroke-dasharray";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	if (value != null) {
	    return value;
	}
	else {
	    return values;
	}
    }
    
    /**
     * Returns true if this property is "softly" inherited
     * This property can't be inherited, it's only for @preference
     */
    public boolean isSoftlyInherited() {
	return value == inherit; 
    }
    
    /**
     * Returns a string representation of the object
     */
    public String toString() {
	if (value != null) {
	    return value.toString();
	}
	else {
	    String ret = "";
	    for (int i = 0; i < values.size(); i++) {
		ret += " " + values.elementAt(i).toString();
	    }
	    return ret;
	}
    }
    
    /**
     * Is the value of this property a default value
     * It is used by all macro for the function <code>print</code>
     */
    public boolean isDefault() {	
	return value == none;
    }
    
}

--- NEW FILE: CssRenderIntent.java ---
//
// $Id: CssRenderIntent.java,v 1.1 2005/08/23 16:25:02 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// COPYRIGHT (c) 1995-2000 World Wide Web Consortium, (MIT, INRIA, Keio University)
// Please first read the full copyright statement at
// http://www.w3.org/Consortium/Legal/copyright-software-19980720

package org.w3c.css.properties.svg;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssIdent;
import org.w3c.css.values.CssValue;

/**
 * <P>
 * <EM>Value:</EM> auto || perceptual || relative-colorimetric ||
 * saturation || absolute-colorimetric || inherit<BR>
 * <EM>Initial:</EM>auto<BR>
 * <EM>Applies to:</EM>all elements<BR>
 * <EM>Inherited</EM>yes<BR>
 * <EM>Percentages:</EM>no<BR>
 * <EM>Media:</EM>visual
 * <P>
 * This property permits the specification of a color profile rendering intent other than the default.
 * The behavior of values other than auto and inherent are defined by the International Color Consortium standard.
 */
public class CssRenderIntent extends CssProperty {
    
    CssValue renderintent;
    
    static CssIdent auto = new CssIdent("auto");
    static CssIdent abscolorimetric = new CssIdent("absolute-colorimetric");
    static CssIdent relcolorimetric = new CssIdent("relative-colorimetric");
    static CssIdent saturation = new CssIdent("saturation");
    static CssIdent perceptual = new CssIdent("perceptual");
    
    /**
     * Create a new CssRenderIntent
     */
    public CssRenderIntent() {
	renderintent = auto;
    }
    
    /**
     * Create a new CssRenderIntent
     *
     *
     */
    public CssRenderIntent(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	setByUser();
	CssValue val = expression.getValue();
	if (val.equals(auto)) {
	    renderintent = auto;
	    expression.next();
	}
	else if (val.equals(perceptual)) {
	    renderintent = perceptual;
	    expression.next();
	}
	else if (val.equals(relcolorimetric)) {
	    renderintent = relcolorimetric;
	    expression.next();
	}
	else if (val.equals(saturation)) {
	    renderintent = saturation;
	    expression.next();
	}
	else if (val.equals(abscolorimetric)) {
	    renderintent = abscolorimetric;
	    expression.next();
	}
	else {
	    throw new InvalidParamException("value", val.toString(), getPropertyName(), ac);
	}
    }
    
    public CssRenderIntent(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((SVGStyle) style).cssRenderIntent != null)
	    style.addRedefinitionWarning(ac, this);
	((SVGStyle) style).cssRenderIntent = this;
	
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((SVGStyle) style).getRenderIntent();
	} else {
	    return ((SVGStyle) style).cssRenderIntent;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof CssRenderIntent &&
		renderintent.equals( ((CssRenderIntent) property).renderintent));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "rendering-intent";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return renderintent;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return renderintent.equals(inherit);
    }
    
    /**
     * Returns a string representation of the object
     */
    public String toString() {
	return renderintent.toString();
    }
    
    /**
     * Is the value of this property a default value
     * It is used by all macro for the function <code>print</code>
     */
    public boolean isDefault() {
	return renderintent == auto;
    }
    
}

--- NEW FILE: ShapeRendering.java ---
//
// $Id: ShapeRendering.java,v 1.1 2005/08/23 16:25:02 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, Keio University)
// Please first read the full copyright statement at
// http://www.w3.org/Consortium/Legal/copyright-software-19980720

package org.w3c.css.properties.svg;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssIdent;
import org.w3c.css.values.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> auto | optimizeSpeed | crispEdges |
 *  geometricPrecision | inherit  <BR>
 *  <EM>Initial:</EM>auto<BR>
 *  <EM>Applies to:</EM><BR>
 *  <EM>Inherited:</EM>yes<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual 
 */

public class ShapeRendering extends CssProperty {
    
    CssValue value;
    
    static CssIdent auto = new CssIdent("auto");
    
    private static String[] values = {
	"auto", "optimizeSpeed", "crispEdges", "geometricPrecision", "inherit"
    };
    
    /**
     * Create a new ShapeRendering
     */
    public ShapeRendering() {
	// nothing to do
    }
    
    /**
     * Create a new ShapeRendering
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public ShapeRendering(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	
	setByUser();
	CssValue val = expression.getValue();
	
	int i = 0;
	for (; i < values.length; i++) {
	    if (val.toString().equals(values[i])) {
		value = val;
		expression.next();
		break;
	    }
	}
	if (i == values.length) {
	    throw new InvalidParamException("value", expression.getValue(),
		    getPropertyName(), ac);
	}
    }
    
    public ShapeRendering(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((SVGStyle) style).shapeRendering != null)
	    style.addRedefinitionWarning(ac, this);
	((SVGStyle) style).shapeRendering = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((SVGStyle) style).getShapeRendering();
	}
	else {
	    return ((SVGStyle) style).shapeRendering;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof ShapeRendering &&
		value.equals(((ShapeRendering) property).value));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "shape-rendering";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return value;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return value.equals(inherit);
    }
    
    /**
     * Returns a string representation of the object
     */
    public String toString() {
	return value.toString();
    }
    
    /**
     * Is the value of this property a default value
     * It is used by alle macro for the function <code>print</code>
     */
    public boolean isDefault() {
	return (value == auto);
    }
    
}

--- NEW FILE: StrokeLinejoin.java ---
//
// $Id: StrokeLinejoin.java,v 1.1 2005/08/23 16:25:02 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, Keio University)
// Please first read the full copyright statement at
// http://www.w3.org/Consortium/Legal/copyright-software-19980720

package org.w3c.css.properties.svg;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssIdent;
import org.w3c.css.values.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> miter | round | bevel | inherit<BR>
 *  <EM>Initial:</EM>miter<BR>
 *  <EM>Applies to:</EM><BR>
 *  <EM>Inherited:</EM>yes<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual 
 */

public class StrokeLinejoin extends CssProperty {

    CssValue value;

    static CssIdent miter = new CssIdent("miter");

    private static String[] values = {
	"miter", "round", "bevel", "inherit"
    };

    /**
     * Create a new StrokeLinejoin
     */
    public StrokeLinejoin() {
	// nothing to do
    }

    /**
     * Create a new StrokeLinejoin
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public StrokeLinejoin(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {

	setByUser();
	CssValue val = expression.getValue();

	int i = 0;
	for (; i < values.length; i++) {
	    if (val.toString().equals(values[i])) {
		value = val;
		expression.next();
		break;
	    }
	}
	if (i == values.length) {
	    throw new InvalidParamException("value", expression.getValue(),
					    getPropertyName(), ac);
	}
    }

    public StrokeLinejoin(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((SVGStyle) style).strokeLinejoin != null)
	    style.addRedefinitionWarning(ac, this);
	((SVGStyle) style).strokeLinejoin = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((SVGStyle) style).getStrokeLinejoin();
	}
	else {
	    return ((SVGStyle) style).strokeLinejoin;
	}
    }

    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof StrokeLinejoin &&
		value.equals(((StrokeLinejoin) property).value));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "stroke-linejoin";
    }

    /**
     * Returns the value of this property
     */
    public Object get() {
	return value;
    }

    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return value.equals(inherit);
    }

    /**
     * Returns a string representation of the object
     */
    public String toString() {
	return value.toString();
    }

    /**
     * Is the value of this property a default value
     * It is used by alle macro for the function <code>print</code>
     */
    public boolean isDefault() {
	return (value == miter);
    }

}

--- NEW FILE: Stroke.java ---
//
// $Id: Stroke.java,v 1.1 2005/08/23 16:25:02 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, Keio University)
// Please first read the full copyright statement at
// http://www.w3.org/Consortium/Legal/copyright-software-19980720

package org.w3c.css.properties.svg;

import java.util.Vector;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssColor;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssFunction;
import org.w3c.css.values.CssIdent;
import org.w3c.css.values.CssNumber;
import org.w3c.css.values.CssOperator;
import org.w3c.css.values.CssURL;
import org.w3c.css.values.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> &lt;paint&gt; | inherit<BR>
 *  <EM>Initial:</EM>none<BR>
 *  <EM>Applies to:</EM>all elements<BR>
 *  <EM>Inherited:</EM>no<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 */
public class Stroke extends CssProperty implements CssOperator {
    
    CssValue stroke;
    ApplContext ac;
    Vector values = new Vector();
    
    CssIdent currentColor = new CssIdent("currentColor");
    CssIdent none = new CssIdent("none");
    
    /**
     * Create a new Stroke
     */
    public Stroke() {
	//nothing to do
    }
    
    /**
     * Create a new Stroke
     *
     * @param expression The expression for this property     
     * @exception InvalidParamException Values are incorrect
     */
    public Stroke(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	this.ac = ac;
	setByUser(); // tell this property is set by the user
	CssValue val = expression.getValue();
	boolean correct = true;
	String errorval = "";
	char op = expression.getOperator();
	
	if (val.equals(inherit)) {
	    stroke = inherit;
	    expression.next();
	} else if (val.equals(currentColor)) {
	    stroke = currentColor;
	    expression.next();
	} else if (val.equals(none)) {
	    stroke = none;
	    expression.next();
	} else {
	    try {
		CssColor color = new CssColor(ac, expression);
		values.addElement(val);
		//expression.next();
		
		op = expression.getOperator();
		val = expression.getValue();
		
		
		if (val instanceof CssFunction) { // icc-color(<name>[,<icccolorvalue>]*)]
		    CssValue function = val;
		    if (!((CssFunction) val).getName().equals("icc-color")) {
			correct = false;
			errorval = val.toString();
		    } else {
			CssExpression params = ((CssFunction) val).getParameters();
			
			op = params.getOperator();
			val = params.getValue();
			
			if (!(val instanceof CssIdent)) {
			    correct = false;
			    errorval = val.toString();
			}
			
			params.next();
			op = params.getOperator();
			val = params.getValue();
			
			if (!params.end()) { // there are more parameters left
			    int counter = 0;
			    
			    while ((op == COMMA || op == SPACE)
				    && (counter < (params.getCount() - 1) && correct == true)) {
				
				if ((!(val instanceof CssNumber)) || (((CssNumber) val).getValue() < 0)) {
				    correct = false;
				    errorval = val.toString();
				}
				
				params.next();
				counter++;
				val = params.getValue();
				op = params.getOperator();
			    }
			}
			
			if (correct) {
			    params.starts();
			    values.addElement(function);
			}
			else {
			    correct = false;
			    errorval = val.toString();
			}
		    }
		}
	    } catch (InvalidParamException e) {
		correct = false;
		errorval = val.toString();
	    }
	    
	    if (val instanceof CssURL) {
		values.addElement(val);
		correct = true;
		errorval = null;
		
		expression.next();
		op = expression.getOperator();
		val = expression.getValue();
		
		if (val.equals(none) || val.equals(currentColor)) {
		    values.addElement(val);
		    expression.next();
		} else {
		    //-------------		   
		    
		    try {
			CssColor color = new CssColor(ac, expression);
			values.addElement(val);
			//expression.next();
			
			op = expression.getOperator();
			val = expression.getValue();
			
			
			if (val instanceof CssFunction) { // icc-color(<name>[,<icccolorvalue>]*)]
			    CssValue function = val;
			    if (!((CssFunction) val).getName().equals("icc-color")) {
				correct = false;
				errorval = val.toString();
			    } else {
				CssExpression params = ((CssFunction) val).getParameters();
				
				op = params.getOperator();
				val = params.getValue();
				
				if (!(val instanceof CssIdent)) {
				    correct = false;
				    errorval = val.toString();
				}
				
				params.next();
				op = params.getOperator();
				val = params.getValue();
				
				if (!params.end()) { // there are more parameters left
				    int counter = 0;
				    
				    while ((op == COMMA || op == SPACE)
					    && (counter < (params.getCount() - 1) && correct == true)) {
					
					if ((!(val instanceof CssNumber)) || (((CssNumber) val).getValue() < 0)) {
					    correct = false;
					    errorval = val.toString();
					}
					
					params.next();
					counter++;
					val = params.getValue();
					op = params.getOperator();
				    }
				}
				
				if (correct) {
				    params.starts();
				    values.addElement(function);
				}
				else {
				    correct = false;
				    errorval = val.toString();
				}
			    }
			}
		    } catch (InvalidParamException e) {
			correct = false;
			errorval = val.toString();
		    }
		    
		    //-----------------
		}
	    } else {
		correct = false;
		errorval = val.toString();
	    }
	    
	}
	
	expression.next();
	
	if (!correct) {
	    throw new InvalidParamException("value", errorval, getPropertyName(), ac);
	}
    }
    
    public Stroke(ApplContext ac, CssExpression expression)
    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((SVGStyle) style).stroke != null)
	    style.addRedefinitionWarning(ac, this);
	((SVGStyle) style).stroke = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */  
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((SVGStyle) style).getStroke();
	} else {
	    return ((SVGStyle) style).stroke;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */  
    public boolean equals(CssProperty property) {
	return (property instanceof Stroke && 
		stroke.equals( ((Stroke) property).stroke));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "stroke";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	if (stroke != null) 
	    return stroke;
	else 
	    return values;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return stroke.equals(inherit);
    }
    
    /**
     * Returns a string representation of the object
     */
    public String toString() {
	if (stroke != null) {
	    return stroke.toString();
	} else {
	    String ret = "";
	    for (int i = 0; i < values.size(); i++) {
		ret += " " + values.elementAt(i).toString();
	    }
	    return ret;
	}
    }
    
    /**
     * Is the value of this property a default value
     * It is used by all macro for the function <code>print</code>
     */
    public boolean isDefault() {	
	return stroke == none;
    }
    
}

--- NEW FILE: StrokeMiterLimit.java ---
//
// $Id: StrokeMiterLimit.java,v 1.1 2005/08/23 16:25:02 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, Keio University)
// Please first read the full copyright statement at
// http://www.w3.org/Consortium/Legal/copyright-software-19980720

package org.w3c.css.properties.svg;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssNumber;
import org.w3c.css.values.CssValue;

/**
 *   <H4>
 *     &nbsp;&nbsp; 'stroke-miterlimit'
 *   </H4>
 *   <P>
 *   <EM>Value:</EM> inherit | &lt;miterlimit&gt; <BR>
 *   <EM>Initial:</EM>4<BR>
 *   <EM>Applies to:</EM> all elements<BR>
 *   <EM>Inherited:</EM> yes<BR>
 *   <EM>Percentage values:</EM> N/A<BR>
 */
public class StrokeMiterLimit extends CssProperty {
    
    CssValue value;

    /**
     * Create a new StrokeMiterLimit
     */
    public StrokeMiterLimit() {
	//nothing to do
    }  
    
    /**
     * Create a new StrokeMiterLimit
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */  
    public StrokeMiterLimit(ApplContext ac, CssExpression expression,
	    boolean check) 
	throws InvalidParamException {
	
	setByUser();
	CssValue val = expression.getValue();

	if (val instanceof CssNumber) {
	    if (((CssNumber) val).getValue() >= 1) {
		value = val;
		expression.next();
	    } else {
		throw new InvalidParamException("out-of-range", expression.getValue(),
						getPropertyName(), ac);
	    }
	} else if (val.equals(inherit)) {
	    value = inherit;
	    expression.next();
	} else {
	    throw new InvalidParamException("value", 
					    expression.getValue(), 
					    getPropertyName(), ac);
	}
    }
    
    public StrokeMiterLimit(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return value;
    }
    
    /**
     * Returns the name of this property
     */  
    public String getPropertyName() {
	return "stroke-miterlimit";
    }

    /**
     * Returns true if this property is "softly" inherited
     * e.g. his value equals inherit
     */
    public boolean isSoftlyInherited() {
	return value == inherit;
    }
    
    /**
     * Returns a string representation of the object.
     */
    public String toString() {
	return value.toString();
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	SVGStyle style0 = (SVGStyle) style;
	if (style0.strokeMiterLimit != null)
	    style0.addRedefinitionWarning(ac, this);
	style0.strokeMiterLimit = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */  
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((SVGStyle) style).getStrokeMiterLimit();
	} else {
	    return ((SVGStyle) style).strokeMiterLimit;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */  
    public boolean equals(CssProperty property) {
	return (property instanceof StrokeMiterLimit && 
		value.equals(((StrokeMiterLimit) property).value));
    }
    
}

--- NEW FILE: MarkerStart.java ---
//
// $Id: MarkerStart.java,v 1.1 2005/08/23 16:25:02 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, Keio University)
// Please first read the full copyright statement at
// http://www.w3.org/Consortium/Legal/copyright-software-19980720

package org.w3c.css.properties.svg;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssIdent;
import org.w3c.css.values.CssURL;
import org.w3c.css.values.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> &lt;uri&gt; || none || inherit<BR>
 *  <EM>Initial:</EM>none<BR>
 *  <EM>Applies to:</EM>all elements<BR>
 *  <EM>Inherited:</EM>no<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual
 */

public class MarkerStart extends CssProperty {
    
    CssValue markerStart;
    ApplContext ac;
    
    CssIdent none = new CssIdent("none");
    
    /**
     * Create a new MarkerStart
     */
    public MarkerStart() {
	//nothing to do
    }
    
    /**
     * Create a new MarkerStart
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Values are incorrect
     */
    public MarkerStart(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	this.ac = ac;
	setByUser(); // tell this property is set by the user
	CssValue val = expression.getValue();
	if (val instanceof CssURL) {
	    markerStart = val;
	    expression.next();
	}
	else if (val instanceof CssIdent) {
	    if (val.equals(inherit)) {
		markerStart = inherit;
		expression.next();
	    } else if (val.equals(none)) {
		markerStart = none;
		expression.next();
	    }
	}
	else {
	    throw new InvalidParamException("value", val.toString(), getPropertyName(), ac);
	}
    }
    
    public MarkerStart(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((SVGStyle) style).markerStart != null)
	    style.addRedefinitionWarning(ac, this);
	((SVGStyle) style).markerStart = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((SVGStyle) style).getMarkerStart();
	} else {
	    return ((SVGStyle) style).markerStart;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof MarkerStart &&
		markerStart.equals( ((MarkerStart) property).markerStart));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "marker-start";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return markerStart;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return markerStart.equals(inherit);
    }
    
    /**
     * Returns a string representation of the object
     */
    public String toString() {
	return markerStart.toString();
    }
    
    /**
     * Is the value of this property a default value
     * It is used by all macro for the function <code>print</code>
     */
    public boolean isDefault() {
	return (markerStart == none);
    }
    
}

--- NEW FILE: FloodOpacity.java ---
//
// $Id: FloodOpacity.java,v 1.1 2005/08/23 16:25:02 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, Keio University)
// Please first read the full copyright statement at
// http://www.w3.org/Consortium/Legal/copyright-software-19980720

package org.w3c.css.properties.svg;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.util.Util;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssIdent;
import org.w3c.css.values.CssNumber;
import org.w3c.css.values.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> &lt; alphavalue&gt; || inherit<BR>
 *  <EM>Initial:</EM>1<BR>
 *  <EM>Applies to:</EM>all elements<BR>
 *  <EM>Inherited:</EM>no<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual<BR>
 */

public class FloodOpacity extends CssProperty {
    
    CssValue opaclevel;
    ApplContext ac;
    
    /**
     * Create a new FloodOpacity
     */
    public FloodOpacity() {
	CssNumber cssnum =  new CssNumber((float) 1.0);
	opaclevel = cssnum;
    }
    
    /**
     * Create a new FloodOpacity
     *
     * @param expression The expression for this property     
     * @exception InvalidParamException Values are incorrect
     */
    public FloodOpacity(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	this.ac = ac;
	setByUser(); // tell this property is set by the user
	CssValue val = expression.getValue();
	if (val instanceof CssNumber) {
	    
	    CssNumber cssnum = new CssNumber(clampedValue(ac, ((CssNumber) val).getValue()));
	    opaclevel = cssnum;
	    expression.next();
	}
	else if (val instanceof CssIdent) {
	    if (val.equals(inherit)) {
		opaclevel = inherit;
		expression.next();
	    }
	}
	else {
	    throw new InvalidParamException("value", val.toString(), getPropertyName(), ac);
	}
    }
    
    public FloodOpacity(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Brings all values back between 0 and 1
     *
     * @param opac The value to be modified if necessary
     */
    private float clampedValue(ApplContext ac, float opac) {
	if (opac < 0 || opac > 1) {
	    ac.getFrame().addWarning("out-of-range", Util.displayFloat(opac));   
	    return ((opac<0)?0:1);
	}
	else return(opac);
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((SVGStyle) style).floodOpacity != null)
	    style.addRedefinitionWarning(ac, this);
	((SVGStyle) style).floodOpacity = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */  
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((SVGStyle) style).getFloodOpacity();
	} else {
	    return ((SVGStyle) style).floodOpacity;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */  
    public boolean equals(CssProperty property) {
	return (property instanceof FloodOpacity && 
		opaclevel.equals( ((FloodOpacity) property).opaclevel));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "flood-opacity";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return opaclevel;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return opaclevel.equals(inherit);
    }
    
    /**
     * Returns a string representation of the object
     */
    public String toString() {
	return opaclevel.toString();
    }
    
    /**
     * Is the value of this property a default value
     * It is used by all macro for the function <code>print</code>
     */
    public boolean isDefault() {	
	CssNumber cssnum = new CssNumber(ac, (float) 1.0);
	return opaclevel == cssnum;
    }
    
}


--- NEW FILE: ColorRendering.java ---
//
// $Id: ColorRendering.java,v 1.1 2005/08/23 16:25:02 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, Keio University)
// Please first read the full copyright statement at
// http://www.w3.org/Consortium/Legal/copyright-software-19980720

package org.w3c.css.properties.svg;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssIdent;
import org.w3c.css.values.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> auto || optimizeSpeed || optimizeQuality || inherit<BR>
 *  <EM>Initial:</EM>auto<BR>
 *  <EM>Applies to:</EM>all elements<BR>
 *  <EM>Inherited:</EM>yes<BR>
 *  <EM>Percentages:</EM>image elements that refer to raster images<BR>
 *  <EM>Media:</EM>:visual
 */

public class ColorRendering extends CssProperty {
    
    CssValue rendering;
    ApplContext ac;
    
    CssIdent auto = new CssIdent("auto");
    CssIdent optimizeSpeed = new CssIdent("optimizeSpeed");
    CssIdent optimizeQuality = new CssIdent("optimizeQuality");
    
    /**
     * Create a new Rendering
     */
    public ColorRendering() {
	//nothing to do
    }
    
    /**
     * Create a new ColorRendering
     *
     * @param expression The expression for this property     
     * @exception InvalidParamException Values are incorrect
     */
    public ColorRendering(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {
	this.ac = ac;
	setByUser(); // tell this property is set by the user
	CssValue val = expression.getValue();
	
	if (val.equals(inherit)) {
	    rendering = inherit;
	    expression.next();
	} else if (val.equals(optimizeSpeed)) {
	    rendering = val;
	    expression.next();
	} else if (val.equals(optimizeQuality)) {
	    rendering = val;
	    expression.next();
	} else if (val.equals(auto)) {
	    rendering = auto;
	    expression.next();
	}
	else {
	    throw new InvalidParamException("value", val.toString(), getPropertyName(), ac);
	}
    }
    
    public ColorRendering(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((SVGStyle) style).colorRendering != null)
	    style.addRedefinitionWarning(ac, this);
	((SVGStyle) style).colorRendering = this;
    }
    
    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */  
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((SVGStyle) style).getColorRendering();
	} else {
	    return ((SVGStyle) style).colorRendering;
	}
    }
    
    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */  
    public boolean equals(CssProperty property) {
	return (property instanceof ColorRendering && 
		rendering.equals( ((ColorRendering) property).rendering));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "color-rendering";
    }
    
    /**
     * Returns the value of this property
     */
    public Object get() {
	return rendering;
    }
    
    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return rendering.equals(inherit);
    }
    
    /**
     * Returns a string representation of the object
     */
    public String toString() {
	return rendering.toString();
    }
    
    /**
     * Is the value of this property a default value
     * It is used by all macro for the function <code>print</code>
     */
    public boolean isDefault() {	
	return (rendering == auto);
    }
    
}

--- NEW FILE: TextRendering.java ---
//
// $Id: TextRendering.java,v 1.1 2005/08/23 16:25:02 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, Keio University)
// Please first read the full copyright statement at
// http://www.w3.org/Consortium/Legal/copyright-software-19980720

package org.w3c.css.properties.svg;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssIdent;
import org.w3c.css.values.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> auto | optimizeSpeed | optimizeLegibility |
 *  geometricPrecision | inherit  <BR>
 *  <EM>Initial:</EM>auto<BR>
 *  <EM>Applies to:</EM>text elements<BR>
 *  <EM>Inherited:</EM>yes<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual 
 */

public class TextRendering extends CssProperty {

    CssValue value;

    static CssIdent auto = new CssIdent("auto");

    private static String[] values = {
	"auto", "optimizeSpeed", "optimizeLegibility", "geometricPrecision", "inherit"
    };

    /**
     * Create a new TextRendering
     */
    public TextRendering() {
	// nothing to do
    }

    /**
     * Create a new TextRendering
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public TextRendering(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {

	setByUser();
	CssValue val = expression.getValue();

	int i = 0;
	for (; i < values.length; i++) {
	    if (val.toString().equals(values[i])) {
		value = val;
		expression.next();
		break;
	    }
	}
	if (i == values.length) {
	    throw new InvalidParamException("value", expression.getValue(),
					    getPropertyName(), ac);
	}
    }

    public TextRendering(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((SVGStyle) style).textRendering != null)
	    style.addRedefinitionWarning(ac, this);
	((SVGStyle) style).textRendering = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((SVGStyle) style).getTextRendering();
	}
	else {
	    return ((SVGStyle) style).textRendering;
	}
    }

    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof TextRendering &&
		value.equals(((TextRendering) property).value));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "text-rendering";
    }

    /**
     * Returns the value of this property
     */
    public Object get() {
	return value;
    }

    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return value.equals(inherit);
    }

    /**
     * Returns a string representation of the object
     */
    public String toString() {
	return value.toString();
    }

    /**
     * Is the value of this property a default value
     * It is used by alle macro for the function <code>print</code>
     */
    public boolean isDefault() {
	return (value == auto);
    }

}

--- NEW FILE: TextAnchor.java ---
//
// $Id: TextAnchor.java,v 1.1 2005/08/23 16:25:02 ylafon Exp $
// From Sijtsche de Jong (sy.de.jong@let.rug.nl)
//
// (c) COPYRIGHT 1995-2000  World Wide Web Consortium (MIT, INRIA, Keio University)
// Please first read the full copyright statement at
// http://www.w3.org/Consortium/Legal/copyright-software-19980720

package org.w3c.css.properties.svg;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssIdent;
import org.w3c.css.values.CssValue;

/**
 *  <P>
 *  <EM>Value:</EM> start | middle | end | inherit<BR>
 *  <EM>Initial:</EM>start<BR>
 *  <EM>Applies to:</EM>'text', 'tspan', 'tref', 'altGlyph', 'textPath' elements<BR>
 *  <EM>Inherited:</EM>yes<BR>
 *  <EM>Percentages:</EM>no<BR>
 *  <EM>Media:</EM>:visual 
 */

public class TextAnchor extends CssProperty {

    CssValue value;

    static CssIdent start = new CssIdent("start");

    private static String[] values = {
	"start", "middle", "end", "inherit"
    };

    /**
     * Create a new TextAnchor
     */
    public TextAnchor() {
	// nothing to do
    }

    /**
     * Create a new TextAnchor
     *
     * @param expression The expression for this property
     * @exception InvalidParamException Incorrect value
     */
    public TextAnchor(ApplContext ac, CssExpression expression,
	    boolean check) throws InvalidParamException {

	setByUser();
	CssValue val = expression.getValue();

	int i = 0;
	for (; i < values.length; i++) {
	    if (val.toString().equals(values[i])) {
		value = val;
		expression.next();
		break;
	    }
	}
	if (i == values.length) {
	    throw new InvalidParamException("value", expression.getValue(),
					    getPropertyName(), ac);
	}
    }

    public TextAnchor(ApplContext ac, CssExpression expression)
	    throws InvalidParamException {
	this(ac, expression, false);
    }
    
    /**
     * Add this property to the CssStyle
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
	if (((SVGStyle) style).textAnchor != null)
	    style.addRedefinitionWarning(ac, this);
	((SVGStyle) style).textAnchor = this;
    }

    /**
     * Get this property in the style.
     *
     * @param style The style where the property is
     * @param resolve if true, resolve the style to find this property
     */
    public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
	if (resolve) {
	    return ((SVGStyle) style).getTextAnchor();
	}
	else {
	    return ((SVGStyle) style).textAnchor;
	}
    }

    /**
     * Compares two properties for equality.
     *
     * @param value The other property.
     */
    public boolean equals(CssProperty property) {
	return (property instanceof TextAnchor &&
		value.equals(((TextAnchor) property).value));
    }
    
    /**
     * Returns the name of this property
     */
    public String getPropertyName() {
	return "text-rendering";
    }

    /**
     * Returns the value of this property
     */
    public Object get() {
	return value;
    }

    /**
     * Returns true if this property is "softly" inherited
     */
    public boolean isSoftlyInherited() {
	return value.equals(inherit);
    }

    /**
     * Returns a string representation of the object
     */
    public String toString() {
	return value.toString();
    }

    /**
     * Is the value of this property a default value
     * It is used by alle macro for the function <code>print</code>
     */
    public boolean isDefault() {
	return (value == start);
    }

}

Received on Tuesday, 23 August 2005 16:25:59 UTC