W3C home > Mailing lists > Public > www-validator-cvs@w3.org > September 2011

2002/css-validator/org/w3c/css/properties/css CssAzimuth.java,NONE,1.1 CssBackground.java,1.8,1.9 CssProperties.java,1.1,1.2 CssProperty.java,1.1,1.2

From: Yves Lafon via cvs-syncmail <cvsmail@w3.org>
Date: Fri, 09 Sep 2011 12:16:45 +0000
To: www-validator-cvs@w3.org
Message-Id: <E1R201D-0004we-I6@lionel-hutz.w3.org>
Update of /sources/public/2002/css-validator/org/w3c/css/properties/css
In directory hutz:/tmp/cvs-serv18813/properties/css

Modified Files:
	CssBackground.java CssProperties.java CssProperty.java 
Added Files:
	CssAzimuth.java 
Log Message:
code cleanup, removed dead code, starting reorg of azimuth (others to follow)

Index: CssProperty.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css/CssProperty.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- CssProperty.java	5 Jan 2010 13:49:38 -0000	1.1
+++ CssProperty.java	9 Sep 2011 12:16:43 -0000	1.2
@@ -6,7 +6,6 @@
 package org.w3c.css.properties.css;
 
 import org.w3c.css.css.StyleSheetOrigin;
-import org.w3c.css.parser.CssPrinterStyle;
 import org.w3c.css.parser.CssSelectors;
 import org.w3c.css.parser.CssStyle;
 import org.w3c.css.util.ApplContext;
@@ -149,20 +148,6 @@
     public abstract boolean equals(CssProperty property);
 
     /**
-     * Print this property.
-     *
-     * @param printer The printer.
-     * @see #toString()
-     * @see #getPropertyName()
-     */
-    public void print(CssPrinterStyle printer) {
-        if (byUser || inherited() || important) {
-            // if (Inherited() || important) {
-            printer.print(this);
-        }
-    }
-
-    /**
      * Returns a string representation of values.
      * <BR>
      * So if you want have something like this :
@@ -238,9 +223,6 @@
 
     /**
      * Is the value of this property is a default value.
-     * It is used by all macro for the function <code>print</code>
-     *
-     * @see #print(CssPrinterStyle)
      */
     public boolean isDefault() {
         return false;

--- NEW FILE: CssAzimuth.java ---
//
// $Id: CssAzimuth.java,v 1.1 2011/09/09 12:16:43 ylafon Exp $
// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr)
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// 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;

/**
 * @version $Revision: 1.1 $
 */
public class CssAzimuth extends CssProperty {

    CssValue value;

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

    /**
     * Creates a new CssAzimuth
     *
     * @param expression The expression for this property
     * @throws org.w3c.css.util.InvalidParamException
     *          Expressions are incorrect
     */
    public CssAzimuth(ApplContext ac, CssExpression expression, boolean check)
            throws InvalidParamException {


        throw new InvalidParamException("value",
                expression.getValue().toString(),
                getPropertyName(), ac);
    }

    public CssAzimuth(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 "azimuth";
    }

    /**
     * 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).cssAzimuth != null)
            style.addRedefinitionWarning(ac, this);
        ((Css1Style) style).cssAzimuth = this;
    }

    /**
     * Compares two properties for equality.
     *
     * @param property The other property.
     */
    public boolean equals(CssProperty property) {
        return (property instanceof CssAzimuth &&
                value.equals(((CssAzimuth) 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).getAzimuth();
        } else {
            return ((Css1Style) style).cssAzimuth;
        }
    }
}


Index: CssProperties.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css/CssProperties.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- CssProperties.java	5 Jan 2010 13:49:38 -0000	1.1
+++ CssProperties.java	9 Sep 2011 12:16:43 -0000	1.2
@@ -16,26 +16,26 @@
     public static Utf8Properties properties;
 
     public static String getString(CssProperty property, String prop) {
-	StringBuilder st = new StringBuilder(property.getPropertyName());
-	st.append('.').append(prop);
-	return properties.getProperty(st.toString());
+        StringBuilder st = new StringBuilder(property.getPropertyName());
+        st.append('.').append(prop);
+        return properties.getProperty(st.toString());
     }
 
     public static boolean getInheritance(CssProperty property) {
-	return "true".equals(getString(property, "inherited"));
+        return "true".equals(getString(property, "inherited"));
     }
 
     static {
-	properties = new Utf8Properties();
-	try {
-	    URL url = CssProperties.class.getResource("CSS1Default.properties");
-	    java.io.InputStream f = url.openStream();
-	    properties.load(f);
-	    f.close();
-	} catch (Exception e) {
-	    System.err.println("org.w3c.css.properties.CssProperties: "+
-			       "couldn't load properties ");
-	    System.err.println("  " + e.toString());
-	}
+        properties = new Utf8Properties();
+        try {
+            URL url = CssProperties.class.getResource("CSS1Default.properties");
+            java.io.InputStream f = url.openStream();
+            properties.load(f);
+            f.close();
+        } catch (Exception e) {
+            System.err.println("org.w3c.css.properties.CssProperties: " +
+                    "couldn't load properties ");
+            System.err.println("  " + e.toString());
+        }
     }
 }

Index: CssBackground.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css/CssBackground.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- CssBackground.java	22 Jan 2010 20:49:16 -0000	1.8
+++ CssBackground.java	9 Sep 2011 12:16:43 -0000	1.9
@@ -6,7 +6,6 @@
 // Please first read the full copyright statement in file COPYRIGHT.html
 package org.w3c.css.properties.css;
 
-import org.w3c.css.parser.CssPrinterStyle;
 import org.w3c.css.parser.CssSelectors;
 import org.w3c.css.parser.CssStyle;
 import org.w3c.css.properties.css1.Css1Style;
@@ -763,50 +762,6 @@
     }
 
     /**
-     * Print this property.
-     *
-     * @param printer The printer.
-     * @see #toString()
-     * @see #getPropertyName()
-     */
-    public void print(CssPrinterStyle printer) {
-        if ((color != null && image != null &&
-                repeat != null && attachment != null &&
-                position != null && size != null) &&
-                (getImportant() ||
-                        (!image.important &&
-                                !color.important &&
-                                !repeat.important &&
-                                !attachment.important &&
-                                !size.important &&
-                                !position.important))) {
-            if (color.byUser || image.byUser || repeat.byUser
-                    || attachment.byUser || size.byUser || position.byUser) {
-                printer.print(this);
-            }
-        } else {
-            if (color != null) {
-                color.print(printer);
-            }
-            if (image != null) {
-                image.print(printer);
-            }
-            if (repeat != null) {
-                repeat.print(printer);
-            }
-            if (attachment != null) {
-                attachment.print(printer);
-            }
-            if (position != null) {
-                position.print(printer);
-            }
-            if (size != null) {
-                size.print(printer);
-            }
-        }
-    }
-
-    /**
      * Set the context.
      * Overrides this method for a macro
      *
Received on Friday, 9 September 2011 12:17:21 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:17:46 UTC