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

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

?? tree.java

?? 源碼為Eclipse開源開發平臺桌面開發工具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精彩视频在线观看| 免费成人美女在线观看.| 亚洲国产精品嫩草影院| 一区二区三区在线高清| 亚洲精品视频免费看| 亚洲国产sm捆绑调教视频| 亚洲毛片av在线| 亚洲一区二区三区中文字幕| 亚洲在线视频网站| 日精品一区二区| 麻豆免费精品视频| 国产精品18久久久久久久网站| 国内不卡的二区三区中文字幕| 国产一区二区三区在线观看免费 | 在线视频中文字幕一区二区| 91在线丨porny丨国产| 色综合久久中文字幕综合网| 欧美在线一二三四区| 91精品国产黑色紧身裤美女| 久久婷婷国产综合国色天香| 亚洲国产精品成人综合| 亚洲最新视频在线播放| 亚洲成人av福利| 久久99久久99| 色婷婷久久久亚洲一区二区三区| 欧美日韩精品一二三区| 91麻豆精品91久久久久久清纯| 精品日韩一区二区三区| 中文字幕一区二区在线播放 | 欧美高清你懂得| 欧美变态凌虐bdsm| 亚洲精品国产品国语在线app| 亚洲影院在线观看| 国产一区二区三区免费| 色噜噜夜夜夜综合网| 日韩欧美一级片| 亚洲精品视频一区二区| 久久成人免费网| 色菇凉天天综合网| 26uuu色噜噜精品一区二区| 亚洲区小说区图片区qvod| 麻豆国产精品视频| 91国偷自产一区二区开放时间| 欧美本精品男人aⅴ天堂| 伊人一区二区三区| 成人免费的视频| 日韩亚洲欧美一区二区三区| 亚洲精品亚洲人成人网| 国产成人精品一区二区三区四区| 欧美色大人视频| 国产精品久久福利| 国产在线不卡一区| 51午夜精品国产| 亚洲午夜视频在线观看| www.欧美亚洲| 国产亚洲精品aa| 奇米一区二区三区av| 欧美人妇做爰xxxⅹ性高电影| 国产精品欧美精品| 国产精品亚洲一区二区三区在线 | 日韩电影免费一区| 欧美在线不卡一区| 亚洲精品久久久蜜桃| 高清不卡一区二区在线| 国产午夜精品理论片a级大结局| 青青青伊人色综合久久| 欧美蜜桃一区二区三区| 夜夜嗨av一区二区三区中文字幕| 波多野结衣的一区二区三区| 欧美激情综合在线| 国产成人亚洲精品青草天美| 久久婷婷国产综合国色天香| 久久9热精品视频| 日韩一区二区三区视频在线观看 | 2020国产精品| 国产一本一道久久香蕉| 久久―日本道色综合久久| 国产综合成人久久大片91| 日韩欧美另类在线| 国内精品伊人久久久久av影院| 欧美大片国产精品| 国产69精品一区二区亚洲孕妇| 久久久一区二区三区捆绑**| 国产成人av影院| 国产精品麻豆视频| 日本高清成人免费播放| 亚洲最新视频在线观看| 7777女厕盗摄久久久| 蜜臀99久久精品久久久久久软件| 欧美大片在线观看一区| 高清在线不卡av| 亚洲欧美区自拍先锋| 欧美日韩精品一区二区| 精品一区二区三区免费| 中日韩av电影| 欧美在线免费播放| 狂野欧美性猛交blacked| 国产欧美va欧美不卡在线| 色综合久久中文综合久久97| 三级欧美在线一区| 久久久精品黄色| 91一区二区三区在线观看| 一区二区欧美视频| 日韩精品一区国产麻豆| 91丨porny丨蝌蚪视频| 三级亚洲高清视频| 中文字幕一区二区视频| 91精品国产欧美日韩| 国产.欧美.日韩| 亚洲电影在线免费观看| 久久亚洲影视婷婷| 欧美日韩国产综合一区二区三区 | 亚洲精品日韩一| 精品少妇一区二区三区日产乱码 | 亚洲女爱视频在线| 日韩一区二区在线观看| 成人app在线观看| 麻豆精品一二三| 一区二区三区四区在线播放| 日韩欧美高清dvd碟片| 在线看一区二区| 成人网页在线观看| 六月婷婷色综合| 亚洲第一成年网| 亚洲丝袜自拍清纯另类| 精品成人一区二区三区四区| 欧美午夜精品免费| 成人污视频在线观看| 精品午夜久久福利影院| 亚洲成人免费看| 亚洲三级电影网站| 欧美激情综合在线| 久久影院午夜论| 日韩精品一区二区三区在线播放| 在线观看日产精品| 不卡av在线免费观看| 国产精品亚洲第一| 久国产精品韩国三级视频| 亚洲成a天堂v人片| 亚洲人成人一区二区在线观看| 中文字幕av在线一区二区三区| 精品国产一区二区三区av性色| 欧美日韩高清不卡| 欧美伊人久久久久久久久影院 | 成年人网站91| 国产精品一线二线三线精华| 久久激五月天综合精品| 另类调教123区| 久久福利资源站| 精品在线一区二区| 国产在线视频精品一区| 久久黄色级2电影| 精品一区二区精品| 加勒比av一区二区| 国产毛片精品视频| 成人精品鲁一区一区二区| 国产传媒久久文化传媒| 国产精品18久久久久久久网站| 国产精品一级片| 高清在线观看日韩| 一本久久综合亚洲鲁鲁五月天| 不卡av免费在线观看| 91在线观看美女| 欧美午夜理伦三级在线观看| 制服丝袜亚洲网站| 欧美成人综合网站| 国产欧美精品区一区二区三区| 国产精品天干天干在观线| 亚洲精品国产成人久久av盗摄 | 国产精品亚洲一区二区三区妖精 | 成人免费在线视频观看| 一区二区三区蜜桃网| 亚洲丶国产丶欧美一区二区三区| 日本不卡视频在线| 成熟亚洲日本毛茸茸凸凹| 色综合视频一区二区三区高清| 欧美日韩一区二区欧美激情| 欧美一区二区三区不卡| 亚洲国产精品激情在线观看| 亚洲一区二区精品3399| 美女久久久精品| av动漫一区二区| 欧美三级韩国三级日本三斤| 精品久久久久久久久久久久包黑料| 中文字幕av一区 二区| 亚洲成人av电影| 国产91精品精华液一区二区三区| 91捆绑美女网站| 精品久久久网站| 一区二区三区免费看视频| 韩国女主播成人在线观看| 色噜噜偷拍精品综合在线| 日韩美女一区二区三区| 亚洲视频在线一区观看| 免费观看在线综合| 欧美亚洲一区二区在线| 欧美国产日韩精品免费观看| 美女免费视频一区二区| 一本一道久久a久久精品综合蜜臀|