public void mouseReleased( MouseEvent e ) {

        mousePos=e.getPoint();

        LBNode mouseOverN = (LBNode) tgPanel.getMouseOverN();



        if (mouseOverN!=null && dragAddNode!=null && mouseOverN!=dragAddNode) {

            

            Edge ed=tgPanel.findEdge(dragAddNode,mouseOverN);

            if (ed==null) {                

                /*add in an edge to the touchgraph, w.r.t. valide CT structure constraint*/

                if(tgLinkBrowser.rna_ct.validBond(dragAddNode.getID(), mouseOverN.getID())){

                    tgPanel.addEdge(new LBEdge(dragAddNode,mouseOverN)); 

                    /*update the corresponding bond in CT structure*/

                    tgLinkBrowser.rna_ct.addBond(dragAddNode.getID(), mouseOverN.getID());

                }

                else{

                    //show a warning 

                    JOptionPane.showMessageDialog(null, "Invalid Pairing !");

                            

                }

                

            }

            //else 

            //    tgPanel.deleteEdge(ed);



        } else if ( mouseOverN == null && dragAddNode != null ) {

            /*

            try {

                LBNode n = new LBNode();      

                tgPanel.addNode(n);       

                tgPanel.addEdge(new LBEdge(dragAddNode,n)); 

                n.drawx = mousePos.x; 

                n.drawy = mousePos.y;

                tgPanel.updatePosFromDraw(n); 

                tgPanel.setSelect(n);

                tgLinkBrowser.lbNodeDialog.setLBNode(n);      

                tgLinkBrowser.lbNodeDialog.showDialog();

            } catch ( TGException tge ) {

                System.err.println(tge.getMessage());

                tge.printStackTrace(System.err);

            }

            */

        }



        if (mouseWasDragged) { //Don't reset the damper on a mouseClicked

            tgPanel.resetDamper();

            tgPanel.startDamper();

        }   



        dragAddNode=null;

    }