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 (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.

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...)

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.

Invoking the diagram synthesis

...

Code Block
DiagramViewManager.getInstance().createView(<<someId>>, <<someName>>, <<yourConcreteData>>, nullKlighdSynthesisProperties.emptyConfig());

This statements will open an eclipse view part showing your desired diagram. <<someId>> is an the Id that can be used to access, update, or close the view part later on programmatically, and <<someName>> is the name of the view (shown at the view's tab), <<yourConcreteData>> is an instance of the input type of your diagram synthesis implementation. Via the last parameter some additional instructions can be handed over. For those that are not yet familiar with Eclipse menu stuff have a look on at a corresponding tutorial, e.g. at vogella.com.

...