KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > opensymphony > workflow > designer > views > CustomEdgeView


1 package com.opensymphony.workflow.designer.views;
2
3 import com.opensymphony.workflow.designer.*;
4 import com.opensymphony.workflow.loader.ResultDescriptor;
5 import org.jgraph.graph.*;
6
7 /**
8  * User: Hani Suleiman
9  * Date: Dec 2, 2003
10  * Time: 2:22:44 PM
11  */

12 public class CustomEdgeView extends EdgeView
13 {
14   public CustomEdgeView(Object JavaDoc obj, WorkflowGraph graph, CellMapper cm)
15   {
16     super(obj, graph, cm);
17   }
18
19   public void setTarget(CellView targetView)
20   {
21     super.setTarget(targetView);
22     if(targetView==null || targetView.getParentView()==null) return;
23     WorkflowCell cell = (WorkflowCell)targetView.getParentView().getCell();
24     ResultDescriptor d = ((ResultEdge)getCell()).getDescriptor();
25     if(cell instanceof StepCell)
26     {
27       d.setStep(cell.getId());
28     }
29     else if(cell instanceof JoinCell)
30     {
31       d.setJoin(cell.getId());
32     }
33     else if(cell instanceof SplitCell)
34     {
35       d.setSplit(cell.getId());
36     }
37   }
38 }
39
Popular Tags