public void drawStateLabel(Graphics g, State state, Point point, Color color) {
		String[] labels = state.getLabels();
		if (labels.length == 0)
			return;

		int ascent = g.getFontMetrics().getAscent();
		int heights = 0;
		int textWidth = 0;

		for (int i = 0; i < labels.length; i++) {
			Rectangle2D bounds = g.getFontMetrics().getStringBounds(labels[i],
					g);
			textWidth = Math.max((int) bounds.getWidth(), textWidth);
			heights += ascent + STATE_LABEL_PAD;
		}
		heights -= STATE_LABEL_PAD;

		// Width of the box.
		int width = textWidth + (STATE_LABEL_PAD << 1);
		int height = heights + (STATE_LABEL_PAD << 1);
		// Upper corner of the box.
		int x = point.x - (width >> 1);
		int y = point.y + STATE_RADIUS - STATE_LABEL_PAD;
		// Where the y point of the baseline is.
		int baseline = y;

		g.setColor(color);
		g.fillRect(x, y, width, height);
		g.setColor(Color.black);
		for (int i = 0; i < labels.length; i++) {
			baseline += ascent + STATE_LABEL_PAD;
			g.drawString(labels[i], x + STATE_LABEL_PAD, baseline);
		}
		g.drawRect(x, y, width, height);
	}