Examples of SVGGraphics2D


Examples of org.apache.batik.svggen.SVGGraphics2D

                SVGGeneratorContext ctx = SVGGeneratorContext.createDefault(document);

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

                Rectangle rect = GlobalFunction.checkMinimumViewport(view);
                Dimension size = new Dimension(rect.width * 2 + 10, rect.height * 2 + 10);

                g2d.translate(-rect.x * 2 + 5, -rect.y * 2 + 5);
View Full Code Here

Examples of org.apache.batik.svggen.SVGGraphics2D

                SVGGeneratorContext ctx = SVGGeneratorContext.createDefault(document);

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

                Rectangle rect = GlobalFunction.checkMinimumViewport(view);
                Dimension size = new Dimension(rect.width + 10, rect.height + 10);

                g2d.translate(-rect.x + 5, -rect.y + 5);
View Full Code Here

Examples of org.apache.batik.svggen.SVGGraphics2D

    /* uložíme graf do souboru */
    try {
      DOMImplementation domImpl = GenericDOMImplementation.getDOMImplementation();
      Document document = domImpl.createDocument(null, "svg", null);
      SVGGraphics2D svgGenerator = new SVGGraphics2D(document);
      /* tady se určuje velikost grafu */
      graf.draw(svgGenerator, new Rectangle2D.Double(0, 0, 640, 400));
      Writer out = new OutputStreamWriter(new FileOutputStream(new File(soubor)), "UTF-8");
      /** tady musí být FALSE, jinak je to rozsypané! */
      svgGenerator.stream(out, false);
                        out.close();
    } catch (IOException e) {
      throw new SVNstatistikaChybaVystupu("Nepodařilo se vytvořit SVG graf", e);
    }

View Full Code Here

Examples of org.apache.batik.svggen.SVGGraphics2D

    /* uložíme graf do souboru */
    try {
      DOMImplementation domImpl = GenericDOMImplementation.getDOMImplementation();
      Document document = domImpl.createDocument(null, "svg", null);
      SVGGraphics2D svgGenerator = new SVGGraphics2D(document);
      /* tady se určuje velikost grafu */
      graf.draw(svgGenerator, new Rectangle2D.Double(0, 0, 640, 400));
      Writer out = new OutputStreamWriter(new FileOutputStream(new File(soubor)), "UTF-8");
      /** tady musí být FALSE, jinak je to rozsypané! */
      svgGenerator.stream(out, false);
                        out.close();
    } catch (IOException e) {
      throw new SVNstatistikaChybaVystupu("Nepodařilo se vytvořit SVG graf", e);
    }

View Full Code Here

Examples of org.apache.batik.svggen.SVGGraphics2D

    // Create an instance of org.w3c.dom.Document.
    String svgNS = "http://www.w3.org/2000/svg";
    Document document = domImpl.createDocument(svgNS, "svg", null);

    // Create an instance of the SVG Generator.
    SVGGraphics2D svgGenerator = new SVGGraphics2D(document);

    PlotForTissue2 test = new PlotForTissue2();

    Map<Gene, List<Triplet>> groupedTrips = groupToFactor(trips);

    for (Gene factor : groupedTrips.keySet())
    {
      System.out.println("\nFactor = " + factor.getPrintable());
      List<Triplet> tripGroup = groupedTrips.get(factor);
      HashMap<String, Group> map = process(tripGroup);
      System.out.println("mods before filtering = " + map.size());
      filterMods(map);
      System.out.println("mods after filtering = " + map.size());

      if (!factor.id.startsWith("M"))
        try{writeDownGroups(map.values(),
          ("result/group_vals/" + comtype + "-" + factor.id + ".txt").replace("|", "_"));
        }catch (Throwable throwable){throwable.printStackTrace();}

      if (!map.isEmpty())
      {
        test.paint(svgGenerator, new ArrayList<Group>(map.values()), factor);
      }
    }

    // Finally, stream out SVG to the standard output using
    // UTF-8 encoding.
    boolean useCSS = true; // we want to use CSS style attributes
    Writer out = new OutputStreamWriter(new FileOutputStream(outFile + ".svg"), "UTF-8");
    svgGenerator.stream(out, useCSS);
  }
View Full Code Here

