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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? tabletree.java

?? 源碼為Eclipse開源開發(fā)平臺(tái)桌面開發(fā)工具SWT的源代碼,
?? JAVA
?? 第 1 頁 / 共 2 頁
字號(hào):
/******************************************************************************* * 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.events.*;import org.eclipse.swt.graphics.*;import org.eclipse.swt.widgets.*;/**  * A TableTree is a selectable user interface object * that displays a hierarchy of items, and issues * notification when an item is selected. * A TableTree may be single or multi select. * <p> * The item children that may be added to instances of this class * must be of type <code>TableTreeItem</code>. * </p><p> * Note that although this class is a subclass of <code>Composite</code>, * it does not make sense to add <code>Control</code> children to it, * or set a layout on it. * </p><p> * <dl> *	<dt><b>Styles:</b> <dd> SINGLE, MULTI, CHECK, FULL_SELECTION *	<dt><b>Events:</b> <dd> Selection, DefaultSelection, Collapse, Expand * </dl> * <p> * Note: Only one of the styles SINGLE, and MULTI may be specified. * </p> */public class TableTree extends Composite {	Table table;	TableTreeItem[] items = EMPTY_ITEMS;	Image plusImage, minusImage, sizeImage;	/*	* TableTreeItems are not treated as children but rather as items.	* When the TableTree is disposed, all children are disposed because 	* TableTree inherits this behaviour from Composite.  The items	* must be disposed separately.  Because TableTree is not part of	* the org.eclipse.swt.widgets package, the method releaseWidget can 	* not be overriden (this is how items are disposed of in Table and Tree).	* Instead, the items are disposed of in response to the dispose event on the	* TableTree.  The "inDispose" flag is used to distinguish between disposing	* one TableTreeItem (e.g. when removing an entry from the TableTree) and 	* disposing the entire TableTree.	*/	boolean inDispose = false;		static final TableTreeItem[] EMPTY_ITEMS = new TableTreeItem [0];		static final String[] EMPTY_TEXTS = new String [0];		static final Image[] EMPTY_IMAGES = new Image [0];	static final String ITEMID = "TableTreeItemID"; //$NON-NLS-1$/** * Constructs a new instance of this class given its parent * and a style value describing its behavior and appearance. * <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 widget which will be the parent of the new instance (cannot be null) * @param style the style of widget 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#SINGLE * @see SWT#MULTI * @see SWT#CHECK * @see SWT#FULL_SELECTION * @see #getStyle */public TableTree(Composite parent, int style) {	super(parent, checkStyle (style));	table = new Table(this, style);	Listener tableListener = new Listener() {		public void handleEvent(Event e) {			switch (e.type) {			case SWT.MouseDown: onMouseDown(e); break;			case SWT.Selection: onSelection(e); break;			case SWT.DefaultSelection: onSelection(e); break;			case SWT.KeyDown: onKeyDown(e); break;			}		}	};	int[] tableEvents = new int[]{SWT.MouseDown, 		                           SWT.Selection, 		                           SWT.DefaultSelection, 		                           SWT.KeyDown};	for (int i = 0; i < tableEvents.length; i++) {		table.addListener(tableEvents[i], tableListener);	}		Listener listener = new Listener() {		public void handleEvent(Event e) {			switch (e.type) {			case SWT.Dispose: onDispose(e); break;			case SWT.Resize:  onResize(e); break;			case SWT.FocusIn: onFocusIn(e); break;			}		}	};	int[] events = new int[]{SWT.Dispose, 		                      SWT.Resize, 		                      SWT.FocusIn};	for (int i = 0; i < events.length; i++) {		addListener(events[i], listener);	}	                      }int addItem(TableTreeItem item, int index) {	if (index < 0 || index > items.length) SWT.error(SWT.ERROR_INVALID_ARGUMENT);	TableTreeItem[] newItems = new TableTreeItem[items.length + 1];	System.arraycopy(items, 0, newItems, 0, index);	newItems[index] = item;	System.arraycopy(items, index, newItems, index + 1, items.length - index); 	items = newItems;	/* Return the index in the table where this table should be inserted */	if (index == items.length - 1 ) 		return table.getItemCount();	else 		return table.indexOf(items[index+1].tableItem);}/** * Adds the listener to the collection of listeners who will * be notified when the receiver's selection changes, by sending * it one of the messages defined in the <code>SelectionListener</code> * interface. * <p> * When <code>widgetSelected</code> is called, the item field of the event object is valid. * If the reciever has <code>SWT.CHECK</code> style set and the check selection changes, * the event object detail field contains the value <code>SWT.CHECK</code>. * <code>widgetDefaultSelected</code> is typically called when an item is double-clicked. * The item field of the event object is valid for default selection, but the detail field is not used. * </p> * * @param listener the listener which should be notified * * @exception IllegalArgumentException <ul> *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li> * </ul> * @exception SWTException <ul> *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> * * @see SelectionListener * @see #removeSelectionListener * @see SelectionEvent */public void addSelectionListener(SelectionListener listener) {	checkWidget();	if (listener == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);	TypedListener typedListener = new TypedListener (listener);	addListener (SWT.Selection,typedListener);	addListener (SWT.DefaultSelection,typedListener);}/** * Adds the listener to the collection of listeners who will * be notified when an item in the receiver is expanded or collapsed * by sending it one of the messages defined in the <code>TreeListener</code> * interface. * * @param listener the listener which should be notified * * @exception IllegalArgumentException <ul> *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li> * </ul> * @exception SWTException <ul> *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> * * @see TreeListener * @see #removeTreeListener */public void addTreeListener(TreeListener listener) {	checkWidget();	if (listener == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);	TypedListener typedListener = new TypedListener (listener);	addListener (SWT.Expand, typedListener);	addListener (SWT.Collapse, typedListener);}private static int checkStyle (int style) {	int mask = SWT.LEFT_TO_RIGHT | SWT.RIGHT_TO_LEFT; 	style = style & mask;	return style;} public Point computeSize (int wHint, int hHint, boolean changed) {	checkWidget();	return table.computeSize (wHint, hHint, changed);}public Rectangle computeTrim (int x, int y, int width, int height) {	checkWidget();	return table.computeTrim(x, y, width, height);}/** * Deselects all items. * <p> * If an item is selected, it is deselected. * If an item is not selected, it remains unselected. * * @exception SWTError <ul> *	<li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread *	<li>ERROR_WIDGET_DISPOSED when the widget has been disposed * </ul> */public void deselectAll () {	checkWidget();	table.deselectAll();}/* Expand upward from the specified leaf item. */void expandItem (TableTreeItem item) {	if (item == null) return;	expandItem(item.parentItem);	if (!item.getVisible()) item.setVisible(true);	if ( !item.expanded && item.items.length > 0) {		item.setExpanded(true);		Event event = new Event();		event.item = item;		notifyListeners(SWT.Expand, event);	}}public Color getBackground () {	// This method must be overriden otherwise, in a TableTree in which the first	// item has no sub items, a grey (Widget background colour) square will appear in	// the first column of the first item.	// It is not possible in the constructor to set the background of the TableTree	// to be the same as the background of the Table because this interferes with 	// the TableTree adapting to changes in the System color settings.	return table.getBackground();}public Rectangle getClientArea () {	return table.getClientArea();}public Color getForeground () {	return table.getForeground();}public Font getFont () {	return table.getFont();}/** * Gets the number of items. * <p> * @return the number of items in the widget */public int getItemCount () {	//checkWidget();	return items.length;}/** * Gets the height of one item. * <p> * This operation will fail if the height of * one item could not be queried from the OS. * * @return the height of one item in the widget * * @exception SWTError <ul> *	<li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread *	<li>ERROR_WIDGET_DISPOSED when the widget has been disposed *	<li>ERROR_CANNOT_GET_ITEM_HEIGHT when the operation fails * </ul> */public int getItemHeight () {	checkWidget();	return table.getItemHeight();}/** * Gets the items. * <p> * @return the items in the widget */public TableTreeItem [] getItems () {	//checkWidget();	TableTreeItem[] newItems = new TableTreeItem[items.length];	System.arraycopy(items, 0, newItems, 0, items.length);	return newItems;}/** * Gets the selected items. * <p> * This operation will fail if the selected * items cannot be queried from the OS. * * @return the selected items in the widget * * @exception SWTError <ul> *		<li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li> *		<li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li> * 		<li>ERROR_CANNOT_GET_SELECTION when the operation fails</li> *	</ul> */public TableTreeItem [] getSelection () {	checkWidget();	TableItem[] selection = table.getSelection();	TableTreeItem [] result = new TableTreeItem[selection.length];	for (int i = 0; i < selection.length; i++){		result[i] = (TableTreeItem) selection[i].getData(ITEMID);	}	return result;}/** * Gets the number of selected items. * <p> * This operation will fail if the number of selected * items cannot be queried from the OS. * * @return the number of selected items in the widget * * @exception SWTError <ul> *		<li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li> *		<li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li> * 		<li>ERROR_CANNOT_GET_COUNT when the operation fails</li> *	</ul> */public int getSelectionCount () {	checkWidget();	return table.getSelectionCount();}public int getStyle () {	checkWidget();	return table.getStyle();}/** * Returns the underlying Table control. * * @return the underlying Table control */public Table getTable () {	//checkWidget();	return table;}void createImages () {		int itemHeight = sizeImage.getBounds().height;	// Calculate border around image. 	// At least 9 pixels are needed to draw the image	// Leave at least a 6 pixel border.	int indent = Math.min(6, (itemHeight - 9) / 2);	indent = Math.max(0, indent);	int size = Math.max (10, itemHeight - 2 * indent); 	size = ((size + 1) / 2) * 2; // size must be an even number	int midpoint = indent + size / 2;		Color foreground = getForeground();	Color plusMinus = getDisplay().getSystemColor(SWT.COLOR_WIDGET_NORMAL_SHADOW);	Color background = getBackground();		/* Plus image */	PaletteData palette = new PaletteData(new RGB[]{foreground.getRGB(), background.getRGB(), plusMinus.getRGB()});	ImageData imageData = new ImageData(itemHeight, itemHeight, 4, palette);	imageData.transparentPixel = 1;	plusImage = new Image(getDisplay(), imageData);	GC gc = new GC(plusImage);	gc.setBackground(background);	gc.fillRectangle(0, 0, itemHeight, itemHeight);	gc.setForeground(plusMinus);	gc.drawRectangle(indent, indent, size, size);	gc.setForeground(foreground);	gc.drawLine(midpoint, indent + 2, midpoint, indent + size - 2);	gc.drawLine(indent + 2, midpoint, indent + size - 2, midpoint);	gc.dispose();		/* Minus image */

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
秋霞电影一区二区| 日日骚欧美日韩| 欧美一区二区女人| 欧美亚洲高清一区| 色综合久久88色综合天天6 | av电影在线观看一区| 激情久久五月天| 精品一区二区三区在线播放视频 | 精品日韩一区二区三区免费视频| 欧美另类高清zo欧美| 欧美乱熟臀69xxxxxx| 欧美精品电影在线播放| 欧美一卡二卡三卡| 久久一区二区三区国产精品| 欧美成人三级电影在线| 久久无码av三级| 国产精品日产欧美久久久久| 国产精品成人免费| 一区二区三区在线不卡| 午夜精品久久久久久久| 麻豆高清免费国产一区| 国产福利一区二区三区| 91浏览器入口在线观看| 欧美优质美女网站| 日韩欧美国产wwwww| 国产亚洲婷婷免费| 亚洲欧美成aⅴ人在线观看| 石原莉奈在线亚洲三区| 国产精品一区二区在线看| 成人黄动漫网站免费app| 91久久精品一区二区| 日韩一区二区精品| 中文一区二区在线观看| 亚洲成在人线免费| 国产综合久久久久影院| 91看片淫黄大片一级在线观看| 欧美日韩国产一区| 久久精品这里都是精品| 亚洲第四色夜色| 国产精品综合在线视频| 欧美亚洲一区三区| 久久久久久久网| 亚洲一区二区美女| 国产一区二区三区四区五区美女| 91久久人澡人人添人人爽欧美| 欧美电影免费观看高清完整版在线 | 精品国产一区二区国模嫣然| 日韩理论片在线| 久久精品国产77777蜜臀| 波多野结衣在线一区| 日韩美女视频一区二区在线观看| 亚洲视频资源在线| 国内精品免费**视频| 欧美色男人天堂| 亚洲人亚洲人成电影网站色| 免费在线观看一区二区三区| 91同城在线观看| 国产日韩欧美精品电影三级在线| 性久久久久久久久| 91极品美女在线| 国产精品国产三级国产三级人妇| 韩国一区二区视频| 91精品蜜臀在线一区尤物| 一区二区三区美女视频| 92精品国产成人观看免费| 国产欧美日韩激情| 国产在线视视频有精品| 欧美xxxx老人做受| 美女视频一区在线观看| 91精品国产手机| 亚洲妇女屁股眼交7| 一本大道av伊人久久综合| 欧美国产一区二区| 国产91丝袜在线18| 亚洲国产精品ⅴa在线观看| 国产一区二区三区免费| 精品久久五月天| 久久99国产精品尤物| 久久综合久久99| 国产一区二区三区四区五区入口| 久久嫩草精品久久久精品| 蜜臀av一区二区| 精品欧美黑人一区二区三区| 黄页网站大全一区二区| 久久久国产一区二区三区四区小说 | 久久99九九99精品| 日韩欧美自拍偷拍| 麻豆成人免费电影| 久久这里都是精品| 粉嫩av一区二区三区在线播放| 国产亚洲一区二区三区| 波多野结衣在线aⅴ中文字幕不卡| 中文字幕一区二区三区av| 色婷婷亚洲精品| 五月婷婷激情综合| 日韩亚洲欧美成人一区| 国产精品一级片| 椎名由奈av一区二区三区| 欧美三区在线视频| 韩国精品在线观看| 国产精品美女一区二区三区| 在线亚洲一区观看| 免费在线观看日韩欧美| 欧美国产激情二区三区| 欧美色综合影院| 久久 天天综合| 国产精品久久99| 欧美精品久久天天躁| 国产精品99久久久久久似苏梦涵| 国产精品久久久久久久岛一牛影视 | 在线免费观看日韩欧美| 日韩vs国产vs欧美| 欧美经典一区二区三区| 欧美三级在线播放| 国产乱子轮精品视频| 一区二区三区四区高清精品免费观看| 7777精品伊人久久久大香线蕉超级流畅| 激情小说欧美图片| 亚洲国产综合人成综合网站| 欧美zozo另类异族| 欧美亚洲图片小说| 成人黄色777网| 日韩不卡一区二区| 一区二区三区中文字幕| 欧美精品一区二区三| 欧美亚洲一区二区在线观看| 国产精品一区二区在线播放| 日韩中文字幕亚洲一区二区va在线| 国产精品久久久久一区二区三区共| 欧美丰满嫩嫩电影| 一本久久a久久免费精品不卡| 精品一区二区三区在线播放视频| 尤物在线观看一区| 国产精品毛片大码女人| 欧美不卡视频一区| 在线不卡免费欧美| 欧美自拍偷拍午夜视频| 成人国产电影网| 黄一区二区三区| 麻豆专区一区二区三区四区五区| 一区二区三区免费观看| 中文字幕一区av| 国产无一区二区| 精品日韩一区二区| 欧美一区二区三区在线观看视频| 欧美视频日韩视频在线观看| 色老汉一区二区三区| 91同城在线观看| 91免费精品国自产拍在线不卡| 国产不卡在线播放| 久久99日本精品| 蜜桃视频一区二区三区| 日韩av中文字幕一区二区三区| 亚洲一区二区三区在线播放| 亚洲人成在线播放网站岛国| 中文字幕制服丝袜成人av | 99久久国产免费看| 成人免费高清视频在线观看| 成人a区在线观看| av日韩在线网站| 91丨九色丨黑人外教| 色综合久久六月婷婷中文字幕| 91福利在线导航| 欧美色老头old∨ideo| 欧美日本在线播放| 日韩一区二区三区视频在线 | 成人一区二区视频| 成人激情免费视频| 99久久精品免费观看| 91麻豆视频网站| 在线免费av一区| 91精品福利在线一区二区三区 | 亚洲精品视频一区| 亚洲综合偷拍欧美一区色| 亚洲国产日韩a在线播放性色| 亚洲动漫第一页| 久久99精品国产.久久久久久 | 26uuu色噜噜精品一区二区| 久久亚区不卡日本| 中文字幕一区二区三| 丝袜a∨在线一区二区三区不卡| 日韩综合一区二区| 成人综合婷婷国产精品久久免费| 91精品1区2区| 欧美成人r级一区二区三区| 国产精品天天看| 亚洲成人一区在线| 国内精品视频666| 欧美在线免费观看视频| 欧美成人一级视频| 自拍av一区二区三区| 久久国产夜色精品鲁鲁99| 91丨porny丨国产入口| 日韩欧美黄色影院| 亚洲欧美日韩久久| 国产美女av一区二区三区| 欧美综合天天夜夜久久| 久久久久久久综合狠狠综合| 性久久久久久久久| 91免费视频网|