Package org.apache.batik.bridge

Examples of org.apache.batik.bridge.GVTBuilder.build()


        // build the GVT tree
        GVTBuilder builder = new GVTBuilder();
        BridgeContext ctx = new BridgeContext(userAgent);
        GraphicsNode gvtRoot;
        try {
            gvtRoot = builder.build(ctx, svgDoc);
        } catch (BridgeException ex) {
            throw new TranscoderException(ex);
        }
        // get the 'width' and 'height' attributes of the SVG document
        float docWidth = (float)ctx.getDocumentSize().getWidth();
View Full Code Here


        GVTBuilder builder = new GVTBuilder();
        BridgeContext ctx = new BridgeContext(userAgent);
        ctx.setDynamic(true);

        try {
            builder.build(ctx, doc);
            BaseScriptingEnvironment scriptEnvironment
                = new BaseScriptingEnvironment(ctx);
            scriptEnvironment.loadScripts();
            scriptEnvironment.dispatchSVGLoadEvent();
        } catch (BridgeException e){
View Full Code Here

        ctx.setDynamic(true);

        // We expect either a SecurityException or a BridgeException
        // with ERR_URI_UNSECURE.
        try {
            builder.build(ctx, doc);
            if (secure) {
                failures.addElement(EXTERNAL_STYLESHEET_ID);
            }
        } catch (BridgeException e){
            if (!secure
View Full Code Here

            }

            insertionPoint.appendChild(target);

            try {
                builder.build(ctx, cloneDoc);
                if (secure) {
                    // If we get here, it means that no SecurityException
                    // was thrown, which is wrong.
                    failures.addElement(id);
                }
View Full Code Here

        // build the GVT tree
        GVTBuilder builder = new GVTBuilder();
        BridgeContext ctx = new BridgeContext(userAgent);
        GraphicsNode gvtRoot;
        try {
            gvtRoot = builder.build(ctx, svgDoc);
        } catch (BridgeException ex) {
            throw new TranscoderException(ex);
        }
        // get the 'width' and 'height' attributes of the SVG document
        float docWidth = (float)ctx.getDocumentSize().getWidth();
View Full Code Here

             BaseScriptingEnvironment.isDynamicDocument(svgDoc));
        ctx.setDynamic(isDynamic);

        GraphicsNode gvtRoot;
        try {
            gvtRoot = builder.build(ctx, svgDoc);
            // dispatch an 'onload' event if needed
            if (ctx.isDynamic()) {
                BaseScriptingEnvironment se = new BaseScriptingEnvironment(ctx);
                se.loadScripts();
                se.dispatchSVGLoadEvent();
View Full Code Here

            GVTBuilder     builder   = new GVTBuilder();

            ctx     = new BridgeContext(userAgent, loader);
            ctx.setDynamic(true);
            svgDoc  = (SVGDocument)loader.loadDocument(svg.toString());
            gvtRoot = builder.build(ctx, svgDoc);
        } catch(Exception e) {
            StringWriter trace = new StringWriter();
            e.printStackTrace(new PrintWriter(trace));
            report.setErrorCode(ERROR_READING_SVG);
            report.setDescription(new TestReport.Entry[] {
View Full Code Here

        GVTBuilder builder = new GVTBuilder();
        BridgeContext ctx = new BridgeContext(userAgent);
        ctx.setDynamic(true);

        try {
            builder.build(ctx, doc);
            BaseScriptingEnvironment scriptEnvironment
                = new BaseScriptingEnvironment(ctx);
            scriptEnvironment.loadScripts();
            scriptEnvironment.dispatchSVGLoadEvent();
        } catch (Exception e){
View Full Code Here

        GVTBuilder builder = new GVTBuilder();
        BridgeContext ctx = new BridgeContext(userAgent);
        ctx.setDynamic(true);

        try {
            builder.build(ctx, doc);
            BaseScriptingEnvironment scriptEnvironment
                = new BaseScriptingEnvironment(ctx);
            scriptEnvironment.loadScripts();
            scriptEnvironment.dispatchSVGLoadEvent();
        } catch (BridgeException e){
View Full Code Here

    ImageRenderer renderer = rendererFactory.createStaticImageRenderer();

    GVTBuilder builder = new GVTBuilder();
    BridgeContext ctx = new BridgeContext(new UserAgentAdapter());
    ctx.setDynamicState(BridgeContext.STATIC);
    GraphicsNode rootNode = builder.build(ctx, document);

    renderer.setTree(rootNode);
   
    float docWidth  = (float) ctx.getDocumentSize().getWidth();
    float docHeight = (float) ctx.getDocumentSize().getHeight();
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.