int width = noCurve ? size.x : size.x - curveWidth + 2* curveIndent - BORDER_LEFT - BORDER_RIGHT; rightSize.x = Math.min(width, rightSize.x); width -= rightSize.x;
public void layout (boolean changed) {	checkWidget();	Point size = getSize();	boolean noCurve = left == null || right == null;	Point rightSize = new Point(0,0);	if (right != null) {		Point trim = right.computeSize(rightWidth, SWT.DEFAULT);		trim.x = trim.x - rightWidth;		rightSize = right.computeSize(rightWidth == SWT.DEFAULT ? SWT.DEFAULT : rightWidth - trim.x, SWT.DEFAULT);	}	int width = noCurve ? size.x : size.x - curveWidth + 2* curveIndent - BORDER_LEFT - BORDER_RIGHT; 	rightSize.x = Math.min(width, rightSize.x);	width -= rightSize.x;	Point leftSize = new Point(0, 0);	if (left != null) {		Point trim = left.computeSize(width, SWT.DEFAULT);		trim.x = trim.x - width;		leftSize = left.computeSize(width - trim.x, SWT.DEFAULT);	}	int x = noCurve ? 0 : BORDER_LEFT;	int oldStart = curveStart;	Rectangle leftRect = null;	Rectangle rightRect = null;	if(left != null) {		int height = Math.min(noCurve ? size.y : size.y - BORDER_TOP - BORDER_BOTTOM - 2*BORDER_STRIPE, leftSize.y);		int y = noCurve ? 0 : BORDER_TOP + BORDER_STRIPE;		leftRect = new Rectangle(x, y, leftSize.x, height);		x += leftSize.x;	}	if (!noCurve) {		curveStart = x - curveIndent;		x += curveWidth - 2*curveIndent;	}	if (right != null) {		int height = noCurve ? size.y : size.y - BORDER_TOP - BORDER_BOTTOM - 2*BORDER_STRIPE;		int y = noCurve ? 0 : BORDER_TOP + BORDER_STRIPE;		rightRect = new Rectangle(x, y, rightSize.x, height);	}	if (curveStart < oldStart) {		redraw(curveStart - CURVE_TAIL, 0, oldStart + curveWidth - curveStart + CURVE_TAIL + 5, size.y, false);	}	if (curveStart > oldStart) {		redraw(oldStart - CURVE_TAIL, 0, curveStart + curveWidth - oldStart + CURVE_TAIL + 5, size.y, false);	}	curveRect = new Rectangle(curveStart, 0, curveWidth, size.y);	update();	if (rightRect != null) right.setBounds(rightRect);	if (leftRect != null) left.setBounds(leftRect);}