public void mouseClicked(MouseEvent mouseEvent) {
        Pair<Vertex, Double> p = mindistv(g, mousePos(mouseEvent));
        Vertex v = (Vertex) p.first;
        if (v != null && isPointOnVertex(g, v, mousePos(mouseEvent))) {
            if (mouseEvent.getClickCount() > 1)
                sendEventToBlackBoard(VertexEvent.doubleClicked(v, mousePos(mouseEvent, v), mouseEvent.getButton(), mouseEvent.getModifiersEx()));
            else
                sendEventToBlackBoard(VertexEvent.clicked(v, mousePos(mouseEvent, v), mouseEvent.getButton(), mouseEvent.getModifiersEx()));
            return;
        }
        Pair<Edge, Double> pp;
        pp = mindiste(g, mousePos(mouseEvent));
        Edge e = (Edge) pp.first;
        double dist = (Double) pp.second;
        if (g.isEdgesCurved()) {
            if (pp.second <= (EDGE_CURVE_CPNTROL_BOX_DIAMETER)) {
                sendEventToBlackBoard(EdgeEvent.clicked(e, mousePos(mouseEvent, e), mouseEvent.getButton()));
                return;
            }
        } else if (Math.sqrt(dist) < 4 ) {
//                if (doubleClicked)
//                    sendEventToBlackBoard(EdgeEvent.mouseDoubleClicked(e, mousePos(mouseEvent), mouseEvent.getButton()));
//                else
//                System.err.println("&^&^&^&^&^&^&");
            sendEventToBlackBoard(EdgeEvent.clicked(e, mousePos(mouseEvent, e), mouseEvent.getButton()));
            return;
        } else {
            if (e != null) {
                if (e.isLoop()) {
                    sendEventToBlackBoard(EdgeEvent.clicked(e, mousePos(mouseEvent, e), mouseEvent.getButton()));
                    return;
                }
            }
        }


        sendEventToBlackBoard(GraphEvent.mouseClicked(g, mousePos(mouseEvent), mouseEvent.getButton(), mouseEvent.getModifiersEx()));
    }