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 NotNode} and adds visual extras like color information
10: *
11: */
12: public class NotNodeVertex extends BaseVertex {
13:
14: private static final String NODE_NAME = "NotNode";
15:
16: private final NotNode node;
17:
18: /**
19: * Constructor
20: *
21: * @param node node to be wrapped
22: */
23: public NotNodeVertex(final NotNode 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: }
34:
35: /* (non-Javadoc)
36: * @see org.drools.eclipse.editors.rete.model.BaseVertex#toString()
37: */
38: public String toString() {
39: return NODE_NAME;
40: }
41:
42: /* (non-Javadoc)
43: * @see org.drools.reteoo.BaseNodeVertex#getFillColor()
44: */
45: public Color getFillColor() {
46: return ColorConstants.cyan;
47: }
48:
49: /**
50: * Node ID
51: *
52: * @return node id
53: */
54: public int getId() {
55: return node.getId();
56: }
57:
58: }
|