use of net.sourceforge.plantuml.FileFormatOption in project netbeans-mmd-plugin by raydac.
the class PlantUmlTextEditor method renderCurrentTextInPlantUml.
private void renderCurrentTextInPlantUml() {
final String text = this.editor.getText();
final SourceStringReader reader = new SourceStringReader(text, "UTF-8");
final ByteArrayOutputStream buffer = new ByteArrayOutputStream(131072);
try {
reader.outputImage(buffer, new FileFormatOption(FileFormat.PNG, false));
this.imageComponent.setImage(ImageIO.read(new ByteArrayInputStream(buffer.toByteArray())));
this.renderedScrollPane.revalidate();
} catch (IOException e) {
LOGGER.error("Can't render plant uml", e);
this.renderedScrollPane.setViewportView(new JLabel("Error during rendering"));
}
}
Aggregations