Package org.apache.batik.dom.svg

Examples of org.apache.batik.dom.svg.DefaultSVGContext


        DocumentState state = (DocumentState)cacheMap.get(uri);
        if (state == null) {
            //System.out.println("loading: "+uri);
            // load the document
            Document document = documentFactory.createDocument(uri);
            DefaultSVGContext ctx
                = (DefaultSVGContext)((SVGOMDocument)document).getSVGContext();
            ctx.setUserStyleSheetURI(userAgent.getUserStyleSheetURI());

            DocumentDescriptor desc = documentFactory.getDocumentDescriptor();
            state = new DocumentState(uri, document, desc);
            cacheMap.put(uri, state);
        }
View Full Code Here


        }
        SVGDocument svgDoc = (SVGDocument)document;
        SVGSVGElement root = svgDoc.getRootElement();
        // initialize the SVG document with the appropriate context
        String parserClassname = (String)hints.get(KEY_XML_PARSER_CLASSNAME);
        DefaultSVGContext svgCtx = new DefaultSVGContext();
        svgCtx.setPixelToMM(userAgent.getPixelToMM());
        ((SVGOMDocument)document).setSVGContext(svgCtx);

        boolean stroke = true;
        if (hints.containsKey(KEY_STROKE_TEXT)) {
            stroke = ((Boolean)hints.get(KEY_STROKE_TEXT)).booleanValue();
View Full Code Here

        SVGDocument svgDoc = (SVGDocument) document;
        SVGSVGElement root = svgDoc.getRootElement();
        // initialize the SVG document with the appropriate context
        String parserClassname =
          (String) hints.get(KEY_XML_PARSER_CLASSNAME);
        DefaultSVGContext svgCtx = new DefaultSVGContext();
        svgCtx.setPixelToMM(userAgent.getPixelToMM());
        ((SVGOMDocument) document).setSVGContext(svgCtx);

        // build the GVT tree
        GVTBuilder builder = new GVTBuilder();
        ImageRendererFactory rendFactory = new StaticRendererFactory();
View Full Code Here

                Messages.formatMessage("notsvg", null));
        }
        SVGDocument svgDoc = (SVGDocument)document;
        SVGSVGElement root = svgDoc.getRootElement();
        // initialize the SVG document with the appropriate context
        DefaultSVGContext svgCtx = new DefaultSVGContext();
        svgCtx.setPixelToMM(userAgent.getPixelToMM());
        ((SVGOMDocument)document).setSVGContext(svgCtx);

        // build the GVT tree
        GVTBuilder builder = new GVTBuilder();
        ImageRendererFactory rendFactory = new StaticRendererFactory();
View Full Code Here

            throw new TranscoderException("");
        }
        SVGDocument svgDoc = (SVGDocument)document;
        SVGSVGElement root = svgDoc.getRootElement();
        // initialize the SVG document with the appropriate context
        DefaultSVGContext svgCtx = new DefaultSVGContext();
        svgCtx.setPixelToMM(userAgent.getPixelToMM());
        ((SVGOMDocument)document).setSVGContext(svgCtx);

        // build the GVT tree
        GVTBuilder builder = new GVTBuilder();
        GraphicsNodeRenderContext rc = getRenderContext();
View Full Code Here

        case (DocumentLoadingEvent.START_LOADING):
            setCursor(WAIT_CURSOR);
            break;
        case (DocumentLoadingEvent.LOADED):
            // New doc has been loaded, prepare for new view
            DefaultSVGContext dc = new DefaultSVGContext();
            SVGOMDocument doc = (SVGOMDocument) e.getValue();
            dc.setUserAgent(this);
            dc.setUserStyleSheetURI(userStyleSheetURI);
            doc.setSVGContext(dc);
            canvas.setSVGDocument(null);
            break;
        case (DocumentLoadingEvent.DONE):
            doc = (SVGOMDocument) e.getValue();
View Full Code Here

        BridgeContext ctx =
            new DefaultBridgeContext(getParserClassName(), svgDocument);
        ctx.setGVTBuilder(getGVTBuilder());
        ctx.setCurrentViewport(getDefaultViewport());

        DefaultSVGContext svgCtx = new DefaultSVGContext();
        svgCtx.setUserAgent(ctx.getUserAgent());
        //svgCtx.setUserStyleSheetURI(null);
        ((SVGOMDocument) svgDocument).setSVGContext(svgCtx);

        ParserFactory parserFactory = ctx.getParserFactory();
View Full Code Here

         * Take action on receipt of a DocumentEvent.
         */
        public void processDocumentEvent(DocumentEvent e) {
            if (e.classid == DocumentEvent.LOADING) {
                if (e.type == DocumentLoadingEvent.DONE) {
                    DefaultSVGContext dc = new DefaultSVGContext();
                    SVGOMDocument doc = (SVGOMDocument)e.getValue();
                    dc.setUserAgent(ViewerFrame.this);
                    doc.setSVGContext(dc);
                    canvas.setSVGDocument(doc);
                }
            } else if (e.classid == DocumentEvent.PROPERTY) {
                //
View Full Code Here

            stopAction.update(true);
            statusBar.setMainMessage(resources.getString("Document.loading"));
            break;
        case (DocumentLoadingEvent.LOADED):
            // New doc has been loaded, prepare for new view
            DefaultSVGContext dc = new DefaultSVGContext();
            SVGOMDocument doc = (SVGOMDocument) e.getValue();
            dc.setUserAgent(ViewerFrame.this);
            dc.setUserStyleSheetURI(userStyleSheetURI);
            doc.setSVGContext(dc);
            domViewer.setDocument(doc, (ViewCSS)doc.getDocumentElement());
            statusBar.setMainMessage(resources.getString("Document.creating"));
            break;
        case (DocumentLoadingEvent.DONE):
View Full Code Here

      ((SVGOMDocument)svgDoc).enableAlternateStyleSheet(stylesheetName);
        }

        SVGSVGElement root = svgDoc.getRootElement();
        // initialize the SVG document with the appropriate context
        DefaultSVGContext svgCtx = new DefaultSVGContext();
        svgCtx.setPixelToMM(userAgent.getPixelToMM());
        ((SVGOMDocument)document).setSVGContext(svgCtx);

        // build the GVT tree
        GVTBuilder builder = new GVTBuilder();
        ImageRendererFactory rendFactory = new StaticRendererFactory();
View Full Code Here

TOP

Related Classes of org.apache.batik.dom.svg.DefaultSVGContext

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.