Package org.apache.batik.svggen

Examples of org.apache.batik.svggen.SVGGeneratorContext$GraphicContextDefaults


      if ((height == -1) || (width == -1)) {
        throw new IOException("Could not determine map dimensions");
      }

      SVGGeneratorContext context = setupContext();
      SVGGraphics2D g = new SVGGraphics2D(context, true);

      g.setSVGCanvasSize(new Dimension((int) width, (int) height));

      // turn off/on anti aliasing
View Full Code Here


        BufferedImage image = null;
       
        SVGOMImageElement imageelement = new SVGOMImageElement("", clone);
        SimpleImageHandler imagehandler = new SimpleImageHandler(new ImageHandlerBase64Encoder());
       
        SVGGeneratorContext svgcxt = SVGGeneratorContext.createDefault(clone);
       
        imagehandler.handleImage((RenderedImage) image, imageelement, 
            imgx, imgy,
          imgwidth, imgheight,
          svgcxt);
View Full Code Here

  private static synchronized void handleSVG (ByteArrayOutputStream baos, JFreeChart chart, int width, int height)
    throws IOException {
    OutputStreamWriter writer = new OutputStreamWriter(baos, "UTF-8");
    DOMImplementation domImpl = GenericDOMImplementation.getDOMImplementation();
    Document document = domImpl.createDocument("cewolf-svg", "svg", null);
    SVGGeneratorContext ctx = SVGGeneratorContext.createDefault(document);
//    ctx.setComment("Generated by Cewolf using JFreeChart and Apache Batik SVG Generator");
    SVGGraphics2D svgGenerator = new SVGGraphics2D(ctx, false);
    svgGenerator.setSVGCanvasSize(new Dimension(width, height));
    chart.draw(svgGenerator, new Rectangle2D.Double(0, 0, width, height), null);
    svgGenerator.stream(writer, false);
View Full Code Here

      DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
      DocumentBuilder builder = factory.newDocumentBuilder();
      DOMImplementation domImpl = builder.getDOMImplementation();
      Document doc =
        domImpl.createDocument("http://www.w3.org/2000/svg", "svg", null);
      SVGGeneratorContext ctx = SVGGeneratorContext.createDefault(doc);
      ctx.setComment("Generated by TinyUML with Batik SVG Generator");
      ctx.setEmbeddedFontsOn(true);
      SVGGraphics2D g2d = new SVGGraphics2D(ctx, true);
      g2d.setSVGCanvasSize(editor.getTotalCanvasSize());
      editor.paintComponentNonScreen(g2d);

      // write the file
View Full Code Here

      DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
      DocumentBuilder builder = factory.newDocumentBuilder();
      DOMImplementation domImpl = builder.getDOMImplementation();
      Document doc =
        domImpl.createDocument("http://www.w3.org/2000/svg", "svg", null);
      SVGGeneratorContext ctx = SVGGeneratorContext.createDefault(doc);
      ctx.setComment("Generated by TinyUML with Batik SVG Generator");
      ctx.setEmbeddedFontsOn(true);
      SVGGraphics2D g2d = new SVGGraphics2D(ctx, true);
      g2d.setSVGCanvasSize(editor.getTotalCanvasSize());
      editor.paintComponentNonScreen(g2d);

      // write the file
View Full Code Here

                DOMImplementation domImpl = GenericDOMImplementation.getDOMImplementation();

                // Create an instance of org.w3c.dom.Document
                Document document = domImpl.createDocument(null, "svg", null);

                SVGGeneratorContext ctx = SVGGeneratorContext.createDefault(document);

                //ctx.setEmbeddedFontsOn(true);
                // Create an instance of the SVG Generator
                g2d = new SVGGraphics2D(ctx, false);
View Full Code Here

                DOMImplementation domImpl = GenericDOMImplementation.getDOMImplementation();

                // Create an instance of org.w3c.dom.Document
                Document document = domImpl.createDocument(null, "svg", null);

                SVGGeneratorContext ctx = SVGGeneratorContext.createDefault(document);

                //ctx.setEmbeddedFontsOn(true);
                // Create an instance of the SVG Generator
                g2d = new SVGGraphics2D(ctx, false);
View Full Code Here

                DOMImplementation domImpl = GenericDOMImplementation.getDOMImplementation();

                // Create an instance of org.w3c.dom.Document
                Document document = domImpl.createDocument(null, "svg", null);

                SVGGeneratorContext ctx = SVGGeneratorContext.createDefault(document);

                //ctx.setEmbeddedFontsOn(true);
                // Create an instance of the SVG Generator
                g2d = new SVGGraphics2D(ctx, false);
View Full Code Here

      DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
      DocumentBuilder builder = factory.newDocumentBuilder();
      DOMImplementation domImpl = builder.getDOMImplementation();
      Document doc =
        domImpl.createDocument("http://www.w3.org/2000/svg", "svg", null);
      SVGGeneratorContext ctx = SVGGeneratorContext.createDefault(doc);
      ctx.setComment("Generated by TinyUML with Batik SVG Generator");
      ctx.setEmbeddedFontsOn(true);
      SVGGraphics2D g2d = new SVGGraphics2D(ctx, true);
      editor.paintComponentNonScreen(g2d);
      FileOutputStream out = new FileOutputStream(file);
      OutputStreamWriter writer = new OutputStreamWriter(out, "UTF-8");
      g2d.stream(writer);
View Full Code Here

      DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
      DocumentBuilder builder = factory.newDocumentBuilder();
      DOMImplementation domImpl = builder.getDOMImplementation();
      Document doc =
        domImpl.createDocument("http://www.w3.org/2000/svg", "svg", null);
      SVGGeneratorContext ctx = SVGGeneratorContext.createDefault(doc);
      ctx.setComment("Generated by TinyUML with Batik SVG Generator");
      ctx.setEmbeddedFontsOn(true);
      SVGGraphics2D g2d = new SVGGraphics2D(ctx, true);
      g2d.setSVGCanvasSize(editor.getTotalCanvasSize());
      editor.paintComponentNonScreen(g2d);

      // write the file
View Full Code Here

TOP

Related Classes of org.apache.batik.svggen.SVGGeneratorContext$GraphicContextDefaults

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.