2002/css-validator/org/w3c/css/properties/css CssBorder.java,NONE,1.1 CssBorderBottom.java,NONE,1.1 CssBorderBottomColor.java,NONE,1.1 CssBorderBottomLeftRadius.java,NONE,1.1 CssBorderBottomRightRadius.java,NONE,1.1 CssBorderBottomStyle.java,NONE,1.1 CssBorderBottomWidth.java,NONE,1.1 CssBorderColor.java,NONE,1.1 CssBorderImage.java,NONE,1.1 CssBorderImageOutset.java,NONE,1.1 CssBorderImageRepeat.java,NONE,1.1 CssBorderImageSlice.java,NONE,1.1 CssBorderImageSource.java,NONE,1.1 CssBorderImageWidth.java,NONE,1.1 CssBorderLeft.java,NONE,1.1 CssBorderLeftColor.java,NONE,1.1 CssBorderLeftStyle.java,NONE,1.1 CssBorderLeftWidth.java,NONE,1.1 CssBorderRadius.java,NONE,1.1 CssBorderRight.java,NONE,1.1 CssBorderRightColor.java,NONE,1.1 CssBorderRightStyle.java,NONE,1.1 CssBorderRightWidth.java,NONE,1.1 CssBorderStyle.java,NONE,1.1 CssBorderTop.java,NONE,1.1 CssBorderTopColor.java,NONE,1.1 CssBorderTopLeftRadius.java,NONE,1.1 CssBorderTopRightRadius.java,NONE,1.1 CssBorderTopStyle.java,NONE,1.1 CssBorderTopW

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

Added Files:
	CssBorder.java CssBorderBottom.java CssBorderBottomColor.java 
	CssBorderBottomLeftRadius.java CssBorderBottomRightRadius.java 
	CssBorderBottomStyle.java CssBorderBottomWidth.java 
	CssBorderColor.java CssBorderImage.java 
	CssBorderImageOutset.java CssBorderImageRepeat.java 
	CssBorderImageSlice.java CssBorderImageSource.java 
	CssBorderImageWidth.java CssBorderLeft.java 
	CssBorderLeftColor.java CssBorderLeftStyle.java 
	CssBorderLeftWidth.java CssBorderRadius.java 
	CssBorderRight.java CssBorderRightColor.java 
	CssBorderRightStyle.java CssBorderRightWidth.java 
	CssBorderStyle.java CssBorderTop.java CssBorderTopColor.java 
	CssBorderTopLeftRadius.java CssBorderTopRightRadius.java 
	CssBorderTopStyle.java CssBorderTopWidth.java 
	CssBorderWidth.java 
Log Message:
Finished implementation of css3-background (background and borders)
* border is now a single item, instead of one per level
* able to parse all the positive tests, some negative ones will need some tuning
* Grammar modification to use the '/' between two numbers without matching a ratio 



--- NEW FILE: CssBorderBottomWidth.java ---
// $Id: CssBorderBottomWidth.java,v 1.1 2012/04/25 20:21:54 ylafon Exp $
// Author: Yves Lafon <ylafon@w3.org>
//
// (c) COPYRIGHT MIT, ERCIM and Keio University, 2012.
// Please first read the full copyright statement in file COPYRIGHT.html
package org.w3c.css.properties.css;

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

/**
 * @since CSS1
 * @version $Revision: 1.1 $
 */
public class CssBorderBottomWidth extends CssProperty {

    public CssValue value;

    /**
     * Create a new CssBorderBottomWidth
     */
    public CssBorderBottomWidth() {
    }

    /**
     * Creates a new CssBorderBottomWidth
     *
     * @param expression The expression for this property
     * @throws org.w3c.css.util.InvalidParamException
     *          Expressions are incorrect
     */
    public CssBorderBottomWidth(ApplContext ac, CssExpression expression, boolean check)
            throws InvalidParamException {
        throw new InvalidParamException("value",
                expression.getValue().toString(),
                getPropertyName(), ac);
    }

