Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Provide the source model type, e.g. via the 'Browse' button. Note that the project containing that class must exist in the workspace or at least any other workspace project must have this class in its class path, e.g. via a bundle dependency. Otherwise it won't be offered by the list of available classes. Of course you might alter the project's name, the name of the diagram synthesis implementation and its containing package. Finally choose your favorite implementation language - we like Xtend very much for this purpose! (smile) If you don't like to have a simple popup menu contribution for testing purposes, uncheck the corresponding checkbox.

You will get the following implementation template, it is already registered via KLighD's dedicated extension point (see the project's plugin.xml).

...

Create a KNode (via createNode()) for each element comprised by the given instance model (usually called the business, domain, or semantic model) of your data type, here EPackage. Add those nodes to the children of root. Create a KEdge for each relation or link to be contained in your diagram. Similarly to createNode() there is createEdge() for that purpose. Set source and target node of those edges accordingly, this will implicitly add the edges to the diagram (via EMF's EOpposite mechanism). You can reveal an already created node representing a certain domain element by calling domainElement.getNode(), or simply domainElement.node. Have a look at UML2UseCaseDiagramSynthesis, which is part of our examples project, on how to do that. If you are interested in diagrams with nodes and edges connected via ports (as depicted in Figure 2 in Just Model! - ...) have a look at CircuitDiagramSynthesis. For convenience you might also want to import the examples project into your workspace. Simply switch to the Plug-ins view and import de.cau.cs.kieler.klighd.examples as Source Project, see screen shot below.

...