Examples of CSSEngine


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

     * @param imgDocument the SVG document that represents the image
     */
    protected GraphicsNode createSVGImageNode(BridgeContext ctx,
                                              Element e,
                                              SVGDocument imgDocument) {
        CSSEngine eng = ((SVGOMDocument)imgDocument).getCSSEngine();
        if (eng != null) {
            subCtx = (BridgeContext)eng.getCSSContext();
        } else {
            subCtx = new BridgeContext(ctx.getUserAgent(),
                                       ctx.getDocumentLoader());
            subCtx.setGVTBuilder(ctx.getGVTBuilder());
            subCtx.setDocument(imgDocument);
View Full Code Here

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

                                     ExtendedParser           ep,
                                     ValueManager     []      vms,
                                     ShorthandManager []      sms) {
                                    
        URL durl = ((SVGOMDocument)doc).getURLObject();
        CSSEngine result = new SVGCSSEngine(doc, durl, ep, vms, sms, ctx);

        URL url = getClass().getResource("resources/UserAgentStyleSheet.css");
        if (url != null) {
            InputSource is = new InputSource(url.toString());
            result.setUserAgentStyleSheet
                (result.parseStyleSheet(is, url, "all"));
        }

        return result;
    }
View Full Code Here

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

    /**
     * Returns the computed style of the given property.
     */
    public static Value getComputedStyle(Element e, int property) {
        CSSEngine engine = getCSSEngine(e);
        if (engine == null) return null;
        return engine.getComputedStyle((CSSStylableElement)e,
                                       null, property);
    }
View Full Code Here

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

        if (uri.length() != 0)
            localRefElement.setAttributeNS(XML_NAMESPACE_URI,
                                           "base",
                                           uri);

        CSSEngine engine    = CSSUtilities.getCSSEngine(localRefElement);
        CSSEngine refEngine = CSSUtilities.getCSSEngine(refElement);
       
        engine.importCascadedStyleMaps(refElement, refEngine, localRefElement);
    }
View Full Code Here

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

    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

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

    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

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

            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

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

    /**
     * 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

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

    /**
     * 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

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

    /**
     * <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
TOP
Copyright © 2018 www.massapi.com. 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.