01: /**
02: *
03: */package org.drools.reteoo;
04:
05: import org.eclipse.draw2d.ColorConstants;
06: import org.eclipse.swt.graphics.Color;
07:
08: /**
09: * Wraps {@link CollectNode} and adds visual extras like color information
10: *
11: */
12: public class CollectNodeVertex extends BaseVertex {
13:
14: private static final String NODE_NAME = "CollectNode";
15:
16: private final CollectNode node;
17:
18: /**
19: * Constructor
20: *
21: * @param node node to be wrapped
22: */
23: public CollectNodeVertex(final CollectNode node) {
24: super ();
25: this .node = node;
26: }
27:
28: /* (non-Javadoc)
29: * @see org.drools.reteoo.BaseNodeVertex#getHtml()
30: */
31: public String getHtml() {
32: return NODE_NAME + " : " + this .node.getId()
33: + " : Chared count = " + this .node.getSharedCount();
34: }
35:
36: /* (non-Javadoc)
37: * @see org.drools.eclipse.editors.rete.model.BaseVertex#toString()
38: */
39: public String toString() {
40: return NODE_NAME;
41: }
42:
43: /* (non-Javadoc)
44: * @see org.drools.reteoo.BaseNodeVertex#getFillColor()
45: */
46: public Color getFillColor() {
47: return ColorConstants.lightGray;
48: }
49:
50: /**
51: * Node ID
52: *
53: * @return id
54: */
55: public int getId() {
56: return this.node.getId();
57: }
58:
59: }
|