de.cau.cs.kieler.keg.importer
Class ImportUtil

java.lang.Object
  extended by de.cau.cs.kieler.keg.importer.ImportUtil

public final class ImportUtil
extends Object

A utility class for KEG import.

Rating red

Method Summary
static
<T> void
applyContainedLayout(IPath diagramPath, boolean openDiagram)
          Given the path to a KEG diagram (kegdi) layout data contained in the KEG model is applied to the KEG diagram.
static Node transformModel2KEGGraph(String xtendFile, String extension, List<Object> parameters, InputStream inputStream, Resource.Factory resourceFactory, IKielerProgressMonitor monitor, String... involvedMetamodels)
          Transforms a model to a KEG graph using a given Xtend transformation file.
static Node transformModel2KEGGraph(String xtendFile, String extension, List<Object> parameters, Resource resource, IKielerProgressMonitor monitor, String... involvedMetamodels)
          Transforms a model to a KEG graph using a given Xtend transformation file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

transformModel2KEGGraph

public static Node transformModel2KEGGraph(String xtendFile,
                                           String extension,
                                           List<Object> parameters,
                                           InputStream inputStream,
                                           Resource.Factory resourceFactory,
                                           IKielerProgressMonitor monitor,
                                           String... involvedMetamodels)
                                    throws IOException,
                                           TransformException
Transforms a model to a KEG graph using a given Xtend transformation file. The model instance is read from an input stream.

Parameters:
xtendFile - the xtend file containing the transformation
extension - the name of the extension that starts the transformation inside the xtend file
parameters - a list of additional parameters for the transformation or null if no additional parameters are required
inputStream - the input stream the source model instance is read from
resourceFactory - the resource factory used to read the model or null for the standard factory
monitor - the progress monitor
involvedMetamodels - the metamodels involved in the transformation
Returns:
the parent node of the KEG graph
Throws:
IOException - thrown when the the xtend file could not be found or opened
TransformException - thrown when the execution of the xtend transformation failed

transformModel2KEGGraph

public static Node transformModel2KEGGraph(String xtendFile,
                                           String extension,
                                           List<Object> parameters,
                                           Resource resource,
                                           IKielerProgressMonitor monitor,
                                           String... involvedMetamodels)
                                    throws IOException,
                                           TransformException
Transforms a model to a KEG graph using a given Xtend transformation file. The model instance is read from a resource.

Parameters:
xtendFile - the xtend file containing the transformation
extension - the name of the extension that starts the transformation inside the xtend file
parameters - a list of additional parameters for the transformation or null if no additional parameters are required
resource - the resource from which to read the model
monitor - the progress monitor
involvedMetamodels - the metamodels involved in the transformation
Returns:
the parent node of the KEG graph
Throws:
IOException - thrown when the the xtend file could not be found or opened
TransformException - thrown when the execution of the xtend transformation failed

applyContainedLayout

public static <T> void applyContainedLayout(IPath diagramPath,
                                            boolean openDiagram)
Given the path to a KEG diagram (kegdi) layout data contained in the KEG model is applied to the KEG diagram.

Parameters:
diagramPath - the diagram path
openDiagram - whether to keep the diagram opened in an editor