Examples of CSSOMValue


Examples of org.apache.batik.css.CSSOMValue

        case LexicalUnit.SAC_IDENT:
        case LexicalUnit.SAC_STRING_VALUE:
      ImmutableValueList list = new ImmutableValueList();
      do {
    if (lu.getLexicalUnitType() == LexicalUnit.SAC_STRING_VALUE) {
        list.append(new CSSOMValue(stringFactory,
                 stringFactory.createValue(lu)));
        if (lu != null) {
      lu = lu.getNextLexicalUnit();
        }
    } else {
        LexicalUnit l = lu;
        String s = l.getStringValue();
        lu = lu.getNextLexicalUnit();
        if (lu != null &&
                        lu.getLexicalUnitType() == LexicalUnit.SAC_IDENT) {
      do {
          s += " " + lu.getStringValue();
          lu = lu.getNextLexicalUnit();
      } while (lu != null &&
         lu.getLexicalUnitType() ==
                                 LexicalUnit.SAC_IDENT);
      ImmutableValue v;
      v = new ImmutableString(CSSPrimitiveValue.CSS_STRING,
                                                s);
      list.append(new CSSOMValue(stringFactory, v));
        } else {
      if (values.get(s.toLowerCase().intern()) != null) {
          list.append
                                (new CSSOMValue(identFactory,
                                                identFactory.createValue(l)));
      } else {
          s = "\"" + s + "\"";
          list.append
                                (new CSSOMValue(stringFactory,
                                                stringFactory.createValue(s)));
      }
        }
    }
    if (lu != null) {
View Full Code Here

Examples of org.apache.batik.css.CSSOMValue

        case LexicalUnit.SAC_IDENT:
        case LexicalUnit.SAC_STRING_VALUE:
      ImmutableValueList list = new ImmutableValueList();
      do {
    if (lu.getLexicalUnitType() == LexicalUnit.SAC_STRING_VALUE) {
        list.append(new CSSOMValue(stringFactory,
                 stringFactory.createValue(lu)));
        if (lu != null) {
      lu = lu.getNextLexicalUnit();
        }
    } else {
        LexicalUnit l = lu;
        String s = l.getStringValue();
        lu = lu.getNextLexicalUnit();
        if (lu != null &&
                        lu.getLexicalUnitType() == LexicalUnit.SAC_IDENT) {
      do {
          s += " " + lu.getStringValue();
          lu = lu.getNextLexicalUnit();
      } while (lu != null &&
         lu.getLexicalUnitType() ==
                                 LexicalUnit.SAC_IDENT);
      ImmutableValue v;
      v = new ImmutableString(CSSPrimitiveValue.CSS_STRING,
                                                s);
      list.append(new CSSOMValue(stringFactory, v));
        } else {
      if (values.get(s.toLowerCase().intern()) != null) {
          list.append
                                (new CSSOMValue(identFactory,
                                                identFactory.createValue(l)));
      } else {
          s = "\"" + s + "\"";
          list.append
                                (new CSSOMValue(stringFactory,
                                                stringFactory.createValue(s)));
      }
        }
    }
    if (lu != null) {
View Full Code Here

Examples of org.apache.batik.css.CSSOMValue

                break;
            }
        case LexicalUnit.SAC_RECT_FUNCTION:
            lu = lu.getParameters();
            CSSPrimitiveValue t;
            t = new CSSOMValue(factory, factory.createValue(lu));
            lu = lu.getNextLexicalUnit();
            if (lu == null ||
                lu.getLexicalUnitType() != LexicalUnit.SAC_OPERATOR_COMMA) {
                throw CSSDOMExceptionFactory.createDOMException
                    (DOMException.INVALID_ACCESS_ERR,
                     "invalid.lexical.unit",
                     new Object[] { new Integer(lu.getLexicalUnitType()),
                                    getPropertyName() });
            }
            lu = lu.getNextLexicalUnit();
            CSSPrimitiveValue r;
            r = new CSSOMValue(factory, factory.createValue(lu));
            lu = lu.getNextLexicalUnit();
            if (lu == null ||
                lu.getLexicalUnitType() != LexicalUnit.SAC_OPERATOR_COMMA) {
                throw CSSDOMExceptionFactory.createDOMException
                    (DOMException.INVALID_ACCESS_ERR,
                     "invalid.lexical.unit",
                     new Object[] { new Integer(lu.getLexicalUnitType()),
                                    getPropertyName() });
            }
            lu = lu.getNextLexicalUnit();
            CSSPrimitiveValue b;
            b = new CSSOMValue(factory, factory.createValue(lu));
            lu = lu.getNextLexicalUnit();
            if (lu == null ||
                lu.getLexicalUnitType() != LexicalUnit.SAC_OPERATOR_COMMA) {
                throw CSSDOMExceptionFactory.createDOMException
                    (DOMException.INVALID_ACCESS_ERR,
                     "invalid.lexical.unit",
                     new Object[] { new Integer(lu.getLexicalUnitType()),
                                    getPropertyName() });
            }
            lu = lu.getNextLexicalUnit();
            CSSPrimitiveValue l;
            l = new CSSOMValue(factory, factory.createValue(lu));
            return new ImmutableRect(t, r, b, l);
        }
        throw CSSDOMExceptionFactory.createDOMException
            (DOMException.INVALID_ACCESS_ERR,
             "invalid.lexical.unit",
View Full Code Here

Examples of org.apache.batik.css.CSSOMValue

    /**
     * Creates a new CSSValue.
     */
    protected CSSOMValue createCSSValue(ImmutableValue v) {
        return new CSSOMValue(this, v);
    }
View Full Code Here

Examples of org.apache.batik.css.CSSOMValue

        rv = new ImmutableFloat(CSSPrimitiveValue.CSS_NUMBER, r);
  ImmutableValue gv;
        gv = new ImmutableFloat(CSSPrimitiveValue.CSS_NUMBER, g);
  ImmutableValue bv;
        bv = new ImmutableFloat(CSSPrimitiveValue.CSS_NUMBER, b);
  return new ImmutableRGBColor(new CSSOMValue(RGB_FACTORY, rv),
             new CSSOMValue(RGB_FACTORY, gv),
             new CSSOMValue(RGB_FACTORY, bv));
    }
View Full Code Here

Examples of org.apache.batik.css.CSSOMValue

        if (lu.getStringValue().equalsIgnoreCase(CSS_NONE_VALUE)) {
        return NONE_VALUE;
      }
      ImmutableValueList list = new ImmutableValueList(' ');
      do {
    list.append(new CSSOMValue(identFactory,
                                           identFactory.createValue(lu)));
    lu = lu.getNextLexicalUnit();
      } while (lu != null);
      return list;
  default:
View Full Code Here

Examples of org.apache.batik.css.CSSOMValue

     new Object[] { new Integer(lu.getLexicalUnitType()),
                                getPropertyName() });
  }
  lu = lu.getParameters();
  ValueFactory ph = new ColorComponentFactory(getParser());
  CSSPrimitiveValue r = new CSSOMValue(ph, createColorValue(lu));
  lu = lu.getNextLexicalUnit().getNextLexicalUnit();
  CSSPrimitiveValue g = new CSSOMValue(ph, createColorValue(lu));
  lu = lu.getNextLexicalUnit().getNextLexicalUnit();
  CSSPrimitiveValue b = new CSSOMValue(ph, createColorValue(lu));
  return new ImmutableRGBColor(r, g, b);
    }
