protected Dimension layoutSize(Container parent, int mode) {
		int wl = 0;
		int wt = 600;
		int h = 0;

		synchronized (parent.getTreeLock()) {
			Dimension db = (mode == MINIMUM_SIZE) ? lblName.getMinimumSize()
					: lblName.getPreferredSize();

			h += db.height + vgap;

			for (int i = 0; i < labels.length; i++) {
				Dimension dl = (mode == MINIMUM_SIZE) ? labels[i]
						.getMinimumSize() : labels[i].getPreferredSize();

				if (wl < dl.width)
					wl = dl.width;

				Dimension dt = (mode == MINIMUM_SIZE) ? values[i]
						.getMinimumSize() : values[i].getPreferredSize();

				if (wt < dt.width)
					wt = dt.width;

				h += (dl.height > dt.height) ? dl.height : dt.height;
			}

			h += vgap * (labels.length - 1);
		}

		Insets insets = getInsets();

		int width = insets.left + myInsets.left + wl + hgap + wt + myInsets.right + insets.right;
		int height = insets.top + myInsets.top + h + myInsets.bottom + insets.bottom;

		return new Dimension(width, height);
	}