Minimal Example HowTo
Version 1.1 by cmot on 2013/11/09 01:48
These instructions should guide you if you'd like to try out using KLighD for visualizing your own models or data structures. A minimal example is shown where a trivial data structure is visualized with KLighD.
The Data
The data structure is defined like follows:
public class MyData {
public String name;
public List<MyData> subData = new LinkedList<MyData>();
public static MyData getTestData() {
MyData d1 = new MyData();
d1.name = "all data";
MyData d2 = new MyData();
d2.name = "outer data";
MyData d3 = new MyData();
d3.name = "inner 1";
MyData d4 = new MyData();
d4.name = "inner 2";
MyData d5 = new MyData();
d5.name = "inner 5";
MyData d6 = new MyData();
d6.name = "most inner 6";
d1.subData.add(d2);
d2.subData.add(d3);
d2.subData.add(d4);
d2.subData.add(d5);
d4.subData.add(d6);
return d1;
}
}
public String name;
public List<MyData> subData = new LinkedList<MyData>();
public static MyData getTestData() {
MyData d1 = new MyData();
d1.name = "all data";
MyData d2 = new MyData();
d2.name = "outer data";
MyData d3 = new MyData();
d3.name = "inner 1";
MyData d4 = new MyData();
d4.name = "inner 2";
MyData d5 = new MyData();
d5.name = "inner 5";
MyData d6 = new MyData();
d6.name = "most inner 6";
d1.subData.add(d2);
d2.subData.add(d3);
d2.subData.add(d4);
d2.subData.add(d5);
d4.subData.add(d6);
return d1;
}
}
The method getTestData() will build a small instance of the MyData class that is used for visualization.
Step-by-step guide
In order to get this example working, please follow the instructions below:
- Download Eclipse Kepler:
http://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/kepler/SR1/eclipse-modeling-kepler-SR1-win32-x86_64.zip&mirror_id=546 - Add the KIELE Pragmatics Nightly update site to your Eclipse (Help -> Install New Software ... -> Add)
http://rtsys.informatik.uni-kiel.de/~kieler/updatesite/nightly/pragmatics/ - Select
[x] Layout,
[x] Lightweight Diagrams, and
[x] Sources
to be installed into your Eclipse - Download the following file, unzip it and import it as an existing project into your Eclipse workspace
- You may now create a new run configuration and run everything as an Eclipse Application
- Once you click on the red-circled button, you should see the visualization as follows

The Details
Mainly there a three classes involved:
- MyData.java : It contains the simple model
Related articles
Related articles appear here based on the labels you select. Click to edit the macro and add or change labels.
Unknown macro: contentbylabel. Click on this message for details.