items[i].x = defaultX;
item.x = defaultX; item.showing = false;
boolean setItemLocation() {	boolean changed = false;	if (items.length == 0) return false;	Point size = getSize();	int y = onBottom ? Math.max(borderBottom, size.y - borderBottom - tabHeight) : borderTop;	if (single) {		int defaultX = size.x + 10; // off screen		for (int i = 0; i < items.length; i++) {			if (i == selectedIndex) {				CTabItem item = items[selectedIndex];				int oldX = item.x, oldY = item.y;				item.x = borderLeft;				item.y = y;				if (showClose || item.showClose) {					item.closeRect.x = borderLeft + CTabItem.LEFT_MARGIN;					item.closeRect.y = onBottom ? size.y - borderBottom - tabHeight + (tabHeight - BUTTON_SIZE)/2: borderTop + (tabHeight - BUTTON_SIZE)/2;				}				if (item.x != oldX || item.y != oldY) changed = true;			} else {				items[i].x = defaultX;			}		}	} else {		int x = -1;		for (int i = firstIndex - 1; i >= 0; i--) { 			// if the first visible tab is not the first tab			CTabItem item = items[i];			x -= item.width; 			// layout tab items from right to left thus making them invisible			item.x = x;			item.y = y;			item.closeRect.x = item.x + item.width - BUTTON_SIZE - CTabItem.RIGHT_MARGIN;			item.closeRect.y = onBottom ? size.y - borderBottom - tabHeight + (tabHeight - BUTTON_SIZE)/2 : borderTop + (tabHeight - BUTTON_SIZE)/2;		}				x = 0;		int rightItemEdge = getRightItemEdge();		for (int i = firstIndex; i < items.length; i++) {			// continue laying out remaining, visible items left to right 			CTabItem item = items[i];			if (item.x != x || item.y != y) changed = true;			item.x = x;			item.y = y;			if (i == selectedIndex) {				int edge = Math.min(item.x + item.width, rightItemEdge);				item.closeRect.x = edge - CTabItem.RIGHT_MARGIN - BUTTON_SIZE;			} else {				item.closeRect.x = item.x + item.width - CTabItem.RIGHT_MARGIN - BUTTON_SIZE;			}			item.closeRect.y = onBottom ? size.y - borderBottom - tabHeight + (tabHeight - BUTTON_SIZE)/2: borderTop + (tabHeight - BUTTON_SIZE)/2;			x = x + item.width;			if (!simple && i == selectedIndex) x += curveWidth - 2*curveIndent;		}	}	return changed;}