    public CssBorderBottomWidth(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 final String getPropertyName() {
        return "border-bottom-width";
    }

    /**
     * Returns true if this property is "softly" inherited
     * e.g. his value is equals to inherit
     */
    public boolean isSoftlyInherited() {
        return value.equals(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) {
        if (((Css1Style) style).cssBorder.borderWidth.bottom != null)
            style.addRedefinitionWarning(ac, this);
        ((Css1Style) style).cssBorder.borderWidth.bottom = this;
    }

    /**
     * Compares two properties for equality.
     *
     * @param property The other property.
     */
    public boolean equals(CssProperty property) {
        return (property instanceof CssBorderBottomWidth &&
                value.equals(((CssBorderBottomWidth) property).value));
    }


    /**
     * 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 ((Css1Style) style).getBorderBottomWidth();
        } else {
            return ((Css1Style) style).cssBorder.borderWidth.bottom;
        }
    }
}


--- NEW FILE: CssBorderStyle.java ---
// $Id: CssBorderStyle.java,v 1.1 2012/04/25 20:21:55 ylafon Exp $
// @author Yves Lafon <ylafon@w3.org>

// (c) COPYRIGHT MIT, ERCIM and Keio University, 2012.
// Please first read the full copyright statement in file COPYRIGHT.html
package org.w3c.css.properties.css;

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

/**
 * @since CSS1
 */
public class CssBorderStyle extends CssProperty {

    public CssValue value;
    // those are @since CSS2
    public CssBorderTopStyle top;
    public CssBorderBottomStyle bottom;
    public CssBorderLeftStyle left;
    public CssBorderRightStyle right;

    public boolean shorthand;

    /**
     * Create a new CssBorderStyle
     */
    public CssBorderStyle() {
    }

    /**
     * Set the value of the property<br/>
     * Does not check the number of values
     *
     * @param expression The expression for this property
     * @throws org.w3c.css.util.InvalidParamException The expression is incorrect
     */
    public CssBorderStyle(ApplContext ac, CssExpression expression)
            throws InvalidParamException {
        this(ac, expression, false);
    }

    /**
     * Set the value of the property
     *
     * @param expression The expression for this property
     * @param check      set it to true to check the number of values
     * @throws org.w3c.css.util.InvalidParamException The expression is incorrect
     */
    public CssBorderStyle(ApplContext ac, CssExpression expression,
                          boolean check) throws InvalidParamException {
        throw new InvalidParamException("unrecognize", ac);

    }



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

    /**
     * Returns the name of this property
     */
    public final String getPropertyName() {
        return "border-style";
    }

    /**
     * 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) {
        CssBorder cssBorder = ((Css1Style) style).cssBorder;
        cssBorder.borderStyle.byUser = byUser;
        if (cssBorder.borderStyle.shorthand) {
            style.addRedefinitionWarning(ac, this);
        } else {
            top.addToStyle(ac, style);
            right.addToStyle(ac, style);
            bottom.addToStyle(ac, style);
            left.addToStyle(ac, style);
        }
        cssBorder.borderWidth.shorthand = shorthand;
    }

    /**
     * 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 ((Css1Style) style).getBorder().borderStyle;
        } else {
            return ((Css1Style) style).cssBorder.borderStyle;
        }
    }

    /**
     * Compares two properties for equality.
     *
     * @param property The other property.
     */
    public boolean equals(CssProperty property) {
        try {
            CssBorderStyle other = (CssBorderStyle) property;
            // FIXME check compound ?
            return ((left != null && left.equals(other.left)) || (left == null && other.left == null)) &&
                    ((bottom != null && bottom.equals(other.bottom)) || (bottom == null && other.bottom == null)) &&
                    ((right != null && right.equals(other.right)) || (right == null && other.right == null)) &&
                    ((top != null && top.equals(other.top)) || (top == null && other.top == null));


        } catch (ClassCastException cce) {
        }
        return false;
    }
}

--- NEW FILE: CssBorderImageSlice.java ---
// $Id: CssBorderImageSlice.java,v 1.1 2012/04/25 20:21:54 ylafon Exp $
// Author: Yves Lafon <ylafon@w3.org>
//
// (c) COPYRIGHT MIT, ERCIM and Keio University, 2012.
// Please first read the full copyright statement in file COPYRIGHT.html
package org.w3c.css.properties.css;

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

/**
 * @since CSS3
 * @version $Revision: 1.1 $
 */
public class CssBorderImageSlice extends CssProperty {

    public CssValue value;

    /**
     * Create a new CssBorderImageSlice
     */
    public CssBorderImageSlice() {
    }

    /**
     * Creates a new CssBorderImageSlice
     *
     * @param expression The expression for this property
     * @throws org.w3c.css.util.InvalidParamException
     *          Expressions are incorrect
     */
    public CssBorderImageSlice(ApplContext ac, CssExpression expression, boolean check)
            throws InvalidParamException {
        throw new InvalidParamException("value",
                expression.getValue().toString(),
                getPropertyName(), ac);
    }

    public CssBorderImageSlice(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 final String getPropertyName() {
        return "border-image-slice";
    }

    /**
     * Returns true if this property is "softly" inherited
     * e.g. his value is equals to inherit
     */
    public boolean isSoftlyInherited() {
        return value.equals(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) {
        if (((Css1Style) style).cssBorder.borderImage.slice != null)
            style.addRedefinitionWarning(ac, this);
        ((Css3Style) style).cssBorder.borderImage.slice = this;
    }

    /**
     * Compares two properties for equality.
     *
     * @param property The other property.
     */
    public boolean equals(CssProperty property) {
        return (property instanceof CssBorderImageSlice &&
                value.equals(((CssBorderImageSlice) property).value));
    }


    /**
     * 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 ((Css1Style) style).getBorder().borderImage.slice;
        } else {
            return ((Css3Style) style).cssBorder.borderImage.slice;
        }
    }
}


--- NEW FILE: CssBorderImage.java ---
// $Id: CssBorderImage.java,v 1.1 2012/04/25 20:21:54 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
// Rewritten 2010 Yves Lafon <ylafon@w3.org>

// (c) COPYRIGHT MIT, ERCIM and Keio, 1997-2010.
// Please first read the full copyright statement in file COPYRIGHT.html
package org.w3c.css.properties.css;

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

/**
 * @since CSS3
 */
public class CssBorderImage extends CssProperty {

    public CssValue value;

    public CssBorderImageSource source;
    public CssBorderImageSlice slice;
    public CssBorderImageWidth width;
    public CssBorderImageOutset outset;
    public CssBorderImageRepeat repeat;


    public boolean shorthand;

    /**
     * Create a new CssBorderImage
     */
    public CssBorderImage() {
    }

    /**
     * Set the value of the property<br/>
     * Does not check the number of values
     *
     * @param expression The expression for this property
     * @throws org.w3c.css.util.InvalidParamException
     *          The expression is incorrect
     */
    public CssBorderImage(ApplContext ac, CssExpression expression)
            throws InvalidParamException {
        this(ac, expression, false);
    }

    /**
     * Set the value of the property
     *
     * @param expression The expression for this property
     * @param check      set it to true to check the number of values
     * @throws org.w3c.css.util.InvalidParamException
     *          The expression is incorrect
     */
    public CssBorderImage(ApplContext ac, CssExpression expression,
                          boolean check) throws InvalidParamException {
        throw new InvalidParamException("unrecognize", ac);

    }


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

    /**
     * Returns the name of this property
     */
    public final String getPropertyName() {
        return "border-image";
    }

    /**
     * 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) {
        ((Css1Style) style).cssBorder.borderImage.shorthand = shorthand;
        ((Css1Style) style).cssBorder.borderImage.byUser = byUser;

        if (source != null) {
            source.addToStyle(ac, style);
        }
        if (slice != null) {
            slice.addToStyle(ac, style);
        }
        if (width != null) {
            width.addToStyle(ac, style);
        }
        if (outset != null) {
            outset.addToStyle(ac, style);
        }
        if (repeat != null) {
            repeat.addToStyle(ac, style);
        }
    }

    /**
     * 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 ((Css1Style) style).getBorder().borderImage;
        } else {
            return ((Css1Style) style).cssBorder.borderImage;
        }
    }

    /**
     * Compares two properties for equality.
     *
     * @param property The other property.
     */
    public boolean equals(CssProperty property) {
        return false; // FIXME
    }
}

--- NEW FILE: CssBorderLeftWidth.java ---
// $Id: CssBorderLeftWidth.java,v 1.1 2012/04/25 20:21:54 ylafon Exp $
// Author: Yves Lafon <ylafon@w3.org>
//
// (c) COPYRIGHT MIT, ERCIM and Keio University, 2012.
// Please first read the full copyright statement in file COPYRIGHT.html
package org.w3c.css.properties.css;

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

/**
 * @since CSS1
 * @version $Revision: 1.1 $
 */
public class CssBorderLeftWidth extends CssProperty {

    public CssValue value;

    /**
     * Create a new CssBorderLeftWidth
     */
    public CssBorderLeftWidth() {
    }

    /**
     * Creates a new CssBorderLeftWidth
     *
     * @param expression The expression for this property
     * @throws org.w3c.css.util.InvalidParamException
     *          Expressions are incorrect
     */
    public CssBorderLeftWidth(ApplContext ac, CssExpression expression, boolean check)
            throws InvalidParamException {
        throw new InvalidParamException("value",
                expression.getValue().toString(),
                getPropertyName(), ac);
    }

    public CssBorderLeftWidth(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 final String getPropertyName() {
        return "border-left-width";
    }

    /**
     * Returns true if this property is "softly" inherited
     * e.g. his value is equals to inherit
     */
    public boolean isSoftlyInherited() {
        return value.equals(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) {
        if (((Css1Style) style).cssBorder.borderWidth.left != null)
            style.addRedefinitionWarning(ac, this);
        ((Css1Style) style).cssBorder.borderWidth.left = this;
    }

    /**
     * Compares two properties for equality.
     *
     * @param property The other property.
     */
    public boolean equals(CssProperty property) {
        return (property instanceof CssBorderLeftWidth &&
                value.equals(((CssBorderLeftWidth) property).value));
    }


    /**
     * 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 ((Css1Style) style).getBorderLeftWidth();
        } else {
            return ((Css1Style) style).cssBorder.borderWidth.left;
        }
    }
}


--- NEW FILE: CssBorderTopLeftRadius.java ---
// $Id: CssBorderTopLeftRadius.java,v 1.1 2012/04/25 20:21:55 ylafon Exp $
// Author: Yves Lafon <ylafon@w3.org>
//
// (c) COPYRIGHT MIT, ERCIM and Keio University, 2012.
// Please first read the full copyright statement in file COPYRIGHT.html
package org.w3c.css.properties.css;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.Css1Style;
import org.w3c.css.properties.css3.Css3Style;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssValue;
import org.w3c.css.values.CssValueList;

/**
 * @since CSS3
 * @version $Revision: 1.1 $
 */
public class CssBorderTopLeftRadius extends CssProperty {

    public CssValue value;
    public CssValue h_radius;
    public CssValue v_radius;

    /**
     * Create a new CssBorderTopLeftRadius
     */
    public CssBorderTopLeftRadius() {
    }

    /**
     * Creates a new CssBorderTopLeftRadius
     *
     * @param expression The expression for this property
     * @throws org.w3c.css.util.InvalidParamException
     *          Expressions are incorrect
     */
    public CssBorderTopLeftRadius(ApplContext ac, CssExpression expression, boolean check)
            throws InvalidParamException {
        throw new InvalidParamException("value",
                expression.getValue().toString(),
                getPropertyName(), ac);
    }

    public CssBorderTopLeftRadius(ApplContext ac, CssExpression expression)
            throws InvalidParamException {
        this(ac, expression, false);
    }

    private void syncval() {
        if (h_radius.equals(v_radius)) {
            value = h_radius;
        } else {
            CssValueList vlist = new CssValueList();
            vlist.add(h_radius);
            vlist.add(v_radius);
            value = vlist;
        }
    }

    /**
     * Returns the value of this property
     */
    public Object get() {
        if ((value == null) && (h_radius != null)) {
            syncval();
        }
        return value;
    }


    /**
     * Returns the name of this property
     */
    public final String getPropertyName() {
        return "border-top-left-radius";
    }

    /**
     * Returns true if this property is "softly" inherited
     * e.g. his value is equals to inherit
     */
    public boolean isSoftlyInherited() {
        if ((value == null) && (h_radius != null)) {
            syncval();
        }
        return value.equals(inherit);
    }

    /**
     * Returns a string representation of the object.
     */
    public String toString() {
        if ((value == null) && (h_radius != null)) {
            syncval();
        }
        return value.toString();
    }

    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
        if (((Css1Style) style).cssBorder.borderRadius.topLeft != null)
            style.addRedefinitionWarning(ac, this);
        ((Css3Style) style).cssBorder.borderRadius.topLeft = this;
    }

    /**
     * Compares two properties for equality.
     *
     * @param property The other property.
     */
    public boolean equals(CssProperty property) {
        if ((value == null) && (h_radius != null)) {
            syncval();
        }
        return (property instanceof CssBorderTopLeftRadius &&
                value.equals(((CssBorderTopLeftRadius) property).value));
    }


    /**
     * 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 ((Css3Style) style).getBorderTopLeftRadius();
        } else {
            return ((Css1Style) style).cssBorder.borderRadius.topLeft;
        }
    }
}


--- NEW FILE: CssBorderBottomRightRadius.java ---
// $Id: CssBorderBottomRightRadius.java,v 1.1 2012/04/25 20:21:54 ylafon Exp $
// Author: Yves Lafon <ylafon@w3.org>
//
// (c) COPYRIGHT MIT, ERCIM and Keio University, 2012.
// Please first read the full copyright statement in file COPYRIGHT.html
package org.w3c.css.properties.css;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.Css1Style;
import org.w3c.css.properties.css3.Css3Style;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssValue;
import org.w3c.css.values.CssValueList;

/**
 * @since CSS3
 * @version $Revision: 1.1 $
 */
public class CssBorderBottomRightRadius extends CssProperty {

    public CssValue value;
    public CssValue h_radius;
    public CssValue v_radius;

    /**
     * Create a new CssBorderBottomRightRadius
     */
    public CssBorderBottomRightRadius() {
    }

    /**
     * Creates a new CssBorderBottomRightRadius
     *
     * @param expression The expression for this property
     * @throws org.w3c.css.util.InvalidParamException
     *          Expressions are incorrect
     */
    public CssBorderBottomRightRadius(ApplContext ac, CssExpression expression, boolean check)
            throws InvalidParamException {
        throw new InvalidParamException("value",
                expression.getValue().toString(),
                getPropertyName(), ac);
    }

    public CssBorderBottomRightRadius(ApplContext ac, CssExpression expression)
            throws InvalidParamException {
        this(ac, expression, false);
    }

    private void syncval() {
        if (h_radius.equals(v_radius)) {
            value = h_radius;
        } else {
            CssValueList vlist = new CssValueList();
            vlist.add(h_radius);
            vlist.add(v_radius);
            value = vlist;
        }
    }

    /**
     * Returns the value of this property
     */
    public Object get() {
        if ((value == null) && (h_radius != null)) {
            syncval();
        }
        return value;
    }


    /**
     * Returns the name of this property
     */
    public final String getPropertyName() {
        return "border-bottom-right-radius";
    }

    /**
     * Returns true if this property is "softly" inherited
     * e.g. his value is equals to inherit
     */
    public boolean isSoftlyInherited() {
        if ((value == null) && (h_radius != null)) {
            syncval();
        }
        return value.equals(inherit);
    }

    /**
     * Returns a string representation of the object.
     */
    public String toString() {
        if ((value == null) && (h_radius != null)) {
            syncval();
        }
        return value.toString();
    }

    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
        if (((Css1Style) style).cssBorder.borderRadius.bottomRight != null)
            style.addRedefinitionWarning(ac, this);
        ((Css3Style) style).cssBorder.borderRadius.bottomRight = this;
    }

    /**
     * Compares two properties for equality.
     *
     * @param property The other property.
     */
    public boolean equals(CssProperty property) {
        if ((value == null) && (h_radius != null)) {
            syncval();
        }
        return (property instanceof CssBorderBottomRightRadius &&
                value.equals(((CssBorderBottomRightRadius) property).value));
    }


    /**
     * 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 ((Css3Style) style).getBorderBottomRightRadius();
        } else {
            return ((Css1Style) style).cssBorder.borderRadius.bottomRight;
        }
    }
}


--- NEW FILE: CssBorderLeft.java ---
// $Id: CssBorderLeft.java,v 1.1 2012/04/25 20:21:54 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
// Rewritten 2010 Yves Lafon <ylafon@w3.org>

// (c) COPYRIGHT MIT, ERCIM and Keio, 1997-2010.
// Please first read the full copyright statement in file COPYRIGHT.html
package org.w3c.css.properties.css;

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

/**
 * @since CSS1
 */
public class CssBorderLeft extends CssProperty {

    public CssValue value;

    // those are @since CSS1
    public CssBorderLeftWidth _width;
    // and @since CSS2
    public CssBorderLeftColor _color;
    public CssBorderLeftStyle _style;

    /**
     * Create a new CssBorderLeft
     */
    public CssBorderLeft() {
    }

    /**
     * Set the value of the property<br/>
     * Does not check the number of values
     *
     * @param expression The expression for this property
     * @throws org.w3c.css.util.InvalidParamException The expression is incorrect
     */
    public CssBorderLeft(ApplContext ac, CssExpression expression)
            throws InvalidParamException {
        this(ac, expression, false);
    }

    /**
     * Set the value of the property
     *
     * @param expression The expression for this property
     * @param check      set it to true to check the number of values
     * @throws org.w3c.css.util.InvalidParamException The expression is incorrect
     */
    public CssBorderLeft(ApplContext ac, CssExpression expression,
                         boolean check) throws InvalidParamException {
        throw new InvalidParamException("unrecognize", ac);

    }



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

    /**
     * Returns the name of this property
     */
    public final String getPropertyName() {
        return "border-left";
    }

    /**
     * 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) {
        Css1Style css1Style = (Css1Style) style;
        css1Style.cssBorder.byUser = byUser;
        if (css1Style.cssBorder.borderLeft != null) {
            style.addRedefinitionWarning(ac, this);
        }
        css1Style.cssBorder.borderLeft = this;
        if (_width != null) {
            _width.addToStyle(ac, style);
        }
        if (_color != null) {
            _color.addToStyle(ac, style);
        }
        if (_style != null) {
            _style.addToStyle(ac, style);
        }
    }

    /**
     * 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 ((Css1Style) style).getBorder().borderLeft;
        } else {
            return ((Css1Style) style).cssBorder.borderLeft;
        }
    }

    /**
     * Compares two properties for equality.
     *
     * @param property The other property.
     */
    public boolean equals(CssProperty property) {
        CssBorderLeft other;
        try {
            other = (CssBorderLeft) property;
            return ((_width == null && other._width == null) || (_width != null && _width.equals(other._width))) &&
                    ((_color == null && other._color == null) || (_color != null && _color.equals(other._color))) &&
                    ((_style == null && other._style == null) || (_style != null && _style.equals(other._style)));
        } catch (ClassCastException cce) {
            return false;
        }
    }
}

--- NEW FILE: CssBorderBottomLeftRadius.java ---
// $Id: CssBorderBottomLeftRadius.java,v 1.1 2012/04/25 20:21:54 ylafon Exp $
// Author: Yves Lafon <ylafon@w3.org>
//
// (c) COPYRIGHT MIT, ERCIM and Keio University, 2012.
// Please first read the full copyright statement in file COPYRIGHT.html
package org.w3c.css.properties.css;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.Css1Style;
import org.w3c.css.properties.css3.Css3Style;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssValue;
import org.w3c.css.values.CssValueList;

/**
 * @since CSS3
 * @version $Revision: 1.1 $
 */
public class CssBorderBottomLeftRadius extends CssProperty {

    public CssValue value;
    public CssValue h_radius;
    public CssValue v_radius;

    /**
     * Create a new CssBorderBottomLeftRadius
     */
    public CssBorderBottomLeftRadius() {
    }

    /**
     * Creates a new CssBorderBottomLeftRadius
     *
     * @param expression The expression for this property
     * @throws org.w3c.css.util.InvalidParamException
     *          Expressions are incorrect
     */
    public CssBorderBottomLeftRadius(ApplContext ac, CssExpression expression, boolean check)
            throws InvalidParamException {
        throw new InvalidParamException("value",
                expression.getValue().toString(),
                getPropertyName(), ac);
    }

    public CssBorderBottomLeftRadius(ApplContext ac, CssExpression expression)
            throws InvalidParamException {
        this(ac, expression, false);
    }

    private void syncval() {
        if (h_radius.equals(v_radius)) {
            value = h_radius;
        } else {
            CssValueList vlist = new CssValueList();
            vlist.add(h_radius);
            vlist.add(v_radius);
            value = vlist;
        }
    }

    /**
     * Returns the value of this property
     */
    public Object get() {
        if ((value == null) && (h_radius != null)) {
            syncval();
        }
        return value;
    }


    /**
     * Returns the name of this property
     */
    public final String getPropertyName() {
        return "border-bottom-left-radius";
    }

    /**
     * Returns true if this property is "softly" inherited
     * e.g. his value is equals to inherit
     */
    public boolean isSoftlyInherited() {
        if (value == null && h_radius != null) {
            syncval();
        }
        return value.equals(inherit);
    }

    /**
     * Returns a string representation of the object.
     */
    public String toString() {
        if (value == null && h_radius != null) {
            syncval();
        }
        return value.toString();
    }

    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
        if (((Css1Style) style).cssBorder.borderRadius.bottomLeft != null)
            style.addRedefinitionWarning(ac, this);
        ((Css3Style) style).cssBorder.borderRadius.bottomLeft = this;
    }

    /**
     * Compares two properties for equality.
     *
     * @param property The other property.
     */
    public boolean equals(CssProperty property) {
        if ((value == null) && (h_radius != null)) {
            syncval();
        }
        return (property instanceof CssBorderBottomLeftRadius &&
                value.equals(((CssBorderBottomLeftRadius) property).value));
    }


    /**
     * 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 ((Css3Style) style).getBorderBottomLeftRadius();
        } else {
            return ((Css1Style) style).cssBorder.borderRadius.bottomLeft;
        }
    }
}


--- NEW FILE: CssBorderImageWidth.java ---
// $Id: CssBorderImageWidth.java,v 1.1 2012/04/25 20:21:54 ylafon Exp $
// Author: Yves Lafon <ylafon@w3.org>
//
// (c) COPYRIGHT MIT, ERCIM and Keio University, 2012.
// Please first read the full copyright statement in file COPYRIGHT.html
package org.w3c.css.properties.css;

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

/**
 * @since CSS3
 * @version $Revision: 1.1 $
 */
public class CssBorderImageWidth extends CssProperty {

    public CssValue value;

    /**
     * Create a new CssBorderImageWidth
     */
    public CssBorderImageWidth() {
    }

    /**
     * Creates a new CssBorderImageWidth
     *
     * @param expression The expression for this property
     * @throws org.w3c.css.util.InvalidParamException
     *          Expressions are incorrect
     */
    public CssBorderImageWidth(ApplContext ac, CssExpression expression, boolean check)
            throws InvalidParamException {
        throw new InvalidParamException("value",
                expression.getValue().toString(),
                getPropertyName(), ac);
    }

    public CssBorderImageWidth(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 final String getPropertyName() {
        return "border-image-width";
    }

    /**
     * Returns true if this property is "softly" inherited
     * e.g. his value is equals to inherit
     */
    public boolean isSoftlyInherited() {
        return value.equals(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) {
        if (((Css1Style) style).cssBorder.borderImage.width != null)
            style.addRedefinitionWarning(ac, this);
        ((Css3Style) style).cssBorder.borderImage.width = this;
    }

    /**
     * Compares two properties for equality.
     *
     * @param property The other property.
     */
    public boolean equals(CssProperty property) {
        return (property instanceof CssBorderImageWidth &&
                value.equals(((CssBorderImageWidth) property).value));
    }


    /**
     * 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 ((Css1Style) style).getBorder().borderImage.width;
        } else {
            return ((Css3Style) style).cssBorder.borderImage.width;
        }
    }
}


--- NEW FILE: CssBorderColor.java ---
// $Id: CssBorderColor.java,v 1.1 2012/04/25 20:21:54 ylafon Exp $
// @author Yves Lafon <ylafon@w3.org>

// (c) COPYRIGHT MIT, ERCIM and Keio University, 2012.
// Please first read the full copyright statement in file COPYRIGHT.html
package org.w3c.css.properties.css;

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

/**
 * @since CSS1
 */
public class CssBorderColor extends CssProperty {

    public CssValue value;
    // those are @since CSS2
    public CssBorderTopColor top;
    public CssBorderBottomColor bottom;
    public CssBorderLeftColor left;
    public CssBorderRightColor right;

    public boolean shorthand;

    /**
     * Create a new CssBorderColor
     */
    public CssBorderColor() {
    }

    /**
     * Set the value of the property<br/>
     * Does not check the number of values
     *
     * @param expression The expression for this property
     * @throws org.w3c.css.util.InvalidParamException
     *          The expression is incorrect
     */
    public CssBorderColor(ApplContext ac, CssExpression expression)
            throws InvalidParamException {
        this(ac, expression, false);
    }

    /**
     * Set the value of the property
     *
     * @param expression The expression for this property
     * @param check      set it to true to check the number of values
     * @throws org.w3c.css.util.InvalidParamException
     *          The expression is incorrect
     */
    public CssBorderColor(ApplContext ac, CssExpression expression,
                          boolean check) throws InvalidParamException {
        throw new InvalidParamException("unrecognize", ac);

    }


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

    /**
     * Returns the color
     */
    public CssValue getColor() {
        return value;
    }

    /**
     * Returns the name of this property
     */
    public final String getPropertyName() {
        return "border-color";
    }

    /**
     * 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) {
        CssBorder cssBorder = ((Css1Style) style).cssBorder;
        cssBorder.borderColor.byUser = byUser;
        if (cssBorder.borderColor.shorthand) {
            style.addRedefinitionWarning(ac, this);
        } else {
            top.addToStyle(ac, style);
            right.addToStyle(ac, style);
            bottom.addToStyle(ac, style);
            left.addToStyle(ac, style);
        }
        cssBorder.borderWidth.shorthand = shorthand;
    }

    /**
     * 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 ((Css1Style) style).getBorder().borderColor;
        } else {
            return ((Css1Style) style).cssBorder.borderColor;
        }
    }

    /**
     * Compares two properties for equality.
     *
     * @param property The other property.
     */
    public boolean equals(CssProperty property) {
        try {
            CssBorderColor other = (CssBorderColor) property;
            // FIXME check compound ?
            return ((left != null && left.equals(other.left)) || (left == null && other.left == null)) &&
                    ((bottom != null && bottom.equals(other.bottom)) || (bottom == null && other.bottom == null)) &&
                    ((right != null && right.equals(other.right)) || (right == null && other.right == null)) &&
                    ((top != null && top.equals(other.top)) || (top == null && other.top == null));


        } catch (ClassCastException cce) {
        }
        return false;
    }
}

--- NEW FILE: CssBorderRightStyle.java ---
// $Id: CssBorderRightStyle.java,v 1.1 2012/04/25 20:21:55 ylafon Exp $
// Author: Yves Lafon <ylafon@w3.org>
//
// (c) COPYRIGHT MIT, ERCIM and Keio University, 2012.
// Please first read the full copyright statement in file COPYRIGHT.html
package org.w3c.css.properties.css;

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

/**
 * @since CSS2
 * @version $Revision: 1.1 $
 */
public class CssBorderRightStyle extends CssProperty {

    public CssValue value;

    /**
     * Create a new CssBorderRightStyle
     */
    public CssBorderRightStyle() {
    }

    /**
     * Creates a new CssBorderRightStyle
     *
     * @param expression The expression for this property
     * @throws org.w3c.css.util.InvalidParamException
     *          Expressions are incorrect
     */
    public CssBorderRightStyle(ApplContext ac, CssExpression expression, boolean check)
            throws InvalidParamException {
        throw new InvalidParamException("value",
                expression.getValue().toString(),
                getPropertyName(), ac);
    }

    public CssBorderRightStyle(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 final String getPropertyName() {
        return "border-right-style";
    }

    /**
     * Returns true if this property is "softly" inherited
     * e.g. his value is equals to inherit
     */
    public boolean isSoftlyInherited() {
        return value.equals(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) {
        if (((Css1Style) style).cssBorder.borderStyle.right != null)
            style.addRedefinitionWarning(ac, this);
        ((Css2Style) style).cssBorder.borderStyle.right = this;
    }

    /**
     * Compares two properties for equality.
     *
     * @param property The other property.
     */
    public boolean equals(CssProperty property) {
        return (property instanceof CssBorderRightStyle &&
                value.equals(((CssBorderRightStyle) property).value));
    }


    /**
     * 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 ((Css2Style) style).getBorder().borderStyle.right;
        } else {
            return ((Css2Style) style).cssBorder.borderStyle.right;
        }
    }
}


--- NEW FILE: CssBorderImageSource.java ---
// $Id: CssBorderImageSource.java,v 1.1 2012/04/25 20:21:54 ylafon Exp $
// Author: Yves Lafon <ylafon@w3.org>
//
// (c) COPYRIGHT MIT, ERCIM and Keio University, 2012.
// Please first read the full copyright statement in file COPYRIGHT.html
package org.w3c.css.properties.css;

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

/**
 * @since CSS3
 * @version $Revision: 1.1 $
 */
public class CssBorderImageSource extends CssProperty {

    public CssValue value;

    /**
     * Create a new CssBorderImageSource
     */
    public CssBorderImageSource() {
    }

    /**
     * Creates a new CssBorderImageSource
     *
     * @param expression The expression for this property
     * @throws org.w3c.css.util.InvalidParamException
     *          Expressions are incorrect
     */
    public CssBorderImageSource(ApplContext ac, CssExpression expression, boolean check)
            throws InvalidParamException {
        throw new InvalidParamException("value",
                expression.getValue().toString(),
                getPropertyName(), ac);
    }

    public CssBorderImageSource(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 final String getPropertyName() {
        return "border-image-source";
    }

    /**
     * Returns true if this property is "softly" inherited
     * e.g. his value is equals to inherit
     */
    public boolean isSoftlyInherited() {
        return value.equals(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) {
        if (((Css1Style) style).cssBorder.borderImage.source != null)
            style.addRedefinitionWarning(ac, this);
        ((Css3Style) style).cssBorder.borderImage.source = this;
    }

    /**
     * Compares two properties for equality.
     *
     * @param property The other property.
     */
    public boolean equals(CssProperty property) {
        return (property instanceof CssBorderImageSource &&
                value.equals(((CssBorderImageSource) property).value));
    }


    /**
     * 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 ((Css1Style) style).getBorder().borderImage.source;
        } else {
            return ((Css3Style) style).cssBorder.borderImage.source;
        }
    }
}


--- NEW FILE: CssBorderRadius.java ---
// $Id: CssBorderRadius.java,v 1.1 2012/04/25 20:21:54 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
// Rewritten 2010 Yves Lafon <ylafon@w3.org>

// (c) COPYRIGHT MIT, ERCIM and Keio, 1997-2010.
// Please first read the full copyright statement in file COPYRIGHT.html
package org.w3c.css.properties.css;

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

/**
 * @since CSS3
 */
public class CssBorderRadius extends CssProperty {

    public CssValue value;

    // those are @since CSS3
    public CssBorderTopLeftRadius topLeft;
    public CssBorderTopRightRadius topRight;
    public CssBorderBottomLeftRadius bottomLeft;
    public CssBorderBottomRightRadius bottomRight;

    public boolean shorthand;

    /**
     * Create a new CssBorderRadius
     */
    public CssBorderRadius() {
    }

    /**
     * Set the value of the property<br/>
     * Does not check the number of values
     *
     * @param expression The expression for this property
     * @throws org.w3c.css.util.InvalidParamException The expression is incorrect
     */
    public CssBorderRadius(ApplContext ac, CssExpression expression)
            throws InvalidParamException {
        this(ac, expression, false);
    }

    /**
     * Set the value of the property
     *
     * @param expression The expression for this property
     * @param check      set it to true to check the number of values
     * @throws org.w3c.css.util.InvalidParamException The expression is incorrect
     */
    public CssBorderRadius(ApplContext ac, CssExpression expression,
                           boolean check) throws InvalidParamException {
        throw new InvalidParamException("unrecognize", ac);

    }



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

    /**
     * Returns the name of this property
     */
    public final String getPropertyName() {
        return "border-radius";
    }

    /**
     * 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) {
        ((Css1Style) style).cssBorder.borderRadius.shorthand = shorthand;
        ((Css1Style) style).cssBorder.borderRadius.byUser = byUser;
        if (topLeft != null) {
            topLeft.addToStyle(ac, style);
        }
        if (topRight != null) {
            topRight.addToStyle(ac, style);
        }
        if (bottomLeft != null) {
            bottomLeft.addToStyle(ac, style);
        }
        if (bottomRight != null) {
            bottomRight.addToStyle(ac, style);
        }
    }

    /**
     * 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 ((Css1Style) style).getBorder().borderRadius;
        } else {
            return ((Css1Style) style).cssBorder.borderRadius;
        }
    }

    /**
     * Compares two properties for equality.
     *
     * @param property The other property.
     */
    public boolean equals(CssProperty property) {
        return false; // FIXME
    }
}

--- NEW FILE: CssBorderLeftStyle.java ---
// $Id: CssBorderLeftStyle.java,v 1.1 2012/04/25 20:21:54 ylafon Exp $
// Author: Yves Lafon <ylafon@w3.org>
//
// (c) COPYRIGHT MIT, ERCIM and Keio University, 2012.
// Please first read the full copyright statement in file COPYRIGHT.html
package org.w3c.css.properties.css;

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

/**
 * @since CSS2
 * @version $Revision: 1.1 $
 */
public class CssBorderLeftStyle extends CssProperty {

    public CssValue value;

    /**
     * Create a new CssBorderLeftStyle
     */
    public CssBorderLeftStyle() {
    }

    /**
     * Creates a new CssBorderLeftStyle
     *
     * @param expression The expression for this property
     * @throws org.w3c.css.util.InvalidParamException
     *          Expressions are incorrect
     */
    public CssBorderLeftStyle(ApplContext ac, CssExpression expression, boolean check)
            throws InvalidParamException {
        throw new InvalidParamException("value",
                expression.getValue().toString(),
                getPropertyName(), ac);
    }

    public CssBorderLeftStyle(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 final String getPropertyName() {
        return "border-left-style";
    }

    /**
     * Returns true if this property is "softly" inherited
     * e.g. his value is equals to inherit
     */
    public boolean isSoftlyInherited() {
        return value.equals(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) {
        if (((Css1Style) style).cssBorder.borderStyle.left != null)
            style.addRedefinitionWarning(ac, this);
        ((Css2Style) style).cssBorder.borderStyle.left = this;
    }

    /**
     * Compares two properties for equality.
     *
     * @param property The other property.
     */
    public boolean equals(CssProperty property) {
        return (property instanceof CssBorderLeftStyle &&
                value.equals(((CssBorderLeftStyle) property).value));
    }


    /**
     * 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 ((Css2Style) style).getBorderLeftStyle();
        } else {
            return ((Css2Style) style).cssBorder.borderStyle.left;
        }
    }
}


--- NEW FILE: CssBorderTopWidth.java ---
// $Id: CssBorderTopWidth.java,v 1.1 2012/04/25 20:21:55 ylafon Exp $
// Author: Yves Lafon <ylafon@w3.org>
//
// (c) COPYRIGHT MIT, ERCIM and Keio University, 2012.
// Please first read the full copyright statement in file COPYRIGHT.html
package org.w3c.css.properties.css;

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

/**
 * @since CSS1
 * @version $Revision: 1.1 $
 */
public class CssBorderTopWidth extends CssProperty {

    public CssValue value;

    /**
     * Create a new CssBorderTopWidth
     */
    public CssBorderTopWidth() {
    }

    /**
     * Creates a new CssBorderTopWidth
     *
     * @param expression The expression for this property
     * @throws org.w3c.css.util.InvalidParamException
     *          Expressions are incorrect
     */
    public CssBorderTopWidth(ApplContext ac, CssExpression expression, boolean check)
            throws InvalidParamException {
        throw new InvalidParamException("value",
                expression.getValue().toString(),
                getPropertyName(), ac);
    }

    public CssBorderTopWidth(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 final String getPropertyName() {
        return "border-top-width";
    }

    /**
     * Returns true if this property is "softly" inherited
     * e.g. his value is equals to inherit
     */
    public boolean isSoftlyInherited() {
        return value.equals(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) {
        if (((Css1Style) style).cssBorder.borderWidth.top != null)
            style.addRedefinitionWarning(ac, this);
        ((Css1Style) style).cssBorder.borderWidth.top = this;
    }

    /**
     * Compares two properties for equality.
     *
     * @param property The other property.
     */
    public boolean equals(CssProperty property) {
        return (property instanceof CssBorderTopWidth &&
                value.equals(((CssBorderTopWidth) property).value));
    }


    /**
     * 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 ((Css1Style) style).getBorderTopWidth();
        } else {
            return ((Css1Style) style).cssBorder.borderWidth.top;
        }
    }
}


--- NEW FILE: CssBorderImageOutset.java ---
// $Id: CssBorderImageOutset.java,v 1.1 2012/04/25 20:21:54 ylafon Exp $
// Author: Yves Lafon <ylafon@w3.org>
//
// (c) COPYRIGHT MIT, ERCIM and Keio University, 2012.
// Please first read the full copyright statement in file COPYRIGHT.html
package org.w3c.css.properties.css;

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

/**
 * @since CSS3
 * @version $Revision: 1.1 $
 */
public class CssBorderImageOutset extends CssProperty {

    public CssValue value;

    /**
     * Create a new CssBorderImageOutset
     */
    public CssBorderImageOutset() {
    }

    /**
     * Creates a new CssBorderImageOutset
     *
     * @param expression The expression for this property
     * @throws org.w3c.css.util.InvalidParamException
     *          Expressions are incorrect
     */
    public CssBorderImageOutset(ApplContext ac, CssExpression expression, boolean check)
            throws InvalidParamException {
        throw new InvalidParamException("value",
                expression.getValue().toString(),
                getPropertyName(), ac);
    }

    public CssBorderImageOutset(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 final String getPropertyName() {
        return "border-image-outset";
    }

    /**
     * Returns true if this property is "softly" inherited
     * e.g. his value is equals to inherit
     */
    public boolean isSoftlyInherited() {
        return value.equals(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) {
        if (((Css1Style) style).cssBorder.borderImage.outset != null)
            style.addRedefinitionWarning(ac, this);
        ((Css3Style) style).cssBorder.borderImage.outset = this;
    }

    /**
     * Compares two properties for equality.
     *
     * @param property The other property.
     */
    public boolean equals(CssProperty property) {
        return (property instanceof CssBorderImageOutset &&
                value.equals(((CssBorderImageOutset) property).value));
    }


    /**
     * 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 ((Css1Style) style).getBorder().borderImage.outset;
        } else {
            return ((Css3Style) style).cssBorder.borderImage.outset;
        }
    }
}


--- NEW FILE: CssBorder.java ---
// $Id: CssBorder.java,v 1.1 2012/04/25 20:21:53 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
// Rewritten 2010 Yves Lafon <ylafon@w3.org>

// (c) COPYRIGHT MIT, ERCIM and Keio, 1997-2010.
// Please first read the full copyright statement in file COPYRIGHT.html
package org.w3c.css.properties.css;

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

/**
 * @since CSS1
 */
public class CssBorder extends CssProperty {

    public CssValue value;
    // @since CSS1
    public CssBorderColor borderColor;
    public CssBorderStyle borderStyle;
    public CssBorderWidth borderWidth;

    public CssBorderRight borderRight;
    public CssBorderTop borderTop;
    public CssBorderBottom borderBottom;
    public CssBorderLeft borderLeft;

    // @since CSS3
    public CssBorderRadius borderRadius;
    public CssBorderImage borderImage;

    public boolean shorthand = false;

    /**
     * Create a new CssBackground
     */
    public CssBorder() {
    }

    // a small init for the holder in Style
    public CssBorder(boolean holder) {
        if (holder) {
            // those are holding stuff...
            borderColor = new CssBorderColor();
            borderStyle = new CssBorderStyle();
            borderWidth = new CssBorderWidth();
            borderRight = new CssBorderRight();
            // we are not generating border-(sides)
            // css3 holders
            borderRadius = new CssBorderRadius();
            borderImage = new CssBorderImage();
        }
    }

    /**
     * Set the value of the property<br/>
     * Does not check the number of values
     *
     * @param expression The expression for this property
     * @throws org.w3c.css.util.InvalidParamException
     *          The expression is incorrect
     */
    public CssBorder(ApplContext ac, CssExpression expression)
            throws InvalidParamException {
        this(ac, expression, false);
    }

    /**
     * Set the value of the property
     *
     * @param expression The expression for this property
     * @param check      set it to true to check the number of values
     * @throws org.w3c.css.util.InvalidParamException
     *          The expression is incorrect
     */
    public CssBorder(ApplContext ac, CssExpression expression,
                     boolean check) throws InvalidParamException {
        throw new InvalidParamException("unrecognize", ac);

    }


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

    /**
     * Returns the color
     */
    public CssValue getColor() {
        if (borderColor == null) {
            return null;
        } else {
            return borderColor.getColor();
        }
    }

    /**
     * Returns the name of this property
     */
    public final String getPropertyName() {
        return "border";
    }

    /**
     * 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) {
        CssBorder cssBorder = ((Css1Style) style).cssBorder;
        cssBorder.byUser = byUser;
        if (cssBorder.borderColor.shorthand) {
            style.addRedefinitionWarning(ac, this);
        } else {
            if (borderColor != null) {
                borderColor.addToStyle(ac, style);
            }
            if (borderStyle != null) {
                borderStyle.addToStyle(ac, style);
            }
            if (borderWidth != null) {
                borderWidth.addToStyle(ac, style);
            }
        }
        cssBorder.shorthand = shorthand;
    }

    /**
     * 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 ((Css1Style) style).getBorder();
        } else {
            return ((Css1Style) style).cssBorder;
        }
    }

    /**
     * Compares two properties for equality.
     *
     * @param property The other property.
     */
    public boolean equals(CssProperty property) {
        try {
            CssBorder other = (CssBorder) property;
            return (value != null && value.equals(other.value)) || (value == null && other.value == null);
        } catch (ClassCastException cce) {
            return false; // FIXME
        }
    }
}

--- NEW FILE: CssBorderBottomColor.java ---
// $Id: CssBorderBottomColor.java,v 1.1 2012/04/25 20:21:53 ylafon Exp $
// Author: Yves Lafon <ylafon@w3.org>
//
// (c) COPYRIGHT MIT, ERCIM and Keio University, 2012.
// Please first read the full copyright statement in file COPYRIGHT.html
package org.w3c.css.properties.css;

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

/**
 * @since CSS2
 * @version $Revision: 1.1 $
 */
public class CssBorderBottomColor extends CssProperty {

    public CssValue value;

    /**
     * Create a new CssBorderBottomColor
     */
    public CssBorderBottomColor() {
    }

    /**
     * Creates a new CssBorderBottomColor
     *
     * @param expression The expression for this property
     * @throws org.w3c.css.util.InvalidParamException
     *          Expressions are incorrect
     */
    public CssBorderBottomColor(ApplContext ac, CssExpression expression, boolean check)
            throws InvalidParamException {
        throw new InvalidParamException("value",
                expression.getValue().toString(),
                getPropertyName(), ac);
    }

    public CssBorderBottomColor(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 final String getPropertyName() {
        return "border-bottom-color";
    }

    /**
     * Returns true if this property is "softly" inherited
     * e.g. his value is equals to inherit
     */
    public boolean isSoftlyInherited() {
        return value.equals(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) {
        if (((Css1Style) style).cssBorder.borderColor.bottom != null)
            style.addRedefinitionWarning(ac, this);
        ((Css2Style) style).cssBorder.borderColor.bottom = this;
    }

    /**
     * Compares two properties for equality.
     *
     * @param property The other property.
     */
    public boolean equals(CssProperty property) {
        return (property instanceof CssBorderBottomColor &&
                value.equals(((CssBorderBottomColor) property).value));
    }


    /**
     * 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 ((Css2Style) style).getBorder().borderColor.bottom;
        } else {
            return ((Css2Style) style).cssBorder.borderColor.bottom;
        }
    }
}


--- NEW FILE: CssBorderTopColor.java ---
// $Id: CssBorderTopColor.java,v 1.1 2012/04/25 20:21:55 ylafon Exp $
// Author: Yves Lafon <ylafon@w3.org>
//
// (c) COPYRIGHT MIT, ERCIM and Keio University, 2012.
// Please first read the full copyright statement in file COPYRIGHT.html
package org.w3c.css.properties.css;

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

/**
 * @since CSS2
 * @version $Revision: 1.1 $
 */
public class CssBorderTopColor extends CssProperty {

    public CssValue value;

    /**
     * Create a new CssBorderTopColor
     */
    public CssBorderTopColor() {
    }

    /**
     * Creates a new CssBorderTopColor
     *
     * @param expression The expression for this property
     * @throws org.w3c.css.util.InvalidParamException
     *          Expressions are incorrect
     */
    public CssBorderTopColor(ApplContext ac, CssExpression expression, boolean check)
            throws InvalidParamException {
        throw new InvalidParamException("value",
                expression.getValue().toString(),
                getPropertyName(), ac);
    }

    public CssBorderTopColor(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 final String getPropertyName() {
        return "border-top-color";
    }

    /**
     * Returns true if this property is "softly" inherited
     * e.g. his value is equals to inherit
     */
    public boolean isSoftlyInherited() {
        return value.equals(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) {
        if (((Css1Style) style).cssBorder.borderColor.top != null)
            style.addRedefinitionWarning(ac, this);
        ((Css2Style) style).cssBorder.borderColor.top = this;
    }

    /**
     * Compares two properties for equality.
     *
     * @param property The other property.
     */
    public boolean equals(CssProperty property) {
        return (property instanceof CssBorderTopColor &&
                value.equals(((CssBorderTopColor) property).value));
    }


    /**
     * 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 ((Css2Style) style).getBorder().borderColor.top;
        } else {
            return ((Css2Style) style).cssBorder.borderColor.top;
        }
    }
}


--- NEW FILE: CssBorderRight.java ---
// $Id: CssBorderRight.java,v 1.1 2012/04/25 20:21:55 ylafon Exp $
// @author Yves Lafon <ylafon@w3.org>

// (c) COPYRIGHT MIT, ERCIM and Keio University, 2012.
// Please first read the full copyright statement in file COPYRIGHT.html
package org.w3c.css.properties.css;

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

/**
 * @since CSS1
 */
public class CssBorderRight extends CssProperty {

    public CssValue value;

    // those are @since CSS1
    public CssBorderRightWidth _width;
    // and @since CSS2
    public CssBorderRightColor _color;
    public CssBorderRightStyle _style;
    /**
     * Create a new CssBorderRight
     */
    public CssBorderRight() {
    }

    /**
     * Set the value of the property<br/>
     * Does not check the number of values
     *
     * @param expression The expression for this property
     * @throws org.w3c.css.util.InvalidParamException The expression is incorrect
     */
    public CssBorderRight(ApplContext ac, CssExpression expression)
            throws InvalidParamException {
        this(ac, expression, false);
    }

    /**
     * Set the value of the property
     *
     * @param expression The expression for this property
     * @param check      set it to true to check the number of values
     * @throws org.w3c.css.util.InvalidParamException The expression is incorrect
     */
    public CssBorderRight(ApplContext ac, CssExpression expression,
                          boolean check) throws InvalidParamException {
        throw new InvalidParamException("unrecognize", ac);

    }



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

    /**
     * Returns the name of this property
     */
    public final String getPropertyName() {
        return "border-right";
    }

    /**
     * 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) {
        Css1Style css1Style = (Css1Style) style;
        css1Style.cssBorder.byUser = byUser;
        if (css1Style.cssBorder.borderRight != null) {
            style.addRedefinitionWarning(ac, this);
        }
        css1Style.cssBorder.borderRight = this;
        if (_width != null) {
            _width.addToStyle(ac, style);
        }
        if (_color != null) {
            _color.addToStyle(ac, style);
        }
        if (_style != null) {
            _style.addToStyle(ac, style);
        }
    }

    /**
     * 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 ((Css1Style) style).getBorder().borderRight;
        } else {
            return ((Css1Style) style).cssBorder.borderRight;
        }
    }

    /**
     * Compares two properties for equality.
     *
     * @param property The other property.
     */
    public boolean equals(CssProperty property) {
        CssBorderRight other;
        try {
            other = (CssBorderRight) property;
            return ((_width == null && other._width == null) || (_width != null && _width.equals(other._width))) &&
                    ((_color == null && other._color == null) || (_color != null && _color.equals(other._color))) &&
                    ((_style == null && other._style == null) || (_style != null && _style.equals(other._style)));
        } catch (ClassCastException cce) {
            return false;
        }
    }
}

--- NEW FILE: CssBorderTopStyle.java ---
// $Id: CssBorderTopStyle.java,v 1.1 2012/04/25 20:21:55 ylafon Exp $
// Author: Yves Lafon <ylafon@w3.org>
//
// (c) COPYRIGHT MIT, ERCIM and Keio University, 2012.
// Please first read the full copyright statement in file COPYRIGHT.html
package org.w3c.css.properties.css;

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

/**
 * @since CSS2
 * @version $Revision: 1.1 $
 */
public class CssBorderTopStyle extends CssProperty {

    public CssValue value;

    /**
     * Create a new CssBorderTopStyle
     */
    public CssBorderTopStyle() {
    }

    /**
     * Creates a new CssBorderTopStyle
     *
     * @param expression The expression for this property
     * @throws org.w3c.css.util.InvalidParamException
     *          Expressions are incorrect
     */
    public CssBorderTopStyle(ApplContext ac, CssExpression expression, boolean check)
            throws InvalidParamException {
        throw new InvalidParamException("value",
                expression.getValue().toString(),
                getPropertyName(), ac);
    }

    public CssBorderTopStyle(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 final String getPropertyName() {
        return "border-top-style";
    }

    /**
     * Returns true if this property is "softly" inherited
     * e.g. his value is equals to inherit
     */
    public boolean isSoftlyInherited() {
        return value.equals(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) {
        if (((Css1Style) style).cssBorder.borderStyle.top != null)
            style.addRedefinitionWarning(ac, this);
        ((Css2Style) style).cssBorder.borderStyle.top = this;
    }

    /**
     * Compares two properties for equality.
     *
     * @param property The other property.
     */
    public boolean equals(CssProperty property) {
        return (property instanceof CssBorderTopStyle &&
                value.equals(((CssBorderTopStyle) property).value));
    }


    /**
     * 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 ((Css2Style) style).getBorder().borderStyle.top;
        } else {
            return ((Css2Style) style).cssBorder.borderStyle.top;
        }
    }
}


--- NEW FILE: CssBorderBottom.java ---
// $Id: CssBorderBottom.java,v 1.1 2012/04/25 20:21:53 ylafon Exp $
// @author Yves Lafon <ylafon@w3.org>

// (c) COPYRIGHT MIT, ERCIM and Keio University, 2012.
// Please first read the full copyright statement in file COPYRIGHT.html
package org.w3c.css.properties.css;

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

/**
 * @since CSS1
 */
public class CssBorderBottom extends CssProperty {

    public CssValue value;

    // those are @since CSS1
    public CssBorderBottomWidth _width;
    // and @since CSS2
    public CssBorderBottomColor _color;
    public CssBorderBottomStyle _style;


    /**
     * Create a new CssBorderBottom
     */
    public CssBorderBottom() {
    }

    /**
     * Set the value of the property<br/>
     * Does not check the number of values
     *
     * @param expression The expression for this property
     * @throws org.w3c.css.util.InvalidParamException The expression is incorrect
     */
    public CssBorderBottom(ApplContext ac, CssExpression expression)
            throws InvalidParamException {
        this(ac, expression, false);
    }

    /**
     * Set the value of the property
     *
     * @param expression The expression for this property
     * @param check      set it to true to check the number of values
     * @throws org.w3c.css.util.InvalidParamException The expression is incorrect
     */
    public CssBorderBottom(ApplContext ac, CssExpression expression,
                           boolean check) throws InvalidParamException {
        throw new InvalidParamException("unrecognize", ac);

    }



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

    /**
     * Returns the name of this property
     */
    public final String getPropertyName() {
        return "border-bottom";
    }

    /**
     * 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) {
        Css1Style css1Style = (Css1Style) style;
        css1Style.cssBorder.byUser = byUser;
        if (css1Style.cssBorder.borderBottom != null) {
            style.addRedefinitionWarning(ac, this);
        }
        css1Style.cssBorder.borderBottom = this;
        if (_width != null) {
            _width.addToStyle(ac, style);
        }
        if (_color != null) {
            _color.addToStyle(ac, style);
        }
        if (_style != null) {
            _style.addToStyle(ac, style);
        }

    }

    /**
     * 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 ((Css1Style) style).getBorder().borderBottom;
        } else {
            return ((Css1Style) style).cssBorder.borderBottom;
        }
    }

    /**
     * Compares two properties for equality.
     *
     * @param property The other property.
     */
    public boolean equals(CssProperty property) {
        CssBorderBottom other;
        try {
            other = (CssBorderBottom) property;
            return ((_width == null && other._width == null) || (_width != null && _width.equals(other._width))) &&
                    ((_color == null && other._color == null) || (_color != null && _color.equals(other._color))) &&
                    ((_style == null && other._style == null) || (_style != null && _style.equals(other._style)));
        } catch (ClassCastException cce) {
            return false;
        }
    }
}

--- NEW FILE: CssBorderTopRightRadius.java ---
// $Id: CssBorderTopRightRadius.java,v 1.1 2012/04/25 20:21:55 ylafon Exp $
// Author: Yves Lafon <ylafon@w3.org>
//
// (c) COPYRIGHT MIT, ERCIM and Keio University, 2012.
// Please first read the full copyright statement in file COPYRIGHT.html
package org.w3c.css.properties.css;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css1.Css1Style;
import org.w3c.css.properties.css3.Css3Style;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssValue;
import org.w3c.css.values.CssValueList;

/**
 * @since CSS3
 * @version $Revision: 1.1 $
 */
public class CssBorderTopRightRadius extends CssProperty {

    public CssValue value;
    public CssValue h_radius;
    public CssValue v_radius;

    /**
     * Create a new CssBorderTopRightRadius
     */
    public CssBorderTopRightRadius() {
    }

    /**
     * Creates a new CssBorderTopRightRadius
     *
     * @param expression The expression for this property
     * @throws org.w3c.css.util.InvalidParamException
     *          Expressions are incorrect
     */
    public CssBorderTopRightRadius(ApplContext ac, CssExpression expression, boolean check)
            throws InvalidParamException {
        throw new InvalidParamException("value",
                expression.getValue().toString(),
                getPropertyName(), ac);
    }

    public CssBorderTopRightRadius(ApplContext ac, CssExpression expression)
            throws InvalidParamException {
        this(ac, expression, false);
    }

    private void syncval() {
        if (h_radius.equals(v_radius)) {
            value = h_radius;
        } else {
            CssValueList vlist = new CssValueList();
            vlist.add(h_radius);
            vlist.add(v_radius);
            value = vlist;
        }
    }
    /**
     * Returns the value of this property
     */
    public Object get() {
        if ((value == null) && (h_radius != null)) {
            syncval();
        }
        return value;
    }


    /**
     * Returns the name of this property
     */
    public final String getPropertyName() {
        return "border-top-right-radius";
    }

    /**
     * Returns true if this property is "softly" inherited
     * e.g. his value is equals to inherit
     */
    public boolean isSoftlyInherited() {
        if ((value == null) && (h_radius != null)) {
            syncval();
        }
        return value.equals(inherit);
    }

    /**
     * Returns a string representation of the object.
     */
    public String toString() {
        if ((value == null) && (h_radius != null)) {
            syncval();
        }
        return value.toString();
    }

    /**
     * Add this property to the CssStyle.
     *
     * @param style The CssStyle
     */
    public void addToStyle(ApplContext ac, CssStyle style) {
        if (((Css1Style) style).cssBorder.borderRadius.topRight != null)
            style.addRedefinitionWarning(ac, this);
        ((Css3Style) style).cssBorder.borderRadius.topRight = this;
    }

    /**
     * Compares two properties for equality.
     *
     * @param property The other property.
     */
    public boolean equals(CssProperty property) {
        if ((value == null) && (h_radius != null)) {
            syncval();
        }
        return (property instanceof CssBorderTopRightRadius &&
                value.equals(((CssBorderTopRightRadius) property).value));
    }


    /**
     * 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 ((Css3Style) style).getBorderTopRightRadius();
        } else {
            return ((Css1Style) style).cssBorder.borderRadius.topRight;
        }
    }
}


--- NEW FILE: CssBorderRightColor.java ---
// $Id: CssBorderRightColor.java,v 1.1 2012/04/25 20:21:55 ylafon Exp $
// Author: Yves Lafon <ylafon@w3.org>
//
// (c) COPYRIGHT MIT, ERCIM and Keio University, 2012.
// Please first read the full copyright statement in file COPYRIGHT.html
package org.w3c.css.properties.css;

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

/**
 * @since CSS2
 * @version $Revision: 1.1 $
 */
public class CssBorderRightColor extends CssProperty {

    public CssValue value;

    /**
     * Create a new CssBorderRightColor
     */
    public CssBorderRightColor() {
    }

    /**
     * Creates a new CssBorderRightColor
     *
     * @param expression The expression for this property
     * @throws org.w3c.css.util.InvalidParamException
     *          Expressions are incorrect
     */
    public CssBorderRightColor(ApplContext ac, CssExpression expression, boolean check)
            throws InvalidParamException {
        throw new InvalidParamException("value",
                expression.getValue().toString(),
                getPropertyName(), ac);
    }

    public CssBorderRightColor(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 final String getPropertyName() {
        return "border-right-color";
    }

    /**
     * Returns true if this property is "softly" inherited
     * e.g. his value is equals to inherit
     */
    public boolean isSoftlyInherited() {
        return value.equals(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) {
        if (((Css1Style) style).cssBorder.borderColor.right != null)
            style.addRedefinitionWarning(ac, this);
        ((Css2Style) style).cssBorder.borderColor.right = this;
    }

    /**
     * Compares two properties for equality.
     *
     * @param property The other property.
     */
    public boolean equals(CssProperty property) {
        return (property instanceof CssBorderRightColor &&
                value.equals(((CssBorderRightColor) property).value));
    }


    /**
     * 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 ((Css2Style) style).getBorder().borderColor.right;
        } else {
            return ((Css2Style) style).cssBorder.borderColor.right;
        }
    }
}


--- NEW FILE: CssBorderRightWidth.java ---
// $Id: CssBorderRightWidth.java,v 1.1 2012/04/25 20:21:55 ylafon Exp $
// Author: Yves Lafon <ylafon@w3.org>
//
// (c) COPYRIGHT MIT, ERCIM and Keio University, 2012.
// Please first read the full copyright statement in file COPYRIGHT.html
package org.w3c.css.properties.css;

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

/**
 * @since CSS1
 * @version $Revision: 1.1 $
 */
public class CssBorderRightWidth extends CssProperty {

    public CssValue value;

    /**
     * Create a new CssBorderRightWidth
     */
    public CssBorderRightWidth() {
    }

    /**
     * Creates a new CssBorderRightWidth
     *
     * @param expression The expression for this property
     * @throws org.w3c.css.util.InvalidParamException
     *          Expressions are incorrect
     */
    public CssBorderRightWidth(ApplContext ac, CssExpression expression, boolean check)
            throws InvalidParamException {
        throw new InvalidParamException("value",
                expression.getValue().toString(),
                getPropertyName(), ac);
    }

    public CssBorderRightWidth(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 final String getPropertyName() {
        return "border-right-width";
    }

    /**
     * Returns true if this property is "softly" inherited
     * e.g. his value is equals to inherit
     */
    public boolean isSoftlyInherited() {
        return value.equals(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) {
        if (((Css1Style) style).cssBorder.borderWidth.right != null)
            style.addRedefinitionWarning(ac, this);
        ((Css1Style) style).cssBorder.borderWidth.right = this;
    }

    /**
     * Compares two properties for equality.
     *
     * @param property The other property.
     */
    public boolean equals(CssProperty property) {
        return (property instanceof CssBorderRightWidth &&
                value.equals(((CssBorderRightWidth) property).value));
    }


    /**
     * 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 ((Css1Style) style).getBorderRightWidth();
        } else {
            return ((Css1Style) style).cssBorder.borderWidth.right;
        }
    }
}


--- NEW FILE: CssBorderWidth.java ---
// $Id: CssBorderWidth.java,v 1.1 2012/04/25 20:21:55 ylafon Exp $
// @author Yves Lafon <ylafon@w3.org>

// (c) COPYRIGHT MIT, ERCIM and Keio University, 2012.
// Please first read the full copyright statement in file COPYRIGHT.html
package org.w3c.css.properties.css;

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

/**
 * @since CSS1
 */
public class CssBorderWidth extends CssProperty {

    public CssValue value;

    // those are @since CSS1
    public CssBorderTopWidth top;
    public CssBorderBottomWidth bottom;
    public CssBorderLeftWidth left;
    public CssBorderRightWidth right;

    public boolean shorthand = false;

    /**
     * Create a new CssBorderWidth
     */
    public CssBorderWidth() {
    }

    /**
     * Set the value of the property<br/>
     * Does not check the number of values
     *
     * @param expression The expression for this property
     * @throws org.w3c.css.util.InvalidParamException
     *          The expression is incorrect
     */
    public CssBorderWidth(ApplContext ac, CssExpression expression)
            throws InvalidParamException {
        this(ac, expression, false);
    }

    /**
     * Set the value of the property
     *
     * @param expression The expression for this property
     * @param check      set it to true to check the number of values
     * @throws org.w3c.css.util.InvalidParamException
     *          The expression is incorrect
     */
    public CssBorderWidth(ApplContext ac, CssExpression expression,
                          boolean check) throws InvalidParamException {
        throw new InvalidParamException("unrecognize", ac);

    }


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

    /**
     * Returns the name of this property
     */
    public final String getPropertyName() {
        return "border-width";
    }

    /**
     * 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) {
        CssBorder cssBorder = ((Css1Style) style).cssBorder;
        cssBorder.borderWidth.byUser = byUser;
        if (cssBorder.borderWidth.shorthand) {
            style.addRedefinitionWarning(ac, this);
        } else {
            top.addToStyle(ac, style);
            right.addToStyle(ac, style);
            bottom.addToStyle(ac, style);
            left.addToStyle(ac, style);
        }
        cssBorder.borderWidth.shorthand = shorthand;
    }

    /**
     * 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 ((Css1Style) style).getBorder().borderWidth;
        } else {
            return ((Css1Style) style).cssBorder.borderWidth;
        }
    }

    /**
     * Compares two properties for equality.
     *
     * @param property The other property.
     */
    public boolean equals(CssProperty property) {
        try {
            CssBorderWidth other = (CssBorderWidth) property;
            // FIXME check compound ?
            return ((left != null && left.equals(other.left)) || (left == null && other.left == null)) &&
                    ((bottom != null && bottom.equals(other.bottom)) || (bottom == null && other.bottom == null)) &&
                    ((right != null && right.equals(other.right)) || (right == null && other.right == null)) &&
                    ((top != null && top.equals(other.top)) || (top == null && other.top == null));


        } catch (ClassCastException cce) {
        }
        return false;
    }
}

--- NEW FILE: CssBorderBottomStyle.java ---
// $Id: CssBorderBottomStyle.java,v 1.1 2012/04/25 20:21:54 ylafon Exp $
// Author: Yves Lafon <ylafon@w3.org>
//
// (c) COPYRIGHT MIT, ERCIM and Keio University, 2012.
// Please first read the full copyright statement in file COPYRIGHT.html
package org.w3c.css.properties.css;

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

/**
 * @since CSS2
 * @version $Revision: 1.1 $
 */
public class CssBorderBottomStyle extends CssProperty {

    public CssValue value;

    /**
     * Create a new CssBorderBottomStyle
     */
    public CssBorderBottomStyle() {
    }

    /**
     * Creates a new CssBorderBottomStyle
     *
     * @param expression The expression for this property
     * @throws org.w3c.css.util.InvalidParamException
     *          Expressions are incorrect
     */
    public CssBorderBottomStyle(ApplContext ac, CssExpression expression, boolean check)
            throws InvalidParamException {
        throw new InvalidParamException("value",
                expression.getValue().toString(),
                getPropertyName(), ac);
    }

    public CssBorderBottomStyle(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 final String getPropertyName() {
        return "border-bottom-style";
    }

    /**
     * Returns true if this property is "softly" inherited
     * e.g. his value is equals to inherit
     */
    public boolean isSoftlyInherited() {
        return value.equals(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) {
        if (((Css1Style) style).cssBorder.borderStyle.bottom != null)
            style.addRedefinitionWarning(ac, this);
        ((Css2Style) style).cssBorder.borderStyle.bottom = this;
    }

    /**
     * Compares two properties for equality.
     *
     * @param property The other property.
     */
    public boolean equals(CssProperty property) {
        return (property instanceof CssBorderBottomStyle &&
                value.equals(((CssBorderBottomStyle) property).value));
    }


    /**
     * 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 ((Css2Style) style).getBorderBottomStyle();
        } else {
            return ((Css2Style) style).cssBorder.borderStyle.bottom;
        }
    }
}


--- NEW FILE: CssBorderLeftColor.java ---
// $Id: CssBorderLeftColor.java,v 1.1 2012/04/25 20:21:54 ylafon Exp $
// Author: Yves Lafon <ylafon@w3.org>
//
// (c) COPYRIGHT MIT, ERCIM and Keio University, 2012.
// Please first read the full copyright statement in file COPYRIGHT.html
package org.w3c.css.properties.css;

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

/**
 * @since CSS2
 * @version $Revision: 1.1 $
 */
public class CssBorderLeftColor extends CssProperty {

    public CssValue value;

    /**
     * Create a new CssBorderLeftColor
     */
    public CssBorderLeftColor() {
    }

    /**
     * Creates a new CssBorderLeftColor
     *
     * @param expression The expression for this property
     * @throws org.w3c.css.util.InvalidParamException
     *          Expressions are incorrect
     */
    public CssBorderLeftColor(ApplContext ac, CssExpression expression, boolean check)
            throws InvalidParamException {
        throw new InvalidParamException("value",
                expression.getValue().toString(),
                getPropertyName(), ac);
    }

    public CssBorderLeftColor(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 final String getPropertyName() {
        return "border-left-color";
    }

    /**
     * Returns true if this property is "softly" inherited
     * e.g. his value is equals to inherit
     */
    public boolean isSoftlyInherited() {
        return value.equals(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) {
        if (((Css1Style) style).cssBorder.borderColor.left != null)
            style.addRedefinitionWarning(ac, this);
        ((Css2Style) style).cssBorder.borderColor.left = this;
    }

    /**
     * Compares two properties for equality.
     *
     * @param property The other property.
     */
    public boolean equals(CssProperty property) {
        return (property instanceof CssBorderLeftColor &&
                value.equals(((CssBorderLeftColor) property).value));
    }


    /**
     * 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 ((Css2Style) style).getBorder().borderColor.left;
        } else {
            return ((Css2Style) style).cssBorder.borderColor.left;
        }
    }
}


--- NEW FILE: CssBorderImageRepeat.java ---
// $Id: CssBorderImageRepeat.java,v 1.1 2012/04/25 20:21:54 ylafon Exp $
// Author: Yves Lafon <ylafon@w3.org>
//
// (c) COPYRIGHT MIT, ERCIM and Keio University, 2012.
// Please first read the full copyright statement in file COPYRIGHT.html
package org.w3c.css.properties.css;

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

/**
 * @since CSS3
 * @version $Revision: 1.1 $
 */
public class CssBorderImageRepeat extends CssProperty {

    public CssValue value;

    /**
     * Create a new CssBorderImageRepeat
     */
    public CssBorderImageRepeat() {
    }

    /**
     * Creates a new CssBorderImageOutset
     *
     * @param expression The expression for this property
     * @throws org.w3c.css.util.InvalidParamException
     *          Expressions are incorrect
     */
    public CssBorderImageRepeat(ApplContext ac, CssExpression expression, boolean check)
            throws InvalidParamException {
        throw new InvalidParamException("value",
                expression.getValue().toString(),
                getPropertyName(), ac);
    }

    public CssBorderImageRepeat(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 final String getPropertyName() {
        return "border-image-repeat";
    }

    /**
     * Returns true if this property is "softly" inherited
     * e.g. his value is equals to inherit
     */
    public boolean isSoftlyInherited() {
        return value.equals(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) {
        if (((Css1Style) style).cssBorder.borderImage.repeat != null)
            style.addRedefinitionWarning(ac, this);
        ((Css3Style) style).cssBorder.borderImage.repeat = this;
    }

    /**
     * Compares two properties for equality.
     *
     * @param property The other property.
     */
    public boolean equals(CssProperty property) {
        return (property instanceof CssBorderImageRepeat &&
                value.equals(((CssBorderImageRepeat) property).value));
    }


    /**
     * 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 ((Css1Style) style).getBorder().borderImage.outset;
        } else {
            return ((Css3Style) style).cssBorder.borderImage.repeat;
        }
    }
}


--- NEW FILE: CssBorderTop.java ---
// $Id: CssBorderTop.java,v 1.1 2012/04/25 20:21:55 ylafon Exp $
// @author Yves Lafon <ylafon@w3.org>

// (c) COPYRIGHT MIT, ERCIM and Keio University, 2012.
// Please first read the full copyright statement in file COPYRIGHT.html
package org.w3c.css.properties.css;

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

/**
 * @since CSS1
 */
public class CssBorderTop extends CssProperty {

    public CssValue value;

    // those are @since CSS1
    public CssBorderTopWidth _width;
    // and @since CSS2
    public CssBorderTopColor _color;
    public CssBorderTopStyle _style;

    /**
     * Create a new CssBorderTop
     */
    public CssBorderTop() {
    }

    /**
     * Set the value of the property<br/>
     * Does not check the number of values
     *
     * @param expression The expression for this property
     * @throws org.w3c.css.util.InvalidParamException The expression is incorrect
     */
    public CssBorderTop(ApplContext ac, CssExpression expression)
            throws InvalidParamException {
        this(ac, expression, false);
    }

    /**
     * Set the value of the property
     *
     * @param expression The expression for this property
     * @param check      set it to true to check the number of values
     * @throws org.w3c.css.util.InvalidParamException The expression is incorrect
     */
    public CssBorderTop(ApplContext ac, CssExpression expression,
                        boolean check) throws InvalidParamException {
        throw new InvalidParamException("unrecognize", ac);

    }



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

    /**
     * Returns the name of this property
     */
    public final String getPropertyName() {
        return "border-top";
    }

    /**
     * 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) {
        Css1Style css1Style = (Css1Style) style;
        css1Style.cssBorder.byUser = byUser;
        if (css1Style.cssBorder.borderTop != null) {
            style.addRedefinitionWarning(ac, this);
        }
        css1Style.cssBorder.borderTop = this;
        if (_width != null) {
            _width.addToStyle(ac, style);
        }
        if (_color != null) {
            _color.addToStyle(ac, style);
        }
        if (_style != null) {
            _style.addToStyle(ac, style);
        }
    }

    /**
     * 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 ((Css1Style) style).getBorder().borderTop;
        } else {
            return ((Css1Style) style).cssBorder.borderTop;
        }
    }

    /**
     * Compares two properties for equality.
     *
     * @param property The other property.
     */
    public boolean equals(CssProperty property) {
        CssBorderTop other;
        try {
            other = (CssBorderTop) property;
            return ((_width == null && other._width == null) || (_width != null && _width.equals(other._width))) &&
                    ((_color == null && other._color == null) || (_color != null && _color.equals(other._color))) &&
                    ((_style == null && other._style == null) || (_style != null && _style.equals(other._style)));
        } catch (ClassCastException cce) {
            return false;
        }
    }
}

Received on Wednesday, 25 April 2012 20:22:04 UTC