01: package com.opensymphony.workflow.designer;
02:
03: import java.awt.Color;
04: import java.util.List;
05:
06: import org.jgraph.graph.GraphConstants;
07:
08: import com.opensymphony.workflow.loader.ResultDescriptor;
09: import com.opensymphony.workflow.loader.SplitDescriptor;
10:
11: public class SplitCell extends WorkflowCell implements ResultAware {
12: private SplitDescriptor descriptor;
13:
14: public SplitCell(SplitDescriptor userObject) {
15: super (userObject);
16: descriptor = userObject;
17: id = descriptor.getId();
18: GraphConstants.setBackground(attributes, Color.gray);
19: }
20:
21: public SplitDescriptor getSplitDescriptor() {
22: return descriptor;
23: }
24:
25: public boolean removeResult(ResultDescriptor result) {
26: List list = descriptor.getResults();
27: if (list != null) {
28: for (int i = 0; i < list.size(); i++) {
29: if (list.get(i) == result) {
30: list.remove(i);
31: return true;
32: }
33: }
34: }
35: return false;
36: }
37:
38: public String toString() {
39: return "Split id " + descriptor.getId();
40: }
41: }
|