1 19 20 21 package ca.mcgill.sable.soot.cfg.editParts; 22 23 import org.eclipse.gef.EditPart; 24 import org.eclipse.gef.EditPartFactory; 25 import ca.mcgill.sable.soot.cfg.model.*; 26 27 28 public class CFGPartFactory implements EditPartFactory { 29 30 31 public CFGPartFactory() { 32 super(); 33 } 34 35 38 public EditPart createEditPart(EditPart arg0, Object arg1) { 39 EditPart part = null; 40 if (arg1 instanceof CFGGraph){ 41 part = new CFGGraphEditPart(); 42 } 43 else if (arg1 instanceof CFGNode){ 44 part = new CFGNodeEditPart(); 45 } 46 else if (arg1 instanceof CFGEdge){ 47 part = new CFGEdgeEditPart(); 48 } 49 else if (arg1 instanceof CFGFlowData){ 50 part = new FlowDataEditPart(); 51 } 52 else if (arg1 instanceof CFGPartialFlowData){ 53 part = new PartialFlowDataEditPart(); 54 } 55 else if (arg1 instanceof CFGFlowInfo){ 56 part = new FlowInfoEditPart(); 57 } 58 else if (arg1 instanceof CFGNodeData){ 59 part = new NodeDataEditPart(); 60 } 61 part.setModel(arg1); 62 return part; 63 } 64 65 } 66 | Popular Tags |