Package org.apache.batik.bridge

Examples of org.apache.batik.bridge.BridgeContext$DOMMouseOutEventListener


    }

    public void registerElement(Element e, String desc) {
        registerObjectDesc(e, desc);
        UpdateManager um = getTheCanvas().getUpdateManager();
        BridgeContext bc = um.getBridgeContext();
        GraphicsNode gn = bc.getGraphicsNode(e);
        if (gn != null)
            registerObjectDesc(gn, desc+"_GN");
        if (e instanceof SVGOMElement) {
            SVGOMElement svge = (SVGOMElement)e;
            SVGContext svgctx = svge.getSVGContext();
View Full Code Here


        }
    }

    public void registerResourceContext(String uriSubstring, String desc) {
        UpdateManager um = getTheCanvas().getUpdateManager();
        BridgeContext bc = um.getBridgeContext();
        BridgeContext[] ctxs = bc.getChildContexts();
        for (int i = 0; i < ctxs.length; i++) {
            bc = ctxs[i];
            if (bc == null) {
                continue;
            }
            String url = ((SVGOMDocument) bc.getDocument()).getURL();
            if (url.indexOf(uriSubstring) != -1) {
                registerObjectDesc(ctxs[i], desc);
            }
        }
    }
View Full Code Here

        registerObjectDesc(canvas.getGraphicsNode(), "GVT");
        UpdateManager um = canvas.getUpdateManager();
        if (um == null) {
            return;
        }
        BridgeContext bc = um.getBridgeContext();
        registerObjectDesc(um, "updateManager");
        registerObjectDesc(bc, "bridgeContext");
        BridgeContext[] subCtxs = bc.getChildContexts();
        for (int i = 0; i < subCtxs.length; i++) {
            if (subCtxs[i] != null) {
                SVGOMDocument doc = (SVGOMDocument) subCtxs[i].getDocument();
                registerObjectDesc(subCtxs[i], "BridgeContext_" + doc.getURL());
            }
View Full Code Here

        // Now that the SVG file has been loaded, build
        // a GVT Tree from it
        TestUserAgent userAgent = new TestUserAgent();
        GVTBuilder builder = new GVTBuilder();
        BridgeContext ctx = new BridgeContext(userAgent);
        ctx.setDynamic(true);

        builder.build(ctx, doc);
        BaseScriptingEnvironment scriptEnvironment
            = new BaseScriptingEnvironment(ctx);
        scriptEnvironment.loadScripts();
View Full Code Here

     */
    protected BridgeContext createBridgeContext(SVGOMDocument doc) {
        if (loader == null) {
            loader = new DocumentLoader(userAgent);
        }
        BridgeContext result;
        if (doc.isSVG12()) {
            result = new SVG12BridgeContext(userAgent, loader);
        } else {
            result = new BridgeContext(userAgent, loader);
        }
        return result;
    }
View Full Code Here

        // Now that the SVG file has been loaded, build
        // a GVT Tree from it
        //
        UserAgent userAgent = buildUserAgent();
        GVTBuilder builder = new GVTBuilder();
        BridgeContext ctx = new BridgeContext(userAgent);
        ctx.setDynamic(true);

        try {
            builder.build(ctx, doc);
            BaseScriptingEnvironment scriptEnvironment
                = new BaseScriptingEnvironment(ctx);
View Full Code Here

        // method (this allows FOP to register it's bridges).
        return createBridgeContext();
    }

    protected BridgeContext createBridgeContext() {
        return new BridgeContext(userAgent);
    }
View Full Code Here

        this.files = files;
        UserAgentAdapter ua = new UserAgentAdapter();
        renderer  = new StaticRenderer();
        userAgent = ua;
        loader    = new DocumentLoader(userAgent);
        ctx       = new BridgeContext(userAgent, loader);
        ua.setBridgeContext(ctx);

        if (size == null) {
            size = Toolkit.getDefaultToolkit().getScreenSize();
        }
View Full Code Here

    }
   
    /** {@inheritDoc} */
    protected BridgeContext createBridgeContext() {

        BridgeContext ctx = new BridgeContext(userAgent);
        if (!isTextStroked()) {
            TextHandler handler = graphics.getCustomTextHandler();
            if (handler instanceof NativeTextHandler) {
                NativeTextHandler nativeTextHandler = (NativeTextHandler)handler;
                PSTextPainter textPainter = new PSTextPainter(nativeTextHandler);
                ctx.setTextPainter(textPainter);
                ctx.putBridge(new PSTextElementBridge(textPainter));
            }
        }

        //ctx.putBridge(new PSImageElementBridge());
        return ctx;
View Full Code Here

        PSGraphics2D graphics = new PSGraphics2D(strokeText, gen);
        graphics.setGraphicContext(new org.apache.xmlgraphics.java2d.GraphicContext());

        GVTBuilder builder = new GVTBuilder();
        NativeTextHandler nativeTextHandler = null;
        BridgeContext ctx = new BridgeContext(ua);
        if (!strokeText) {
            nativeTextHandler = new NativeTextHandler(graphics, psInfo.getFontInfo());
            graphics.setCustomTextHandler(nativeTextHandler);
            PSTextPainter textPainter = new PSTextPainter(nativeTextHandler);
            ctx.setTextPainter(textPainter);           
            PSTextElementBridge tBridge = new PSTextElementBridge(textPainter);
            ctx.putBridge(tBridge);
        }

        GraphicsNode root;
        try {
            root = builder.build(ctx, doc);
        } catch (Exception e) {
            log.error("SVG graphic could not be built: "
                                   + e.getMessage(), e);
            return;
        }
        // get the 'width' and 'height' attributes of the SVG document
        float w = (float)ctx.getDocumentSize().getWidth() * 1000f;
        float h = (float)ctx.getDocumentSize().getHeight() * 1000f;

        float sx = psInfo.getWidth() / (float)w;
        float sy = psInfo.getHeight() / (float)h;

        ctx = null;
View Full Code Here

TOP

Related Classes of org.apache.batik.bridge.BridgeContext$DOMMouseOutEventListener

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.