Package org.w3c.dom.css

Examples of org.w3c.dom.css.CSSPrimitiveValue


        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

        float stopOpacity = PaintServer.convertOpacity
            (decl.getPropertyCSSValueInternal(CSS_STOP_OPACITY_PROPERTY));
        opacity *= stopOpacity;

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

     * @param ctx the context used to resolve relative value
     */
    public static float cssOtherCoordinateToUserSpace(CSSValue v,
                                                      String prop,
                                                      Context ctx) {
        CSSPrimitiveValue pv = (CSSPrimitiveValue)v;
        short type = pv.getPrimitiveType();
        return cssToUserSpace(pv.getFloatValue(type),
                              type,
                              OTHER_LENGTH,
                              ctx);
    }
View Full Code Here

     * @param ctx the context used to resolve relative value
     */
    public static float cssHorizontalCoordinateToUserSpace(CSSValue v,
                                                           String prop,
                                                           Context ctx) {
        CSSPrimitiveValue pv = (CSSPrimitiveValue)v;
        short type = pv.getPrimitiveType();
        return cssToUserSpace(pv.getFloatValue(type),
                              type,
                              HORIZONTAL_LENGTH,
                              ctx);
    }
View Full Code Here

     * @param ctx the context used to resolve relative value
     */
    public static float cssVerticalCoordinateToUserSpace(CSSValue v,
                                                         String prop,
                                                         Context ctx) {
        CSSPrimitiveValue pv = (CSSPrimitiveValue)v;
        short type = pv.getPrimitiveType();
        return cssToUserSpace(pv.getFloatValue(type),
                              type,
                              VERTICAL_LENGTH,
                              ctx);
    }
View Full Code Here

     * @param ctx the context used to resolve relative value
     */
    public static float cssOtherLengthToUserSpace(CSSValue v,
                                                  String prop,
                                                  Context ctx) {
        CSSPrimitiveValue pv = (CSSPrimitiveValue)v;
        short type = pv.getPrimitiveType();
        return cssLengthToUserSpace(pv.getFloatValue(type),
                                    prop,
                                    type,
                                    OTHER_LENGTH,
                                    ctx);
    }
View Full Code Here

     * @param ctx the context used to resolve relative value
     */
    public static float cssHorizontalLengthToUserSpace(CSSValue v,
                                                       String prop,
                                                       Context ctx) {
        CSSPrimitiveValue pv = (CSSPrimitiveValue)v;
        short type = pv.getPrimitiveType();
        return cssLengthToUserSpace(pv.getFloatValue(type),
                                    prop,
                                    type,
                                    HORIZONTAL_LENGTH,
                                    ctx);
    }
View Full Code Here

     * @param ctx the context used to resolve relative value
     */
    public static float cssVerticalLengthToUserSpace(CSSValue v,
                                                     String prop,
                                                     Context ctx) {
        CSSPrimitiveValue pv = (CSSPrimitiveValue)v;
        short type = pv.getPrimitiveType();
        return cssLengthToUserSpace(pv.getFloatValue(type),
                                    prop,
                                    type,
                                    VERTICAL_LENGTH,
                                    ctx);
    }
View Full Code Here

     * @param v the value to convert
     * @param d HORIZONTAL_LENGTH, VERTICAL_LENGTH, or OTHER_LENGTH
     * @param ctx the context
     */
    protected static float pixelsToEms(float v, short d, Context ctx) {
        CSSPrimitiveValue fontSize = ctx.getFontSize();
        short type = fontSize.getPrimitiveType();
        switch (type) {
            case CSSPrimitiveValue.CSS_IDENT:
                float fs = ctx.getMediumFontSize();
                fs = TextUtilities.parseFontSize(fontSize.getStringValue(), fs);
                return v / cssToUserSpace(fs,
                                          CSSPrimitiveValue.CSS_PT,
                                          d,
                                          ctx);
            default:
                return v / cssToUserSpace(fontSize.getFloatValue(type),
                                          type,
                                          d,
                                          ctx.getParentElementContext());
        }
    }
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.