private void drawColourPalette(Graphics g)
	{
		BufferedImage palette = new BufferedImage(COLOUR_W, COLOUR_H,
				BufferedImage.TYPE_INT_ARGB);
		Graphics2D paletteG2D = palette.createGraphics();
		paletteG2D.drawImage(colourPalette, 0, 0, null);

		// draw box for selected component colour.
		Tile tile = getSelectedTile();
		if (!(tile instanceof EmptyTile)) {
			if (tile instanceof ActionTile && selectedComponent == 6)
				paletteG2D.drawImage(colourSelect, COLOUR_OX + COLOUR_SX
						* ((ActionTile) tile).getTargetColour(), COLOUR_OY,
						null);
			else {
				if (selectedComponent == 1)
					paletteG2D.drawImage(colourSelect, COLOUR_OX + COLOUR_SX
							* tile.getColour(), COLOUR_OY, null);
				else if (selectedComponent == 2)
					paletteG2D.drawImage(colourSelect, COLOUR_OX + COLOUR_SX
							* tile.getConnections()[0], COLOUR_OY, null);
				else if (selectedComponent == 3)
					paletteG2D.drawImage(colourSelect, COLOUR_OX + COLOUR_SX
							* tile.getConnections()[1], COLOUR_OY, null);
				else if (selectedComponent == 4)
					paletteG2D.drawImage(colourSelect, COLOUR_OX + COLOUR_SX
							* tile.getConnections()[2], COLOUR_OY, null);
				else if (selectedComponent == 5)
					paletteG2D.drawImage(colourSelect, COLOUR_OX + COLOUR_SX
							* tile.getConnections()[3], COLOUR_OY, null);
			}
		}

		g.drawImage(palette, COLOUR_X, COLOUR_Y, null);
	}