private void drawCloudMap(Graphics graphics) {
		BufferedImage buffer = new BufferedImage(getWidth(), getHeight(),
				BufferedImage.TYPE_INT_RGB);
		Graphics gr = buffer.getGraphics();
		for (int x = 0; x < mapWidth; x++) {
			for (int y = 0; y < mapHeight; y++) {
				double emptyAverage = 1;
				for (int t = 0; t < converter.numOfTileTypes(); t++) {
					emptyAverage -= tileTypeAverages[t][x][y];
				}
				
				double r = emptyAverage * backgroundColor.getRed();
				double g = emptyAverage * backgroundColor.getGreen();
				double b = emptyAverage * backgroundColor.getBlue();
				
				for (int t = 0; t < converter.numOfTileTypes(); t++) {
					Color tileColor =  converter.colorReprisentation(t);
					
					r += tileTypeAverages[t][x][y] * tileColor.getRed();
					g += tileTypeAverages[t][x][y] * tileColor.getGreen();
					b += tileTypeAverages[t][x][y] * tileColor.getBlue();
				}
				
				if (state == State.SELECTED)
					gr.setColor(new Color((int) (r / 1.1), (int) (g / 1.1), (int)b));
				else
					gr.setColor(new Color((int)r, (int)g, (int)b));
				gr.fillRect(x * blockWidth, y * blockHeight, blockWidth,
						blockHeight);
			}
		}

		int panelWidth = getWidth();
		int panelHeight = getHeight();
		gr.setColor(Color.black);
		switch (state) {
		case SELECTED:
		case INSPECTED:
			gr.setColor(Color.blue);
		case MOUSEOVER:
			gr.drawRect(1, 1, panelWidth - 3, panelHeight - 3);
			gr.drawRect(2, 2, panelWidth - 5, panelHeight - 5);
		case IDLE:
			gr.drawRect(0, 0, panelWidth - 1, getHeight() - 1);
			break;
		}
		gr.setColor(Color.black);
		Graphics2D graphics2d = (Graphics2D) graphics;
		graphics2d.drawImage(buffer, null, 0, 0);
	}