Package org.apache.flex.forks.batik.css.engine.value

Examples of org.apache.flex.forks.batik.css.engine.value.Value


     */
    public String getColorProfile() {
        if (getColorType() != SVG_COLORTYPE_RGBCOLOR_ICCCOLOR) {
            throw new DOMException(DOMException.SYNTAX_ERR, "");
        }
        Value value = valueProvider.getValue();
        return ((ICCColor)value.item(1)).getColorProfile();
    }
View Full Code Here


     */
    public int getNumberOfItems() {
        if (getColorType() != SVG_COLORTYPE_RGBCOLOR_ICCCOLOR) {
            throw new DOMException(DOMException.SYNTAX_ERR, "");
        }
        Value value = valueProvider.getValue();
        return ((ICCColor)value.item(1)).getNumberOfColors();
    }
View Full Code Here

            iccColors = new ArrayList(n);
            for (int i = iccColors.size(); i < n; i++) {
                iccColors.add(null);
            }
        }
        Value value = valueProvider.getValue().item(1);
        float f = ((ICCColor)value).getColor(index);
        SVGNumber result = new ColorNumber(f);
        iccColors.set(index, result);
        return result;
    }
View Full Code Here

            SVGNumber result = null;
            if (iccColors != null) {
                result = (ColorNumber)iccColors.get(index);
            }
            if (result == null) {
                Value value = valueProvider.getValue().item(1);
                result =
                    new ColorNumber(((ICCColor)value).getColor(index));
            }
            handler.colorRemoved(index);
            return result;
View Full Code Here

     * Returns a printable representation of this style map.
     */
    public String toString(CSSEngine eng) {
        StringBuffer sb = new StringBuffer();
        for (int i = 0; i < values.length; i++) {
            Value v = values[i];
            if (v == null) continue;

            sb.append(eng.getPropertyName(i));
            sb.append(": ");
            sb.append(v);
View Full Code Here

            }
            int idx = iccColors.indexOf(this);
            if (idx == -1) {
                return value;
            }
            Value value = valueProvider.getValue().item(1);
            return ((ICCColor)value).getColor(idx);
        }
View Full Code Here

                     new Object [] {SVG_ORIENT_ATTRIBUTE, s});
            }
        }

        // 'stroke-width' property
        Value val = CSSUtilities.getComputedStyle
            (paintedElement, SVGCSSEngine.STROKE_WIDTH_INDEX);
        float strokeWidth = val.getFloatValue();

        // 'markerUnits' attribute - default is 'strokeWidth'
        short unitsType;
        s = markerElement.getAttributeNS(null, SVG_MARKER_UNITS_ATTRIBUTE);
        if (s.length() == 0) {
View Full Code Here

    /**
     * <b>DOM</b>: Implements {@link
     * org.w3c.flex.forks.dom.svg.SVGPaint#getPaintType()}.
     */
    public short getPaintType() {
        Value value = valueProvider.getValue();
        switch (value.getCssValueType()) {
        case CSSValue.CSS_PRIMITIVE_VALUE:
            switch (value.getPrimitiveType()) {
            case CSSPrimitiveValue.CSS_IDENT: {
                String str = value.getStringValue();
                if (str.equalsIgnoreCase(CSSConstants.CSS_NONE_VALUE)) {
                    return SVG_PAINTTYPE_NONE;
                } else if (str.equalsIgnoreCase
                           (CSSConstants.CSS_CURRENTCOLOR_VALUE)) {
                    return SVG_PAINTTYPE_CURRENTCOLOR;
                }
                return SVG_PAINTTYPE_RGBCOLOR;
            }
            case CSSPrimitiveValue.CSS_RGBCOLOR:
                return SVG_PAINTTYPE_RGBCOLOR;

            case CSSPrimitiveValue.CSS_URI:
                return SVG_PAINTTYPE_URI;
            }
            break;

        case CSSValue.CSS_VALUE_LIST:
            Value v0 = value.item(0);
            Value v1 = value.item(1);
            switch (v0.getPrimitiveType()) {
            case CSSPrimitiveValue.CSS_IDENT:
                return SVG_PAINTTYPE_RGBCOLOR_ICCCOLOR;
            case CSSPrimitiveValue.CSS_URI:
                if (v1.getCssValueType() == CSSValue.CSS_VALUE_LIST)
                    // Should probably check this more deeply...
                    return SVG_PAINTTYPE_URI_RGBCOLOR_ICCCOLOR;

                switch (v1.getPrimitiveType()) {
                case CSSPrimitiveValue.CSS_IDENT: {
                    String str = v1.getStringValue();
                    if (str.equalsIgnoreCase(CSSConstants.CSS_NONE_VALUE)) {
                        return SVG_PAINTTYPE_URI_NONE;
                    } else if (str.equalsIgnoreCase
                               (CSSConstants.CSS_CURRENTCOLOR_VALUE)) {
                        return SVG_PAINTTYPE_URI_CURRENTCOLOR;
View Full Code Here

                    public void property(String pname, LexicalUnit lu,
                                         boolean important) {
                        int idx = getPropertyIndex(pname);
                        if (idx != -1) {
                            ValueManager vm = valueManagers[idx];
                            Value v = vm.createValue(lu, CSSEngine.this);
                            putAuthorProperty(result, idx, v, important,
                                              StyleMap.NON_CSS_ORIGIN);
                            return;
                        }
                        idx = getShorthandIndex(pname);
View Full Code Here

        if (sm == null) {
            sm = getCascadedStyleMap(elt, pseudo);
            elt.setComputedStyleMap(pseudo, sm);
        }

        Value value = sm.getValue(propidx);
        if (sm.isComputed(propidx))
            return value;

        Value result = value;
        ValueManager vm = valueManagers[propidx];
        CSSStylableElement p = getParentCSSStylableElement(elt);
        if (value == null) {
            if ((p == null) || !vm.isInheritedProperty())
                result = vm.getDefaultValue();
View Full Code Here

TOP

Related Classes of org.apache.flex.forks.batik.css.engine.value.Value

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.