public void mouseReleased(MouseEvent e) {
        Cell connectCell = null;
        for (Cell cell : canvas.getCells()) {
            Rectangle rect = SwingUtilities.convertRectangle(cell, cell.getConnectHotSpotArea().getArea(), canvas);
            Point p = SwingUtilities.convertPoint(connectObject, e.getPoint(), canvas);
            if (rect.contains(p) && cell.isConnecting()) {
                connectCell = cell;
            }
        }
        if (connectCell != null) {
            canvas.addArrow((Node) connectObject, (Node) connectCell);
            canvas.setChanged(true);
            canvas.removeTempArrow();
        } else {
            canvas.removeTempArrow();
        }
    }