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

Examples of org.apache.flex.forks.batik.css.engine.CSSEngine


            (XMLConstants.XML_EVENTS_NAMESPACE_URI, "DOMCharacterDataModified",
             domCharacterDataModifiedEventListener, true);

        doc.removeAnimatedAttributeListener(animatedAttributeListener);

        CSSEngine cssEngine = doc.getCSSEngine();
        if (cssEngine != null) {
            cssEngine.removeCSSEngineListener
                (cssPropertiesChangedListener);
            cssEngine.dispose();
            doc.setCSSEngine(null);
        }
    }
View Full Code Here


            Element fontFaceElement = (Element)fontFaceElements.item(i);
            ret.add(fontFaceBridge.createFontFace
                    (ctx, fontFaceElement));
        }

        CSSEngine engine = ((SVGOMDocument)doc).getCSSEngine();
        List sms = engine.getFontFaces();
        Iterator iter = sms.iterator();
        while (iter.hasNext()) {
            FontFaceRule ffr = (FontFaceRule)iter.next();
            ret.add(CSSFontFace.createCSSFontFace(engine, ffr));
        }
View Full Code Here

    protected static float extractOpacity(Element paintElement,
                                          float opacity,
                                          BridgeContext ctx) {
        Map refs = new HashMap();
        CSSEngine eng = CSSUtilities.getCSSEngine(paintElement);
        int pidx = eng.getPropertyIndex
            (SVG12CSSConstants.CSS_SOLID_OPACITY_PROPERTY);

        for (;;) {
            Value opacityVal =
                CSSUtilities.getComputedStyle(paintElement, pidx);
View Full Code Here

    protected static Color extractColor(Element paintElement,
                                        float opacity,
                                        BridgeContext ctx) {
        Map refs = new HashMap();
        CSSEngine eng = CSSUtilities.getCSSEngine(paintElement);
        int pidx = eng.getPropertyIndex
            (SVG12CSSConstants.CSS_SOLID_COLOR_PROPERTY);

        for (;;) {
            Value colorDef =
                CSSUtilities.getComputedStyle(paintElement, pidx);
View Full Code Here

            while (it.hasNext()) {
                sms[i++] = (ShorthandManager)it.next();
            }
        }

        CSSEngine result = createCSSEngine(doc, ctx, ep, vms, sms);
        doc.setCSSEngine(result);
        return result;
    }
View Full Code Here

    /**
     * Returns the override style declaration for this element.
     */
    public CSSStyleDeclaration getOverrideStyle() {
        if (overrideStyleDeclaration == null) {
            CSSEngine eng = ((SVGOMDocument) getOwnerDocument()).getCSSEngine();
            overrideStyleDeclaration = new OverrideStyleDeclaration(eng);
        }
        return overrideStyleDeclaration;
    }
View Full Code Here

    /**
     * Returns whether color interpolations should be done in linear RGB
     * color space rather than sRGB.
     */
    public boolean useLinearRGBColorInterpolation() {
        CSSEngine eng = ((SVGOMDocument) getOwnerDocument()).getCSSEngine();
        Value v = eng.getComputedStyle(this, null,
                                       SVGCSSEngine.COLOR_INTERPOLATION_INDEX);
        return v.getStringValue().charAt(0) == 'l';
    }
View Full Code Here

    /**
     * <b>DOM</b>: Implements {@link org.w3c.dom.svg.SVGStylable#getStyle()}.
     */
    public CSSStyleDeclaration getStyle() {
        if (style == null) {
            CSSEngine eng = ((SVGOMDocument)getOwnerDocument()).getCSSEngine();
            style = new StyleDeclaration(eng);
            putLiveAttributeValue(null, SVG_STYLE_ATTRIBUTE, style);
        }
        return style;
    }
View Full Code Here

    public CSSValue getPresentationAttribute(String name) {
        CSSValue result = (CSSValue)getLiveAttributeValue(null, name);
        if (result != null)
            return result;

        CSSEngine eng = ((SVGOMDocument)getOwnerDocument()).getCSSEngine();
        int idx = eng.getPropertyIndex(name);
        if (idx == -1)
            return null;

        if (idx > SVGCSSEngine.FINAL_INDEX) {
            if (eng.getValueManagers()[idx] instanceof SVGPaintManager) {
                result = new PresentationAttributePaintValue(eng, name);
            }
            if (eng.getValueManagers()[idx] instanceof SVGColorManager) {
                result = new PresentationAttributeColorValue(eng, name);
            }
        } else {
            switch (idx) {
            case SVGCSSEngine.FILL_INDEX:
View Full Code Here

    int indentIndex       = -1;
    int textAlignIndex    = -1;
    int lineHeightIndex   = -1;

    protected void initCSSPropertyIndexes(Element e) {
        CSSEngine eng = CSSUtilities.getCSSEngine(e);
        marginTopIndex    = eng.getPropertyIndex(SVG12CSSConstants.CSS_MARGIN_TOP_PROPERTY);
        marginRightIndex  = eng.getPropertyIndex(SVG12CSSConstants.CSS_MARGIN_RIGHT_PROPERTY);
        marginBottomIndex = eng.getPropertyIndex(SVG12CSSConstants.CSS_MARGIN_BOTTOM_PROPERTY);
        marginLeftIndex   = eng.getPropertyIndex(SVG12CSSConstants.CSS_MARGIN_LEFT_PROPERTY);
        indentIndex       = eng.getPropertyIndex(SVG12CSSConstants.CSS_INDENT_PROPERTY);
        textAlignIndex    = eng.getPropertyIndex(SVG12CSSConstants.CSS_TEXT_ALIGN_PROPERTY);
        lineHeightIndex   = eng.getPropertyIndex(SVG12CSSConstants.CSS_LINE_HEIGHT_PROPERTY);
    }
View Full Code Here

TOP

Related Classes of org.apache.flex.forks.batik.css.engine.CSSEngine

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.