setTolerance(2);
  public WorkflowGraph(GraphModel model, WorkflowDescriptor descriptor, Layout layout, boolean doAutoLayout)  {    super(model);    getGraphLayoutCache().setFactory(new WorkflowCellViewFactory());    getGraphLayoutCache().setSelectsAllInsertedCells(false);    ToolTipManager.sharedInstance().registerComponent(this);    this.layout = layout;    setDescriptor(descriptor);    if(doAutoLayout)    {      autoLayout();    }    setGridEnabled(true);    setSizeable(true);    setGridColor(GRID_COLOR);    setGridSize(12);    setTolerance(2);    setGridVisible(true);    setGridMode(JGraph.LINE_GRID_MODE);    setBendable(true);    setMarqueeHandler(new WorkflowMarqueeHandler(this));    setCloneable(false);    setPortsVisible(true);    // one set of menu <==> one graph <==> one workflow descriptor    genericMenu = new JPopupMenu();    JMenu n = new JMenu(ResourceManager.getString("create.new"));    genericMenu.add(n);    n.add(new CreateStep(descriptor, getWorkflowGraphModel(), menuLocation));    //	n.add(new CreateInitialAction(descriptor, getWorkflowGraphModel(), menuLocation));    n.add(new CreateJoin(descriptor, getWorkflowGraphModel(), menuLocation));    n.add(new CreateSplit(descriptor, getWorkflowGraphModel(), menuLocation));    JMenu g = new JMenu(ResourceManager.getString("grid.size"));    genericMenu.add(g);    g.add(new SetGridSize(this, menuLocation, 1));    g.add(new SetGridSize(this, menuLocation, 2));    g.add(new SetGridSize(this, menuLocation, 4));    g.add(new SetGridSize(this, menuLocation, 8));    g.add(new SetGridSize(this, menuLocation, 12));    g.add(new SetGridSize(this, menuLocation, 16));    cellMenu = new JPopupMenu();    cellMenu.add(new Delete(descriptor, this, menuLocation));    edgeMenu = new JPopupMenu();    n = new JMenu(ResourceManager.getString("edge.color"));    edgeMenu.add(n);    n.add(new ResultEdgeColor(this, menuLocation, Color.black, ResourceManager.getString("edge.color.black")));    n.add(new ResultEdgeColor(this, menuLocation, Color.LIGHT_GRAY, ResourceManager.getString("edge.color.gray")));    n.add(new ResultEdgeColor(this, menuLocation, Color.red, ResourceManager.getString("edge.color.red")));    n.add(new ResultEdgeColor(this, menuLocation, Color.ORANGE, ResourceManager.getString("edge.color.orange")));    n.add(new ResultEdgeColor(this, menuLocation, new Color(0, 200, 0), ResourceManager.getString("edge.color.green")));    n.add(new ResultEdgeColor(this, menuLocation, Color.MAGENTA, ResourceManager.getString("edge.color.magenta")));    n.add(new ResultEdgeColor(this, menuLocation, Color.blue, ResourceManager.getString("edge.color.blue")));    n = new JMenu(ResourceManager.getString("edge.width"));    edgeMenu.add(n);    for(int i = 1; i <= 5; i++)    {      n.add(new ResultEdgeLineWidth(this, menuLocation, i));    }    edgeMenu.add(new Delete(descriptor, this, menuLocation));    model.addUndoableEditListener(undoManager);    new DropTarget(this, this);  }