View Full Code Here

Examples of org.apache.batik.css.CSSOMValue

     */
    public ImmutableValue createValue(LexicalUnit lu) throws DOMException {
  if (lu.getLexicalUnitType() == LexicalUnit.SAC_URI) {
      ImmutableValueList list = new ImmutableValueList();
      do {
    list.append(new CSSOMValue(uriFactory,
                                           uriFactory.createValue(lu)));
    lu = lu.getNextLexicalUnit().getNextLexicalUnit();
      } while (lu.getLexicalUnitType() == LexicalUnit.SAC_URI);
      list.append(new CSSOMValue(identFactory,
                                       identFactory.createValue(lu)));
      return list;
  }
  return super.createValue(lu);
    }
View Full Code Here

Examples of org.apache.batik.css.CSSOMValue

            }
            return super.createValue(lu);
        case LexicalUnit.SAC_RGBCOLOR:
            LexicalUnit l = lu.getParameters();
            ValueFactory ph = new ColorComponentFactory(getParser());
            CSSPrimitiveValue r = new CSSOMValue(ph, createColorValue(l));
            l = l.getNextLexicalUnit().getNextLexicalUnit();
            CSSPrimitiveValue g = new CSSOMValue(ph, createColorValue(l));
            l = l.getNextLexicalUnit().getNextLexicalUnit();
            CSSPrimitiveValue b = new CSSOMValue(ph, createColorValue(l));
            lu = lu.getNextLexicalUnit();
            if (lu == null) {
                return new ImmutableRGBColor(r, g, b);
            }
            if (lu.getLexicalUnitType() != LexicalUnit.SAC_FUNCTION) {
                throw CSSDOMExceptionFactory.createDOMException
                    (DOMException.INVALID_ACCESS_ERR,
                     "invalid.lexical.unit",
                     new Object[] { new Integer(lu.getLexicalUnitType()),
                                    getPropertyName() });
            }
            if (!lu.getFunctionName().toLowerCase().equals("icc-color")) {
                throw CSSDOMExceptionFactory.createDOMException
                    (DOMException.INVALID_ACCESS_ERR,
                     "invalid.lexical.unit",
                     new Object[] { new Integer(lu.getLexicalUnitType()),
                                    getPropertyName() });
            }
            lu = lu.getParameters();
            if (lu.getLexicalUnitType() != LexicalUnit.SAC_IDENT) {
                throw CSSDOMExceptionFactory.createDOMException
                    (DOMException.INVALID_ACCESS_ERR,
                     "invalid.lexical.unit",
                     new Object[] { new Integer(lu.getLexicalUnitType()),
                                    getPropertyName() });
            }
            String cp = lu.getStringValue();
            lu = lu.getNextLexicalUnit();
            SVGCSSNumberList nl = new SVGCSSNumberList();
            while (lu != null) {
                lu = lu.getNextLexicalUnit();
                if (lu == null) {
                    throw CSSDOMExceptionFactory.createDOMException
                        (DOMException.INVALID_ACCESS_ERR,
                         "invalid.lexical.unit",
                         new Object[] { new Integer(0), getPropertyName() });
                }
                nl.appendItem(new SVGCSSNumber(getColorValue(lu)));
                lu = lu.getNextLexicalUnit();
            }
            return new ImmutableSVGPaintValue
                (SVGPaint.SVG_PAINTTYPE_RGBCOLOR_ICCCOLOR,
                 r, g, b, cp, nl, null);

        case LexicalUnit.SAC_URI:
            String uri = lu.getStringValue();
            lu = lu.getNextLexicalUnit();
            if (lu == null) {
                return new ImmutableString(CSSPrimitiveValue.CSS_URI, uri);
            }

            switch (lu.getLexicalUnitType()) {
            case LexicalUnit.SAC_RGBCOLOR:
                l = lu.getParameters();
                ph = new ColorComponentFactory(getParser());
                r = new CSSOMValue(ph, createColorValue(l));
                l = l.getNextLexicalUnit().getNextLexicalUnit();
                g = new CSSOMValue(ph, createColorValue(l));
                l = l.getNextLexicalUnit().getNextLexicalUnit();
                b = new CSSOMValue(ph, createColorValue(l));
                lu = lu.getNextLexicalUnit();
                if (lu == null) {
                    return new ImmutableSVGPaintValue
                        (SVGPaint.SVG_PAINTTYPE_URI_RGBCOLOR,
                         r, g, b, null, null, uri);
View Full Code Here

Examples of org.apache.batik.css.CSSOMValue

      if (v == ACCUMULATE_VALUE) {
            return (ImmutableValue)v;
      }
      ImmutableValueList list = new ImmutableValueList(' ');
      list.append(new CSSOMValue(this, (ImmutableValue)v));
      for (int i = 0; i < 4; i++) {
    lu = lu.getNextLexicalUnit();
                if (lu == null){
                    if (i == 0) {
                        return list;
                    }
                    throw CSSDOMExceptionFactory.createDOMException
                        (DOMException.INVALID_ACCESS_ERR,
                         "unexpected.end.of.list",
                         new Object[] { getPropertyName() });
                }
    list.append(new CSSOMValue(lengthFactory,
             lengthFactory.createValue(lu)));
      }
      return list;
  default:
            throw CSSDOMExceptionFactory.createDOMException
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.