Versions Compared

Key

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

...

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 interested in diagrams with nodes and edges connected via ports have a look at CircuitDiagramSynthesis. Note that this example is not part of our latest release so install a nightly build (with all its bugs (wink)) are checkout our source code.

Finally attach figure specifications to the nodes and edges, most conveniently by means of the extension methods provided by the ...Extension classes - see the use case example on that, too. A documentation of those methods in form of a list of all extension methods sorted by the type they can be used with can be found here. (And yes, there is still some lack of documentation...)

...