de.frag.umlplugin.graphio
Enum GraphFileType

java.lang.Object
  extended by java.lang.Enum<GraphFileType>
      extended by de.frag.umlplugin.graphio.GraphFileType
All Implemented Interfaces:
FileType, java.io.Serializable, java.lang.Comparable<GraphFileType>

public enum GraphFileType
extends java.lang.Enum<GraphFileType>
implements FileType

Diagram file types.


Enum Constant Summary
GIF
           
JPG
           
PNG
           
SVG
           
 
Method Summary
 java.lang.String appendExtension(java.lang.String path)
          Appends extension, if it is not already present.
 boolean canWriteThumbnail()
          Checks whether this file type supports storage of image thumbnails.
 java.lang.String getDescription()
          Gets file type description.
 java.lang.String toString()
          Gets file type name.
static GraphFileType valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static GraphFileType[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 void writeGraph(com.intellij.openapi.graph.view.Graph2D graph, java.lang.String path, boolean saveThumbnail, int thumbnailHeight)
          Writes given graph to specified file path.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

GIF

public static final GraphFileType GIF

JPG

public static final GraphFileType JPG

PNG

public static final GraphFileType PNG

SVG

public static final GraphFileType SVG
Method Detail

values

public static GraphFileType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (GraphFileType c : GraphFileType.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static GraphFileType valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

getDescription

@NotNull
public java.lang.String getDescription()
Gets file type description.

Specified by:
getDescription in interface FileType
Returns:
file type description

toString

@NotNull
public java.lang.String toString()
Gets file type name.

Specified by:
toString in interface FileType
Overrides:
toString in class java.lang.Enum<GraphFileType>
Returns:
file type name

appendExtension

@NotNull
public java.lang.String appendExtension(@NotNull
                                                java.lang.String path)
Appends extension, if it is not already present.

Parameters:
path - path to append extension to
Returns:
modified path

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 specified file path.

Parameters:
graph - graph 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

canWriteThumbnail

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

Specified by:
canWriteThumbnail in interface FileType
Returns:
true, if this file type can create thumbnail images; false otherwise