public class ModelDrawer
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.io.File |
dotPath
The path to the DOT executable
|
private static java.util.logging.Logger |
LOGGER
The Logger to track all the execution traces
|
private java.io.File |
workingDir
The folder used as working directory to save temporary files
|
Constructor and Description |
---|
ModelDrawer(java.io.File workingDir,
java.io.File dotPath)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
draw(java.util.List<org.eclipse.emf.ecore.EObject> elements,
java.io.File resultingFile)
Draws a picture out of a list of model elements (as
EObject s) |
private java.io.File |
pictureFile(java.io.File source)
Generates a File to store the JPG out of a model file
|
void |
traverseAndDrawFolder(java.io.File targetFolder)
Main method to traverse a folder, discover and generate the pictures
This method call
traverseAndDrawFolder(File, boolean) with
the overwrite param active. |
void |
traverseAndDrawFolder(java.io.File targetFolder,
boolean overwrite)
Main method to traverse a folder, discover and generate the pictures.
|
private static final java.util.logging.Logger LOGGER
private java.io.File workingDir
private java.io.File dotPath
public ModelDrawer(java.io.File workingDir, java.io.File dotPath)
Registers the metamodels and sets the log level
workingDir
- The folder where the temporary files will be storeddotPath
- The path to the DOT executablepublic void traverseAndDrawFolder(java.io.File targetFolder)
This method call traverseAndDrawFolder(File, boolean)
with
the overwrite param active.
targetFolder
- The folder to analyzepublic void traverseAndDrawFolder(java.io.File targetFolder, boolean overwrite)
The generation process can overwrite (or not) according to the param.
The process traverses the folder (if contains other folders, they are traversed recursively) and generates the model/metamodel for each JSON document found.
targetFolder
- The folder to analyzeoverwrite
- True if the results have to overwritepublic void draw(java.util.List<org.eclipse.emf.ecore.EObject> elements, java.io.File resultingFile)
EObject
s)elements
- List of model elements (as EObject
s)resultingFile
- The file where the picture will be savedprivate java.io.File pictureFile(java.io.File source)
source
- The model fileFile
for savnig the JPG file