KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > opensymphony > workflow > designer > SplitCell


1 package com.opensymphony.workflow.designer;
2
3 import java.awt.Color JavaDoc;
4 import java.util.List JavaDoc;
5
6 import org.jgraph.graph.GraphConstants;
7
8 import com.opensymphony.workflow.designer.proxy.SplitProxy;
9 import com.opensymphony.workflow.loader.ResultDescriptor;
10 import com.opensymphony.workflow.loader.SplitDescriptor;
11
12 public class SplitCell extends WorkflowCell implements ResultAware
13 {
14   private SplitDescriptor descriptor;
15
16   public SplitCell(SplitDescriptor userObject)
17   {
18     super(new SplitProxy(userObject));
19     descriptor = userObject;
20     id = descriptor.getId();
21     GraphConstants.setBackground(attributes, Color.gray);
22   }
23
24   public SplitDescriptor getSplitDescriptor()
25   {
26     return descriptor;
27   }
28
29   public boolean removeResult(ResultDescriptor result)
30   {
31     List JavaDoc list = descriptor.getResults();
32     if(list != null)
33     {
34       for(int i = 0; i < list.size(); i++)
35       {
36         if(list.get(i) == result)
37         {
38           list.remove(i);
39           return true;
40         }
41       }
42     }
43     return false;
44   }
45 }
46
47
48
Popular Tags