亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? ctabitem.java

?? 源碼為Eclipse開源開發平臺桌面開發工具SWT的源代碼,
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
/******************************************************************************* * Copyright (c) 2000, 2004 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Common Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/cpl-v10.html *  * Contributors: *     IBM Corporation - initial API and implementation *******************************************************************************/package org.eclipse.swt.custom;import org.eclipse.swt.*;import org.eclipse.swt.graphics.*;import org.eclipse.swt.widgets.*;/** * Instances of this class represent a selectable user interface object * that represent a page in a notebook widget. *  * <dl> * <dt><b>Styles:</b></dt> * <dd>SWT.CLOSE</dd> * <dt><b>Events:</b></dt> * <dd>(none)</dd> * </dl> * <p> * IMPORTANT: This class is <em>not</em> intended to be subclassed. * </p> */public class CTabItem extends Item {	CTabFolder parent;	int x,y,width,height = 0;	Control control; // the tab page		String toolTipText;	String shortenedText;	int shortenedTextWidth;		// Appearance	Font font;	Image disabledImage; 		Rectangle closeRect = new Rectangle(0, 0, 0, 0);	int closeImageState = CTabFolder.NONE;	boolean showClose = false;	// internal constants	static final int TOP_MARGIN = 2;	static final int BOTTOM_MARGIN = 2;	static final int LEFT_MARGIN = 4;	static final int RIGHT_MARGIN = 4;	static final int INTERNAL_SPACING = 2;	static final int FLAGS = SWT.DRAW_TRANSPARENT | SWT.DRAW_MNEMONIC;	static final String ELLIPSIS = "..."; //$NON-NLS-1$ // could use the ellipsis glyph on some platforms "\u2026"	/** * Constructs a new instance of this class given its parent * (which must be a <code>CTabFolder</code>) and a style value * describing its behavior and appearance. The item is added * to the end of the items maintained by its parent. * <p> * The style value is either one of the style constants defined in * class <code>SWT</code> which is applicable to instances of this * class, or must be built by <em>bitwise OR</em>'ing together  * (that is, using the <code>int</code> "|" operator) two or more * of those <code>SWT</code> style constants. The class description * lists the style constants that are applicable to the class. * Style bits are also inherited from superclasses. * </p> * * @param parent a CTabFolder which will be the parent of the new instance (cannot be null) * @param style the style of control to construct * * @exception IllegalArgumentException <ul> *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li> * </ul> * @exception SWTException <ul> *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li> * </ul> * * @see SWT * @see Widget#getStyle() */public CTabItem (CTabFolder parent, int style) {	this(parent, style, parent.getItemCount());}/** * Constructs a new instance of this class given its parent * (which must be a <code>CTabFolder</code>), a style value * describing its behavior and appearance, and the index * at which to place it in the items maintained by its parent. * <p> * The style value is either one of the style constants defined in * class <code>SWT</code> which is applicable to instances of this * class, or must be built by <em>bitwise OR</em>'ing together  * (that is, using the <code>int</code> "|" operator) two or more * of those <code>SWT</code> style constants. The class description * lists the style constants that are applicable to the class. * Style bits are also inherited from superclasses. * </p> * * @param parent a CTabFolder which will be the parent of the new instance (cannot be null) * @param style the style of control to construct * @param index the index to store the receiver in its parent * * @exception IllegalArgumentException <ul> *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li> * </ul> * @exception SWTException <ul> *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li> * </ul> * * @see SWT * @see Widget#getStyle() */public CTabItem (CTabFolder parent, int style, int index) {	super (parent, checkStyle(style));	showClose = (style & SWT.CLOSE) != 0;	parent.createItem (this, index);}static int checkStyle(int style) {	return SWT.NONE;}static String shortenText(GC gc, String text, int width) {	if (gc.textExtent(text, FLAGS).x <= width) return text;	int ellipseWidth = gc.textExtent(ELLIPSIS, FLAGS).x;	int length = text.length();	int end = length - 1;	while (end > 0) {		text = text.substring(0, end);		int l = gc.textExtent(text, FLAGS).x;		if (l + ellipseWidth <= width) {			return text + ELLIPSIS;		}		end--;	}	return text.substring(0,1);}public void dispose() {	if (isDisposed ()) return;	//if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS);	parent.destroyItem(this);	super.dispose();	parent = null;	control = null;	toolTipText = null;	shortenedText = null;	font = null;}void drawClose(GC gc) {	if (closeRect.width == 0 || closeRect.height == 0) return;	Display display = getDisplay();	// draw X 9x9	int indent = Math.max(1, (CTabFolder.BUTTON_SIZE-9)/2);	int x = closeRect.x + indent;	int y = closeRect.y + indent;	y += parent.onBottom ? -1 : 1;		Color closeBorder = display.getSystemColor(CTabFolder.BUTTON_BORDER);	switch (closeImageState) {		case CTabFolder.NORMAL: {			int[] shape = new int[] {x,y, x+2,y, x+4,y+2, x+5,y+2, x+7,y, x+9,y, 					                 x+9,y+2, x+7,y+4, x+7,y+5, x+9,y+7, x+9,y+9,			                         x+7,y+9, x+5,y+7, x+4,y+7, x+2,y+9, x,y+9,			                         x,y+7, x+2,y+5, x+2,y+4, x,y+2};			gc.setBackground(display.getSystemColor(CTabFolder.BUTTON_FILL));			gc.fillPolygon(shape);			gc.setForeground(closeBorder);			gc.drawPolygon(shape);			break;		}		case CTabFolder.HOT: {			int[] shape = new int[] {x,y, x+2,y, x+4,y+2, x+5,y+2, x+7,y, x+9,y, 					                 x+9,y+2, x+7,y+4, x+7,y+5, x+9,y+7, x+9,y+9,			                         x+7,y+9, x+5,y+7, x+4,y+7, x+2,y+9, x,y+9,			                         x,y+7, x+2,y+5, x+2,y+4, x,y+2};			Color fill = new Color(display, CTabFolder.CLOSE_FILL);			gc.setBackground(fill);			gc.fillPolygon(shape);			fill.dispose();			gc.setForeground(closeBorder);			gc.drawPolygon(shape);			break;		}		case CTabFolder.SELECTED: {			int[] shape = new int[] {x+1,y+1, x+3,y+1, x+5,y+3, x+6,y+3, x+8,y+1, x+10,y+1, 					                 x+10,y+3, x+8,y+5, x+8,y+6, x+10,y+8, x+10,y+10,			                         x+8,y+10, x+6,y+8, x+5,y+8, x+3,y+10, x+1,y+10,			                         x+1,y+8, x+3,y+6, x+3,y+5, x+1,y+3};			Color fill = new Color(display, CTabFolder.CLOSE_FILL);			gc.setBackground(fill);			gc.fillPolygon(shape);			fill.dispose();			gc.setForeground(closeBorder);			gc.drawPolygon(shape);			break;		}		case CTabFolder.NONE: {			int[] shape = new int[] {x,y, x+10,y, x+10,y+10, x,y+10};			if (parent.gradientColors != null && !parent.gradientVertical) {				parent.drawBackground(gc, shape, false);			} else {				Color defaultBackground = parent.getBackground();				Image image = parent.bgImage;				Color[] colors = parent.gradientColors;				int[] percents = parent.gradientPercents;				boolean vertical = parent.gradientVertical; 				parent.drawBackground(gc, shape, x, y, 10, 10, defaultBackground, image, colors, percents, vertical);			}			break;		}	}}void drawSelected(GC gc ) {	Point size = parent.getSize();	int rightEdge = Math.min (x + width, parent.getRightItemEdge());		//	 Draw selection border across all tabs	int xx = parent.borderLeft;	int yy = parent.onBottom ? size.y - parent.borderBottom - parent.tabHeight - parent.highlight_header : parent.borderTop + parent.tabHeight + 1;	int ww = size.x - parent.borderLeft - parent.borderRight;	int hh = parent.highlight_header - 1;	int[] shape = new int[] {xx,yy, xx+ww,yy, xx+ww,yy+hh, xx,yy+hh};	if (parent.selectionGradientColors != null && !parent.selectionGradientVertical) {		parent.drawBackground(gc, shape, true);	} else {		gc.setBackground(parent.selectionBackground);		gc.fillRectangle(xx, yy, ww, hh);	}		if (parent.single) {		if (!isShowing()) return;	} else {		// if selected tab scrolled out of view or partially out of view		// just draw bottom line		if (!isShowing()){			int x1 = Math.max(0, parent.borderLeft - 1);			int y1 = (parent.onBottom) ? y - 1 : y + height;			int x2 = size.x - parent.borderRight;			gc.setForeground(CTabFolder.borderColor);			gc.drawLine(x1, y1, x2, y1);			return;		}					// draw selected tab background and outline		shape = null;		if (this.parent.onBottom) {			int[] left = parent.simple ? CTabFolder.SIMPLE_BOTTOM_LEFT_CORNER : CTabFolder.BOTTOM_LEFT_CORNER;			int[] right = parent.simple ? CTabFolder.SIMPLE_BOTTOM_RIGHT_CORNER : parent.curve;			if (parent.borderLeft == 0 && parent.indexOf(this) == parent.firstIndex) {				left = new int[]{x, y+height};			}			shape = new int[left.length+right.length+8];			int index = 0;			shape[index++] = x; // first point repeated here because below we reuse shape to draw outline			shape[index++] = y - 1;			shape[index++] = x;			shape[index++] = y - 1;			for (int i = 0; i < left.length/2; i++) {				shape[index++] = x + left[2*i];				shape[index++] = y + height + left[2*i+1] - 1;			}			for (int i = 0; i < right.length/2; i++) {				shape[index++] = parent.simple ? rightEdge - 1 + right[2*i] : rightEdge - parent.curveIndent + right[2*i];				shape[index++] = parent.simple ? y + height + right[2*i+1] - 1 : y + right[2*i+1] - 2;			}			shape[index++] = parent.simple ? rightEdge - 1 : rightEdge + parent.curveWidth - parent.curveIndent;			shape[index++] = y - 1;			shape[index++] = parent.simple ? rightEdge - 1 : rightEdge + parent.curveWidth - parent.curveIndent;			shape[index++] = y - 1;		} else {			int[] left = parent.simple ? CTabFolder.SIMPLE_TOP_LEFT_CORNER : CTabFolder.TOP_LEFT_CORNER;			int[] right = parent.simple ? CTabFolder.SIMPLE_TOP_RIGHT_CORNER : parent.curve;			if (parent.borderLeft == 0 && parent.indexOf(this) == parent.firstIndex) {				left = new int[]{x, y};			}			shape = new int[left.length+right.length+8];			int index = 0;			shape[index++] = x; // first point repeated here because below we reuse shape to draw outline			shape[index++] = y + height + 1;			shape[index++] = x;			shape[index++] = y + height + 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++] = parent.simple ? rightEdge - 1 + right[2*i] : rightEdge - parent.curveIndent + right[2*i];				shape[index++] = y + right[2*i+1];			}			shape[index++] = parent.simple ? rightEdge - 1 : rightEdge + parent.curveWidth - parent.curveIndent;			shape[index++] = y + height + 1;			shape[index++] = parent.simple ? rightEdge - 1 : rightEdge + parent.curveWidth - parent.curveIndent;			shape[index++] = y + height + 1;		}				Rectangle clipping = gc.getClipping();		Rectangle bounds = getBounds();		bounds.height += 1;		if (parent.onBottom) bounds.y -= 1;		boolean tabInPaint = clipping.intersects(bounds);				if (tabInPaint) {			// fill in tab background			if (parent.selectionGradientColors != null && !parent.selectionGradientVertical) {				parent.drawBackground(gc, shape, true);			} else {				Color defaultBackground = parent.selectionBackground;				Image image = parent.selectionBgImage;				Color[] colors = parent.selectionGradientColors;				int[] percents = parent.selectionGradientPercents;				boolean vertical = parent.selectionGradientVertical;				xx = x;				yy = parent.onBottom ? y -1 : y + 1;				ww = width;				hh = height;				if (!parent.single && !parent.simple) ww += parent.curveWidth - parent.curveIndent;				parent.drawBackground(gc, shape, xx, yy, ww, hh, defaultBackground, image, colors, percents, vertical);			}		}				// draw outline		shape[0] = Math.max(0, parent.borderLeft - 1);		if (parent.borderLeft == 0 && parent.indexOf(this) == parent.firstIndex) {			shape[1] = parent.onBottom ? y + height - 1 : y; 			shape[5] = shape[3] = shape[1];		}		shape[shape.length - 2] = size.x - parent.borderRight + 1;		for (int i = 0; i < shape.length/2; i++) {			if (shape[2*i + 1] == y + height + 1) shape[2*i + 1] -= 1;		}		RGB inside = parent.selectionBackground.getRGB();		if (parent.selectionBgImage != null || 		    (parent.selectionGradientColors != null && parent.selectionGradientColors.length > 1)) {		    inside = null;		}		RGB outside = parent.getBackground().getRGB();				if (parent.bgImage != null || 		    (parent.gradientColors != null && parent.gradientColors.length > 1)) {		    outside = null;		}		parent.antialias(shape, CTabFolder.borderColor.getRGB(), inside, outside, gc);		gc.setForeground(CTabFolder.borderColor);		gc.drawPolyline(shape);				if (!tabInPaint) return;	}		// draw Image	int xDraw = x + LEFT_MARGIN;	if (parent.single && (parent.showClose || showClose)) xDraw += CTabFolder.BUTTON_SIZE; 	Image image = getImage();	if (image != null) {		Rectangle imageBounds = image.getBounds();		// only draw image if it won't overlap with close button		int maxImageWidth = rightEdge - xDraw - RIGHT_MARGIN;		if (!parent.single && closeRect.width > 0) maxImageWidth -= closeRect.width + INTERNAL_SPACING;		if (imageBounds.width < maxImageWidth) {			int imageX = xDraw;			int imageHeight = imageBounds.height;			int imageY = y + (height - imageHeight) / 2;			imageY += parent.onBottom ? -1 : 1;			int imageWidth = imageBounds.width * imageHeight / imageBounds.height;			gc.drawImage(image, 				         imageBounds.x, imageBounds.y, imageBounds.width, imageBounds.height,				         imageX, imageY, imageWidth, imageHeight);			xDraw += imageWidth + INTERNAL_SPACING;		}	}		// draw Text	int textWidth = rightEdge - xDraw - RIGHT_MARGIN;	if (!parent.single && closeRect.width > 0) textWidth -= closeRect.width + INTERNAL_SPACING;	if (textWidth > 0) {		Font gcFont = gc.getFont();		gc.setFont(font == null ? parent.getFont() : font);				if (shortenedText == null || shortenedTextWidth != textWidth) {			shortenedText = shortenText(gc, getText(), textWidth);			shortenedTextWidth = textWidth;		}		Point extent = gc.textExtent(shortenedText, FLAGS);			int textY = y + (height - extent.y) / 2;		textY += parent.onBottom ? -1 : 1;				gc.setForeground(parent.selectionForeground);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日本一区二区在线观看| 欧美高清hd18日本| 91国在线观看| 欧美电影精品一区二区| 国产精品久久久久久福利一牛影视 | 国产精品视频一二三| 亚洲美女在线一区| 免费久久99精品国产| 美腿丝袜在线亚洲一区| 99久久精品国产导航| 日韩三区在线观看| 亚洲乱码国产乱码精品精98午夜| 亚洲成人综合网站| 热久久久久久久| 91在线一区二区三区| 久久这里只有精品首页| 亚洲综合激情网| 成人精品一区二区三区四区| 欧美美女视频在线观看| 亚洲天堂精品在线观看| 成人免费av在线| 国产精品久久久久影院| 国产成人在线看| 亚洲国产精品高清| 成人午夜碰碰视频| 欧美国产日产图区| av动漫一区二区| 中文字幕av一区二区三区免费看 | 亚洲在线免费播放| 一本大道av伊人久久综合| 亚洲同性gay激情无套| 99麻豆久久久国产精品免费优播| 国产精品区一区二区三区| 成人黄色综合网站| 日韩理论在线观看| 欧美亚洲国产bt| 五月天丁香久久| 精品久久人人做人人爰| 国产精品99久| 国产精品成人网| 日本高清不卡在线观看| 亚洲综合久久av| 日韩一区二区在线免费观看| 毛片av一区二区| 欧美国产日韩一二三区| 色综合天天综合给合国产| 亚洲亚洲人成综合网络| 日韩亚洲欧美综合| 国产成人亚洲综合色影视| 亚洲手机成人高清视频| 欧美日韩精品一区二区三区| 青青草91视频| 国产精品女同一区二区三区| 91久久精品网| 久久爱www久久做| 国产精品不卡在线观看| 欧美高清视频一二三区| 激情图片小说一区| 亚洲人一二三区| 91精品国产91久久综合桃花| 国产精品18久久久久久vr| 亚洲精品成人少妇| 日韩精品最新网址| 91在线国产福利| 卡一卡二国产精品| 一区二区三区欧美亚洲| 26uuu国产日韩综合| 在线视频观看一区| 国产精品自拍av| 亚洲18色成人| 中文字幕一区二区三区av| 欧美一级二级三级蜜桃| 91在线观看污| 国产精品18久久久久久vr| 亚洲成人一区二区| 亚洲少妇最新在线视频| 久久综合视频网| 欧美日韩一区小说| 99久久久精品免费观看国产蜜| 日韩不卡手机在线v区| 亚洲色图色小说| 久久久精品tv| 欧美成人精精品一区二区频| 色一区在线观看| 成人午夜视频在线观看| 看电影不卡的网站| 亚洲成a人在线观看| 最近日韩中文字幕| 国产亚洲va综合人人澡精品| 欧美一区二区成人6969| 在线观看视频一区二区欧美日韩| 在线亚洲高清视频| 国产99久久久久久免费看农村| 男女男精品视频网| 亚洲一区二区高清| 一区二区三区四区蜜桃 | 国产大片一区二区| 久久99热99| 日日嗨av一区二区三区四区| 国产精品传媒视频| 国产精品国产三级国产普通话99 | 韩国中文字幕2020精品| 日本中文字幕一区| 亚洲国产精品自拍| 亚洲一区二区三区美女| 亚洲综合免费观看高清在线观看| 亚洲品质自拍视频网站| 国产精品黄色在线观看| 国产精品私房写真福利视频| 国产亚洲污的网站| 国产女人aaa级久久久级| 国产午夜亚洲精品理论片色戒| 久久人人超碰精品| 日韩欧美成人激情| 久久蜜臀中文字幕| 国产日韩高清在线| 日本一区二区免费在线| 国产精品美女一区二区三区| 欧美国产综合一区二区| 国产精品乱码人人做人人爱| 国产精品美女视频| 亚洲欧美韩国综合色| 亚洲线精品一区二区三区 | 一区二区三区四区在线免费观看| 日日夜夜精品视频天天综合网| 日韩影视精彩在线| 久久精品av麻豆的观看方式| 国产乱一区二区| www.亚洲精品| 在线一区二区视频| 欧美一区二区三区在线电影| 精品国产乱码久久久久久1区2区 | 成人av网址在线| 一本色道久久加勒比精品 | 色综合久久天天综合网| 欧美午夜精品免费| 欧美mv日韩mv亚洲| 国产精品久久午夜夜伦鲁鲁| 一区2区3区在线看| 日本欧美一区二区在线观看| 国产精品中文字幕一区二区三区| 99精品久久久久久| 69久久夜色精品国产69蝌蚪网| 精品成人佐山爱一区二区| 国产精品水嫩水嫩| 天使萌一区二区三区免费观看| 久久不见久久见免费视频1| www.欧美.com| 欧美大片一区二区| 亚洲欧美一区二区三区孕妇| 日本午夜一区二区| 成人av电影观看| 欧美一区二区三区四区五区| 亚洲国产精品传媒在线观看| 性做久久久久久免费观看欧美| 国产精品一区二区在线观看不卡 | 久久精品一区四区| 亚洲一卡二卡三卡四卡无卡久久| 精品一二线国产| 欧美在线免费观看亚洲| 久久九九久精品国产免费直播| 亚洲综合男人的天堂| 成人午夜av电影| 日韩精品中文字幕在线不卡尤物| 亚洲欧美日韩电影| 国产 欧美在线| 日韩一区二区三区av| 亚洲精品视频一区| 国产99久久久国产精品免费看| 3d动漫精品啪啪| 一区二区三区在线高清| 国产成人免费高清| 欧美大肚乱孕交hd孕妇| 亚洲综合999| 色av一区二区| 日韩一区欧美小说| 国产一区二区不卡在线| 欧美一区二区三区白人| 亚洲一区二区欧美激情| 91视频91自| 国产精品黄色在线观看 | 九九九精品视频| 欧美日韩在线电影| 亚洲黄色尤物视频| 99国产精品国产精品久久| 国产欧美一区二区在线观看| 免费成人结看片| 欧美一区二区三区性视频| 亚洲福利电影网| 欧美日韩一区二区三区高清| 亚洲欧美偷拍卡通变态| 99re视频精品| 亚洲另类在线视频| 91年精品国产| 一区二区在线观看免费视频播放| 91一区二区三区在线播放| 欧美aa在线视频| 欧美大片一区二区| 国产精品中文字幕日韩精品| 欧美国产日韩在线观看|