de.frag.umlplugin.uml.diagramio
Enum DiagramFileType

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

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

Diagram file types.


Enum Constant Summary
DIAGRAM
           
DIAGRAMS
           
GIF
           
GRAPHML
           
JPG
           
PNG
           
SVG
           
 
Method Summary
 java.lang.String appendExtension(java.lang.String path)
          Appends extension, if it is not already present.
 boolean canWriteMultipleDiagrams()
          Checks whether this writer can write multiple diagrams or not.
 boolean canWriteThumbnail()
          Checks whether this file type supports storage of image thumbnails.
 java.lang.String createThumbnailPath(java.lang.String path, java.lang.String thumbnailSuffix)
          Creates a thumbnail path.
 java.lang.String getDescription()
          Gets file type description.
 java.lang.String toString()
          Gets file type name.
static DiagramFileType valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static DiagramFileType[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 void writeDiagram(UMLDiagram[] diagrams, java.lang.String path, boolean saveThumbnail, int thumbnailHeight)
          Writes given diagrams 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

DIAGRAM

public static final DiagramFileType DIAGRAM

DIAGRAMS

public static final DiagramFileType DIAGRAMS

GIF

public static final DiagramFileType GIF

JPG

public static final DiagramFileType JPG

PNG

public static final DiagramFileType PNG

SVG

public static final DiagramFileType SVG

GRAPHML

public static final DiagramFileType GRAPHML
Method Detail

values

public static DiagramFileType[] 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 (DiagramFileType c : DiagramFileType.values())
    System.out.println(c);

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

valueOf

public static DiagramFileType 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<DiagramFileType>
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

createThumbnailPath

@NotNull
public java.lang.String createThumbnailPath(@NotNull
                                                    java.lang.String path,
                                                    @NotNull
                                                    java.lang.String thumbnailSuffix)
Creates a thumbnail path.

Parameters:
path - path of normal file with extension already attached.
thumbnailSuffix - thumbnail suffix
Returns:
created thumbnail path

canWriteMultipleDiagrams

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

Returns:
true, if this writer can write multiple diagrams; false, if it can write only one diagram

writeDiagram

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

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

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