Package org.w3c.dom.css

Examples of org.w3c.dom.css.CSSValue


     *
     * @param e the element
     */
    public static boolean convertVisibility(Element e) {
        CSSOMReadOnlyStyleDeclaration decl = getComputedStyle(e);
        CSSValue v = decl.getPropertyCSSValueInternal(CSS_VISIBILITY_PROPERTY);
        if (v.getCssValueType() == CSSValue.CSS_INHERIT) {
            // workaround for the CSS2 spec which indicates that the
            // initial value is 'inherit'. So if we get 'inherit' it
            // means that we are on the outermost svg element and we
            // always return true.
            return true;
View Full Code Here


     *
     * @param e the element
     */
    public static Composite convertOpacity(Element e) {
        CSSOMReadOnlyStyleDeclaration decl = getComputedStyle(e);
        CSSValue v =
            getComputedStyle(e).getPropertyCSSValueInternal
            (CSS_OPACITY_PROPERTY);
        float opacity = PaintServer.convertOpacity(v);
        if (opacity <= 0f) {
            return null;
View Full Code Here

     * @param ctx the bridge context
     */
    public static Color convertLightingColor(Element e, BridgeContext ctx) {
        CSSOMReadOnlyStyleDeclaration decl = getComputedStyle(e);

        CSSValue colorDef = decl.getPropertyCSSValueInternal
            (CSS_LIGHTING_COLOR_PROPERTY);
        if (colorDef.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE) {
            CSSPrimitiveValue v = (CSSPrimitiveValue)colorDef;
            return PaintServer.convertColor(v.getRGBColorValue(), 1);
        } else {
            return PaintServer.convertRGBICCColor
                (e, (SVGColor)colorDef, 1, ctx);
View Full Code Here

    public static Color convertFloodColor(Element e, BridgeContext ctx) {
        CSSOMReadOnlyStyleDeclaration decl = getComputedStyle(e);
        float opacity = PaintServer.convertOpacity
            (decl.getPropertyCSSValueInternal(CSS_FLOOD_OPACITY_PROPERTY));

        CSSValue colorDef
            = decl.getPropertyCSSValueInternal(CSS_FLOOD_COLOR_PROPERTY);
        if (colorDef.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE) {
            CSSPrimitiveValue v = (CSSPrimitiveValue)colorDef;
            return PaintServer.convertColor(v.getRGBColorValue(), opacity);
        } else {
            return PaintServer.convertRGBICCColor
                (e, (SVGColor)colorDef, opacity, ctx);
View Full Code Here

            result.put(GVTAttributedCharacterIterator.TextAttribute.STROKE,
                       stroke);
        }

        // Text decoration
        CSSValue cssVal = cssDecl.getPropertyCSSValueInternal
            (CSS_TEXT_DECORATION_PROPERTY);
        t = cssVal.getCssValueType();
        if (t == CSSValue.CSS_VALUE_LIST) {
            CSSValueList lst = (CSSValueList)cssVal;
            for (int i = 0; i < lst.getLength(); i++) {
                v = (CSSPrimitiveValue)lst.item(i);
                s = v.getStringValue();
View Full Code Here

        }

        // 'stroke-width' property
        CSSStyleDeclaration decl
            = CSSUtilities.getComputedStyle(paintedElement);
        CSSValue v = decl.getPropertyCSSValue(CSS_STROKE_WIDTH_PROPERTY);
        float strokeWidth = UnitProcessor.cssOtherLengthToUserSpace
            (v, CSS_STROKE_WIDTH_PROPERTY, uctx);

        // 'markerUnits' attribute - default is 'strokeWidth'
        short unitsType;
View Full Code Here

        flattenParentStyles(ds, styles);
        return ds;
    }

    private static void flattenParentStyles(StyleImpl style, IStyle[] parents) {
        CSSValue value;
        if (parents != null) {
            for (int j = 0; j < StyleConstants.NUMBER_OF_STYLE; j++) {
                value = style.getProperty(j);

                if (isNonEffectiveValue(value)) {
View Full Code Here

    public int hashCode() {
        int hash = 0;

        if (!isEmpty()) {
            for (int i = 0; i < StyleConstants.NUMBER_OF_STYLE; i++) {
                CSSValue v1 = getProperty(i);

                if (v1 != null) {
                    hash += (i ^ v1.hashCode());
                }
            }
        }

        return hash;
View Full Code Here

        if (empty != aempty) {
            return false;
        }

        for (int i = 0; i < StyleConstants.NUMBER_OF_STYLE; i++) {
            CSSValue v1 = getProperty(i);
            CSSValue v2 = ((IStyle) obj).getProperty(i);

            if ((v1 == null && v2 != null) || (v2 == null && v1 != null)) {
                return false;
            }
View Full Code Here

        final List<CSSStyleRule> rules = getRules(getStyleSheet(cssFile));
        final Optional<CSSStyleDeclaration> styleMaybe = getStyle(rules,
                selector);
        if (styleMaybe.isPresent()) {
            final CSSStyleDeclaration style = styleMaybe.get();
            final CSSValue val = style.getPropertyCSSValue(property);
            if (val == null) {
                // The property might be a CSS shorthand property
                final String strVal = style.getPropertyValue(property);
                if (!strVal.isEmpty()) {
                    value = strVal;
                }
            } else {
                value = val.getCssText();
            }
        }
        return Optional.fromNullable(value);
    }
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.