Package org.w3c.dom.css

Examples of org.w3c.dom.css.CSSPrimitiveValue


     *
     * @param e the element
     */
    public static Map convertTextRendering(Element e) {
        CSSOMReadOnlyStyleDeclaration decl = getComputedStyle(e);
        CSSPrimitiveValue v = (CSSPrimitiveValue)
            decl.getPropertyCSSValueInternal(CSS_TEXT_RENDERING_PROPERTY);
        String s = v.getStringValue();
        if (s.charAt(0) == 'a') { // auto
            return null;
        }
        Map hints = new HashMap();
        switch(s.charAt(8)) {
View Full Code Here


     *
     * @param e the element
     */
    public static Map convertImageRendering(Element e) {
        CSSOMReadOnlyStyleDeclaration decl = getComputedStyle(e);
        CSSPrimitiveValue v = (CSSPrimitiveValue)
            decl.getPropertyCSSValueInternal(CSS_IMAGE_RENDERING_PROPERTY);
        String s = v.getStringValue();
        if (s.charAt(0) == 'a') { // auto
            return null;
        }
        Map hints = new HashMap();
        switch(s.charAt(8)) {
View Full Code Here

     *
     * @param e the element
     */
    public static Map convertColorRendering(Element e) {
        CSSOMReadOnlyStyleDeclaration decl = getComputedStyle(e);
        CSSPrimitiveValue v = (CSSPrimitiveValue)
            decl.getPropertyCSSValueInternal(CSS_COLOR_RENDERING_PROPERTY);
        String s = v.getStringValue();
        if (s.charAt(0) == 'a') { // auto
            return null;
        }
        // System.out.println("Str: " + s + "[8] = '" + s.charAt(8) + "'");
        Map hints = new HashMap();
View Full Code Here

     *
     * @param e the element with the 'overflow' property
     */
    public static boolean convertOverflow(Element e) {
        CSSOMReadOnlyStyleDeclaration decl = getComputedStyle(e);
        CSSPrimitiveValue overflow =
            (CSSPrimitiveValue)decl.getPropertyCSSValueInternal
            (CSS_OVERFLOW_PROPERTY);
        String s = overflow.getStringValue();
        // clip if 'hidden' or 'scroll'
        return (s.charAt(0) == 'h') || (s.charAt(0) == 's');
    }
View Full Code Here

     *
     * @param e the element with the 'clip' property
     */
    public static float[] convertClip(Element e) {
        CSSOMReadOnlyStyleDeclaration decl = getComputedStyle(e);
        CSSPrimitiveValue clip =
            (CSSPrimitiveValue)decl.getPropertyCSSValueInternal
            (CSS_CLIP_PROPERTY);
        switch (clip.getPrimitiveType()) {
        case CSSPrimitiveValue.CSS_RECT:
            float [] off = new float[4];
            Rect r = clip.getRectValue();
            off[0] = r.getTop().getFloatValue(CSSPrimitiveValue.CSS_NUMBER);
            off[1] = r.getRight().getFloatValue(CSSPrimitiveValue.CSS_NUMBER);
            off[2] = r.getBottom().getFloatValue(CSSPrimitiveValue.CSS_NUMBER);
            off[3] = r.getLeft().getFloatValue(CSSPrimitiveValue.CSS_NUMBER);
            return off;
View Full Code Here

    public static Filter convertFilter(Element filteredElement,
                                       GraphicsNode filteredNode,
                                       BridgeContext ctx) {
        CSSOMReadOnlyStyleDeclaration decl = getComputedStyle(filteredElement);

        CSSPrimitiveValue filterValue =
            (CSSPrimitiveValue)decl.getPropertyCSSValueInternal
            (CSS_FILTER_PROPERTY);

        switch(filterValue.getPrimitiveType()){
        case CSSPrimitiveValue.CSS_IDENT:
            return null; // 'filter:none'
        case CSSPrimitiveValue.CSS_URI:
            String uri = filterValue.getStringValue();
            Element filter = ctx.getReferencedElement(filteredElement, uri);
            Bridge bridge = ctx.getBridge(filter);
            if (bridge == null || !(bridge instanceof FilterBridge)) {
                throw new BridgeException(filteredElement,
                                          ERR_CSS_URI_BAD_TARGET,
View Full Code Here

    public static ClipRable convertClipPath(Element clipedElement,
                                            GraphicsNode clipedNode,
                                            BridgeContext ctx) {
        CSSOMReadOnlyStyleDeclaration decl = getComputedStyle(clipedElement);

        CSSPrimitiveValue clipValue =
            (CSSPrimitiveValue)decl.getPropertyCSSValueInternal
            (CSS_CLIP_PATH_PROPERTY);

        switch(clipValue.getPrimitiveType()){
        case CSSPrimitiveValue.CSS_IDENT:
            return null; // 'clip-path:none'
        case CSSPrimitiveValue.CSS_URI:
            String uri = clipValue.getStringValue();
            Element clipPath = ctx.getReferencedElement(clipedElement, uri);
            Bridge bridge = ctx.getBridge(clipPath);
            if (bridge == null || !(bridge instanceof ClipBridge)) {
                throw new BridgeException(clipedElement,
                                          ERR_CSS_URI_BAD_TARGET,
View Full Code Here

    public static Mask convertMask(Element maskedElement,
                                   GraphicsNode maskedNode,
                                   BridgeContext ctx) {
        CSSOMReadOnlyStyleDeclaration decl = getComputedStyle(maskedElement);

        CSSPrimitiveValue maskValue =
            (CSSPrimitiveValue)decl.getPropertyCSSValueInternal
            (CSS_MASK_PROPERTY);

        switch(maskValue.getPrimitiveType()){
        case CSSPrimitiveValue.CSS_IDENT:
            return null; // 'mask:none'
        case CSSPrimitiveValue.CSS_URI:
            String uri = maskValue.getStringValue();
            Element mask = ctx.getReferencedElement(maskedElement, uri);
            Bridge bridge = ctx.getBridge(mask);
            if (bridge == null || !(bridge instanceof MaskBridge)) {
                throw new BridgeException(maskedElement,
                                          ERR_CSS_URI_BAD_TARGET,
View Full Code Here

        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

            (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

TOP

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

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.