1
2
3
4
5
6
7
8
9
10
11 package org.mule.tools.visualizer.processor;
12
13 import org.mule.tools.visualizer.config.ColorRegistry;
14 import org.mule.tools.visualizer.config.GraphEnvironment;
15 import org.mule.tools.visualizer.util.MuleTag;
16
17 import com.oy.shared.lm.graph.Graph;
18 import com.oy.shared.lm.graph.GraphNode;
19
20 import org.jdom.Element;
21
22 public class ConnectionStrategyProcessor extends TagProcessor
23 {
24
25 public ConnectionStrategyProcessor(GraphEnvironment environment)
26 {
27 super(environment);
28 }
29
30 public void process(Graph graph, Element currentElement, GraphNode parent)
31 {
32
33 Element cs = currentElement.getChild(MuleTag.ELEMENT_CONNECTION_STRATEGY);
34 if (cs != null)
35 {
36 GraphNode csNode = graph.addNode();
37 csNode.getInfo().setFillColor(ColorRegistry.COLOR_CONNECTION_STRATEGY);
38 csNode.getInfo().setHeader(cs.getAttributeValue(MuleTag.ATTRIBUTE_CLASS_NAME));
39
40 StringBuffer caption = new StringBuffer();
41 appendProperties(cs, caption);
42 appendDescription(cs, caption);
43 csNode.getInfo().setCaption(caption.toString());
44 addRelation(graph, parent, csNode, null);
45 }
46 }
47 }