/** @see org.eclipse.gef.commands.Command#canExecute() */ public boolean canExecute() { if (source.equals(target)) return false; // Check for existence of connection already List transistions = source.getOutgoingTransitions(); for (int i = 0; i < transistions.size(); i++) { if (((Transition) transistions.get(i)).target.equals(target)) return false; } return true; }
/** @see org.eclipse.gef.commands.Command#redo() */ public void redo() { source.addOutput(transition); target.addInput(transition); }
/** @see org.eclipse.gef.commands.Command#undo() */ public void undo() { source.removeOutput(transition); target.removeInput(transition); }