Examples of org.apache.batik.svggen.SVGGraphics2D

    // Create an instance of org.w3c.dom.Document.
    String svgNS = "http://www.w3.org/2000/svg";
    Document document = domImpl.createDocument(svgNS, "svg", null);

    // Create an instance of the SVG Generator.
    SVGGraphics2D svgGenerator = new SVGGraphics2D(document);

    // Read the triplet data
    List<Triplet> list = Triplet.readTrips(tripFile);

    for (Triplet t : list)
    {
      t.backFromURLToIDs();
      t.pvalGamma = Difference.calcGammaPval(t);
    }

    list = Triplet.selectModulator(list, "UBE2I");
//    StageAnalyzer.removeBadTars(list);

    for (Triplet t : list)
    {
      t.backFromIDToSymbol();
    }

    // Remove unclassified triplets
    Triplet.keepClassified(list);

    // Among the triplets with same M, F, and T, keep only the one with the most significant
    // gamma
    Triplet.keepMostSignif(list);

    HashMap<String, Group> map = process(list);

    // Filter out unqualyfying groups
    filterGroups(map);

    System.out.println("map.size() = " + map.size());

    // Render using SVG Graphics2D implementation.
    Plot plot = new Plot();

//    try
//    {
//      intiVerticalFonts();
//    }
//    catch (NoninvertibleTransformException e)
//    {
//      e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
//    }

    plot.paint(svgGenerator, new ArrayList<Group>(map.values()));

    // Finally, stream out SVG to the standard output using
    // UTF-8 encoding.
    boolean useCSS = true; // we want to use CSS style attributes
    Writer out = new OutputStreamWriter(new FileOutputStream(outFile), "UTF-8");
    svgGenerator.stream(out, useCSS);
  }
View Full Code Here

Examples of org.apache.batik.svggen.SVGGraphics2D

    // Create an instance of org.w3c.dom.Document.
    String svgNS = "http://www.w3.org/2000/svg";
    Document document = domImpl.createDocument(svgNS, "svg", null);

    // Create an instance of the SVG Generator.
    SVGGraphics2D svgGenerator = new SVGGraphics2D(document);

    PlotForTissue test = new PlotForTissue();

    Map<Gene, List<Triplet>> groupedTrips = groupToFactor(trips);

    for (Gene factor : groupedTrips.keySet())
    {
//      Triplet.keepMostSignif(trips);
      List<Triplet> tripGroup = groupedTrips.get(factor);
      HashMap<String, Group> map = process(tripGroup);
      filterMods(map);

      test.paint(svgGenerator, new ArrayList<Group>(map.values()), factor);
    }

    // Finally, stream out SVG to the standard output using
    // UTF-8 encoding.
    boolean useCSS = true; // we want to use CSS style attributes
    Writer out = new OutputStreamWriter(new FileOutputStream(outFile), "UTF-8");
    svgGenerator.stream(out, useCSS);
  }
View Full Code Here

Examples of org.apache.batik.svggen.SVGGraphics2D

    // Create an instance of org.w3c.dom.Document.
    String svgNS = "http://www.w3.org/2000/svg";
    Document document = domImpl.createDocument(svgNS, "svg", null);

    // Create an instance of the SVG Generator.
    SVGGraphics2D svgGenerator = new SVGGraphics2D(document);

    paint(svgGenerator, trips);

    // Finally, stream out SVG to the standard output using
    // UTF-8 encoding.
    boolean useCSS = true; // we want to use CSS style attributes
    Writer out = new OutputStreamWriter(new FileOutputStream(outFile), "UTF-8");
    svgGenerator.stream(out, useCSS);
  }
View Full Code Here

Examples of org.apache.batik.svggen.SVGGraphics2D

    DOMImplementation domImpl = GenericDOMImplementation.getDOMImplementation();

    // Create an instance of org.w3c.dom.Document.
    String svgNS = "http://www.w3.org/2000/svg";
    Document document = domImpl.createDocument(svgNS, "svg", null);
    SVGGraphics2D svgGenerator = new SVGGraphics2D(document);
    paint(svgGenerator);

    // Finally, stream out SVG to the standard output using
    // UTF-8 encoding.
    boolean useCSS = true; // we want to use CSS style attributes
    Writer out = new OutputStreamWriter(new FileOutputStream(outFile), "UTF-8");
    svgGenerator.stream(out, useCSS);
  }
View Full Code Here

Examples of org.apache.batik.svggen.SVGGraphics2D

        // create an instance of org.w3c.dom.Document.
        namespace = "http://www.w3.org/2000/svg";
        document = domImpl.createDocument( namespace, "svg", null );

        // create an instance of the SVG Generator.
        svgGenerator = new SVGGraphics2D( document );
    }
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.