- From: Yves Lafon via cvs-syncmail <cvsmail@w3.org>
- Date: Wed, 14 Sep 2005 15:15:00 +0000
- To: www-validator-cvs@w3.org
Update of /sources/public/2002/css-validator/org/w3c/css/properties/css2/user In directory hutz:/tmp/cvs-serv9389/org/w3c/css/properties/css2/user Modified Files: Css2Style.java Cursor.java CursorATSC.java CursorCSS2.java Outline.java OutlineATSC.java OutlineColor.java OutlineColorATSC.java OutlineStyle.java OutlineStyleATSC.java OutlineWidth.java OutlineWidthATSC.java UserProperties.java Log Message: >From Jean-Guilhem Rouel (again!) Reformatting of code Fix for bug 774 [1] (even more warnings) Fix for bug 768 [2] Modification of the soap output format (each warning list and error list has the URI it refers to) [1] http://www.w3.org/Bugs/Public/show_bug.cgi?id=774 [2] http://www.w3.org/Bugs/Public/show_bug.cgi?id=768 Index: CursorCSS2.java =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css2/user/CursorCSS2.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- CursorCSS2.java 1 Sep 2005 11:51:21 -0000 1.2 +++ CursorCSS2.java 14 Sep 2005 15:14:58 -0000 1.3 @@ -22,41 +22,41 @@ /** * @version $Revision$ */ -public class CursorCSS2 extends CssProperty +public class CursorCSS2 extends CssProperty implements CssOperator { - + int value; Vector uris = new Vector(); boolean inheritedValue; - + private static String CURSOR[] = { - "auto", "crosshair", "default", "pointer", "move", "e-resize", - "ne-resize", "nw-resize", "n-resize", "se-resize", "sw-resize", + "auto", "crosshair", "default", "pointer", "move", "e-resize", + "ne-resize", "nw-resize", "n-resize", "se-resize", "sw-resize", "s-resize", "w-resize", "text", "wait", "help" }; - + private static int[] hash_values; - - + + /** * Create a new Cursor */ public CursorCSS2() { value = 0; } - + /** * Create a new Cursor * * @param expression The expression for this property * @exception InvalidParamException Values are incorrect - */ - public CursorCSS2(ApplContext ac, CssExpression expression, boolean check) + */ + public CursorCSS2(ApplContext ac, CssExpression expression, boolean check) throws InvalidParamException { CssValue val = expression.getValue(); char op = expression.getOperator(); - + setByUser(); - + if (val.equals(inherit)) { if(expression.getCount() > 1) { throw new InvalidParamException("unrecognize", ac); @@ -65,7 +65,7 @@ expression.next(); return; } - + while ((op == COMMA) && (val instanceof CssURL)) { if(val != null && val.equals(inherit)) { throw new InvalidParamException("unrecognize", ac); @@ -74,16 +74,16 @@ expression.next(); val = expression.getValue(); op = expression.getOperator(); - } + } if (val instanceof CssURL) { - throw new InvalidParamException("comma", - val.toString(), + throw new InvalidParamException("comma", + val.toString(), getPropertyName(), ac); } - + if (val instanceof CssIdent) { int hash = val.hashCode(); - + for (int i = 0; i < CURSOR.length; i++) { if (hash_values[i] == hash) { value = i; @@ -95,16 +95,16 @@ } } } - - throw new InvalidParamException("value", + + throw new InvalidParamException("value", val.toString(), getPropertyName(), ac); } - + public CursorCSS2(ApplContext ac, CssExpression expression) throws InvalidParamException { this(ac, expression, false); - } - + } + /** * @return Returns the uris. */ @@ -153,14 +153,14 @@ public Object get() { return null; } - + /** * Returns the name of this property - */ + */ public String getPropertyName() { return "cursor"; } - + /** * Returns true if this property is "softly" inherited * e.g. his value equals inherit @@ -168,7 +168,7 @@ public boolean isSoftlyInherited() { return inheritedValue; } - + /** * Returns a string representation of the object. */ @@ -180,14 +180,14 @@ int l = uris.size(); String ret = ""; while (i != l) { - ret += uris.elementAt(i++) + + ret += uris.elementAt(i++) + (new Character(COMMA)).toString() + " "; } ret += " " + CURSOR[value]; return ret; } } - + /** * Add this property to the CssStyle. * @@ -199,13 +199,13 @@ style0.addRedefinitionWarning(ac, this); style0.cursorCSS2 = this; } - + /** * Get this property in the style. * * @param style The style where the property is * @param resolve if true, resolve the style to find this property - */ + */ public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) { if (resolve) { return ((Css2Style) style).getCursorCSS2(); @@ -213,25 +213,25 @@ return ((Css2Style) style).cursor; } } - + /** * Compares two properties for equality. * * @param value The other property. - */ + */ public boolean equals(CssProperty property) { - return (property instanceof Cursor + return (property instanceof Cursor && value == ((Cursor) property).value); } - + /** * Is the value of this property is a default value. * It is used by all macro for the function <code>print</code> - */ + */ public boolean isDefault() { return value == 0; } - + static { hash_values = new int[CURSOR.length]; for (int i=0; i<CURSOR.length; i++) Index: Css2Style.java =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css2/user/Css2Style.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Css2Style.java 23 Aug 2005 16:33:51 -0000 1.1 +++ Css2Style.java 14 Sep 2005 15:14:58 -0000 1.2 @@ -21,13 +21,13 @@ Outline outline = new Outline(); OutlineATSC outlineATSC = new OutlineATSC(); - + /** * Get the cursor property */ public final CursorCSS2 getCursorCSS2() { if (cursorCSS2 == null) { - cursorCSS2 = (CursorCSS2) style.CascadingOrder(new CursorCSS2(), + cursorCSS2 = (CursorCSS2) style.CascadingOrder(new CursorCSS2(), style, selector); } return cursorCSS2; @@ -51,11 +51,11 @@ /** * Get the outline-style property - */ + */ public final OutlineStyle getOutlineStyle() { if (outline.style == null) { - outline.style = - (OutlineStyle) style.CascadingOrder(new OutlineStyle(), + outline.style = + (OutlineStyle) style.CascadingOrder(new OutlineStyle(), style, selector); } return outline.style; @@ -63,8 +63,8 @@ public final OutlineStyleATSC getOutlineStyleATSC() { if (outlineATSC.style == null) { - outlineATSC.style = - (OutlineStyleATSC) style.CascadingOrder(new OutlineStyleATSC(), + outlineATSC.style = + (OutlineStyleATSC) style.CascadingOrder(new OutlineStyleATSC(), style, selector); } return outlineATSC.style; @@ -72,11 +72,11 @@ /** * Get the outline-width property - */ + */ public final OutlineWidth getOutlineWidth() { if (outline.width == null) { - outline.width = - (OutlineWidth) style.CascadingOrder(new OutlineWidth(), + outline.width = + (OutlineWidth) style.CascadingOrder(new OutlineWidth(), style, selector); } return outline.width; @@ -84,8 +84,8 @@ public final OutlineWidthATSC getOutlineWidthATSC() { if (outlineATSC.width == null) { - outlineATSC.width = - (OutlineWidthATSC) style.CascadingOrder(new OutlineWidthATSC(), + outlineATSC.width = + (OutlineWidthATSC) style.CascadingOrder(new OutlineWidthATSC(), style, selector); } return outlineATSC.width; @@ -93,11 +93,11 @@ /** * Get the outline-color property - */ + */ public final OutlineColor getOutlineColor() { if (outline.color == null) { - outline.color = - (OutlineColor) style.CascadingOrder(new OutlineColor(), + outline.color = + (OutlineColor) style.CascadingOrder(new OutlineColor(), style, selector); } return outline.color; @@ -105,8 +105,8 @@ public final OutlineColorATSC getOutlineColorATSC() { if (outlineATSC.color == null) { - outlineATSC.color = - (OutlineColorATSC) style.CascadingOrder(new OutlineColorATSC(), + outlineATSC.color = + (OutlineColorATSC) style.CascadingOrder(new OutlineColorATSC(), style, selector); } return outlineATSC.color; @@ -145,7 +145,7 @@ * Print this style. * * @param printer The printer interface. - */ + */ public void print(CssPrinterStyle printer) { super.print(printer); if (cursor != null) { Index: CursorATSC.java =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css2/user/CursorATSC.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- CursorATSC.java 23 Aug 2005 16:33:51 -0000 1.1 +++ CursorATSC.java 14 Sep 2005 15:14:58 -0000 1.2 @@ -22,43 +22,43 @@ /** * @version $Revision$ */ -public class CursorATSC extends CssProperty +public class CursorATSC extends CssProperty implements CssOperator { - + int value; Vector uris = new Vector(); boolean inheritedValue; - + private static String CURSOR[] = { - "auto", "crosshair", "default", "pointer", "move", "e-resize", - "ne-resize", "nw-resize", "n-resize", "se-resize", "sw-resize", + "auto", "crosshair", "default", "pointer", "move", "e-resize", + "ne-resize", "nw-resize", "n-resize", "se-resize", "sw-resize", "s-resize", "w-resize", "text", "wait", "help" }; - + private static int[] hash_values; - - + + /** * Create a new Cursor */ public CursorATSC() { value = 0; } - + /** * Create a new Cursor * * @param expression The expression for this property * @exception InvalidParamException Values are incorrect - */ + */ public CursorATSC(ApplContext ac, CssExpression expression, boolean check) throws InvalidParamException { CssValue val = expression.getValue(); char op = expression.getOperator(); - + setByUser(); ac.getFrame().addWarning("atsc", val.toString()); - + if (val.equals(inherit)) { if(expression.getCount() > 1) { throw new InvalidParamException("unrecognize", ac); @@ -67,7 +67,7 @@ expression.next(); return; } - + while ((op == COMMA)&& (val instanceof CssURL)) { if(val != null && val.equals(inherit)) { throw new InvalidParamException("unrecognize", ac); @@ -76,16 +76,16 @@ expression.next(); val = expression.getValue(); op = expression.getOperator(); - } + } if (val instanceof CssURL) { - throw new InvalidParamException("comma", - val.toString(), + throw new InvalidParamException("comma", + val.toString(), getPropertyName(), ac); } - + if (val instanceof CssIdent) { int hash = val.hashCode(); - + for (int i = 0; i < CURSOR.length; i++) { if (hash_values[i] == hash) { value = i; @@ -97,30 +97,30 @@ } } } - - throw new InvalidParamException("value", + + throw new InvalidParamException("value", val.toString(), getPropertyName(), ac); } - + public CursorATSC(ApplContext ac, CssExpression expression) throws InvalidParamException { this(ac, expression, false); } - + /** * Returns the value of this property */ public Object get() { return null; } - + /** * Returns the name of this property - */ + */ public String getPropertyName() { return "cursor"; } - + /** * Returns true if this property is "softly" inherited * e.g. his value equals inherit @@ -128,7 +128,7 @@ public boolean isSoftlyInherited() { return inheritedValue; } - + /** * Returns a string representation of the object. */ @@ -140,14 +140,14 @@ int l = uris.size(); String ret = ""; while (i != l) { - ret += uris.elementAt(i++) + + ret += uris.elementAt(i++) + (new Character(COMMA)).toString() + " "; } ret += " " + CURSOR[value]; return ret; } } - + /** * Add this property to the CssStyle. * @@ -159,13 +159,13 @@ style0.addRedefinitionWarning(ac, this); style0.cursorATSC = this; } - + /** * Get this property in the style. * * @param style The style where the property is * @param resolve if true, resolve the style to find this property - */ + */ public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) { if (resolve) { return ((Css2Style) style).getCursorATSC(); @@ -173,25 +173,25 @@ return ((Css2Style) style).cursorATSC; } } - + /** * Compares two properties for equality. * * @param value The other property. - */ + */ public boolean equals(CssProperty property) { - return (property instanceof CursorATSC + return (property instanceof CursorATSC && value == ((CursorATSC) property).value); } - + /** * Is the value of this property is a default value. * It is used by all macro for the function <code>print</code> - */ + */ public boolean isDefault() { return value == 0; } - + static { hash_values = new int[CURSOR.length]; for (int i=0; i<CURSOR.length; i++) Index: OutlineColor.java =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css2/user/OutlineColor.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- OutlineColor.java 23 Aug 2005 16:33:51 -0000 1.1 +++ OutlineColor.java 14 Sep 2005 15:14:58 -0000 1.2 @@ -22,9 +22,9 @@ * @version $Revision$ */ public class OutlineColor extends UserProperty { - + CssValue color; - + private static final CssIdent invert = new CssIdent("invert"); /** @@ -32,23 +32,23 @@ */ public OutlineColor() { color = invert; - } - + } + /** * Set the value of the property * @param expression The expression for this property * @exception InvalidParamException Values are incorrect - */ + */ public OutlineColor(ApplContext ac, CssExpression expression, boolean check) throws InvalidParamException { - + if(check && expression.getCount() > 1) { throw new InvalidParamException("unrecognize", ac); } - + CssValue val = expression.getValue(); setByUser(); - + if (val.equals(inherit)) { color = inherit; expression.next(); @@ -62,23 +62,23 @@ color = new CssColor(ac, (String) val.get()); expression.next(); } else { - throw new InvalidParamException("value", val, + throw new InvalidParamException("value", val, getPropertyName(), ac); } } - + public OutlineColor(ApplContext ac, CssExpression expression) throws InvalidParamException { this(ac, expression, false); } - + /** * Returns the value of this property */ public Object get() { return color; } - + /** * Returns true if this property is "softly" inherited * e.g. his value equals inherit @@ -86,14 +86,14 @@ public boolean isSoftlyInherited() { return color.equals(inherit); } - + /** * Returns a string representation of the object. */ public String toString() { return color.toString(); } - + /** * Add this property to the CssStyle. * @@ -106,13 +106,13 @@ } outline.color = this; } - + /** * Get this property in the style. * * @param style The style where the property is * @param resolve if true, resolve the style to find this property - */ + */ public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) { if (resolve) { return ((Css2Style) style).getOutlineColor(); @@ -120,22 +120,22 @@ return ((Css2Style) style).outline.color; } } - + /** * Compares two properties for equality. * * @param value The other property. - */ + */ public boolean equals(CssProperty property) { - return (property instanceof OutlineColor && + return (property instanceof OutlineColor && color.equals(((OutlineColor) property).color)); } - + /** * Returns the name of this property - */ + */ public String getPropertyName() { return "outline-color"; } - + } Index: OutlineATSC.java =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css2/user/OutlineATSC.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- OutlineATSC.java 23 Aug 2005 16:33:51 -0000 1.1 +++ OutlineATSC.java 14 Sep 2005 15:14:58 -0000 1.2 @@ -22,32 +22,32 @@ * @version $Revision$ */ public class OutlineATSC extends UserProperty implements CssOperator { - + OutlineColorATSC color; OutlineWidthATSC width; OutlineStyleATSC style; boolean same; - + /** * Create a new OutlineATSC */ public OutlineATSC() { - } - + } + /** * Create a new OutlineATSC * * @param expression The expression for this property * @exception InvalidParamException Values are incorrect - */ + */ public OutlineATSC(ApplContext ac, CssExpression expression, boolean check) throws InvalidParamException { - + if(check && expression.getCount() > 3) { throw new InvalidParamException("unrecognize", ac); } - + CssValue val = expression.getValue(); char op = SPACE; boolean find = true; @@ -67,32 +67,32 @@ style.value = OutlineStyleATSC.BORDERSTYLE.length - 1; return; } - + while (find && max_values-- > 0) { find = false; val = expression.getValue(); op = expression.getOperator(); - + if(val != null && val.equals(inherit)) { throw new InvalidParamException("unrecognize", ac); } - + if (val == null) { break; } - + if (op != SPACE) { - throw new InvalidParamException("operator", + throw new InvalidParamException("operator", ((new Character(op)).toString()), ac); } - + if (style == null) { try { style = new OutlineStyleATSC(ac, expression); find = true; } catch (InvalidParamException e) { } - } + } if (!find && color == null) { try { color = new OutlineColorATSC(ac, expression); @@ -124,12 +124,12 @@ } */ } - + public OutlineATSC(ApplContext ac, CssExpression expression) throws InvalidParamException { this(ac, expression, false); } - + /** * Returns the value of this property * not useful @@ -137,14 +137,14 @@ public Object get() { return color; } - + /** * Returns the name of this property - */ + */ public String getPropertyName() { return "outline"; } - + /** * Returns a string representation of the object. */ @@ -166,11 +166,11 @@ return ret.substring(1); } } - + /** * Set this property to be important. * Overrides this method for a macro - */ + */ public void setImportant() { super.setImportant(); if(color != null) @@ -180,7 +180,7 @@ if(style != null) style.setImportant(); } - + /** * Returns true if this property is important. * Overrides this method for a macro @@ -190,14 +190,14 @@ && (color == null || color.getImportant()) && (style == null || style.getImportant())); } - + /** * Print this property. * * @param printer The printer. * @see #toString() * @see #getPropertyName() - */ + */ public void print(CssPrinterStyle printer) { if ((color != null && width != null && style != null) && (getImportant() || @@ -205,7 +205,7 @@ && !style.getImportant() && !width.getImportant()))) { printer.print(this); - } else { + } else { if (color != null) { color.print(printer); } @@ -217,7 +217,7 @@ } } } - + /** * Add this property to the CssStyle * @@ -233,14 +233,14 @@ if(style != null) style.addToStyle(ac, style0); } - + /** * Update the source file and the line. * Overrides this method for a macro * * @param line The line number where this property is defined * @param source The source file where this property is defined - */ + */ public void setInfo(int line, String source) { super.setInfo(line, source); if(color != null) @@ -250,16 +250,16 @@ if(style != null) style.setInfo(line, source); } - + /** * Compares two properties for equality. * * @param value The other property. - */ + */ public boolean equals(CssProperty property) { return false; // @FIXME } - + /** * Set the context. * Overrides this method for a macro @@ -279,13 +279,13 @@ style.setSelectors(selector); } } - + /** * 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).getOutlineATSC(); @@ -293,5 +293,5 @@ return ((Css2Style) style).outlineATSC; } } - + } Index: OutlineStyleATSC.java =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css2/user/OutlineStyleATSC.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- OutlineStyleATSC.java 23 Aug 2005 16:33:51 -0000 1.1 +++ OutlineStyleATSC.java 14 Sep 2005 15:14:58 -0000 1.2 @@ -21,35 +21,35 @@ * @version $Revision$ */ public class OutlineStyleATSC extends UserProperty { - + int value = -1; - + static String[] BORDERSTYLE = { - "none", "dotted", "dashed", "solid", "double", "groove", + "none", "dotted", "dashed", "solid", "double", "groove", "ridge", "inset", "outset", "inherit" }; - + private static int[] hash_values; - + /** * Create a new OutlineStyleATSC */ public OutlineStyleATSC() { // nothing to do - } - + } + /** * Create a new OutlineStyleATSC * * @param expression The expression for this face * @exception InvalidParamException The expression is incorrect - */ + */ public OutlineStyleATSC(ApplContext ac, CssExpression expression, boolean check) throws InvalidParamException { - + if(check && expression.getCount() > 1) { throw new InvalidParamException("unrecognize", ac); } - + CssValue val = expression.getValue(); setByUser(); @@ -65,23 +65,23 @@ } } } - - throw new InvalidParamException("value", val.toString(), + + throw new InvalidParamException("value", val.toString(), getPropertyName(), ac); } - + public OutlineStyleATSC(ApplContext ac, CssExpression expression) throws InvalidParamException { this(ac, expression, false); } - + /** * Returns the internal value - */ + */ public Object get() { return BORDERSTYLE[value]; } - + /** * Returns true if this property is "softly" inherited * e.g. his value equals inherit @@ -89,14 +89,14 @@ public boolean isSoftlyInherited() { return value == (BORDERSTYLE.length - 1); } - + /** * Returns a string representation of the object. */ public String toString() { return BORDERSTYLE[value]; } - + /** * Add this property to the CssStyle. * @@ -109,13 +109,13 @@ } outline.style = this; } - + /** * Get this property in the style. * * @param style The style where the property is * @param resolve if true, resolve the style to find this property - */ + */ public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) { if (resolve) { return ((Css2Style) style).getOutlineStyleATSC(); @@ -123,28 +123,28 @@ return ((Css2Style) style).outlineATSC.style; } } - + /** * Compares two properties for equality. * * @param value The other property. - */ + */ public boolean equals(CssProperty property) { - return ((property instanceof OutlineStyleATSC) + return ((property instanceof OutlineStyleATSC) && (value == ((OutlineStyleATSC) property).value)); } - + /** * Returns the name of this property - */ + */ public String getPropertyName() { return "outline-style"; } - + static { hash_values = new int[BORDERSTYLE.length]; for (int i=0; i<BORDERSTYLE.length; i++) hash_values[i] = BORDERSTYLE[i].hashCode(); } - + } Index: OutlineColorATSC.java =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css2/user/OutlineColorATSC.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- OutlineColorATSC.java 23 Aug 2005 16:33:51 -0000 1.1 +++ OutlineColorATSC.java 14 Sep 2005 15:14:58 -0000 1.2 @@ -22,9 +22,9 @@ * @version $Revision$ */ public class OutlineColorATSC extends UserProperty { - + CssValue color; - + private static final CssIdent invert = new CssIdent("invert"); /** @@ -32,23 +32,23 @@ */ public OutlineColorATSC() { color = invert; - } - + } + /** * Set the value of the property * @param expression The expression for this property * @exception InvalidParamException Values are incorrect - */ + */ public OutlineColorATSC(ApplContext ac, CssExpression expression, boolean check) throws InvalidParamException { - + if(check && expression.getCount() > 1) { throw new InvalidParamException("unrecognize", ac); } - + CssValue val = expression.getValue(); setByUser(); - + ac.getFrame().addWarning("atsc", val.toString()); if (val.equals(inherit)) { @@ -64,23 +64,23 @@ color = new CssColor(ac, (String) val.get()); expression.next(); } else { - throw new InvalidParamException("value", val, + throw new InvalidParamException("value", val, getPropertyName(), ac); } } - + public OutlineColorATSC(ApplContext ac, CssExpression expression) throws InvalidParamException { this(ac, expression, false); } - + /** * Returns the value of this property */ public Object get() { return color; } - + /** * Returns true if this property is "softly" inherited * e.g. his value equals inherit @@ -88,14 +88,14 @@ public boolean isSoftlyInherited() { return color.equals(inherit); } - + /** * Returns a string representation of the object. */ public String toString() { return color.toString(); } - + /** * Add this property to the CssStyle. * @@ -108,13 +108,13 @@ } outline.color = this; } - + /** * Get this property in the style. * * @param style The style where the property is * @param resolve if true, resolve the style to find this property - */ + */ public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) { if (resolve) { return ((Css2Style) style).getOutlineColorATSC(); @@ -122,22 +122,22 @@ return ((Css2Style) style).outlineATSC.color; } } - + /** * Compares two properties for equality. * * @param value The other property. - */ + */ public boolean equals(CssProperty property) { - return (property instanceof OutlineColorATSC && + return (property instanceof OutlineColorATSC && color.equals(((OutlineColorATSC) property).color)); } - + /** * Returns the name of this property - */ + */ public String getPropertyName() { return "outline-color"; } - + } Index: OutlineStyle.java =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css2/user/OutlineStyle.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- OutlineStyle.java 23 Aug 2005 16:33:51 -0000 1.1 +++ OutlineStyle.java 14 Sep 2005 15:14:58 -0000 1.2 @@ -45,7 +45,7 @@ */ public OutlineStyle(ApplContext ac, CssExpression expression, boolean check) throws InvalidParamException { - + if(check && expression.getCount() > 1) { throw new InvalidParamException("unrecognize", ac); } @@ -72,7 +72,7 @@ throws InvalidParamException { this(ac, expression, false); } - + /** * Returns the internal value */ Index: OutlineWidth.java =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css2/user/OutlineWidth.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- OutlineWidth.java 23 Aug 2005 16:33:51 -0000 1.1 +++ OutlineWidth.java 14 Sep 2005 15:14:58 -0000 1.2 @@ -23,20 +23,20 @@ * @version $Revision$ */ public class OutlineWidth extends UserProperty { - + CssValue value; - + private static CssIdent thin = new CssIdent("thin"); private static CssIdent medium = new CssIdent("medium"); private static CssIdent thick = new CssIdent("thick"); - + /** * Create a new OutlineWidth */ public OutlineWidth() { value = medium; } - + /** * Create a new OutlineWidth from an another OutlineWidth * @@ -45,20 +45,20 @@ public OutlineWidth(OutlineWidth another) { value = another.value; } - + /** * Create a new OutlineWidth * * @param expression The expression for this property * @exception InvalidParamException Values are incorrect */ - public OutlineWidth(ApplContext ac, CssExpression expression, boolean check) + public OutlineWidth(ApplContext ac, CssExpression expression, boolean check) throws InvalidParamException { - + if(check && expression.getCount() > 1) { throw new InvalidParamException("unrecognize", ac); } - + CssValue val = expression.getValue(); setByUser(); @@ -67,7 +67,7 @@ if (f >= 0) { this.value = val; } else { - throw new InvalidParamException("negative-value", + throw new InvalidParamException("negative-value", val.toString(), ac); } } else if (val instanceof CssNumber) { @@ -81,25 +81,25 @@ } else if (val.equals(inherit)) { value = CssProperty.inherit; } else { - throw new InvalidParamException("value", val.toString(), + throw new InvalidParamException("value", val.toString(), "width", ac); } - + expression.next(); - } - + } + public OutlineWidth(ApplContext ac, CssExpression expression) throws InvalidParamException { this(ac, expression, false); } - + /** * Returns the internal value - */ + */ public Object get() { return value; } - + /** * Returns true if this property is "softly" inherited * e.g. his value equals inherit @@ -107,14 +107,14 @@ public boolean isSoftlyInherited() { return value.equals(inherit); } - + /** * Returns a string representation of the object. */ - public String toString() { + public String toString() { return value.toString(); } - + /** * Add this property to the CssStyle. * @@ -127,13 +127,13 @@ } outline.width = this; } - + /** * Get this property in the style. * * @param style The style where the property is * @param resolve if true, resolve the style to find this property - */ + */ public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) { if (resolve) { return ((Css2Style) style).getOutlineWidth(); @@ -141,24 +141,24 @@ return ((Css2Style) style).outline.width; } } - + /** * Compares two properties for equality. * * @param value The other property. - */ + */ public boolean equals(CssProperty property) { - return (property instanceof OutlineWidth && + return (property instanceof OutlineWidth && value.equals(((OutlineWidth) property).value)); } - + /** * Returns the name of this property - */ + */ public String getPropertyName() { return "outline-width"; } - + } Index: Outline.java =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css2/user/Outline.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Outline.java 23 Aug 2005 16:33:51 -0000 1.1 +++ Outline.java 14 Sep 2005 15:14:58 -0000 1.2 @@ -22,32 +22,32 @@ * @version $Revision$ */ public class Outline extends UserProperty implements CssOperator { - + OutlineColor color; OutlineWidth width; OutlineStyle style; boolean same; - + /** * Create a new Outline */ public Outline() { - } - + } + /** * Create a new Outline * * @param expression The expression for this property * @exception InvalidParamException Values are incorrect - */ + */ public Outline(ApplContext ac, CssExpression expression, boolean check) throws InvalidParamException { - + if(check && expression.getCount() > 3) { throw new InvalidParamException("unrecognize", ac); } - + CssValue val = expression.getValue(); char op = SPACE; boolean find = true; @@ -65,32 +65,32 @@ style.value = OutlineStyle.BORDERSTYLE.length - 1; return; } - + while (find && max_values-- > 0) { find = false; val = expression.getValue(); op = expression.getOperator(); - + if(val != null && val.equals(inherit)) { throw new InvalidParamException("unrecognize", ac); } - + if (val == null) { break; } - + if (op != SPACE) { - throw new InvalidParamException("operator", + throw new InvalidParamException("operator", ((new Character(op)).toString()), ac); } - + if (style == null) { try { style = new OutlineStyle(ac, expression); find = true; } catch (InvalidParamException e) { } - } + } if (!find && color == null) { try { color = new OutlineColor(ac, expression); @@ -121,12 +121,12 @@ style = new OutlineStyle(); }*/ } - + public Outline(ApplContext ac, CssExpression expression) throws InvalidParamException { this(ac, expression, false); } - + /** * Returns the value of this property * not useful @@ -134,14 +134,14 @@ public Object get() { return color; } - + /** * Returns the name of this property - */ + */ public String getPropertyName() { return "outline"; } - + /** * Returns a string representation of the object. */ @@ -163,11 +163,11 @@ return ret.substring(1); } } - + /** * Set this property to be important. * Overrides this method for a macro - */ + */ public void setImportant() { super.setImportant(); if(color != null) @@ -177,7 +177,7 @@ if(style != null) style.setImportant(); } - + /** * Returns true if this property is important. * Overrides this method for a macro @@ -187,14 +187,14 @@ && (color == null || color.getImportant()) && (style == null || style.getImportant())); } - + /** * Print this property. * * @param printer The printer. * @see #toString() * @see #getPropertyName() - */ + */ public void print(CssPrinterStyle printer) { if ((color != null && width != null && style != null) && (getImportant() || @@ -202,7 +202,7 @@ && !style.getImportant() && !width.getImportant()))) { printer.print(this); - } else { + } else { if (color != null) { color.print(printer); } @@ -214,7 +214,7 @@ } } } - + /** * Add this property to the CssStyle * @@ -230,14 +230,14 @@ if(style != null) style.addToStyle(ac, style0); } - + /** * Update the source file and the line. * Overrides this method for a macro * * @param line The line number where this property is defined * @param source The source file where this property is defined - */ + */ public void setInfo(int line, String source) { super.setInfo(line, source); if(color != null) @@ -247,16 +247,16 @@ if(style != null) style.setInfo(line, source); } - + /** * Compares two properties for equality. * * @param value The other property. - */ + */ public boolean equals(CssProperty property) { return false; // @FIXME } - + /** * Set the context. * Overrides this method for a macro @@ -276,13 +276,13 @@ style.setSelectors(selector); } } - + /** * 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).getOutline(); @@ -290,5 +290,5 @@ return ((Css2Style) style).outline; } } - + } Index: Cursor.java =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css2/user/Cursor.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Cursor.java 23 Aug 2005 16:33:51 -0000 1.1 +++ Cursor.java 14 Sep 2005 15:14:58 -0000 1.2 @@ -55,8 +55,8 @@ * @exception InvalidParamException Values are incorrect */ public Cursor(ApplContext ac, CssExpression expression, boolean check) - throws InvalidParamException { - + throws InvalidParamException { + CssValue val = expression.getValue(); char op = expression.getOperator(); @@ -109,7 +109,7 @@ throws InvalidParamException { this(ac, expression, false); } - + /** * Returns the value of this property */ Index: OutlineWidthATSC.java =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css2/user/OutlineWidthATSC.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- OutlineWidthATSC.java 23 Aug 2005 16:33:51 -0000 1.1 +++ OutlineWidthATSC.java 14 Sep 2005 15:14:58 -0000 1.2 @@ -23,20 +23,20 @@ * @version $Revision$ */ public class OutlineWidthATSC extends UserProperty { - + CssValue value; - + private static CssIdent thin = new CssIdent("thin"); private static CssIdent medium = new CssIdent("medium"); private static CssIdent thick = new CssIdent("thick"); - + /** * Create a new OutlineWidthATSC */ public OutlineWidthATSC() { value = medium; } - + /** * Create a new OutlineWidthATSC from an another OutlineWidthATSC * @@ -45,7 +45,7 @@ public OutlineWidthATSC(OutlineWidthATSC another) { value = another.value; } - + /** * Create a new OutlineWidthATSC * @@ -54,11 +54,11 @@ */ public OutlineWidthATSC(ApplContext ac, CssExpression expression, boolean check) throws InvalidParamException { - + if(check && expression.getCount() > 1) { throw new InvalidParamException("unrecognize", ac); } - + CssValue val = expression.getValue(); setByUser(); @@ -69,7 +69,7 @@ if (f >= 0) { this.value = val; } else { - throw new InvalidParamException("negative-value", + throw new InvalidParamException("negative-value", val.toString(), ac); } } else if (val instanceof CssNumber) { @@ -83,25 +83,25 @@ } else if (val.equals(inherit)) { value = CssProperty.inherit; } else { - throw new InvalidParamException("value", val.toString(), + throw new InvalidParamException("value", val.toString(), "width", ac); } - + expression.next(); - } - + } + public OutlineWidthATSC(ApplContext ac, CssExpression expression) throws InvalidParamException { this(ac, expression, false); } - + /** * Returns the internal value - */ + */ public Object get() { return value; } - + /** * Returns true if this property is "softly" inherited * e.g. his value equals inherit @@ -109,14 +109,14 @@ public boolean isSoftlyInherited() { return value.equals(inherit); } - + /** * Returns a string representation of the object. */ - public String toString() { + public String toString() { return value.toString(); } - + /** * Add this property to the CssStyle. * @@ -129,13 +129,13 @@ } outline.width = this; } - + /** * Get this property in the style. * * @param style The style where the property is * @param resolve if true, resolve the style to find this property - */ + */ public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) { if (resolve) { return ((Css2Style) style).getOutlineWidthATSC(); @@ -143,24 +143,24 @@ return ((Css2Style) style).outlineATSC.width; } } - + /** * Compares two properties for equality. * * @param value The other property. - */ + */ public boolean equals(CssProperty property) { - return (property instanceof OutlineWidthATSC && + return (property instanceof OutlineWidthATSC && value.equals(((OutlineWidthATSC) property).value)); } - + /** * Returns the name of this property - */ + */ public String getPropertyName() { return "outline-width"; } - + } Index: UserProperties.java =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css2/user/UserProperties.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- UserProperties.java 23 Aug 2005 16:33:51 -0000 1.1 +++ UserProperties.java 14 Sep 2005 15:14:58 -0000 1.2 @@ -16,15 +16,15 @@ */ public class UserProperties { public static Utf8Properties properties; - + public static String getString(CssProperty property, String prop) { return properties.getProperty(property.getPropertyName() + "." + prop); } - + public static boolean getInheritance(CssProperty property) { return getString(property, "inherited").equals("true"); } - + static { properties = new Utf8Properties(); try {
Received on Wednesday, 14 September 2005 15:16:45 UTC