@Override
    public void paintComponent(Graphics g) {
        super.paintComponent(g);
        this.g = g;

        width = getWidth();
        height = getHeight();

        if (drawAxis) {
            drawVerticals();
        }

        if (click_state == STATE_DROPPED && edit) {
            drawEdge(x0, y0, x1, y1, Color.RED);
            click_state = STATE_IDLE;
        }

        drawPointer(current_x, current_y, Color.LIGHT_GRAY);
        if (edit) {
            drawVertex(relX(), relY(), "", -1, Color.GREEN);
        }

        for (Vertex v : graph.getVertices()) {
            drawVertex(v.x, v.y, v.name, v.dist, v.vColor);
            for (Edge e : v.adj) {
                drawEdge2(e.src.x, e.src.y, e.dest.x, e.dest.y, e.cost, e.flow, e.eColor);
            }
        }

        /*
         Iterator it = coordToName.entrySet().iterator();
         while (it.hasNext()) {
         Map.Entry pairs = (Map.Entry) it.next();
         String name = (String) pairs.getValue();

         Vertex v = graph.getVertex(name);

         drawVertex(v.x, v.y, name, v.dist, v.vColor);
         for (Edge e : v.adj) {
         drawEdge2(e.src.x, e.src.y, e.dest.x, e.dest.y, e.cost, e.flow, e.eColor);
         }
         }
         */
    }