drawBackground(gc, shape, single);
boolean bkSelected = single && selectedIndex != -1; drawBackground(gc, shape, bkSelected);
void drawTabArea(Event event) {	GC gc = event.gc;	Point size = getSize();	int[] shape = null;		if (tabHeight == 0) {		int x1 = borderLeft - 1;		int x2 = size.x - borderRight;		int y1 = onBottom ? size.y - borderBottom - highlight_header - 1 : borderTop + highlight_header;		int y2 = onBottom ? size.y - borderBottom : borderTop;		if (borderLeft > 0 && onBottom) y2 -= 1;				shape = new int[] {x1, y1, x1,y2, x2,y2, x2,y1};		// If horizontal gradient, show gradient across the whole area		if (selectedIndex != -1 && selectionGradientColors != null && selectionGradientColors.length > 1 && !selectionGradientVertical) {			drawBackground(gc, shape, true);		} else if (selectedIndex == -1 && gradientColors != null && gradientColors.length > 1 && !gradientVertical) {			drawBackground(gc, shape, false);		} else {			gc.setBackground(selectedIndex == -1 ? getBackground() : selectionBackground);			gc.fillPolygon(shape);		}				//draw 1 pixel border		if (borderLeft > 0) {			gc.setForeground(borderColor);			gc.drawPolyline(shape); 		}		return;	}		int x = Math.max(0, borderLeft - 1);	int y = onBottom ? size.y - borderBottom - tabHeight : borderTop;	int width = size.x - borderLeft - borderRight + 1;	int height = tabHeight - 1;		// Draw Tab Header	if (onBottom) {		int[] left = simple ? SIMPLE_BOTTOM_LEFT_CORNER : BOTTOM_LEFT_CORNER;		int[] right = simple ? SIMPLE_BOTTOM_RIGHT_CORNER : BOTTOM_RIGHT_CORNER;		shape = new int[left.length + right.length + 4];		int index = 0;		shape[index++] = x;		shape[index++] = y-highlight_header;		for (int i = 0; i < left.length/2; i++) {			shape[index++] = x+left[2*i];			shape[index++] = y+height+left[2*i+1];			if (borderLeft == 0) shape[index-1] += 1;		}		for (int i = 0; i < right.length/2; i++) {			shape[index++] = x+width+right[2*i];			shape[index++] = y+height+right[2*i+1];			if (borderLeft == 0) shape[index-1] += 1;		}		shape[index++] = x+width;		shape[index++] = y-highlight_header;	} else {		int[] left = simple ? SIMPLE_TOP_LEFT_CORNER : TOP_LEFT_CORNER;		int[] right = simple ? SIMPLE_TOP_RIGHT_CORNER : TOP_RIGHT_CORNER;		shape = new int[left.length + right.length + 4];		int index = 0;		shape[index++] = x;		shape[index++] = y+height+highlight_header + 1;		for (int i = 0; i < left.length/2; i++) {			shape[index++] = x+left[2*i];			shape[index++] = y+left[2*i+1];		}		for (int i = 0; i < right.length/2; i++) {			shape[index++] = x+width+right[2*i];			shape[index++] = y+right[2*i+1];		}		shape[index++] = x+width;		shape[index++] = y+height+highlight_header + 1;	}	// Fill in background	drawBackground(gc, shape, single);	// Fill in parent background for non-rectangular shape	Region r = new Region();	r.add(new Rectangle(x, y, width + 1, height + 1));	r.subtract(shape);	gc.setBackground(getParent().getBackground());	fillRegion(gc, r);	r.dispose();	// Draw border line	if (borderLeft > 0) {		RGB outside = getParent().getBackground().getRGB();		antialias(shape, borderColor.getRGB(), null, outside, gc);		gc.setForeground(borderColor);		gc.drawPolyline(shape);	}			// Draw the unselected tabs.	if (!single) {		for (int i=0; i < items.length; i++) {			if (i != selectedIndex && event.getBounds().intersects(items[i].getBounds())) {				items[i].onPaint(gc, false);			}		}	}		// Draw selected tab	if (selectedIndex != -1) {		CTabItem item = items[selectedIndex];		item.onPaint(gc, true);	} else {		// if no selected tab - draw line across bottom of all tabs		int x1 = borderLeft;		int y1 = (onBottom) ? size.y - borderBottom - tabHeight - 1 : borderTop + tabHeight;		int x2 = size.x - borderRight;		gc.setForeground(borderColor);		gc.drawLine(x1, y1, x2, y1);	}		// Draw Buttons	if (items.length > 0) {		drawChevron(gc);		drawMinimize(gc);		drawMaximize(gc);	}		// Draw insertion mark//	if (insertionIndex > -2) {//		gc.setForeground(getDisplay().getSystemColor(SWT.COLOR_LIST_SELECTION));//		if (insertionIndex == -1) {//			Rectangle bounds = items[0].getBounds();//			gc.drawLine(bounds.x, bounds.y, bounds.x, bounds.y + bounds.height - 1);//			gc.drawLine(bounds.x - 2, bounds.y, bounds.x + 2, bounds.y);//			gc.drawLine(bounds.x - 1, bounds.y + 1, bounds.x + 1, bounds.y + 1);//			gc.drawLine(bounds.x - 1, bounds.y + bounds.height - 2, bounds.x + 1, bounds.y + bounds.height - 2);//			gc.drawLine(bounds.x - 2, bounds.y + bounds.height - 1, bounds.x + 2, bounds.y + bounds.height - 1);////		} else {//			Rectangle bounds = items[insertionIndex].getBounds();//			gc.drawLine(bounds.x + bounds.width, bounds.y, bounds.x + bounds.width, bounds.y + bounds.height - 1);//			gc.drawLine(bounds.x + bounds.width - 2, bounds.y, bounds.x + bounds.width + 2, bounds.y);//			gc.drawLine(bounds.x + bounds.width - 1, bounds.y + 1, bounds.x + bounds.width + 1, bounds.y + 1);//			gc.drawLine(bounds.x + bounds.width - 1, bounds.y + bounds.height - 2, bounds.x + bounds.width + 1, bounds.y + bounds.height - 2);//			gc.drawLine(bounds.x + bounds.width - 2, bounds.y + bounds.height - 1, bounds.x + bounds.width + 2, bounds.y + bounds.height - 1);//		}//	}}