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

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

?? tabletree.java

?? 源碼為Eclipse開源開發(fā)平臺桌面開發(fā)工具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.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
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美刺激午夜性久久久久久久| 欧美一级免费大片| 亚洲mv在线观看| 久久色中文字幕| 欧美精品高清视频| 成人黄色av电影| 日韩影院精彩在线| 亚洲免费在线看| 久久亚洲综合色一区二区三区| 色哟哟一区二区在线观看| 国产一区二区视频在线| 亚洲成人黄色影院| 亚洲欧美一区二区三区孕妇| 久久久www免费人成精品| 欧美年轻男男videosbes| 9i在线看片成人免费| 国产麻豆成人传媒免费观看| 日韩va亚洲va欧美va久久| 一区二区成人在线视频| 国产精品色呦呦| www久久精品| 欧美成人激情免费网| 欧美日本一区二区三区| 色综合久久中文综合久久牛| 国产精品一区二区免费不卡| 蜜臀av性久久久久蜜臀av麻豆| 亚洲尤物视频在线| 亚洲欧洲日韩在线| 国产精品三级久久久久三级| 久久一夜天堂av一区二区三区 | 精品视频在线免费看| 99re这里都是精品| aa级大片欧美| 北条麻妃国产九九精品视频| 国产精品一品视频| 国产精品亚洲一区二区三区妖精 | 欧美日韩在线播放三区四区| 99视频一区二区| 成人免费视频一区二区| 国产成人亚洲综合a∨猫咪| 麻豆精品蜜桃视频网站| 蜜桃一区二区三区四区| 久热成人在线视频| 久久成人麻豆午夜电影| 国内精品嫩模私拍在线| 国产中文一区二区三区| 国产在线看一区| 国产一区二区三区久久久 | 亚洲国产日韩精品| 亚洲综合激情另类小说区| 亚洲午夜影视影院在线观看| 香蕉成人啪国产精品视频综合网| 亚洲大片精品永久免费| 日韩电影在线观看一区| 精品在线播放午夜| 国产成人亚洲精品狼色在线| 成人av在线资源网| 色婷婷综合中文久久一本| 91福利在线导航| 欧美日韩大陆在线| 日韩精品中文字幕一区二区三区| 久久久噜噜噜久久人人看| 国产精品久久久久aaaa樱花| 亚洲日本成人在线观看| 亚洲国产综合91精品麻豆| 免费观看在线综合色| 国产老肥熟一区二区三区| 99在线精品免费| 欧美精品久久一区二区三区 | 亚洲麻豆国产自偷在线| 亚洲第一福利视频在线| 国产最新精品免费| 成人免费毛片aaaaa**| 色婷婷综合久久| 日韩一卡二卡三卡四卡| 国产午夜亚洲精品羞羞网站| 亚洲精品v日韩精品| 青青草伊人久久| 国产91在线看| 欧美亚洲综合在线| 亚洲精品一区二区精华| 亚洲精品视频一区| 久久国产精品露脸对白| 99国产麻豆精品| 7777精品伊人久久久大香线蕉 | 成人久久视频在线观看| 欧美日韩一区视频| 久久久久一区二区三区四区| 艳妇臀荡乳欲伦亚洲一区| 国产在线不卡视频| 精品污污网站免费看| 国产欧美日韩不卡| 日韩精品1区2区3区| 色综合天天综合网天天看片| 精品久久久久99| 香蕉久久一区二区不卡无毒影院| 成人深夜福利app| 精品国产青草久久久久福利| 亚洲最大成人综合| 国产河南妇女毛片精品久久久| 欧美色大人视频| 国产日韩精品一区二区三区在线| 亚洲高清视频在线| 国产精品一线二线三线精华| 国产91在线看| 精品国产成人在线影院| 一区二区三区产品免费精品久久75| 强制捆绑调教一区二区| 91视频.com| 久久综合九色综合欧美就去吻 | 2020国产精品自拍| 亚洲精品欧美在线| 国产精品996| 在线综合视频播放| 亚洲欧洲国产日韩| 麻豆传媒一区二区三区| 色又黄又爽网站www久久| 久久久99精品免费观看不卡| 视频一区二区中文字幕| 一本色道久久综合亚洲91| 久久伊人中文字幕| 亚洲成人一区在线| 91在线观看免费视频| 久久九九影视网| 日韩成人av影视| 欧美天堂一区二区三区| 久久久久九九视频| 国产在线不卡一区| 欧美一级一级性生活免费录像| 亚洲欧美日韩久久精品| www.久久精品| 2022国产精品视频| 国产一区二区看久久| 日韩免费电影网站| 婷婷六月综合亚洲| 欧美色涩在线第一页| 亚洲精品成人在线| 国产精品99久久久久久宅男| 久久久国产精品麻豆| 精品一区二区三区久久| 91.成人天堂一区| 亚洲成人激情自拍| 欧美丝袜丝nylons| 日日摸夜夜添夜夜添精品视频| 色8久久人人97超碰香蕉987| 亚洲女爱视频在线| 99精品在线免费| 国产精品欧美久久久久一区二区| 9i在线看片成人免费| 国产精品久久久久久久第一福利| 久久成人免费电影| 精品国产a毛片| 国产精品自拍在线| 国产精品美女一区二区| av在线不卡电影| 亚洲天堂网中文字| 色综合久久99| 亚洲国产视频直播| 欧美在线视频日韩| 久久精品久久精品| 久久久一区二区三区捆绑**| 国产99精品国产| 国产精品免费免费| 极品瑜伽女神91| 亚洲欧洲av一区二区三区久久| 色综合天天在线| 午夜视频久久久久久| 欧美群妇大交群中文字幕| 欧美aaa在线| 欧美精品一区二区在线观看| 国产精品69毛片高清亚洲| 国产精品久久久久三级| 日本韩国一区二区| 日本视频一区二区三区| 久久久噜噜噜久久人人看| 成人av电影在线播放| 亚洲精品国产无天堂网2021| 69久久夜色精品国产69蝌蚪网| 日本不卡高清视频| 久久久久一区二区三区四区| 成人av电影免费观看| 亚洲资源在线观看| 精品日韩欧美在线| 色系网站成人免费| 看片网站欧美日韩| 最新中文字幕一区二区三区| 精品视频999| 免费在线观看不卡| 亚洲欧美国产三级| 日韩欧美国产精品一区| 成人丝袜高跟foot| 天天影视涩香欲综合网| 亚洲欧洲成人自拍| 日韩一区二区三区三四区视频在线观看 | 99视频在线精品| 精品中文字幕一区二区| 亚洲精品视频在线观看免费| 日韩你懂的在线观看| 色综合久久久久| 久久99国产精品久久99果冻传媒 |