| digraph G { |
| [%for (g in AllGoals) {%] |
| { rank = same; |
| [%=g.nodeLabel("rect", "")%] |
| [% for (c in AllContextOf.select(c | c.source == g)) { %] |
| [%=c.target.nodeLabel("rect", "rounded")%] |
| [% }%] |
| } |
| [%}%] |
| [%for (s in AllStrategies) { %] |
| { rank = same; |
| [%=s.nodeLabel("parallelogram", "")%] |
| [% var ctxs = AllContextOf.select(c | c.source == s); |
| if (ctxs.size() > 0) {%] |
| node[group=[%=s.name%]]; |
| [% for (c in ctxs) { %] |
| [%=c.target.nodeLabel("rect", "rounded")%] |
| [% }%] |
| [%=ctxs.target.name.concat("->")%][style=invis]; |
| [% }%] |
| } |
| [%}%] |
| [%for (s in AllSolutions) {%] |
| { rank = same; |
| [%=s.nodeLabel("circle", "")%] |
| } |
| [%}%] |
| [%for (s in AllSupportedBy) { %]
|
| [%=s.source.name%] -> [%=s.target.name%];
|
| [%}%] |
| |
| [%for (s in AllContextOf) { %] |
| [%=s.source.name%] -> [%=s.target.name%] [arrowhead = onormal]; |
| [%}%] |
| } |
| [% |
| /** Table for Node content */ |
| @template |
| operation Node nodeLabel(shape, style) {%] |
| [%=self.name%] [shape=[%=shape%] [%if(style.length()>0){%] style=[%=style%][%}%] label=< |
| <TABLE border="0" cellborder="0" cellspacing="0" cellpading="0"> |
| <tr> |
| <td align="left">[%=self.name%]</td> |
| </tr> |
| <tr> |
| <td> </td> |
| </tr> |
| <tr> |
| <td>[%=self.breakDesc()%]</td> |
| </tr> |
| </TABLE>>]; |
| [%} |
| |
| /** Break the description string by adding (\n) characters |
| */ |
| operation Node breakDesc() : String { |
| var result = ""; |
| var slices = 15; |
| for (w in self.description.split(" ")) { |
| result += w; |
| if (hasMore) { |
| if (result.length() > slices) { |
| result += "<br align=\"left\"/>"; // " "; |
| slices = result.length() + 15; |
| } |
| else { |
| result += " "; |
| } |
| } |
| } |
| result += "<br align=\"left\"/>"; |
| return result; |
| } |
| %] |