Package net.sourceforge.plantuml

Examples of net.sourceforge.plantuml.SourceStringReader


        ByteArrayOutputStream baos = new ByteArrayOutputStream();

        try {
            XdmNode doc = source.read();
            String text = doc.getStringValue();
            SourceStringReader reader = new SourceStringReader(text);

            FileFormat fmt = "svg".equals(format) ? FileFormat.SVG : FileFormat.PNG;

            String desc = reader.generateImage(baos, new FileFormatOption(fmt));
            if (desc == null) {
                throw new XProcException("PlantUML diagram returned null");
            }
        } catch (XProcException e) {
            throw e;
View Full Code Here


                        + text
                        + "\n@enduml";
                Plugin.print("UML Diagram Source", plantUml);
                ByteArrayOutputStream image = new ByteArrayOutputStream();
                try {
                    new SourceStringReader(plantUml).generateImage(image);
                }
                catch ( IOException e ) {
                    LOG.error("Error generating UML", e, fileName, String.valueOf(docComment.toString()), String.valueOf(docComment.getContainingFile()));
                }
                try {
View Full Code Here

        }
        outputFile.mkdirs();
        outputFile = new File(outputFile, fileName.replace("/", File.separator));
        doclet.printNotice("Generating UML diagram " + outputFile);
        // render
        SourceStringReader reader = new SourceStringReader(new Defines(), source, config);
        try {
            reader.generateImage(outputFile);
        }
        catch ( IOException e ) {
            doclet.printError(tag.position(), "Error generating UML image " + outputFile + ": " + e.getLocalizedMessage());
        }
    }
View Full Code Here

            dispatcher.forward(request, response);
        }
    }

    private void handleImageProxy(HttpServletResponse response, String num, String source) throws IOException {
        SourceStringReader reader = new SourceStringReader(getSource(source));
        int n = num == null ? 0 : Integer.parseInt(num);

        reader.generateImage(response.getOutputStream(), n, new FileFormatOption(getOutputFormat(), false));
    }
View Full Code Here

            response.addDateHeader("Last-Modified", 1261440000000L);
            // 2009 dec 22 constant date in the past
            response.addHeader("Cache-Control", "public");
        }
        response.setContentType("image/png");
        SourceStringReader reader = new SourceStringReader(uml);
        reader.generateImage(response.getOutputStream(), new FileFormatOption(FileFormat.PNG, false));
    }
View Full Code Here

    void sendDiagram(String uml) throws IOException {
        if (StringUtils.isDiagramCacheable(uml)) {
            addHeaderForCache();
        }
        response.setContentType(getContentType());
        SourceStringReader reader = new SourceStringReader(uml);
        reader.generateImage(response.getOutputStream(), new FileFormatOption(format, false));
    }
View Full Code Here

    void sendMap(String uml) throws IOException {
        if (StringUtils.isDiagramCacheable(uml)) {
            addHeaderForCache();
        }
        response.setContentType(getContentType());
        SourceStringReader reader = new SourceStringReader(uml);
        String map = reader.generateImage(new NullOutputStream(), new FileFormatOption(FileFormat.PNG, false));
        String[] mapLines = map.split("[\\r\\n]");
        PrintWriter httpOut = response.getWriter();
        for (int i = 2; (i + 1) < mapLines.length; i++) {
            httpOut.print(mapLines[i]);
        }
View Full Code Here

        }
   }

    void sendCheck(String uml) throws IOException {
        response.setContentType(getContentType());
        SourceStringReader reader = new SourceStringReader(uml);
        DiagramDescription desc = reader.generateDiagramDescription(
            new NullOutputStream(), new FileFormatOption(FileFormat.PNG, false));
        PrintWriter httpOut = response.getWriter();
        httpOut.print(desc.getDescription());
}
View Full Code Here

        }

        // generate the response
        String diagmarkup = getSource(srcUrl);
        System.out.println("getSource=>" + diagmarkup);
        SourceStringReader reader = new SourceStringReader(diagmarkup);
        int n = index == null ? 0 : Integer.parseInt(index);
        List<BlockUml> blocks = reader.getBlocks();
        BlockUml block = blocks.get(n);
        Diagram diagram = block.getDiagram();
        UmlSource umlSrc = diagram.getSource();
        String uml = umlSrc.getPlainString();
        System.out.println("uml=" + uml);
View Full Code Here

TOP

Related Classes of net.sourceforge.plantuml.SourceStringReader

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.