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

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

?? color.java

?? 源碼為Eclipse開源開發平臺桌面開發工具SWT的源代碼,
?? JAVA
字號:
/******************************************************************************* * 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.graphics;import org.eclipse.swt.internal.win32.*;import org.eclipse.swt.*;/** * Instances of this class manage the operating system resources that * implement SWT's RGB color model. To create a color you can either * specify the individual color components as integers in the range  * 0 to 255 or provide an instance of an <code>RGB</code>.  * <p> * Application code must explicitly invoke the <code>Color.dispose()</code>  * method to release the operating system resources managed by each instance * when those instances are no longer required. * </p> * * @see RGB * @see Device#getSystemColor */public final class Color {		/**	 * the handle to the OS color resource 	 * (Warning: This field is platform dependent)	 */	public int handle;		/**	 * the device where this color was created	 */	Device device;/** * Prevents uninitialized instances from being created outside the package. */Color() {	}/**	  * Constructs a new instance of this class given a device and the * desired red, green and blue values expressed as ints in the range * 0 to 255 (where 0 is black and 255 is full brightness). On limited * color devices, the color instance created by this call may not have * the same RGB values as the ones specified by the arguments. The * RGB values on the returned instance will be the color values of  * the operating system color. * <p> * You must dispose the color when it is no longer required.  * </p> * * @param device the device on which to allocate the color * @param red the amount of red in the color * @param green the amount of green in the color * @param blue the amount of blue in the color * * @exception IllegalArgumentException <ul> *    <li>ERROR_NULL_ARGUMENT - if device is null and there is no current device</li> *    <li>ERROR_INVALID_ARGUMENT - if the red, green or blue argument is not between 0 and 255</li> * </ul> * * @see #dispose */public Color (Device device, int red, int green, int blue) {	if (device == null) device = Device.getDevice();	if (device == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);	init(device, red, green, blue);	if (device.tracking) device.new_Object(this);}/**	  * Constructs a new instance of this class given a device and an * <code>RGB</code> describing the desired red, green and blue values. * On limited color devices, the color instance created by this call * may not have the same RGB values as the ones specified by the * argument. The RGB values on the returned instance will be the color * values of the operating system color. * <p> * You must dispose the color when it is no longer required.  * </p> * * @param device the device on which to allocate the color * @param rgb the RGB values of the desired color * * @exception IllegalArgumentException <ul> *    <li>ERROR_NULL_ARGUMENT - if device is null and there is no current device</li> *    <li>ERROR_NULL_ARGUMENT - if the rgb argument is null</li> *    <li>ERROR_INVALID_ARGUMENT - if the red, green or blue components of the argument are not between 0 and 255</li> * </ul> * * @see #dispose */public Color (Device device, RGB rgb) {	if (device == null) device = Device.getDevice();	if (device == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);	if (rgb == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);	init(device, rgb.red, rgb.green, rgb.blue);	if (device.tracking) device.new_Object(this);}/** * Disposes of the operating system resources associated with * the color. Applications must dispose of all colors which * they allocate. */public void dispose() {	if (handle == -1) return;	if (device.isDisposed()) return;	/*	 * If this is a palette-based device,	 * Decrease the reference count for this color.	 * If the reference count reaches 0, the slot may	 * be reused when another color is allocated.	 */	int hPal = device.hPalette;	if (hPal != 0) {		int index = OS.GetNearestPaletteIndex(hPal, handle);		int[] colorRefCount = device.colorRefCount;		if (colorRefCount[index] > 0) {			colorRefCount[index]--;		}	}	handle = -1;	if (device.tracking) device.dispose_Object(this);	device = null;}/** * Compares the argument to the receiver, and returns true * if they represent the <em>same</em> object using a class * specific comparison. * * @param object the object to compare with this object * @return <code>true</code> if the object is the same as this object and <code>false</code> otherwise * * @see #hashCode */public boolean equals (Object object) {	if (object == this) return true;	if (!(object instanceof Color)) return false;	Color color = (Color) object;	return device == color.device && (handle & 0xFFFFFF) == (color.handle & 0xFFFFFF);}/** * Returns the amount of blue in the color, from 0 to 255. * * @return the blue component of the color * * @exception SWTException <ul> *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> */public int getBlue () {	if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);	return (handle & 0xFF0000) >> 16;}/** * Returns the amount of green in the color, from 0 to 255. * * @return the green component of the color * * @exception SWTException <ul> *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> */public int getGreen () {	if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);	return (handle & 0xFF00) >> 8 ;}/** * Returns the amount of red in the color, from 0 to 255. * * @return the red component of the color * * @exception SWTException <ul> *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> */public int getRed () {	if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);	return handle & 0xFF;}/** * Returns an <code>RGB</code> representing the receiver. * * @return the RGB for the color * * @exception SWTException <ul> *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> */public RGB getRGB () {	if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);	return new RGB(handle & 0xFF, (handle & 0xFF00) >> 8, (handle & 0xFF0000) >> 16);}/** * Returns an integer hash code for the receiver. Any two  * objects which return <code>true</code> when passed to  * <code>equals</code> must return the same value for this * method. * * @return the receiver's hash * * @see #equals */public int hashCode () {	return handle;}/** * Allocates the operating system resources associated  * with the receiver. * * @param device the device on which to allocate the color * @param red the amount of red in the color * @param green the amount of green in the color * @param blue the amount of blue in the color * * @exception IllegalArgumentException <ul> *    <li>ERROR_INVALID_ARGUMENT - if the red, green or blue argument is not between 0 and 255</li> * </ul> * * @see #dispose */void init(Device device, int red, int green, int blue) {	if (red > 255 || red < 0 || green > 255 || green < 0 || blue > 255 || blue < 0) {		SWT.error(SWT.ERROR_INVALID_ARGUMENT);	}	this.device = device;	handle = 0x02000000 | (red & 0xFF) | ((green & 0xFF) << 8) | ((blue & 0xFF) << 16);		/* If this is not a palette-based device, return */	int hPal = device.hPalette;	if (hPal == 0) return;		int[] colorRefCount = device.colorRefCount;	/* Add this color to the default palette now */	/* First find out if the color already exists */	int index = OS.GetNearestPaletteIndex(hPal, handle);	/* See if the nearest color actually is the color */	byte[] entry = new byte[4];	OS.GetPaletteEntries(hPal, index, 1, entry);	if ((entry[0] == (byte)red) && (entry[1] == (byte)green) &&		(entry[2] == (byte)blue)) {			/* Found the color. Increment the ref count and return */			colorRefCount[index]++;			return;	}	/* Didn't find the color, allocate it now. Find the first free entry */	int i = 0;	while (i < colorRefCount.length) {		if (colorRefCount[i] == 0) {			index = i;			break;		}		i++;	}	if (i == colorRefCount.length) {		/* No free entries, use the closest one */		/* Remake the handle from the actual rgbs */		handle = (entry[0] & 0xFF) | ((entry[1] & 0xFF) << 8) |				 ((entry[2] & 0xFF) << 16);	} else {		/* Found a free entry */		entry = new byte[] { (byte)(red & 0xFF), (byte)(green & 0xFF), (byte)(blue & 0xFF), 0 };		OS.SetPaletteEntries(hPal, index, 1, entry);	}	colorRefCount[index]++;}/** * Returns <code>true</code> if the color has been disposed, * and <code>false</code> otherwise. * <p> * This method gets the dispose state for the color. * When a color has been disposed, it is an error to * invoke any other method using the color. * * @return <code>true</code> when the color is disposed and <code>false</code> otherwise */public boolean isDisposed() {	return handle == -1;}/** * Returns a string containing a concise, human-readable * description of the receiver. * * @return a string representation of the receiver */public String toString () {	if (isDisposed()) return "Color {*DISPOSED*}"; //$NON-NLS-1$	return "Color {" + getRed() + ", " + getGreen() + ", " + getBlue() + "}"; //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$}/**	  * Invokes platform specific functionality to allocate a new color. * <p> * <b>IMPORTANT:</b> This method is <em>not</em> part of the public * API for <code>Color</code>. It is marked public only so that it * can be shared within the packages provided by SWT. It is not * available on all platforms, and should never be called from * application code. * </p> * * @param device the device on which to allocate the color * @param handle the handle for the color * @return a new color object containing the specified device and handle */public static Color win32_new(Device device, int handle) {	if (device == null) device = Device.getDevice();	Color color = new Color();	color.handle = handle;	color.device = device;	return color;}}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲国产精品久久艾草纯爱 | 欧美四级电影在线观看| 日韩中文字幕一区二区三区| 国产精品丝袜黑色高跟| 精品美女一区二区| 日韩欧美国产系列| 日韩欧美一卡二卡| 精品国产一区二区三区四区四 | 亚洲激情网站免费观看| 国产精品传媒入口麻豆| 日韩一区中文字幕| 亚洲私人黄色宅男| 一区二区三区免费观看| 久久精品国产亚洲aⅴ| 中文字幕一区二区三区四区| 日本一区二区三区高清不卡| 久久99久国产精品黄毛片色诱| 国产亚洲精品久| 久久久久国产精品人| 国产精品成人一区二区艾草 | 久久久欧美精品sm网站| 精品粉嫩aⅴ一区二区三区四区| 日韩视频在线永久播放| 精品国产乱码久久久久久免费| 久久久99免费| 国产精品久久99| 一区二区国产视频| 蜜桃视频在线观看一区| 国产精品羞羞答答xxdd| 成人精品鲁一区一区二区| 国产女同互慰高潮91漫画| 一本久久综合亚洲鲁鲁五月天| 欧美日韩一级二级三级| 久久女同精品一区二区| 亚洲精品中文字幕乱码三区| 琪琪一区二区三区| 成人性色生活片| 欧美精品在线观看一区二区| 久久久www成人免费毛片麻豆| 亚洲小说欧美激情另类| 裸体歌舞表演一区二区| 91麻豆精品秘密| 日韩一级高清毛片| 18欧美亚洲精品| 精品亚洲免费视频| 日本韩国一区二区三区视频| 欧美精品一区二区三区在线 | 日韩av电影免费观看高清完整版 | 欧美一级艳片视频免费观看| 日本一区二区免费在线观看视频| 国产日本亚洲高清| 专区另类欧美日韩| 九九久久精品视频| 91精品福利视频| 久久久久久毛片| 偷拍与自拍一区| 97se亚洲国产综合自在线| 日韩女优av电影| 一区二区成人在线| 国产精品99久久久久久久女警 | 精品美女在线观看| 亚洲午夜免费福利视频| av综合在线播放| 一色桃子久久精品亚洲| 91在线国产福利| 在线日韩国产精品| 国产精品的网站| 懂色av中文一区二区三区| 91精品国产入口| 午夜欧美电影在线观看| 色综合一个色综合| 国产精品二区一区二区aⅴ污介绍| 久久精品免费观看| 欧美成人一级视频| 人禽交欧美网站| 在线电影院国产精品| 亚洲一区二区三区四区不卡| 日本高清不卡视频| 亚洲日本中文字幕区| 99视频精品在线| 亚洲色图在线视频| 色综合久久中文字幕| 中文字幕一区二区三| 成人晚上爱看视频| 国产日韩欧美不卡在线| 粉嫩av一区二区三区在线播放| 2020国产成人综合网| 国产一区二区三区免费观看| 久久先锋影音av| 成人免费毛片嘿嘿连载视频| 国产欧美一二三区| 95精品视频在线| 亚洲一二三四区| 欧美日韩午夜精品| 久久精品久久久精品美女| 日韩欧美的一区| 国产激情一区二区三区| 中文字幕一区二区三区在线不卡| 91丨porny丨首页| 一区二区高清免费观看影视大全| 欧美日韩精品一区二区三区四区| 五月天一区二区| 久久一区二区三区四区| av电影在线观看完整版一区二区| 亚洲人成网站精品片在线观看| 欧美日韩一区二区在线视频| 奇米综合一区二区三区精品视频| 久久精品一区二区三区不卡| www.欧美精品一二区| 亚洲成年人网站在线观看| 精品伦理精品一区| 91在线观看高清| 日日嗨av一区二区三区四区| 国产欧美一区二区在线| 欧美在线综合视频| 精品无人码麻豆乱码1区2区| 国产精品久久久一区麻豆最新章节| 欧美在线影院一区二区| 国产激情视频一区二区三区欧美| 亚洲精品日韩一| xf在线a精品一区二区视频网站| 成人久久视频在线观看| 日韩极品在线观看| 国产欧美综合色| 欧美一区二区免费视频| jizzjizzjizz欧美| 免费观看日韩av| 亚洲免费大片在线观看| 久久久久99精品一区| 欧美日韩中文字幕一区二区| 成人的网站免费观看| 美国毛片一区二区| 一区二区三区四区国产精品| 国产网红主播福利一区二区| 91麻豆精品国产91久久久更新时间 | 亚洲男帅同性gay1069| 91视频免费播放| 国产大片一区二区| 亚洲va欧美va国产va天堂影院| 日本一二三不卡| 久久综合色一综合色88| 欧美日韩高清一区二区三区| 色综合久久综合网欧美综合网| 国产福利一区在线观看| 国产永久精品大片wwwapp| 亚洲国产wwwccc36天堂| 亚洲精品久久久蜜桃| 国产精品乱人伦一区二区| 久久这里只精品最新地址| 欧美一级爆毛片| 91精品国产一区二区三区| 在线观看国产91| 在线观看成人小视频| 在线免费观看日本一区| 国产精品麻豆久久久| 中文幕一区二区三区久久蜜桃| 精品久久久久一区二区国产| 色婷婷av一区二区| 欧美剧情片在线观看| 在线成人午夜影院| 国产欧美精品区一区二区三区| 国产精品视频一二三区| 亚洲一区二区三区精品在线| 青青青伊人色综合久久| 北岛玲一区二区三区四区| 一本色道久久综合狠狠躁的推荐| 精品蜜桃在线看| 在线视频中文字幕一区二区| 97成人超碰视| 精品视频1区2区3区| 日韩欧美国产高清| 国产欧美一区二区精品性色超碰| 精品国产伦理网| 欧美在线播放高清精品| 欧美日韩aaaaa| 精品久久久久一区二区国产| 欧美国产日韩亚洲一区| 1024亚洲合集| 亚洲国产精品一区二区尤物区| 日韩国产精品久久| 捆绑紧缚一区二区三区视频| 成人自拍视频在线观看| 在线观看不卡视频| 欧美tk—视频vk| 精品国产不卡一区二区三区| 久久久久国产精品免费免费搜索| 久久久不卡网国产精品一区| 亚洲三级在线免费观看| 一区二区三区不卡视频| 久久久久久综合| 亚洲精品国产a| 青青草原综合久久大伊人精品优势| 亚洲成人你懂的| 国产毛片精品视频| 成人亚洲一区二区一| 欧美视频在线观看一区| 日韩三级视频在线看| 欧美国产日韩a欧美在线观看| 精品国产亚洲在线| 一区二区三区在线免费视频|