de.frag.umlplugin.uml.diagramio
Class ImageDiagramWriter

java.lang.Object
  extended by de.frag.umlplugin.uml.diagramio.ImageDiagramWriter
All Implemented Interfaces:
DiagramWriter

public class ImageDiagramWriter
extends java.lang.Object
implements DiagramWriter

Writes diagram to an image file.


Constructor Summary
ImageDiagramWriter(java.lang.String extension)
          Creates a new diagram writer that writes diagrams to image files.
 
Method Summary
 boolean canWriteMultipleDiagrams()
          Checks whether this writer can write multiple diagrams or not.
 boolean canWriteThumbnail()
          Checks whether this writer supports storage of image thumbnails.
 void writeDiagram(UMLDiagram[] diagrams, java.lang.String path, boolean saveThumbnail, int thumbnailHeight)
          Writes given diagram to file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageDiagramWriter

public ImageDiagramWriter(@NotNull
                          java.lang.String extension)
Creates a new diagram writer that writes diagrams to image files.

Parameters:
extension - image file extension which will be used to determine image type
Method Detail

canWriteMultipleDiagrams

public boolean canWriteMultipleDiagrams()
Checks whether this writer can write multiple diagrams or not.

Specified by:
canWriteMultipleDiagrams in interface DiagramWriter
Returns:
true, if this writer can write multiple diagrams; false, if it can write only one diagram

canWriteThumbnail

public boolean canWriteThumbnail()
Checks whether this writer supports storage of image thumbnails.

Specified by:
canWriteThumbnail in interface DiagramWriter
Returns:
true, if this writer can create thumbnail images; false otherwise

writeDiagram

public void writeDiagram(@NotNull
                         UMLDiagram[] diagrams,
                         @NotNull
                         java.lang.String path,
                         boolean saveThumbnail,
                         int thumbnailHeight)
                  throws java.io.IOException
Writes given diagram to file.

Specified by:
writeDiagram in interface DiagramWriter
Parameters:
diagrams - diagrams to write
path - path to target file
saveThumbnail - true, if thumbnail should be written; false otherwise
thumbnailHeight - desired thumbnail height in pixels
Throws:
java.io.IOException - on IO error