1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
package org.mule.tools.visualizer.postprocessors; |
12 | |
|
13 | |
import org.mule.tools.visualizer.components.PostProcessor; |
14 | |
import org.mule.tools.visualizer.config.ColorRegistry; |
15 | |
import org.mule.tools.visualizer.config.GraphEnvironment; |
16 | |
import org.mule.tools.visualizer.processor.TagProcessor; |
17 | |
|
18 | |
import com.oy.shared.lm.graph.Graph; |
19 | |
import com.oy.shared.lm.graph.GraphNode; |
20 | |
|
21 | 4 | public class ExternalSystemPostProcessor implements PostProcessor |
22 | |
{ |
23 | |
|
24 | |
public void postProcess(Graph graph, GraphEnvironment env) |
25 | |
{ |
26 | 4 | if (env.getConfig().getMappings().size() > 0) |
27 | |
{ |
28 | 0 | GraphNode[] nodes = graph.getNodes(); |
29 | 0 | for (int i = 0; i < nodes.length; i++) |
30 | |
{ |
31 | 0 | GraphNode node = nodes[i]; |
32 | 0 | String ext = env.getConfig().getMappings().getProperty( |
33 | |
node.getInfo().getHeader() + ".external", null); |
34 | 0 | if (ext != null) |
35 | |
{ |
36 | 0 | env.log("Adding External system '" + ext + "'"); |
37 | |
|
38 | 0 | String type = env.getConfig().getMappings().getProperty( |
39 | |
node.getInfo().getHeader() + ".external.type", null); |
40 | 0 | GraphNode n = graph.addNode(); |
41 | 0 | n.getInfo().setShapeEllipse(); |
42 | 0 | n.getInfo().setCaption(ext); |
43 | 0 | n.getInfo().setFillColor(ColorRegistry.COLOR_EXTERNAL); |
44 | 0 | if ("server".equalsIgnoreCase(type)) |
45 | |
{ |
46 | 0 | TagProcessor.addEdge(graph, node, n, null, true); |
47 | |
} |
48 | |
else |
49 | |
{ |
50 | 0 | TagProcessor.addEdge(graph, n, node, null, true); |
51 | |
} |
52 | |
} |
53 | |
} |
54 | |
} |
55 | 4 | } |
56 | |
|
57 | |
} |