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

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


    /**
     * Checks if the cursor property on the input element is set to auto
     */
    public static boolean isAutoCursor(Element e) {
        Value cursorValue =
            CSSUtilities.getComputedStyle(e,
                                          SVGCSSEngine.CURSOR_INDEX);

        boolean isAuto = false;
        if (cursorValue != null){
            if(
               cursorValue.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE
               &&
               cursorValue.getPrimitiveType() == CSSPrimitiveValue.CSS_IDENT
               &&
               cursorValue.getStringValue().charAt(0) == 'a'
               ) {
                isAuto = true;
            } else if (
                       cursorValue.getCssValueType() == CSSValue.CSS_VALUE_LIST
                       &&
                       cursorValue.getLength() == 1) {
                Value lValue = cursorValue.item(0);
                if (lValue != null
                    &&
                    lValue.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE
                    &&
                    lValue.getPrimitiveType() == CSSPrimitiveValue.CSS_IDENT
                    &&
                    lValue.getStringValue().charAt(0) == 'a') {
                    isAuto = true;
                }
            }
        }

View Full Code Here


     * @param e the element
     * @param hints a RenderingHints to fill, or null.
     */
    public static RenderingHints convertShapeRendering(Element e,
                                                       RenderingHints hints) {
        Value  v = getComputedStyle(e, SVGCSSEngine.SHAPE_RENDERING_INDEX);
        String s = v.getStringValue();
        int    len = s.length();
        if ((len == 4) && (s.charAt(0) == 'a')) // auto
            return hints;
        if (len < 10) return hints;  // Unknown.

View Full Code Here

     * @param e the element
     * @param hints a RenderingHints to fill, or null.
     */
    public static RenderingHints convertTextRendering(Element e,
                                                      RenderingHints hints) {
        Value v = getComputedStyle(e, SVGCSSEngine.TEXT_RENDERING_INDEX);
        String s = v.getStringValue();
        int    len = s.length();
        if ((len == 4) && (s.charAt(0) == 'a')) // auto
            return hints;
        if (len < 13) return hints;  // Unknown.

View Full Code Here

     * @param e the element
     * @param hints a RenderingHints to fill, or null.
     */
    public static RenderingHints convertImageRendering(Element e,
                                                       RenderingHints hints) {
        Value v = getComputedStyle(e, SVGCSSEngine.IMAGE_RENDERING_INDEX);
        String s = v.getStringValue();
        int    len = s.length();
        if ((len == 4) && (s.charAt(0) == 'a')) // auto
            return hints;
        if (len < 13) return hints;  // Unknown.

View Full Code Here

     * @param e the element
     * @param hints a RenderingHints to fill, or null.
     */
    public static RenderingHints convertColorRendering(Element e,
                                                       RenderingHints hints) {
        Value v = getComputedStyle(e, SVGCSSEngine.COLOR_RENDERING_INDEX);
        String s = v.getStringValue();
        int    len = s.length();
        if ((len == 4) && (s.charAt(0) == 'a')) // auto
            return hints;
        if (len < 13) return hints;  // Unknown.

View Full Code Here

     * otherwise. Checks the 'display' property.
     *
     * @param e the element
     */
    public static boolean convertDisplay(Element e) {
        Value v = getComputedStyle(e, SVGCSSEngine.DISPLAY_INDEX);
        return v.getStringValue().charAt(0) != 'n';
    }
View Full Code Here

     * otherwise. Checks the 'visibility' property.
     *
     * @param e the element
     */
    public static boolean convertVisibility(Element e) {
        Value v = getComputedStyle(e, SVGCSSEngine.VISIBILITY_INDEX);
        return v.getStringValue().charAt(0) == 'v';
    }
View Full Code Here

     * specified element.
     *
     * @param e the element
     */
    public static Composite convertOpacity(Element e) {
        Value v = getComputedStyle(e, SVGCSSEngine.OPACITY_INDEX);
        float f = v.getFloatValue();
        if (f <= 0f) {
            return TRANSPARENT;
        } else if (f >= 1f) {
            return AlphaComposite.SrcOver;
        } else {
View Full Code Here

     * 'hidden'.
     *
     * @param e the element with the 'overflow' property
     */
    public static boolean convertOverflow(Element e) {
        Value v = getComputedStyle(e, SVGCSSEngine.OVERFLOW_INDEX);
        String s = v.getStringValue();
        return (s.charAt(0) == 'h') || (s.charAt(0) == 's');
    }
View Full Code Here

     * order top, right, bottom, left.
     *
     * @param e the element with the 'clip' property
     */
    public static float[] convertClip(Element e) {
        Value v = getComputedStyle(e, SVGCSSEngine.CLIP_INDEX);
        switch (v.getPrimitiveType()) {
        case CSSPrimitiveValue.CSS_RECT:
            float [] off = new float[4];
            off[0] = v.getTop().getFloatValue();
            off[1] = v.getRight().getFloatValue();
            off[2] = v.getBottom().getFloatValue();
            off[3] = v.getLeft().getFloatValue();
            return off;
        case CSSPrimitiveValue.CSS_IDENT:
            return null; // 'auto' means no offsets
        default:
            throw new Error(); // can't be reached
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.