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

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

?? tree.java

?? 源碼為Eclipse開源開發(fā)平臺桌面開發(fā)工具SWT的源代碼,
?? JAVA
?? 第 1 頁 / 共 5 頁
字號:
/******************************************************************************* * 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.widgets;import org.eclipse.swt.internal.win32.*;import org.eclipse.swt.*;import org.eclipse.swt.graphics.*;import org.eclipse.swt.events.*;/** * Instances of this class provide a selectable user interface object * that displays a hierarchy of items and issue notificiation when an * item in the hierarchy is selected. * <p> * The item children that may be added to instances of this class * must be of type <code>TreeItem</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></dt> * <dd>SINGLE, MULTI, CHECK</dd> * <dt><b>Events:</b></dt> * <dd>Selection, DefaultSelection, Collapse, Expand</dd> * </dl> * <p> * Note: Only one of the styles SINGLE and MULTI may be specified. * </p><p> * IMPORTANT: This class is <em>not</em> intended to be subclassed. * </p> */public class Tree extends Composite {	int hAnchor;	TreeItem [] items;	ImageList imageList;	boolean dragStarted, gestureCompleted;	boolean ignoreSelect, ignoreExpand, ignoreDeselect;	boolean customDraw;	static final int TreeProc;	static final TCHAR TreeClass = new TCHAR (0, OS.WC_TREEVIEW, true);	static {		WNDCLASS lpWndClass = new WNDCLASS ();		OS.GetClassInfo (0, TreeClass, lpWndClass);		TreeProc = lpWndClass.lpfnWndProc;	}/** * 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 composite control 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> *    <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li> * </ul> * * @see SWT#SINGLE * @see SWT#MULTI * @see SWT#CHECK * @see Widget#checkSubclass * @see Widget#getStyle */public Tree (Composite parent, int style) {	super (parent, checkStyle (style));}static int checkStyle (int style) {	/*	* Feature in Windows.  It is not possible to create	* a tree that scrolls and does not have scroll bars.	* The TVS_NOSCROLL style will remove the scroll bars	* but the tree will never scroll.  Therefore, no matter	* what style bits are specified, set the H_SCROLL and	* V_SCROLL bits so that the SWT style will match the	* widget that Windows creates.	*/	style |= SWT.H_SCROLL | SWT.V_SCROLL;	return checkBits (style, SWT.SINGLE, SWT.MULTI, 0, 0, 0, 0);}/** * 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) 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) error (SWT.ERROR_NULL_ARGUMENT);	TypedListener typedListener = new TypedListener (listener);	addListener (SWT.Expand, typedListener);	addListener (SWT.Collapse, typedListener);} int callWindowProc (int msg, int wParam, int lParam) {	if (handle == 0) return 0;	return OS.CallWindowProc (TreeProc, handle, msg, wParam, lParam);}boolean checkScroll (int hItem) {	/*	* Feature in Windows.  If redraw is turned off using WM_SETREDRAW 	* and a tree item that is not a child of the first root is selected or	* scrolled using TVM_SELECTITEM or TVM_ENSUREVISIBLE, then scrolling	* does not occur.  The fix is to detect this case, and make sure	* that redraw is temporarly enabled.  To avoid flashing, DefWindowProc()	* is called to disable redrawing.	* 	* NOTE:  The code that actually works around the problem is in the	* callers of this method.	*/	if (drawCount == 0) return false;	int hRoot = OS.SendMessage (handle, OS.TVM_GETNEXTITEM, OS.TVGN_ROOT, 0);	int hParent = OS.SendMessage (handle, OS.TVM_GETNEXTITEM, OS.TVGN_PARENT, hItem);	while (hParent != hRoot && hParent != 0) {		hParent = OS.SendMessage (handle, OS.TVM_GETNEXTITEM, OS.TVGN_PARENT, hParent);	}	return hParent == 0;}public Point computeSize (int wHint, int hHint, boolean changed) {	checkWidget ();	int width = 0, height = 0;	RECT rect = new RECT ();	int hItem = OS.SendMessage (handle, OS.TVM_GETNEXTITEM, OS.TVGN_ROOT, 0);	while (hItem != 0) {		rect.left = hItem;		if (OS.SendMessage (handle, OS.TVM_GETITEMRECT, 1, rect) != 0) {			width = Math.max (width, rect.right);			height += rect.bottom - rect.top;		}		hItem = OS.SendMessage (handle, OS.TVM_GETNEXTITEM, OS.TVGN_NEXT, hItem);	}	if (width == 0) width = DEFAULT_WIDTH;	if (height == 0) height = DEFAULT_HEIGHT;	if (wHint != SWT.DEFAULT) width = wHint;	if (hHint != SWT.DEFAULT) height = hHint;	int border = getBorderWidth ();	width += border * 2;  height += border * 2;	if ((style & SWT.V_SCROLL) != 0) {		width += OS.GetSystemMetrics (OS.SM_CXVSCROLL);	}	if ((style & SWT.H_SCROLL) != 0) {		height += OS.GetSystemMetrics (OS.SM_CYHSCROLL);	}	return new Point (width, height);}void createHandle () {	super.createHandle ();	state &= ~CANVAS;		/*	* Feature in Windows.  In version 5.8 of COMCTL32.DLL,	* if the font is changed for an item, the bounds for the	* item are not updated, causing the text to be clipped.	* The fix is to detect the version of COMCTL32.DLL, and	* if it is one of the versions with the problem, then	* use version 5.00 of the control (a version that does	* not have the problem).  This is the recomended work	* around from the MSDN.	*/	if (OS.COMCTL32_MAJOR < 6) {		OS.SendMessage (handle, OS.CCM_SETVERSION, 5, 0);	}	/* Set the checkbox image list */	if ((style & SWT.CHECK) != 0) setCheckboxImageList ();		/*	* Feature in Windows.  When the control is created,	* it does not use the default system font.  A new HFONT	* is created and destroyed when the control is destroyed.	* This means that a program that queries the font from	* this control, uses the font in another control and then	* destroys this control will have the font unexpectedly	* destroyed in the other control.  The fix is to assign	* the font ourselves each time the control is created.	* The control will not destroy a font that it did not	* create.	*/	int hFont = OS.GetStockObject (OS.SYSTEM_FONT);	OS.SendMessage (handle, OS.WM_SETFONT, hFont, 0);}void createItem (TreeItem item, int hParent, int hInsertAfter) {	item.foreground = item.background = item.font = -1;	int id = 0;	while (id < items.length && items [id] != null) id++;	if (id == items.length) {		TreeItem [] newItems = new TreeItem [items.length + 4];		System.arraycopy (items, 0, newItems, 0, items.length);		items = newItems;	}	TVINSERTSTRUCT tvInsert = new TVINSERTSTRUCT ();	tvInsert.hParent = hParent;	tvInsert.hInsertAfter = hInsertAfter;	tvInsert.lParam = id;	tvInsert.iImage = OS.I_IMAGENONE;	tvInsert.iSelectedImage = tvInsert.iImage;	tvInsert.mask = OS.TVIF_HANDLE | OS.TVIF_PARAM | OS.TVIF_IMAGE | OS.TVIF_SELECTEDIMAGE;		/* Set the initial unchecked state */	if ((style & SWT.CHECK) != 0) {		tvInsert.mask = tvInsert.mask | OS.TVIF_STATE;		tvInsert.state = 1 << 12;		tvInsert.stateMask = OS.TVIS_STATEIMAGEMASK;	}	/* Insert the item */	int hItem = OS.SendMessage (handle, OS.TVM_INSERTITEM, 0, tvInsert);	if (hItem == 0) error (SWT.ERROR_ITEM_NOT_ADDED);	item.handle = hItem;	items [id] = item;		/*	* This code is intentionally commented.	*///	if (hParent != 0) {//		int bits = OS.GetWindowLong (handle, OS.GWL_STYLE);//		bits |= OS.TVS_LINESATROOT;//		OS.SetWindowLong (handle, OS.GWL_STYLE, bits);//	}	/*	* Bug in Windows.  When a child item is added to a parent item	* that has no children outside of WM_NOTIFY with control code	* TVN_ITEMEXPANDED, the tree widget does not redraw the +/-	* indicator.  The fix is to detect the case when the first	* child is added to a visible parent item and redraw the parent.	*/	if (!OS.IsWindowVisible (handle) || drawCount > 0) return;	int hChild = OS.SendMessage (handle, OS.TVM_GETNEXTITEM, OS.TVGN_CHILD, hParent);	if (hChild != 0 && OS.SendMessage (handle, OS.TVM_GETNEXTITEM, OS.TVGN_NEXT, hChild) == 0) {		RECT rect = new RECT ();		rect.left = hParent;		if (OS.SendMessage (handle, OS.TVM_GETITEMRECT, 0, rect) != 0) {			OS.InvalidateRect (handle, rect, true);		}	}}void createWidget () {	super.createWidget ();	items = new TreeItem [4];}int defaultBackground () {	return OS.GetSysColor (OS.COLOR_WINDOW);}/** * Deselects all selected items in the receiver. * * @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> */public void deselectAll () {	checkWidget ();	TVITEM tvItem = new TVITEM ();	tvItem.mask = OS.TVIF_STATE;	tvItem.stateMask = OS.TVIS_SELECTED;	if ((style & SWT.SINGLE) != 0) {		int hItem = OS.SendMessage (handle, OS.TVM_GETNEXTITEM, OS.TVGN_CARET, 0);		if (hItem != 0) {			tvItem.hItem = hItem;			OS.SendMessage (handle, OS.TVM_SETITEM, 0, tvItem);		}		return;	}	int oldProc = OS.GetWindowLong (handle, OS.GWL_WNDPROC);	OS.SetWindowLong (handle, OS.GWL_WNDPROC, TreeProc);		for (int i=0; i<items.length; i++) {		TreeItem item = items [i];		if (item != null) {			tvItem.hItem = item.handle;			OS.SendMessage (handle, OS.TVM_SETITEM, 0, tvItem);		}	}	OS.SetWindowLong (handle, OS.GWL_WNDPROC, oldProc);}void destroyItem (TreeItem item) {	/*	* Feature in Windows.  When an item is removed that is not	* visible in the tree because it belongs to a collapsed branch,	* Windows redraws the tree causing a flash for each item that	* is removed.  The fix is to detect whether the item is visible,	* force the widget to be fully painted, turn off redraw, remove	* the item and validate the damage caused by the removing of	* the item.	*/	int hItem = item.handle, hParent = 0;	boolean fixRedraw = false;	if (drawCount == 0 && OS.IsWindowVisible (handle)) {		RECT rect = new RECT ();		rect.left = hItem;		fixRedraw = OS.SendMessage (handle, OS.TVM_GETITEMRECT, 0, rect) == 0;	}	if (fixRedraw) {		hParent = OS.SendMessage (handle, OS.TVM_GETNEXTITEM, OS.TVGN_PARENT, hItem);		OS.UpdateWindow (handle);		OS.SendMessage (handle, OS.WM_SETREDRAW, 0, 0);	}	TVITEM tvItem = new TVITEM ();	tvItem.mask = OS.TVIF_HANDLE | OS.TVIF_PARAM;	releaseItems (item.getItems (), tvItem);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一区二区三区四区激情| 日韩欧美成人激情| 亚洲色图欧洲色图| 91在线视频官网| 亚洲激情一二三区| 欧美四级电影在线观看| 日韩激情视频网站| 精品国产99国产精品| 国产精品羞羞答答xxdd| 国产精品欧美一区喷水| 91社区在线播放| 亚洲h在线观看| 337p日本欧洲亚洲大胆精品| 国产91在线观看丝袜| 中文字幕中文字幕一区| 91国产精品成人| 美美哒免费高清在线观看视频一区二区 | 精品对白一区国产伦| 老司机精品视频在线| 国产日韩高清在线| 色偷偷成人一区二区三区91 | 99视频有精品| 亚洲国产精品人人做人人爽| 日韩欧美国产系列| 国产成人午夜精品5599| 亚洲一区二区欧美激情| 久久久久免费观看| 欧美伊人久久久久久久久影院| 美国毛片一区二区| 国产精品高潮呻吟久久| 日韩视频免费观看高清在线视频| 国产不卡视频在线观看| 性感美女久久精品| 欧美激情一区二区三区蜜桃视频| 欧美日韩高清一区二区不卡| 丰满放荡岳乱妇91ww| 首页亚洲欧美制服丝腿| 国产精品美女视频| 欧美一区二区三区播放老司机| av中文字幕在线不卡| 精品一区二区免费看| 亚洲欧美成aⅴ人在线观看| 精品福利一区二区三区免费视频| 99精品1区2区| 国产成人自拍网| 日韩成人午夜电影| 亚洲色图.com| 国产欧美日韩另类一区| 91精品国产全国免费观看 | 国产成都精品91一区二区三| 亚洲成人你懂的| 国产精品国产三级国产普通话蜜臀| 欧美精品精品一区| 在线观看中文字幕不卡| 成人丝袜视频网| 国产久卡久卡久卡久卡视频精品| 亚洲成人资源在线| 亚洲综合在线第一页| 日本一区二区成人| 久久嫩草精品久久久精品一| 日韩色视频在线观看| 欧美精品精品一区| 欧美日韩亚洲国产综合| 色吊一区二区三区| 成人高清免费观看| 成人动漫一区二区三区| 国产jizzjizz一区二区| 国产一区二区三区不卡在线观看| 日韩av成人高清| 婷婷综合在线观看| 三级影片在线观看欧美日韩一区二区| 亚洲精品乱码久久久久久黑人| 国产精品久久久久久久久久免费看| 久久精品视频网| 国产三级欧美三级日产三级99| 久久亚洲二区三区| 久久久综合视频| 欧美极品美女视频| 中文字幕中文字幕在线一区| 国产精品久久久久久久久动漫| 国产精品乱人伦| 综合激情成人伊人| 亚洲精品乱码久久久久久日本蜜臀| 玉米视频成人免费看| 亚洲精品写真福利| 亚洲国产精品久久人人爱蜜臀| 午夜影院在线观看欧美| 日韩影院精彩在线| 美腿丝袜一区二区三区| 韩国欧美国产一区| 成人午夜激情影院| 97久久人人超碰| 欧美三区在线视频| 欧美猛男gaygay网站| 日韩欧美一区二区免费| 久久色视频免费观看| 国产精品丝袜黑色高跟| 亚洲蜜臀av乱码久久精品| 亚洲国产综合人成综合网站| 午夜影院久久久| 国产精品一级片| 91色在线porny| 欧美精选在线播放| 久久伊人中文字幕| 亚洲视频一二区| 天堂一区二区在线免费观看| 久久er99热精品一区二区| 处破女av一区二区| 欧美亚洲动漫精品| 久久夜色精品国产欧美乱极品| ...xxx性欧美| 日韩国产在线观看| 成人av在线一区二区| 在线不卡免费av| 久久久综合激的五月天| 亚洲尤物视频在线| 国产一区二区精品在线观看| 一本色道久久综合亚洲91| 日韩一区二区在线看| 国产精品久久久久久久久动漫| 午夜精品福利在线| 成人a级免费电影| 日韩欧美国产综合| 亚洲欧美国产77777| 激情综合网最新| 欧美性videosxxxxx| 精品国产青草久久久久福利| 亚洲综合av网| 成人小视频在线| 日韩午夜激情av| 亚洲综合色婷婷| caoporn国产精品| 欧美α欧美αv大片| 一区二区在线电影| 国产成人免费在线观看| 欧美肥妇free| 亚洲午夜激情av| 91丨九色丨国产丨porny| 精品久久久久久久久久久久久久久 | 成人18视频日本| 欧美大片在线观看一区二区| 夜夜精品浪潮av一区二区三区| 国产一区二区剧情av在线| 91精品国产一区二区人妖| 亚洲激情男女视频| 成人手机在线视频| 精品国一区二区三区| 日本免费新一区视频| 欧美性一级生活| 亚洲丝袜美腿综合| 高清在线不卡av| 久久综合色8888| 久久99久久99精品免视看婷婷| 欧美精品在线观看播放| 一区二区在线观看视频在线观看| 波多野结衣亚洲一区| 国产欧美日韩在线视频| 国产精品一区二区男女羞羞无遮挡 | 亚洲欧美偷拍另类a∨色屁股| 丁香啪啪综合成人亚洲小说| 久久久久久久电影| 国产在线麻豆精品观看| 2017欧美狠狠色| 国产精品一区在线观看你懂的| www一区二区| 国产精品综合视频| 久久在线观看免费| 国产一区二区免费看| 国产亚洲一区二区在线观看| 精品影视av免费| 亚洲精品在线电影| 激情综合色综合久久| 精品国内二区三区| 国产精品一级黄| 中文字幕av一区 二区| av动漫一区二区| 亚洲日本乱码在线观看| 91成人免费电影| 五月激情综合色| 日韩欧美一级特黄在线播放| 国产一区二区三区在线观看免费 | 91精品国产全国免费观看| 蜜桃视频在线观看一区二区| 精品国产乱码久久久久久图片| 国产精品一级黄| 亚洲色图第一区| 4438x亚洲最大成人网| 久久精品国产澳门| 欧美激情一区二区三区在线| 色综合婷婷久久| 午夜精品一区在线观看| 日韩欧美综合一区| 成人性生交大片| 亚洲国产婷婷综合在线精品| 欧美一级高清片在线观看| 国产成人av一区二区| 一区二区三区波多野结衣在线观看| 欧美日韩高清一区二区| 国产一区二区调教| 一区二区三区久久久|