Examples of SVGDiagram


Examples of com.kitfox.svg.SVGDiagram

                .setDestDir(new File(Main.pref.getCacheDirectory(), "images").getPath());
        try (InputStream is = cf.getInputStream()) {
            switch (type) {
            case SVG:
                URI uri = getSvgUniverse().loadSVG(is, Utils.fileToURL(cf.getFile()).toString());
                SVGDiagram svg = getSvgUniverse().getDiagram(uri);
                return svg == null ? null : new ImageResource(svg);
            case OTHER:
                BufferedImage img = null;
                try {
                    img = read(Utils.fileToURL(cf.getFile()), false, false);
View Full Code Here

Examples of com.kitfox.svg.SVGDiagram

                    }
                }
                if (mediatype != null && mediatype.contains("image/svg+xml")) {
                    String s = new String(bytes, StandardCharsets.UTF_8);
                    URI uri = getSvgUniverse().loadSVG(new StringReader(s), URLEncoder.encode(s, "UTF-8"));
                    SVGDiagram svg = getSvgUniverse().getDiagram(uri);
                    if (svg == null) {
                        Main.warn("Unable to process svg: "+s);
                        return null;
                    }
                    return new ImageResource(svg);
View Full Code Here

Examples of com.kitfox.svg.SVGDiagram

                byte[] buf = new byte[size];
                try (InputStream is = zipFile.getInputStream(entry)) {
                    switch (type) {
                    case SVG:
                        URI uri = getSvgUniverse().loadSVG(is, entryName);
                        SVGDiagram svg = getSvgUniverse().getDiagram(uri);
                        return svg == null ? null : new ImageResource(svg);
                    case OTHER:
                        while(size > 0)
                        {
                            int l = is.read(buf, offs, size);
View Full Code Here

Examples of com.kitfox.svg.SVGDiagram

    private static ImageResource getIfAvailableLocalURL(URL path, ImageType type) {
        switch (type) {
        case SVG:
            URI uri = getSvgUniverse().loadSVG(path);
            SVGDiagram svg = getSvgUniverse().getDiagram(uri);
            return svg == null ? null : new ImageResource(svg);
        case OTHER:
            BufferedImage img = null;
            try {
                img = read(path, false, false);
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.