cellBounds.height - (2 * padding));
cellBounds.height - 2 * (padding - (parent.linesVisible ? 1 : 0)));
void paint (GC gc, TreeColumn column, boolean paintCellContent) {	int columnIndex = 0, x = 0;	if (column != null) {		columnIndex = column.getIndex ();		x = column.getX ();	}	/* if this cell is completely to the right of the client area then there's no need to paint it */	Rectangle clientArea = parent.getClientArea ();	if (clientArea.x + clientArea.width < x) return;	Rectangle cellBounds = getCellBounds (columnIndex);	if (parent.linesVisible) {		cellBounds.y++;		cellBounds.height--;	}	int cellRightX = 0;	if (column != null) {		cellRightX = column.getX () + column.width;	} else {		cellRightX = cellBounds.x + cellBounds.width;	}	/* if this cell is completely to the left of the client area then there's no need to paint it */	if (cellRightX < 0) return;	/* restrict the clipping region to the cell */	gc.setClipping (x, cellBounds.y, clientArea.width - x, cellBounds.height);		int y = parent.getItemY (this);	int itemHeight = parent.itemHeight;	/* draw the background color of this cell */	Color background = getBackground (columnIndex);	if (columnIndex == 0) {		Rectangle focusBounds = getFocusBounds ();		gc.setBackground (parent.getBackground ());		if (focusBounds.x > 0) {			/* fill space to left of selection rect */			gc.fillRectangle (0, y, focusBounds.x, itemHeight);		}		if (column == null) {			/* fill space to right of selection rect */			int rightX = focusBounds.x + focusBounds.width;			int width = clientArea.width - rightX;			if (width > 0) {				gc.fillRectangle (rightX, y, width, itemHeight);			}		}		int fillWidth = 0;		if (column == null) {			fillWidth = focusBounds.width;		} else {			fillWidth = column.width - focusBounds.x;			if (parent.linesVisible) fillWidth--;		}		gc.setBackground (background);		gc.fillRectangle (focusBounds.x, cellBounds.y, fillWidth, cellBounds.height);	} else {		int fillWidth = cellBounds.width;		if (parent.linesVisible) fillWidth--;		gc.setBackground (background);		gc.fillRectangle (cellBounds.x, cellBounds.y, fillWidth, cellBounds.height);	}	/* draw the selection bar if the receiver is selected */	if (isSelected () && (columnIndex == 0 || (parent.style & SWT.FULL_SELECTION) != 0)) {		gc.setBackground (display.getSystemColor (SWT.COLOR_LIST_SELECTION));		if (columnIndex == 0) {			Rectangle focusBounds = getFocusBounds ();			int fillWidth = focusBounds.width;			if (parent.columns.length < 2 || (parent.style & SWT.FULL_SELECTION) == 0) {				fillWidth -= 2;	/* space for right bound of focus rect */			}			if (fillWidth > 0) {				gc.fillRectangle (focusBounds.x + 1, focusBounds.y + 1, fillWidth, focusBounds.height - 2);			}		} else {			int fillWidth = column.width;			if (columnIndex == parent.columns.length - 1) {				fillWidth -= 2;		/* space for right bound of focus rect */			}			if (fillWidth > 0) {				gc.fillRectangle (					column.getX (),					cellBounds.y + 1,					fillWidth,					cellBounds.height - 2);			}		}	}			if (!paintCellContent) return;	/* Draw column 0 decorations */	if (columnIndex == 0) {		/* Draw hierarchy connector lines */		Rectangle expanderBounds = getExpanderBounds ();		gc.setForeground (parent.getConnectorColor ());		/* Draw vertical line above expander */		int lineX = expanderBounds.x + expanderBounds.width / 2;		int y2 = expanderBounds.y;		if (items.length == 0) {			y2 += expanderBounds.height / 2;		}		/* Do not draw this line iff this is the very first item in the tree */ 		if (parentItem != null || getIndex () != 0) {			gc.drawLine (lineX, y, lineX, y2);		}		/* Draw vertical line below expander if the receiver has lower siblings */		if (!isLastChild ()) {			if (items.length != 0) y2 += expanderBounds.height;			gc.drawLine (lineX, y2, lineX, y + itemHeight);		}		/* Draw horizontal line to right of expander */		Point[] endpoints = getHconnectorEndpoints ();		gc.drawLine (endpoints [0].x, endpoints [0].y, endpoints [1].x - Tree.MARGIN_IMAGE, endpoints [1].y);				/* 		 * Draw hierarchy lines that are needed by other items that are shown below		 * this item but whose parents are shown above (ie.- lines to the left of		 * this item's connector line).		 */		TreeItem item = parentItem;		while (item != null) {			if (!item.isLastChild ()) {				Rectangle itemExpanderBounds = item.getExpanderBounds ();				lineX = itemExpanderBounds.x + itemExpanderBounds.width / 2;				gc.drawLine (lineX, y, lineX, y + itemHeight);			}			item = item.parentItem;		}				/* Draw expand/collapse image if receiver has children */		if (items.length > 0) {			Image image = expanded ? parent.getExpandedImage () : parent.getCollapsedImage ();			gc.drawImage (image, expanderBounds.x, expanderBounds.y);		}				/* Draw checkbox if parent Tree has style SWT.CHECK */		if ((parent.style & SWT.CHECK) != 0) {			Image baseImage = grayed ? parent.getGrayUncheckedImage () : parent.getUncheckedImage ();			Rectangle checkboxBounds = getCheckboxBounds ();			gc.drawImage (baseImage, checkboxBounds.x, checkboxBounds.y);			/* Draw checkmark if item is checked */			if (checked) {				Image checkmarkImage = parent.getCheckmarkImage ();				Rectangle checkmarkBounds = checkmarkImage.getBounds ();				int xInset = (checkboxBounds.width - checkmarkBounds.width) / 2;				int yInset = (checkboxBounds.height - checkmarkBounds.height) / 2;				gc.drawImage (checkmarkImage, checkboxBounds.x + xInset, checkboxBounds.y + yInset);			}		}	}	Image image = getImage (columnIndex);	String text = getDisplayText (columnIndex);	Rectangle imageArea = getImageBounds (columnIndex);	int startX = imageArea.x;		/* while painting the cell's content restrict the clipping region */	int padding = parent.getCellPadding ();	gc.setClipping (		startX,		cellBounds.y + padding,		cellRightX - startX - padding,		cellBounds.height - (2 * padding));	/* draw the image */	if (image != null) {		Rectangle imageBounds = image.getBounds ();		gc.drawImage (			image,			0, 0,									/* source x, y */			imageBounds.width, imageBounds.height,	/* source width, height */			imageArea.x, imageArea.y,				/* dest x, y */			imageArea.width, imageArea.height);		/* dest width, height */	}		/* draw the text */	if (text.length () > 0) {		gc.setFont (getFont (columnIndex));		int fontHeight = getFontHeight (columnIndex);		if (isSelected () && (columnIndex == 0 || (parent.style & SWT.FULL_SELECTION) != 0)) {			gc.setForeground (display.getSystemColor (SWT.COLOR_LIST_SELECTION_TEXT));		} else {			gc.setForeground (getForeground (columnIndex));		}		x = getTextX (columnIndex) + MARGIN_TEXT;		gc.drawString (text, x, y + (itemHeight - fontHeight) / 2, true);	}}