public int getWidth(LinkedList<Component> list) {
		if (list == null) {
			return 0;
		}
		if (list.size() == 1) {
			return getDimensions(list.get(0)).width;
		}
		int width = 0;
		for (Component c : list) {
			if (list.contains(c)) {
				width += getDimensions(c).width;
			}
		}
		width += (list.size() - 1) * hgap;
		return width;
	}