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