if (!ModuleNode.meetsConstraintsForEdge(sourceNode, destNode)) {
if (ModuleNode.meetsConstraintsForEdge(sourceNode, destNode)) {
    public void mouseReleased(MouseEvent me) {        if (me.isConsumed()) {            return;        }        if (_sourceFigNode == null) {            done();            me.consume();            return;        }        int x = me.getX(), y = me.getY();        Editor ce = Globals.curEditor();        Fig destFig = ce.hit(x, y);        if (destFig == null) {            destFig = ce.hit(x - 16, y - 16, 32, 32);        }        GraphModel gm = ce.getGraphModel();        if (!(gm instanceof MutableGraphModel)) {            destFig = null;        }        if (destFig instanceof FigNode) {            MutableGraphModel mgm = (MutableGraphModel) gm;            FigNode destFigNode = (FigNode) destFig;            // If its a FigNode, then check within the            // FigNode to see if a port exists            Object foundPort = destFigNode.deepHitPort(x, y);            Fig destPortFig = destFigNode.getPortFig(foundPort);            if (foundPort != null && mgm.canConnect(startPort, foundPort)) {                ModuleNode sourceNode = (ModuleNode) _sourceFigNode.getOwner();                ModuleNode destNode = (ModuleNode) destFig.getOwner();                if (!ModuleNode.meetsConstraintsForEdge(sourceNode, destNode)) {                    _newEdge = mgm.connect(startPort, foundPort);                    ModuleEdge newModuleEdge = (ModuleEdge) _newEdge;                    //number of edges including the one just made                    int numberOfEdges = sourceNode.countEdges(destNode);                    newModuleEdge.setIndex(numberOfEdges - 1);                    newModuleEdge.initializeFlowrates();                }            }            // Calling connect() will add the edge to the GraphModel and            // any LayerPersectives on that GraphModel will get a            // edgeAdded event and will add an appropriate FigEdge            // (determined by the GraphEdgeRenderer).            if (_newEdge != null) {                ce.damageAll();                _sourceFigNode.damage();                destFigNode.damage();                _newItem = null;                Layer layer = ce.getLayerManager().getActiveLayer();                FigEdge fe = (FigEdge) layer.presentationFor(_newEdge);                fe.setSourcePortFig(_startPortFig);                fe.setSourceFigNode(_sourceFigNode);                fe.setDestPortFig(destPortFig);                fe.setDestFigNode(destFigNode);                if (fe != null)                    ce.getSelectionManager().select(fe);                done();                me.consume();                return;            }        }        _sourceFigNode.damage();        ce.damageAll();        _newItem = null;        done();        me.consume();    }