private void drawMap(Graphics graphics) {
        BufferedImage buffer = new BufferedImage( getWidth(), getHeight(), BufferedImage.TYPE_INT_RGB );
        Graphics g = buffer.getGraphics();
        g.setColor( Color.white);
        g.fillRect( 0, 0, getWidth(), getHeight() );
        if (myMap != null) {
            for (int x=0; x<myMap.getWidth(); x++) {
                for (int y=0; y<myMap.getHeight(); y++) {

                	g.setColor(converter.colorReprisentation(myMap.getTerrain(x, y)));
                    
                    g.fillRect( x*blockWidth, y*blockHeight, blockWidth, blockHeight );
                    g.setColor( Color.white);
                }   
            }
        }

        int panelWidth = getWidth();
        int panelHeight = getHeight();
        g.setColor( Color.black );
        if (!selected)
            g.drawRect( 0, 0, panelWidth-1, getHeight()-1 );
        else {
            g.drawRect( 0, 0, panelWidth-1, panelHeight-1 );
            g.drawRect( 1, 1, panelWidth-3, panelHeight-3 );
            g.drawRect( 2, 2, panelWidth-5, panelHeight-5 );
        }
        Graphics2D graphics2d = (Graphics2D)graphics;
        graphics2d.drawImage(buffer,null,0,0);
    }