public void mousePressed(MouseEvent e) {

            Node mouseOverN = tgPanel.getMouseOverN();

            Node select = tgPanel.getSelect();





            if (e.getModifiers() == MouseEvent.BUTTON1_MASK) {

                if (mouseOverN != null) {

                    if(mouseOverN!=select)

                        dragNodeUI.activate(e);

                    else

                        dragAddUI.activate(e);

                }

                else

                    if(hvDragUI!=null) hvDragUI.activate(e);

            }

            

                          if (e.isPopupTrigger()) {

                   popupNode = tgPanel.getMouseOverN();

                   popupEdge = tgPanel.getMouseOverE();

                   if (popupNode!=null) {

                       tgPanel.setMaintainMouseOver(true);

                    nodePopup.show(e.getComponent(), e.getX(), e.getY());

                }

                else if (popupEdge!=null) {

                    tgPanel.setMaintainMouseOver(true);

                    edgePopup.show(e.getComponent(), e.getX(), e.getY());

                }

                else {

                    backPopup.show(e.getComponent(), e.getX(), e.getY());

                }

               }



        }