Package com.kitfox.svg

Examples of com.kitfox.svg.SVGUniverse.loadSVG()


      _points = (List<Point>) RessourceManager.getRessource(key);
      if (_points == null) {
        try {
          SVGUniverse svgUniverse = new SVGUniverse();
          StringReader reader = new StringReader(svg);
          SVGDiagram diagram = svgUniverse.getDiagram(svgUniverse.loadSVG(reader, "svgImage"));

          int imgWidth = Tools.FTOI(diagram.getWidth() * resolution_multiplier);
          int imgHeight = Tools.FTOI(diagram.getHeight() * resolution_multiplier);

          //          SVGRoot root = diagram.getRoot();
View Full Code Here


      if (currFile.exists()) {

        SVGUniverse svgUniverse = new SVGUniverse();
        String svg = Tools.readUTF8Textfile(currFile.getAbsolutePath());
        StringReader reader = new StringReader(svg);
        SVGDiagram diagram = svgUniverse.getDiagram(svgUniverse.loadSVG(reader, "svgImage"));

        int imgWidth = this.getPreferredSize().width;
        int imgHeight = this.getPreferredSize().height - BUTTON_HEIGHT;

        SimpleImage imgMap = new SimpleImage(imgWidth, imgHeight);
View Full Code Here

        URI uri;

        if (!CheckBoxMenuItem_anonInputStream.isSelected())
        {
            //Load from a disk with a valid URL
            uri = universe.loadSVG(url);

            if (verbose) System.err.println("Loading document " + uri.toString());

            diagram = universe.getDiagram(uri);
        }
View Full Code Here

        {
            //Load from a stream with no particular valid URL
            try
            {
                InputStream is = url.openStream();
                uri = universe.loadSVG(is, "defaultName");

                if (verbose) System.err.println("Loading document " + uri.toString());
            }
            catch (Exception e)
            {
View Full Code Here

    private static final String NAME_PREFIX = "svgimage_";

    @Override
    public SVGDiagram readObject(InputStream inputStream) throws IOException {
        SVGUniverse universe = SVGCache.getSVGUniverse();
        URI location = universe.loadSVG(inputStream, NAME_PREFIX + (index++));
        return universe.getDiagram(location, true);
    }

    @Override
    public void writeObject(SVGDiagram diagram, OutputStream outputStream) {
View Full Code Here

    g2d.setRenderingHint( RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON );

    // Draw graphics
    try {
      SVGUniverse universe = SVGCache.getSVGUniverse();
      SVGDiagram diagram = universe.getDiagram( universe.loadSVG( is, name ));
      if ( diagram != null ) {
        SVGRoot root = diagram.getRoot();
        root.setAttribute( "width", AnimationElement.AT_XML, Double.toString( width ));
        root.setAttribute( "height", AnimationElement.AT_XML, Double.toString( height ));
        root.build();  
View Full Code Here

    Interface refInterface;
    public PanelWithAnimation(Interface in) throws Exception{
      // konstruktor przyjmujacy referencje
      refInterface=in;
        SVGUniverse svgUniverse = new SVGUniverse();
        URI uri = svgUniverse.loadSVG(getClass().getResourceAsStream("Picture1.svg"), "Rysunek");
        svgDiagram = svgUniverse.getDiagram(uri);
        //przygotowanie obrazka
       
    }
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.