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

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

?? device.java

?? 源碼為Eclipse開源開發平臺桌面開發工具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.graphics; import org.eclipse.swt.internal.*;import org.eclipse.swt.internal.win32.*;import org.eclipse.swt.*;/** * This class is the abstract superclass of all device objects, * such as the Display device and the Printer device. Devices * can have a graphics context (GC) created for them, and they * can be drawn on by sending messages to the associated GC. */public abstract class Device implements Drawable {		/* Debugging */	public static boolean DEBUG;	boolean debug = DEBUG;	boolean tracking = DEBUG;	Error [] errors;	Object [] objects;		/* Palette 	* (Warning: This field is platform dependent)	*/	public int hPalette = 0;	int [] colorRefCount;		/* System Font */	int systemFont;	/* Font Enumeration */	int nFonts = 256;	LOGFONT [] logFonts;	/* Scripts */	int [] scripts;	LOGFONT [] logFontsCache;	boolean disposed;		/*	* TEMPORARY CODE. When a graphics object is	* created and the device parameter is null,	* the current Display is used. This presents	* a problem because SWT graphics does not	* reference classes in SWT widgets. The correct	* fix is to remove this feature. Unfortunately,	* too many application programs rely on this	* feature.	*	* This code will be removed in the future.	*/	protected static Device CurrentDevice;	protected static Runnable DeviceFinder;	static {		try {			Class.forName ("org.eclipse.swt.widgets.Display");		} catch (Throwable e) {}	}	/** TEMPORARY CODE.*/static Device getDevice () {	if (DeviceFinder != null) DeviceFinder.run();	Device device = CurrentDevice;	CurrentDevice = null;	return device;}	/** * Constructs a new instance of this class. * <p> * You must dispose the device when it is no longer required.  * </p> * * @param data the DeviceData which describes the receiver * * @see #create * @see #init * @see DeviceData */public Device(DeviceData data) {	if (data != null) {		debug = data.debug;		tracking = data.tracking;	}	create (data);	init ();	if (tracking) {		errors = new Error [128];		objects = new Object [128];	}		/* Initialize the system font slot */	systemFont = getSystemFont().handle;}/** * Throws an <code>SWTException</code> if the receiver can not * be accessed by the caller. This may include both checks on * the state of the receiver and more generally on the entire * execution context. This method <em>should</em> be called by * device implementors to enforce the standard SWT invariants. * <p> * Currently, it is an error to invoke any method (other than * <code>isDisposed()</code> and <code>dispose()</code>) on a * device that has had its <code>dispose()</code> method called. * </p><p> * In future releases of SWT, there may be more or fewer error * checks and exceptions may be thrown for different reasons. * <p> * * @exception SWTException <ul> *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * </ul> */protected void checkDevice () {	if (disposed) SWT.error(SWT.ERROR_DEVICE_DISPOSED);}/** * Creates the device in the operating system.  If the device * does not have a handle, this method may do nothing depending * on the device. * <p> * This method is called before <code>init</code>. * </p><p> * Subclasses are supposed to reimplement this method and not * call the <code>super</code> implementation. * </p> * * @param data the DeviceData which describes the receiver * * @see #init */protected void create (DeviceData data) {}int computePixels(int height) {	int hDC = internal_new_GC (null);	int pixels = -Compatibility.round(height * OS.GetDeviceCaps(hDC, OS.LOGPIXELSY), 72);	internal_dispose_GC (hDC, null);	return pixels;}int computePoints(LOGFONT logFont) {	int hDC = internal_new_GC (null);	int logPixelsY = OS.GetDeviceCaps(hDC, OS.LOGPIXELSY);	int pixels = 0; 	if (logFont.lfHeight > 0) {		/*		 * Feature in Windows. If the lfHeight of the LOGFONT structure		 * is positive, the lfHeight measures the height of the entire		 * cell, including internal leading, in logical units. Since the		 * height of a font in points does not include the internal leading,		 * we must subtract the internal leading, which requires a TEXTMETRIC,		 * which in turn requires font creation.		 */		int hFont = OS.CreateFontIndirect(logFont);		int oldFont = OS.SelectObject(hDC, hFont);		TEXTMETRIC lptm = OS.IsUnicode ? (TEXTMETRIC)new TEXTMETRICW() : new TEXTMETRICA();		OS.GetTextMetrics(hDC, lptm);		OS.SelectObject(hDC, oldFont);		OS.DeleteObject(hFont);		pixels = logFont.lfHeight - lptm.tmInternalLeading;	} else {		pixels = -logFont.lfHeight;	}	internal_dispose_GC (hDC, null);	return Compatibility.round(pixels * 72, logPixelsY);}/** * Destroys the device in the operating system and releases * the device's handle.  If the device does not have a handle, * this method may do nothing depending on the device. * <p> * This method is called after <code>release</code>. * </p><p> * Subclasses are supposed to reimplement this method and not * call the <code>super</code> implementation. * </p> * * @see #dispose * @see #release */protected void destroy () {}/** * Disposes of the operating system resources associated with * the receiver. After this method has been invoked, the receiver * will answer <code>true</code> when sent the message * <code>isDisposed()</code>. * * @see #release * @see #destroy * @see #checkDevice */public void dispose () {	if (isDisposed()) return;	checkDevice ();	release ();	destroy ();	disposed = true;	if (tracking) {		objects = null;		errors = null;	}}void dispose_Object (Object object) {	for (int i=0; i<objects.length; i++) {		if (objects [i] == object) {			objects [i] = null;			errors [i] = null;			return;		}	}}int EnumFontFamProc (int lpelfe, int lpntme, int FontType, int lParam) {	boolean isScalable = (FontType & OS.RASTER_FONTTYPE) == 0;	boolean scalable = lParam == 1;	if (isScalable == scalable) {		/* Add the log font to the list of log fonts */		if (nFonts == logFonts.length) {			LOGFONT [] newLogFonts = new LOGFONT [logFonts.length + 128];			System.arraycopy (logFonts, 0, newLogFonts, 0, nFonts);			logFonts = newLogFonts;		}		LOGFONT logFont = logFonts [nFonts];		if (logFont == null) logFont = OS.IsUnicode ? (LOGFONT)new LOGFONTW () : new LOGFONTA ();		OS.MoveMemory (logFont, lpelfe, LOGFONT.sizeof);		logFonts [nFonts++] = logFont;	}	return 1;}/** * Returns a rectangle describing the receiver's size and location. * * @return the bounding rectangle * * @exception SWTException <ul> *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li> * </ul> */public Rectangle getBounds () {	checkDevice ();	int hDC = internal_new_GC (null);	int width = OS.GetDeviceCaps (hDC, OS.HORZRES);	int height = OS.GetDeviceCaps (hDC, OS.VERTRES);	internal_dispose_GC (hDC, null);	return new Rectangle (0, 0, width, height);}/** * Returns a <code>DeviceData</code> based on the receiver. * Modifications made to this <code>DeviceData</code> will not * affect the receiver. * * @return a <code>DeviceData</code> containing the device's data and attributes * * @exception SWTException <ul> *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li> * </ul> * * @see DeviceData */public DeviceData getDeviceData () {	checkDevice();	DeviceData data = new DeviceData ();	data.debug = debug;	data.tracking = tracking;	int count = 0, length = 0;	if (tracking) length = objects.length;	for (int i=0; i<length; i++) {		if (objects [i] != null) count++;	}	int index = 0;	data.objects = new Object [count];	data.errors = new Error [count];	for (int i=0; i<length; i++) {		if (objects [i] != null) {			data.objects [index] = objects [i];			data.errors [index] = errors [i];			index++;		}	}	return data;}/** * Returns a rectangle which describes the area of the * receiver which is capable of displaying data. *  * @return the client area * * @exception SWTException <ul> *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li> * </ul> * * @see #getBounds */public Rectangle getClientArea () {	return getBounds ();}/** * Returns the bit depth of the screen, which is the number of * bits it takes to represent the number of unique colors that * the screen is currently capable of displaying. This number  * will typically be one of 1, 8, 15, 16, 24 or 32. * * @return the depth of the screen * * @exception SWTException <ul> *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li> * </ul> */public int getDepth () {	checkDevice ();	int hDC = internal_new_GC (null);	int bits = OS.GetDeviceCaps (hDC, OS.BITSPIXEL);	int planes = OS.GetDeviceCaps (hDC, OS.PLANES);	internal_dispose_GC (hDC, null);	return bits * planes;}/** * Returns a point whose x coordinate is the horizontal * dots per inch of the display, and whose y coordinate * is the vertical dots per inch of the display. * * @return the horizontal and vertical DPI * * @exception SWTException <ul> *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li> * </ul> */public Point getDPI () {	checkDevice ();	int hDC = internal_new_GC (null);	int dpiX = OS.GetDeviceCaps (hDC, OS.LOGPIXELSX);	int dpiY = OS.GetDeviceCaps (hDC, OS.LOGPIXELSY);	internal_dispose_GC (hDC, null);	return new Point (dpiX, dpiY);}/** * Returns <code>FontData</code> objects which describe * the fonts that match the given arguments. If the * <code>faceName</code> is null, all fonts will be returned. * * @param faceName the name of the font to look for, or null * @param scalable if true only scalable fonts are returned, otherwise only non-scalable fonts are returned. * @return the matching font data * * @exception SWTException <ul> *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美激情综合五月色丁香小说| 亚洲精品视频观看| 国产精品美女久久久久久久 | 亚洲国产日韩一级| 国产在线不卡视频| 在线观看免费亚洲| 欧美国产精品久久| 青青草原综合久久大伊人精品| 色悠悠久久综合| 亚洲国产精品99久久久久久久久| 日韩不卡一二三区| 欧美日韩美少妇| 亚洲欧美激情在线| 成人黄页在线观看| 国产日产欧产精品推荐色| 日本vs亚洲vs韩国一区三区| 欧美亚洲动漫精品| 最新久久zyz资源站| 风间由美一区二区av101 | 国产精品久久午夜夜伦鲁鲁| 精品一区二区三区欧美| 91精品欧美福利在线观看| 亚洲成av人片在线| 在线观看日产精品| 亚洲一卡二卡三卡四卡| 色婷婷av久久久久久久| 亚洲免费在线视频| 色婷婷综合久久久中文字幕| 国产精品毛片久久久久久久| 国产成人av电影在线观看| 久久久久久9999| 国产精品一区免费在线观看| 国产午夜亚洲精品羞羞网站| 国产乱妇无码大片在线观看| 久久色在线视频| 国产精品99精品久久免费| 国产偷v国产偷v亚洲高清| 成人午夜免费电影| 亚洲四区在线观看| 色婷婷av一区二区三区软件| 亚洲第一福利视频在线| 欧美理论在线播放| 日本伊人精品一区二区三区观看方式| 欧美久久一二区| 美女尤物国产一区| 久久久99精品久久| 99re视频精品| 亚洲777理论| 精品国产亚洲一区二区三区在线观看| 捆绑调教美女网站视频一区| 久久久国际精品| 色综合网站在线| 日本网站在线观看一区二区三区 | 日本免费新一区视频| 日韩你懂的在线播放| 国产一区二区女| 亚洲人成在线观看一区二区| 日本丶国产丶欧美色综合| 日韩av午夜在线观看| 久久久久国产精品人| 色久综合一二码| 免费久久精品视频| 国产精品久久看| 777午夜精品视频在线播放| 国产精品99久久久久久有的能看 | 国产三级精品在线| 日本高清不卡在线观看| 久久草av在线| 亚洲综合网站在线观看| 精品国产一区二区精华| 欧美主播一区二区三区| 久久超碰97人人做人人爱| 亚洲免费观看高清| 精品免费99久久| 欧美在线免费观看亚洲| 国产精品一区二区在线看| 亚洲主播在线播放| 国产精品系列在线| 欧美一级黄色录像| 99久久久国产精品免费蜜臀| 精品一区二区三区视频在线观看| 亚洲你懂的在线视频| 久久久九九九九| 欧美一区二区私人影院日本| 97se亚洲国产综合自在线观| 久久国产麻豆精品| 日韩激情视频在线观看| 依依成人精品视频| 国产精品视频一二三区| 欧美精品一区二区三区蜜桃 | 午夜免费久久看| 亚洲丝袜制服诱惑| 久久九九久久九九| 欧美videos中文字幕| 欧美精品三级日韩久久| 一本到三区不卡视频| 国产成人欧美日韩在线电影| 久久精品99久久久| 日韩av在线免费观看不卡| 亚洲一区欧美一区| 夜色激情一区二区| 亚洲天堂成人在线观看| 中文字幕中文字幕在线一区 | 日韩无一区二区| 欧美日韩一区二区在线观看视频| 成人网在线免费视频| 国产一区二区三区黄视频 | 欧美一区二区三区免费视频| 欧洲亚洲国产日韩| 在线视频国内自拍亚洲视频| 99久久精品久久久久久清纯| 成人av高清在线| www.在线成人| 波多野结衣中文字幕一区| 成人一级黄色片| 成人免费视频播放| 成人中文字幕合集| 99久久精品免费| 91久久精品一区二区| 日本高清无吗v一区| 欧美系列日韩一区| 欧美老人xxxx18| 日韩无一区二区| 26uuu精品一区二区三区四区在线| 日韩一区二区三| 精品国产亚洲在线| 国产日产欧产精品推荐色 | 亚洲国产精品av| 中文字幕五月欧美| 夜夜揉揉日日人人青青一国产精品| 一区二区三区精品在线观看| 亚洲3atv精品一区二区三区| 日韩成人伦理电影在线观看| 国产一区视频导航| 波多野结衣在线一区| 色婷婷精品大在线视频 | 美女在线一区二区| 国产精品自在在线| 99久久精品国产麻豆演员表| 欧美在线免费视屏| 精品国产乱码久久久久久影片| 国产午夜精品在线观看| 亚洲美女精品一区| 日本欧美肥老太交大片| 国产麻豆欧美日韩一区| 99精品视频在线观看| 欧美日韩国产高清一区二区三区 | 亚洲欧美电影院| 日韩av电影天堂| 成人福利在线看| 制服丝袜成人动漫| 欧美国产综合色视频| 亚洲大片精品永久免费| 国产曰批免费观看久久久| 99在线视频精品| 日韩一级在线观看| 亚洲日本丝袜连裤袜办公室| 男女男精品视频| 99精品视频中文字幕| 日韩欧美中文字幕精品| 最近日韩中文字幕| 老司机午夜精品99久久| 91视频.com| 久久综合中文字幕| 亚洲愉拍自拍另类高清精品| 国产真实乱子伦精品视频| 日本高清不卡一区| 国产精品网站在线播放| 青青草成人在线观看| 不卡的av中国片| 精品国精品国产尤物美女| 亚洲另类一区二区| 国产精品一区二区在线观看网站 | 日本精品一区二区三区四区的功能| 91麻豆精品国产91久久久久| 日韩毛片一二三区| 国产91精品入口| 2014亚洲片线观看视频免费| 日韩电影在线观看电影| 欧美视频日韩视频在线观看| 国产精品女同一区二区三区| 美女视频网站久久| 7777精品久久久大香线蕉| 亚洲美女屁股眼交| 色综合中文字幕国产| 国产精品成人在线观看| 丁香婷婷综合网| 久久久不卡影院| 国产乱人伦精品一区二区在线观看 | 日韩美女在线视频| 五月天精品一区二区三区| 欧美午夜精品一区二区蜜桃| 亚洲日本中文字幕区| 色综合久久久久综合| 成人欧美一区二区三区小说| 成人午夜电影网站| 综合电影一区二区三区| 99久久精品国产网站| 亚洲欧美日韩综合aⅴ视频| 91免费国产在线|