@Override
        public void paint(Graphics g) {
            
            try {
                //Some performance boosts (may lower the quality, will increase the performance)
                Graphics2D g2d = (Graphics2D) g;
            
                g2d.setRenderingHint(
                    RenderingHints.KEY_DITHERING,
                    RenderingHints.VALUE_DITHER_DISABLE);
            
                g2d.setRenderingHint(
                    RenderingHints.KEY_COLOR_RENDERING,
                    RenderingHints.VALUE_COLOR_RENDER_SPEED);
            
                g2d.setRenderingHint(
                    RenderingHints.KEY_ANTIALIASING,
                    RenderingHints.VALUE_ANTIALIAS_OFF);
            
                g2d.setRenderingHint(
                    RenderingHints.KEY_TEXT_ANTIALIASING,
                    RenderingHints.VALUE_TEXT_ANTIALIAS_OFF);
                
                //set transparency
                g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER,0.3F));
            }
            catch (ClassCastException e) {
                
            }
            
            super.paint(g); // call superclass's paint
            
            //TODO Background image (as map)
            try {
                BufferedImage bi = ImageIO.read(new File("res/Plane.jpg"));
                g.drawImage(bi, 0, 0, 660, 660, this);
            }
            catch (IOException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
            
            //Causes recalculation on each change of the window size, position etc ...
            //determinePoints();
            
            //No runtime-intensive calculations here, since this method is called a huge amount of times!
            g.setFont(labelFont);
            g.setColor(labelColor);
            
            for(Map.Entry<Airport, Point2D.Double> entry: points.entrySet()) {
                Airport        a = entry.getKey();
                Point2D.Double p = entry.getValue();
                
                //Set paint mode on ...
                g.setColor(labelColor);
                g.setPaintMode();

                //Paint the airport ...
                g.drawImage(airportPicture, (int)Math.round(p.x-picCenter.x), (int)Math.round(p.y-picCenter.y), this);
                
                //If the airport is the start or the destination airport, change the color
                if (a == ConnectionVisualization.this.startAirport) {
                    g.setColor(Color.RED);
                }
                
                if (a == ConnectionVisualization.this.destinationAirport) {
                    g.setColor(Color.CYAN);
                }
               
                //Paint the airport's name
                g.drawString(a.toString(), (int)Math.round(p.x), (int)Math.round(p.y));
                
                //Set paint mode on ...
                g.setColor(labelColor);
                g.setPaintMode();
                
                //Draw the connections to the destinations
                drawConnectionsOfAirport(a, g);
            }
            
            //Set the status text
            statusText.setText(getStatusText());
            
            //Set the calculation button
            if (startAirport == null || destinationAirport == null) {
                calcButton.setEnabled(false);
            }
            else {
            //Only enable when startAirport and destinationAirport are selected
                calcButton.setEnabled(true);
            }

            //a given route is painted in orange
            if (route != null) {
                Airport source = null, dest = null;
                
                g.setColor(Color.ORANGE);
                
                Iterator<Airport> it = route.iterator();
                while(it.hasNext()) {
                    dest = it.next();
                    drawConnectionBetween(source, dest, g);
                    source = dest;
                }
            }
            else {
            //No route is given. Assume that we are in selection mode
            
            //redraw the connections of the startAirport
            //Note: we are using XOR mode to show bidirectional connection as RED xor CYAN = WHITE !!
            g.setXORMode(Color.RED);
            drawConnectionsOfAirport(startAirport, g);
            
            //redraw the connections of the destinationAirport
            g.setXORMode(Color.CYAN);
            drawConnectionsOfAirport(destinationAirport, g);
            
            }
        }