Package org.apache.batik.dom.svg

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


                    doc = (SVGDocument)domSrc.getNode();
                } else {
                    in = new UnclosableInputStream(ImageUtil.needInputStream(src));
                    int length = in.available();
                    in.mark(length + 1);
                    SAXSVGDocumentFactory factory = new SAXSVGDocumentFactory(
                            getParserName());
                    doc = factory.createSVGDocument(src.getSystemId(), in);
                }
                ImageInfo info = createImageInfo(uri, context, doc);

                return info;
            } catch (NoClassDefFoundError ncdfe) {
View Full Code Here


                info.mimeType = getMimeType();
                info.str = SVGDOMImplementation.SVG_NAMESPACE_URI;

                length = fis.available();
                fis.mark(length + 1);
                SAXSVGDocumentFactory factory = new SAXSVGDocumentFactory(
                        XMLImage.getParserName());
                SVGDocument doc = (SVGDocument) factory.createSVGDocument(uri, fis);
                info.data = doc;

                Element e = doc.getRootElement();
                String s;
                SVGUserAgent userAg = new SVGUserAgent(pixelUnitToMM,
View Full Code Here

        try {
            // Quick and dirty hack. We should probably use a path resolver.
            this.path = (path.startsWith("/logisim/icons/")) ? path : "/logisim/icons/" + path;
            URL url = SVGIcon.class.getResource(this.path);
            String xmlParser = XMLResourceDescriptor.getXMLParserClassName();
            SAXSVGDocumentFactory df = new SAXSVGDocumentFactory(xmlParser);
            SVGDocument doc = df.createSVGDocument(url.toString());
            UserAgent userAgent = new UserAgentAdapter();
            DocumentLoader loader = new DocumentLoader(userAgent);
            BridgeContext ctx = new BridgeContext(userAgent, loader);
            ctx.setDynamicState(BridgeContext.DYNAMIC);
            GVTBuilder builder = new GVTBuilder();
View Full Code Here

 
  public SVGDocument loadMapAsDocument(Content map) throws IOException {
    String mapContent;
   
    mapContent = new String( DECODER.decodeBuffer(map.getContent()) );
    documentFactory = new SAXSVGDocumentFactory(parser);
    return (SVGDocument)documentFactory.createDocument( null, new StringReader(mapContent) );
  }
View Full Code Here

   */
  public SVGDocument loadMapAsDocument(String url) throws IOException {
    logger.debug(url);
    SVGDocument svgDoc = null;
    try{
      documentFactory = new SAXSVGDocumentFactory(parser);
      svgDoc = (SVGDocument)documentFactory.createDocument(url);
    }catch (Throwable e) {
      logger.error(e);
    }
      return svgDoc;
View Full Code Here

                    doc = (SVGDocument)domSrc.getNode();
                } else {
                    in = new UnclosableInputStream(ImageUtil.needInputStream(src));
                    int length = in.available();
                    in.mark(length + 1);
                    SAXSVGDocumentFactory factory = new SAXSVGDocumentFactory(
                            getParserName());
                    doc = factory.createSVGDocument(src.getSystemId(), in);
                }
                ImageInfo info = createImageInfo(uri, context, doc);

                return info;
            } catch (NoClassDefFoundError ncdfe) {
View Full Code Here

     * @param domImpl the DOM Implementation (not used)
     * @param parserClassname the XML parser classname
     */
    protected DocumentFactory createDocumentFactory(DOMImplementation domImpl,
            String parserClassname) {
        return new SAXSVGDocumentFactory(parserClassname);
    }
View Full Code Here

        return parserClassName;
    }

    protected void loadImage() throws FopImageException {
        try {
            SAXSVGDocumentFactory factory = new SAXSVGDocumentFactory(SVGImage.getParserName());
            doc = factory.createDocument(this.m_href.toExternalForm());
        } catch (Exception e) {
            MessageHandler.errorln("ERROR LOADING EXTERNAL SVG: " +
                                   e.getMessage());
        }
    }
View Full Code Here

     * @param domImpl the DOM Implementation (not used)
     * @param parserClassname the XML parser classname
     */
    protected DocumentFactory createDocumentFactory(
      DOMImplementation domImpl, String parserClassname) {
        return new SAXSVGDocumentFactory(parserClassname);
    }
View Full Code Here

     * Possibly need a slightly different design for the image stuff.
     */
    protected boolean loadImage(String uri) {
        // parse document and get the size attributes of the svg element
        try {
            SAXSVGDocumentFactory factory = new SAXSVGDocumentFactory(SVGImage.getParserName());
            SVGDocument doc = factory.createDocument(uri, imageStream);
            // should check the stream contains text data
            SVGSVGElement svg = doc.getRootElement();
            this.width =
              (int) svg.getWidth().getBaseVal().getValue();
            this.height =
View Full Code Here

TOP

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

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.