1 package com.opensymphony.workflow.designer; 2 3 import java.util.Iterator ; 4 5 import org.jgraph.graph.DefaultPort; 6 7 12 public class WorkflowPort extends DefaultPort 13 { 14 public WorkflowPort() 15 { 16 } 17 18 public int getEdgeCount() 19 { 20 return edges.size(); 21 } 22 23 30 public void assignIndex(ResultEdge edge) 31 { 32 WorkflowPort source = (WorkflowPort)edge.getSource(); 33 WorkflowPort target = (WorkflowPort)edge.getTarget(); 34 int index = 0; 35 Iterator i = edges.iterator(); 36 while(i.hasNext()) 37 { 38 ResultEdge e = (ResultEdge)i.next(); 39 if(e.getTarget().equals(source) && e.getSource().equals(target)) 40 { 41 index++; 42 } 43 } 44 edge.setIndex(index); 45 } 46 } 47 | Popular Tags |