@Override
    public void paintComponent(Graphics g){
        super.paintComponent(g);
        if(nodes.get(0) == null)
        {
            return;
        }
        Graphics2D g2 = (Graphics2D)g;
        g2.setColor(Color.blue);
        int x = 0;
        int y = 0;
        double xs = (double)(this.getWidth()-b-(nodes.get(0).r*nodeScaling));
        double ys = (double)(this.getHeight()-b-(nodes.get(0).r*nodeScaling)-noticeBorder);
        g2.setColor(Color.black);
        g2.fillRect(0, 0, this.getWidth(), this.getHeight());
        g2.setColor(Color.blue);
        drawNode s;
        drawNode d;
        RenderingHints rh = new RenderingHints(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
        g2.setRenderingHints(rh);
        g2.setColor(Color.white);
        if(!ignoreLinks)
        {
            for(drawLink L : links.values())
            {
                g2.setColor(L.color);
                s = nodes.get(L.sid);
                d = nodes.get(L.eid);
                if(s != null && d != null)
                {
                    g2.drawLine((int)((s.x*xs)+(s.r*nodeScaling)/2d), (int)((s.y*ys)+(s.r*nodeScaling)/2d),(int)((d.x*xs)+(d.r*nodeScaling)/2d),(int)((d.y*ys)+(d.r*nodeScaling)/2d));
                }
            }
        }
        for(drawNode N : nodes.values())
        {
            g2.setColor(N.color);
            g2.fill(new Ellipse2D.Double(N.x*xs,N.y*ys, N.r*nodeScaling, N.r*nodeScaling));
            g2.setColor(Color.black);
            g2.draw(new Ellipse2D.Double(N.x*xs,N.y*ys, N.r*nodeScaling, N.r*nodeScaling));
        }
        if(showInfoForNode != -1 && nodeInfo.containsKey(showInfoForNode))
        {
            drawNode N = nodes.get(showInfoForNode);

            x = (int)(N.x*xs + N.r*nodeScaling) + 3;
            y = (int)(N.y*ys);
            CTB.flipShift = (int)(N.r*nodeScaling)+5;
            CTB.draw(g2, x, y, this.getWidth(), this.getHeight(), nodeInfo.get(showInfoForNode));
        }
        g2.setColor(Color.white);
        g2.setFont(new Font("Arial",Font.PLAIN,10));
        g2.drawString("Ruud van de Bovenkamp - NAS", b, this.getHeight()-b);
        doneDrawing = true;
    }