if (stream == null) {
System.err.println("ERROR: " + imgpath);
}
Image img = new Image(d, stream);
GraphNode node = new GraphNode(g.getGraphControl(), SWT.NONE, lbl, img, cur);
node.setTooltip(new Label(tmp));
if (cur.status == State.FORWARD) {
// node.setText("");
// node.setNodeStyle(ZestStyles.NODES_HIDE_TEXT);
}
if (cur.status == State.INVALID) {
node.setBackgroundColor(d.getSystemColor(SWT.COLOR_RED));
node.setHighlightColor(d.getSystemColor(SWT.COLOR_DARK_RED));
node.setForegroundColor(d.getSystemColor(SWT.COLOR_WHITE));
}
else if (cur.status == State.MATCH) {
node.setBackgroundColor(d.getSystemColor(SWT.COLOR_GREEN));
node.setHighlightColor(d.getSystemColor(SWT.COLOR_DARK_GREEN));
}
else if (cur.status == State.SKIP) {
node.setBackgroundColor(d.getSystemColor(SWT.COLOR_YELLOW));
node.setHighlightColor(d.getSystemColor(SWT.COLOR_DARK_YELLOW));
}
else if (cur.status == State.PROPOSE) {
node.setBackgroundColor(d.getSystemColor(SWT.COLOR_BLUE));
node.setHighlightColor(d.getSystemColor(SWT.COLOR_DARK_BLUE));
node.setForegroundColor(d.getSystemColor(SWT.COLOR_WHITE));
}
else {
node.setBackgroundColor(d.getSystemColor(SWT.COLOR_GRAY));
node.setHighlightColor(d.getSystemColor(SWT.COLOR_DARK_GRAY));
}
nodes.add(node);
for (ResultNode n : cur.next) {
GraphNode child = dbg(n, cur, g);
new GraphConnection(g.getGraphControl(), ZestStyles.CONNECTIONS_DIRECTED, node, child);
}
return node;
}