de.frag.umlplugin.graphio
Class ImageGraphWriter

java.lang.Object
  extended by de.frag.umlplugin.graphio.ImageGraphWriter
All Implemented Interfaces:
GraphWriter

public class ImageGraphWriter
extends java.lang.Object
implements GraphWriter

Write graphs to image files (JPG, PNG, GIF).


Constructor Summary
ImageGraphWriter(java.lang.String extension)
          Creates new writer that writes graphs to images.
 
Method Summary
 boolean canWriteThumbnail()
          Checks whether this graph writer supports storage image thumbnails.
 void writeGraph(com.intellij.openapi.graph.view.Graph2D graph, java.lang.String path, boolean saveThumbnail, int thumbnailHeight)
          Writes given graph to file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageGraphWriter

public ImageGraphWriter(@NotNull
                        java.lang.String extension)
Creates new writer that writes graphs to images.

Parameters:
extension - file extension that specified desired image format
Method Detail

writeGraph

public void writeGraph(@NotNull
                       com.intellij.openapi.graph.view.Graph2D graph,
                       @NotNull
                       java.lang.String path,
                       boolean saveThumbnail,
                       int thumbnailHeight)
                throws java.io.IOException
Writes given graph to file.

Specified by:
writeGraph in interface GraphWriter
Parameters:
graph - graph to write
path - path to target file
saveThumbnail - true, if thumbnail should be created and written; false otherwise
thumbnailHeight - desired height of thumbnail image in pixels
Throws:
java.io.IOException - on IO error

canWriteThumbnail

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

Specified by:
canWriteThumbnail in interface GraphWriter
Returns:
true, since this writer can create thumbnail images