Package org.w3c.dom.css

Examples of org.w3c.dom.css.CSSValue


                                     CSSOMReadOnlyStyleDeclaration dest) {
  CSSOMValue         val   = (CSSOMValue)decl.getPropertyCSSValue(name);
  String             prio  = decl.getPropertyPriority(name);
  CSSOMReadOnlyValue value = val.createReadOnlyCopy();

  CSSValue           dval   = dest.getLocalPropertyCSSValue(name);
        int                dorg   = dest.getLocalPropertyOrigin(name);
  String             dprio  = dest.getLocalPropertyPriority(name);

        if (dval == null ||
            dorg != CSSOMReadOnlyStyleDeclaration.USER_ORIGIN ||
View Full Code Here


            String value,
            String priority ) throws DOMException {
        try {
            InputSource is = new InputSource(new StringReader(value));
            CSSOMParser parser = new CSSOMParser();
            CSSValue expr = parser.parsePropertyValue(is);
            Property p = this.getPropertyDeclaration(propertyName);
            boolean important = (priority != null)
                ? priority.equalsIgnoreCase("important")
                : false;
            if (p == null) {
View Full Code Here

    /**
     * <b>DOM</b>: Implements {@link
     * org.w3c.dom.svg.SVGStylable#getPresentationAttribute(String)}.
     */
    public CSSValue getPresentationAttribute(String name) {
        CSSValue result = (CSSValue)getLiveAttributeValue(null, name);
        if (result != null)
            return result;

        CSSEngine eng = ((SVGOMDocument)getOwnerDocument()).getCSSEngine();
        int idx = eng.getPropertyIndex(name);
View Full Code Here

    /**
     * Gets the CSS value associated with the given property.
     */
    protected CSSValue getCSSValue(String name) {
        CSSValue result = null;
        if (values != null) {
            result = (CSSValue)values.get(name);
        }
        if (result == null) {
            result = createCSSValue(name);
View Full Code Here

    /**
     * <b>DOM</b>: Implements {@link
     * org.w3c.dom.css.CSSStyleDeclaration#getPropertyCSSValue(String)}.
     */
    public CSSValue getPropertyCSSValue(String propertyName) {
        CSSValue result = (CSSValue)values.get(propertyName);
        if (result == null) {
            int idx = cssEngine.getPropertyIndex(propertyName);
            if (idx != -1) {
                result = createCSSValue(idx);
                values.put(propertyName, result);
View Full Code Here

            for (int i = 0; i < items.length; i++) {
                nitems[i] = items[i];
            }
            items = nitems;
        }
        CSSValue result = items[index];
        if (result == null) {
            items[index] = result = new ListComponent(index);
        }
        return result;
    }
View Full Code Here

    /**
     * <b>DOM</b>: Implements {@link
     * org.w3c.dom.svg.SVGStylable#getPresentationAttribute(String)}.
     */
    public CSSValue getPresentationAttribute(String name) {
        CSSValue result = (CSSValue)getLiveAttributeValue(null, name);
        if (result != null)
            return result;

        CSSEngine eng = ((SVGOMDocument)getOwnerDocument()).getCSSEngine();
        int idx = eng.getPropertyIndex(name);
View Full Code Here

protected void updateURIs(CSSOMReadOnlyStyleDeclaration sd, URL url)
    throws MalformedURLException {
    int len = sd.getLength();
    for (int i = 0; i < len; i++) {
        String name = sd.item(i);
        CSSValue val = sd.getLocalPropertyCSSValue(name);
        if (val != null &&
            val.getCssValueType() ==
            CSSPrimitiveValue.CSS_PRIMITIVE_VALUE) {
            CSSPrimitiveValue pv = (CSSPrimitiveValue)val;
            if (pv.getPrimitiveType() == CSSPrimitiveValue.CSS_URI) {
                CSSOMReadOnlyValue v =
                    new CSSOMReadOnlyValue
View Full Code Here

     * Returns the viewport
     */
    public static Rectangle2D convertEnableBackground(SVGElement svgElement,
                                                      CSSStyleDeclaration decl,
                                                      UnitProcessor.Context uctx) {
        CSSValue val;
        val = decl.getPropertyCSSValue(CSS_ENABLE_BACKGROUND_PROPERTY);

        if (val.getCssValueType() != val.CSS_VALUE_LIST) {
            return null; // accumulate
        }
        try {
            CSSValueList lst = (CSSValueList)val;
            int len = lst.getLength();
View Full Code Here

        v = (CSSPrimitiveValue)decl.getPropertyCSSValue(CSS_STROKE_MITERLIMIT_PROPERTY);
        float miterlimit = v.getFloatValue(CSSPrimitiveValue.CSS_NUMBER);
        miterlimit = (miterlimit < 1)? 1 : miterlimit;

        // 'stroke-dasharray'
        CSSValue vv = decl.getPropertyCSSValue(CSS_STROKE_DASHARRAY_PROPERTY);
        float [] dashArray = null;
        float dashOffset = 0;
        if (vv.getCssValueType() == CSSValue.CSS_VALUE_LIST) {
            CSSValueList l = (CSSValueList) vv;
            int length = l.getLength();
            dashArray = new float[length];
            for (int i=0; i < length; ++i) {
                v = (CSSPrimitiveValue) l.item(i);
View Full Code Here

TOP

Related Classes of org.w3c.dom.css.CSSValue

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.