} else if ( this.xOffset + activeTabXPos < 2 * scrollerWidth ) { this.xOffset = 2 * scrollerWidth - activeTabXPos; } else if ( this.xOffset + activeTabXPos + activeTabWidth > lineWidth ) { this.xOffset = (lineWidth - activeTabWidth) - (activeTabXPos - scrollerWidth);
} else if ( this.xOffset + activeTabXPos < scrollerWidth ) {  this.xOffset = scrollerWidth - activeTabXPos; System.out.println("this.xOffset + activeTabXPos < scrollerWidth "); } else if ( this.xOffset + activeTabXPos + activeTabWidth > rightBorder ) {   if (this.allowRoundtrip) { this.xOffset = (rightBorder - activeTabWidth - activeTabXPos); } else {  this.xOffset = (rightBorder - activeTabWidth) - (activeTabXPos - scrollerWidth);  }  System.out.println("this.xOffset + activeTabXPos + activeTabWidth > rightBorder"); System.out.println("xOffset=" + this.xOffset + ", activeTabXPos=" + activeTabXPos + ", activeTabWidth=" + activeTabWidth + ", rightBorder=" + rightBorder);
	protected void initContent(int firstLineWidth, int lineWidth) {		int scrollerWidth = this.scrollArrowHeight + 2 * this.scrollArrowPadding; 		int maxHeight = scrollerWidth;		int completeWidth = 0;		if (this.activeTabIndex == 0 || this.activeTabIndex == this.tabs.length -1) {			// only one scroll indicator needs to be painted			lineWidth -= maxHeight;			completeWidth = maxHeight;		} else {			lineWidth -= 2 * maxHeight;			completeWidth = 2 * maxHeight;		}				int activeTabXPos = 0;		int activeTabWidth = 0;		for (int i = 0; i < this.tabs.length; i++) {			ImageItem tab = this.tabs[i];			int tabHeight = tab.getItemHeight(firstLineWidth, lineWidth);			if (tabHeight > maxHeight ) { 				maxHeight = tabHeight;			}			if (i == this.activeTabIndex) {				activeTabXPos = completeWidth;				activeTabWidth = tab.itemWidth;			}			// I can use the itemWidth field, since I have called getItemHeight(..) above,			// which initialises the tab.			completeWidth += tab.itemWidth;		}		this.contentHeight = maxHeight;		this.contentWidth = completeWidth;		if (this.activeTabIndex == 0) {			this.xOffset = 0;		} else if ( this.xOffset + activeTabXPos < 2 * scrollerWidth ) {			this.xOffset = 2 * scrollerWidth - activeTabXPos;		} else if ( this.xOffset + activeTabXPos + activeTabWidth > lineWidth ) {			this.xOffset = (lineWidth - activeTabWidth) - (activeTabXPos - scrollerWidth); 		}	}