private void paintGraph(Graphics g) {
        
        if (!java.beans.Beans.isDesignTime()) {
            if (buffer != null) {
                g.drawImage(buffer, 0, 0, buffer.getWidth(), buffer.getHeight(), null);
            }
            
            buffer = new BufferedImage(this.getWidth(), this.getHeight(), BufferedImage.TYPE_INT_RGB);
            Graphics2D g2D = (Graphics2D) buffer.getGraphics();
            
            calcRelation();
            
            g2D.setColor(new Color(238,238,238));
            g2D.fillRect(0, 0, this.getWidth(), this.getHeight());    
            g2D.setColor(Color.white);
            g2D.fillRoundRect(5, 5, this.getWidth()- 10, this.getHeight() - 10, 15, 15);
            if (this.showPheromonLevel) {
                g2D.setStroke(this.normalline);
                drawPheromonLevels(g2D);
            }
            
            if (showOptTour) {
                lineOffset = 2;
                //g2D.setColor(Color.green);
                g2D.setColor(new Color(0,200,0,transparency)); // Green
                g2D.setStroke(this.normalline);
                drawRoute(g2D, Main.data.getOptimalRoute());
            }
            
            if (showLocalBest) {
                lineOffset = -2;
                //g2D.setColor(Color.blue);
                g2D.setColor(new Color(0,0,255,transparency)); // Blue
                g2D.setStroke(this.normalline);
                drawRoute(g2D, Main.data.getLocalBest());
            }
            
            if (showGlobalBest) {
                lineOffset = 0;
                //g2D.setColor(Color.red);
                g2D.setColor(new Color(255,0,0,transparency)); // Red
                g2D.setStroke(this.normalline);
                drawRoute(g2D, Main.data.getGlobalBest());
            }


            //Städte Anzeigen
            for (City city : Main.data.getCityCollection()) {
                drawCity(g2D, city);
            }
            
            g.drawImage(buffer, 0, 0, null);
        }
    }