checkWidget(); if (preferredWidth > -1) return new Point(preferredWidth, preferredHeight); int width = MINIMUM_WIDTH; int height = DEFAULT_HEIGHT; if (wHint != SWT.DEFAULT) width = wHint + MINIMUM_WIDTH + MARGIN_WIDTH; if (hHint != SWT.DEFAULT) height = hHint + (2 + MARGIN_HEIGHT);
checkWidget (); Point size; if (control != null) { size = control.computeSize (wHint, hHint); } else { size = new Point (0,0); } if (wHint != SWT.DEFAULT) size.x = wHint; if (hHint != SWT.DEFAULT) size.y = hHint; int width = size.x + MINIMUM_WIDTH + MARGIN_WIDTH; int height = Math.max (MINIMUM_CHILD_HEIGHT, size.y) + MARGIN_HEIGHT;
public Point computeSize (int wHint, int hHint) {	checkWidget();	if (preferredWidth > -1) return new Point(preferredWidth, preferredHeight);	int width = MINIMUM_WIDTH;	int height = DEFAULT_HEIGHT;	if (wHint != SWT.DEFAULT) width = wHint + MINIMUM_WIDTH + MARGIN_WIDTH; 	if (hHint != SWT.DEFAULT) height = hHint + (2 + MARGIN_HEIGHT);	return new Point (width, height);}