@Override
    protected void paintComponent(Graphics g) {
        super.paintComponent(g); //To change body of generated methods, choose Tools | Templates.
        g.drawImage(image, 0, 0, image.getWidth(this), image.getHeight(this), this);
        
        g.setColor(Color.red);
        if(points != null && !points.isEmpty()){
            for(int i = 0; i < points.size(); i++){
                g.fillOval(points.get(i).getLocation().x - 4, points.get(i).getLocation().y - 4, 8, 8);
            }
        }
        
        g.setColor(Color.yellow);
        if(hoveredPoint != null) g.fillOval(hoveredPoint.getLocation().x - 4, hoveredPoint.getLocation().y - 4, 8, 8);
        
        g.setColor(Color.red);
        if(selectedPoint != null) g.fillOval(selectedPoint.getLocation().x - 6, selectedPoint.getLocation().y - 6, 12, 12);
        g.setColor(Color.yellow);
        if(selectedPoint != null) g.fillOval(selectedPoint.getLocation().x - 4, selectedPoint.getLocation().y - 4, 8, 8);
        
        
        g.setColor(Color.BLACK);
        
        for (int i = 0; i < edges.size(); i++)
        {
            g.drawLine(edges.get(i).a.getLocation().x, edges.get(i).a.getLocation().y, edges.get(i).b.getLocation().x, edges.get(i).b.getLocation().y);
        }
        if(drawingLine) g.drawLine(selectedPoint.getLocation().x, selectedPoint.getLocation().y, xDragged, yDragged);
    }