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

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

?? styledtext.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.custom;import java.util.*;import org.eclipse.swt.*;import org.eclipse.swt.accessibility.*;import org.eclipse.swt.dnd.*;import org.eclipse.swt.events.*;import org.eclipse.swt.graphics.*;import org.eclipse.swt.internal.*;import org.eclipse.swt.printing.*;import org.eclipse.swt.widgets.*;/** * A StyledText is an editable user interface object that displays lines  * of text.  The following style attributes can be defined for the text:  * <ul> * <li>foreground color  * <li>background color * <li>font style (bold, regular) * </ul> * <p> * In addition to text style attributes, the background color of a line may  * be specified. * </p> * <p> * There are two ways to use this widget when specifying text style information.   * You may use the API that is defined for StyledText or you may define your own  * LineStyleListener.  If you define your own listener, you will be responsible  * for maintaining the text style information for the widget.  IMPORTANT: You may  * not define your own listener and use the StyledText API.  The following * StyledText API is not supported if you have defined a LineStyleListener: * <ul> * <li>getStyleRangeAtOffset(int) * <li>getStyleRanges() * <li>replaceStyleRanges(int,int,StyleRange[]) * <li>setStyleRange(StyleRange) * <li>setStyleRanges(StyleRange[]) * </ul> * </p> * <p> * There are two ways to use this widget when specifying line background colors. * You may use the API that is defined for StyledText or you may define your own  * LineBackgroundListener.  If you define your own listener, you will be responsible  * for maintaining the line background color information for the widget.   * IMPORTANT: You may not define your own listener and use the StyledText API.   * The following StyledText API is not supported if you have defined a  * LineBackgroundListener: * <ul> * <li>getLineBackground(int) * <li>setLineBackground(int,int,Color) * </ul> * </p> * <p> * The content implementation for this widget may also be user-defined.  To do so, * you must implement the StyledTextContent interface and use the StyledText API * setContent(StyledTextContent) to initialize the widget.  * </p> * <p> * IMPORTANT: This class is <em>not</em> intended to be subclassed. * </p> * <dl> * <dt><b>Styles:</b><dd>FULL_SELECTION, MULTI, READ_ONLY, SINGLE, WRAP * <dt><b>Events:</b><dd>ExtendedModify, LineGetBackground, LineGetSegments, LineGetStyle, Modify, Selection, Verify, VerifyKey * </dl> */public class StyledText extends Canvas {	static final char TAB = '\t';	static final String PlatformLineDelimiter = System.getProperty("line.separator");	static final int BIDI_CARET_WIDTH = 3;	static final int DEFAULT_WIDTH	= 64;	static final int DEFAULT_HEIGHT = 64;		static final int ExtendedModify = 3000;	static final int LineGetBackground = 3001;	static final int LineGetStyle = 3002;	static final int TextChanging = 3003;	static final int TextSet = 3004;	static final int VerifyKey = 3005;	static final int TextChanged = 3006;	static final int LineGetSegments = 3007;		Color selectionBackground;	// selection background color	Color selectionForeground;	// selection foreground color	StyledTextContent logicalContent;	// native content (default or user specified)	StyledTextContent content;			// line wrapping content, same as logicalContent if word wrap is off	DisplayRenderer renderer;	Listener listener;	TextChangeListener textChangeListener;	// listener for TextChanging, TextChanged and TextSet events from StyledTextContent	DefaultLineStyler defaultLineStyler;// used for setStyles API when no LineStyleListener is registered	LineCache lineCache;	boolean userLineStyle = false;		// true=widget is using a user defined line style listener for line styles. false=widget is using the default line styler to store line styles	boolean userLineBackground = false;	// true=widget is using a user defined line background listener for line backgrounds. false=widget is using the default line styler to store line backgrounds	int verticalScrollOffset = 0;		// pixel based	int horizontalScrollOffset = 0;		// pixel based	int topIndex = 0;					// top visible line	int lastPaintTopIndex = -1;	int topOffset = 0;					// offset of first character in top line	int clientAreaHeight = 0;			// the client area height. Needed to calculate content width for new 										// visible lines during Resize callback	int clientAreaWidth = 0;			// the client area width. Needed during Resize callback to determine 										// if line wrap needs to be recalculated	int lineHeight;						// line height=font height	int tabLength = 4;					// number of characters in a tab	int leftMargin;	int topMargin;	int rightMargin;	int bottomMargin;	Cursor ibeamCursor;			int columnX;							// keep track of the horizontal caret position										// when changing lines/pages. Fixes bug 5935	int caretOffset = 0;	Point selection = new Point(0, 0);	// x and y are start and end caret offsets of selection	int selectionAnchor;				// position of selection anchor. 0 based offset from beginning of text	Point doubleClickSelection;			// selection after last mouse double click	boolean editable = true;	boolean wordWrap = false;	boolean doubleClickEnabled = true;	// see getDoubleClickEnabled 	boolean overwrite = false;			// insert/overwrite edit mode	int textLimit = -1;					// limits the number of characters the user can type in the widget. Unlimited by default.	Hashtable keyActionMap = new Hashtable();	Color background = null;			// workaround for bug 4791	Color foreground = null;			//	Clipboard clipboard;	boolean mouseDoubleClick = false;	// true=a double click ocurred. Don't do mouse swipe selection.	int autoScrollDirection = SWT.NULL;	// the direction of autoscrolling (up, down, right, left)	int lastTextChangeStart;			// cache data of the 	int lastTextChangeNewLineCount;		// last text changing 	int lastTextChangeNewCharCount;		// event for use in the 	int lastTextChangeReplaceLineCount;	// text changed handler	int lastTextChangeReplaceCharCount;		boolean isBidi;	boolean isMirrored;	boolean bidiColoring = false;		// apply the BIDI algorithm on text segments of the same color	Image leftCaretBitmap = null;	Image rightCaretBitmap = null;	int caretDirection = SWT.NULL;	boolean advancing = true;	Caret defaultCaret = null;	boolean updateCaretDirection = true;	final static boolean IS_CARBON;	final static boolean DOUBLE_BUFFERED;		static {		String platform = SWT.getPlatform();		IS_CARBON = "carbon".equals(platform);		DOUBLE_BUFFERED = !("carbon".equals(platform) || "gtk".equals(platform));	}	/**	 * The Printing class implements printing of a range of text.	 * An instance of <class>Printing </class> is returned in the 	 * StyledText#print(Printer) API. The run() method may be 	 * invoked from any thread.	 */	static class Printing implements Runnable {		final static int LEFT = 0;						// left aligned header/footer segment		final static int CENTER = 1;					// centered header/footer segment		final static int RIGHT = 2;						// right aligned header/footer segment		StyledText parent;		Printer printer;		PrintRenderer renderer;		StyledTextPrintOptions printOptions;		StyledTextContent printerContent;				// copy of the widget content		Rectangle clientArea;							// client area to print on		Font printerFont;		FontData displayFontData;		Hashtable printerColors;						// printer color cache for line backgrounds and style		Hashtable lineBackgrounds = new Hashtable();	// cached line backgrounds		Hashtable lineStyles = new Hashtable();			// cached line styles		Hashtable bidiSegments = new Hashtable();		// cached bidi segments when running on a bidi platform		GC gc;											// printer GC		int pageWidth;									// width of a printer page in pixels		int startPage;									// first page to print		int endPage;									// last page to print		int pageSize;									// number of lines on a page		int startLine;									// first (wrapped) line to print		int endLine;									// last (wrapped) line to print		boolean singleLine;								// widget single line mode		Point selection = null;					// selected text	/**	 * Creates an instance of <class>Printing</class>.	 * Copies the widget content and rendering data that needs 	 * to be requested from listeners.	 * </p>	 * @param parent StyledText widget to print.	 * @param printer printer device to print on.	 * @param printOptions print options	 */			Printing(StyledText parent, Printer printer, StyledTextPrintOptions printOptions) {		PrinterData data = printer.getPrinterData();		this.parent = parent;		this.printer = printer;		this.printOptions = printOptions;		singleLine = parent.isSingleLine();		startPage = 1;		endPage = Integer.MAX_VALUE;		if (data.scope == PrinterData.PAGE_RANGE) {			startPage = data.startPage;			endPage = data.endPage;			if (endPage < startPage) {				int temp = endPage;				endPage = startPage;				startPage = temp;			}					} 		else 		if (data.scope == PrinterData.SELECTION) {			selection = parent.getSelectionRange();		}		displayFontData = parent.getFont().getFontData()[0];		copyContent(parent.getContent());		cacheLineData(printerContent);	}	/**	 * Caches the bidi segments of the given line.	 * </p>	 * @param lineOffset offset of the line to cache bidi segments for. 	 * 	Relative to the start of the document.	 * @param line line to cache bidi segments for. 	 */	void cacheBidiSegments(int lineOffset, String line) {		int[] segments = parent.getBidiSegments(lineOffset, line);				if (segments != null) {			bidiSegments.put(new Integer(lineOffset), segments);		}	}	/**	 * Caches the line background color of the given line.	 * </p>	 * @param lineOffset offset of the line to cache the background 	 * 	color for. Relative to the start of the document.	 * @param line line to cache the background color for	 */	void cacheLineBackground(int lineOffset, String line) {		StyledTextEvent event = parent.getLineBackgroundData(lineOffset, line);				if (event != null) {			lineBackgrounds.put(new Integer(lineOffset), event);		}	}	/**	 * Caches all line data that needs to be requested from a listener.	 * </p>	 * @param printerContent <class>StyledTextContent</class> to request 	 * 	line data for.	 */	void cacheLineData(StyledTextContent printerContent) {			for (int i = 0; i < printerContent.getLineCount(); i++) {			int lineOffset = printerContent.getOffsetAtLine(i);			String line = printerContent.getLine(i);				if (printOptions.printLineBackground) {				cacheLineBackground(lineOffset, line);			}			if (printOptions.printTextBackground ||				printOptions.printTextForeground ||				printOptions.printTextFontStyle) {				cacheLineStyle(lineOffset, line);			}			if (parent.isBidi()) {				cacheBidiSegments(lineOffset, line);			}		}	}	/**	 * Caches all line styles of the given line.	 * </p>	 * @param lineOffset offset of the line to cache the styles for.	 * 	Relative to the start of the document.	 * @param line line to cache the styles for.	 */	void cacheLineStyle(int lineOffset, String line) {		StyledTextEvent event = parent.getLineStyleData(lineOffset, line);				if (event != null) {			StyleRange[] styles = event.styles;			for (int i = 0; i < styles.length; i++) {				StyleRange styleCopy = null;				if (printOptions.printTextBackground == false && styles[i].background != null) {					styleCopy = (StyleRange) styles[i].clone();					styleCopy.background = null;				}				if (printOptions.printTextForeground == false && styles[i].foreground != null) {					if (styleCopy == null) {						styleCopy = (StyleRange) styles[i].clone();					}					styleCopy.foreground = null;				}				if (printOptions.printTextFontStyle == false && styles[i].fontStyle != SWT.NORMAL) {					if (styleCopy == null) {						styleCopy = (StyleRange) styles[i].clone();					}					styleCopy.fontStyle = SWT.NORMAL;				}				if (styleCopy != null) {					styles[i] = styleCopy;				}			}				lineStyles.put(new Integer(lineOffset), event);		}	}	/**	 * Copies the text of the specified <class>StyledTextContent</class>.	 * </p>	 * @param original the <class>StyledTextContent</class> to copy.	 */	void copyContent(StyledTextContent original) {		int insertOffset = 0;				printerContent = new DefaultContent();		for (int i = 0; i < original.getLineCount(); i++) {			int insertEndOffset;			if (i < original.getLineCount() - 1) {				insertEndOffset = original.getOffsetAtLine(i + 1);			}			else {				insertEndOffset = original.getCharCount();			}			printerContent.replaceTextRange(insertOffset, 0, original.getTextRange(insertOffset, insertEndOffset - insertOffset));			insertOffset = insertEndOffset;		}	}	/**	 * Replaces all display colors in the cached line backgrounds and 	 * line styles with printer colors.	 */	void createPrinterColors() {		Enumeration values = lineBackgrounds.elements();		printerColors = new Hashtable();		while (values.hasMoreElements()) {			StyledTextEvent event = (StyledTextEvent) values.nextElement();			event.lineBackground = getPrinterColor(event.lineBackground);		}				values = lineStyles.elements();		while (values.hasMoreElements()) {			StyledTextEvent event = (StyledTextEvent) values.nextElement();			for (int i = 0; i < event.styles.length; i++) {				StyleRange style = event.styles[i];				Color printerBackground = getPrinterColor(style.background);				Color printerForeground = getPrinterColor(style.foreground);								if (printerBackground != style.background || 					printerForeground != style.foreground) {					style = (StyleRange) style.clone();					style.background = printerBackground;					style.foreground = printerForeground;					event.styles[i] = style;				}			}		}			}	/**	 * Disposes of the resources and the <class>PrintRenderer</class>.	 */	void dispose() {		if (printerColors != null) {			Enumeration colors = printerColors.elements();						while (colors.hasMoreElements()) {				Color color = (Color) colors.nextElement();				color.dispose();			}			printerColors = null;		}		if (gc != null) {			gc.dispose();			gc = null;		}		if (printerFont != null) {			printerFont.dispose();			printerFont = null;		}		if (renderer != null) {

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩欧美中文字幕制服| 亚洲另类在线一区| 亚洲精品国产a久久久久久| 午夜精品久久久久| 国产成人超碰人人澡人人澡| 欧美揉bbbbb揉bbbbb| 久久精品一区四区| 奇米色一区二区| 在线亚洲精品福利网址导航| 国产亚洲精品精华液| 免费观看91视频大全| 在线免费观看成人短视频| 久久久久久久久久久黄色| 午夜精品久久久久久久久久久| 国产jizzjizz一区二区| 日韩欧美国产电影| 日韩高清在线观看| 欧美日韩亚洲国产综合| 亚洲欧洲成人自拍| 顶级嫩模精品视频在线看| 久久这里只有精品首页| 日本不卡一区二区三区| 欧美日韩久久久一区| 亚洲同性gay激情无套| 99视频一区二区| 国产视频一区不卡| 国产成人在线免费| 日韩欧美中文一区二区| 丝袜美腿亚洲综合| 欧美情侣在线播放| 日韩成人一区二区三区在线观看| 在线日韩国产精品| 亚洲一区免费在线观看| 在线观看日韩高清av| 一区二区三区欧美| 日本韩国欧美国产| 亚洲大型综合色站| 欧美精品三级日韩久久| 青青草原综合久久大伊人精品| 欧美片在线播放| 蜜桃av噜噜一区二区三区小说| 在线不卡欧美精品一区二区三区| 三级欧美韩日大片在线看| 717成人午夜免费福利电影| 日韩不卡一区二区| 欧美精品一区二区三| 国产成人丝袜美腿| 最新不卡av在线| 欧美色老头old∨ideo| 欧美a级一区二区| 久久日一线二线三线suv| 色女孩综合影院| 亚洲国产精品综合小说图片区| 91精品免费在线观看| 狠狠v欧美v日韩v亚洲ⅴ| 2023国产精华国产精品| www.亚洲国产| 日韩综合在线视频| 日韩丝袜美女视频| 99精品国产视频| 视频一区在线播放| 中文字幕免费不卡| 欧美日韩午夜精品| 国产精品白丝jk黑袜喷水| 国产精品国产自产拍在线| 欧美丝袜自拍制服另类| 久久99国产精品免费| 18涩涩午夜精品.www| 91精品国产色综合久久久蜜香臀| 国产精品一线二线三线| 亚洲综合色丁香婷婷六月图片| xfplay精品久久| 欧美三级乱人伦电影| 国产一区二区三区精品视频| 亚洲免费观看高清完整版在线观看| 欧美一区二区日韩| 色哟哟精品一区| 国产大陆a不卡| 日本中文字幕一区| 亚洲免费av高清| 久久久99久久| 日韩女优av电影| 在线日韩av片| a美女胸又www黄视频久久| 九九**精品视频免费播放| 亚洲成a人片综合在线| 中文字幕 久热精品 视频在线 | 欧美日韩一区二区在线视频| 麻豆精品久久精品色综合| 亚洲精品菠萝久久久久久久| 国产三级三级三级精品8ⅰ区| 欧美日韩高清一区二区| 97精品久久久午夜一区二区三区 | 亚洲一区二区综合| 久久久久国产精品人| 日韩免费视频线观看| 91欧美激情一区二区三区成人| 寂寞少妇一区二区三区| 亚洲sss视频在线视频| 亚洲视频免费看| 国产精品三级久久久久三级| 久久综合久色欧美综合狠狠| 欧美精品第1页| 欧美视频在线观看一区二区| 99久久婷婷国产| 成人免费黄色在线| 国产呦萝稀缺另类资源| 日本不卡视频一二三区| 午夜欧美视频在线观看| 亚洲电影一区二区| 亚洲人成网站影音先锋播放| 亚洲欧洲av在线| 最近中文字幕一区二区三区| 国产精品伦一区二区三级视频| 久久久影院官网| 久久五月婷婷丁香社区| 久久久久久久综合日本| 欧美国产精品v| 国产日韩精品久久久| 中文字幕不卡一区| 亚洲桃色在线一区| 亚洲第一综合色| 国产成人在线电影| 成人免费黄色在线| 91在线视频播放| 欧美日韩在线播放三区四区| 欧美日韩国产综合草草| 在线91免费看| 精品国产乱码久久久久久图片| 精品国产伦理网| 中文字幕欧美激情一区| 成人欧美一区二区三区小说| 亚洲精品免费播放| 婷婷综合在线观看| 狠狠色丁香久久婷婷综合丁香| 国产精品中文有码| 色综合天天综合网国产成人综合天| 91一区一区三区| 欧美日韩免费观看一区二区三区 | 丝袜诱惑制服诱惑色一区在线观看 | 国产欧美一区二区三区在线看蜜臀| 国产精品素人一区二区| 亚洲情趣在线观看| 日韩和欧美的一区| 国产精品888| 欧美性一级生活| 日韩免费成人网| 中文字幕精品一区二区精品绿巨人| 亚洲少妇中出一区| 日日欢夜夜爽一区| 国产91在线观看丝袜| 在线日韩国产精品| 久久精品一区二区三区av| 亚洲视频一区在线| 免费成人性网站| 成人黄色av电影| 3atv在线一区二区三区| 久久久久久久久免费| 亚洲国产精品久久久久秋霞影院| 国产伦精品一区二区三区在线观看 | 精品系列免费在线观看| 成人激情免费视频| 日韩三级精品电影久久久 | 色综合久久中文字幕综合网| 欧美日本一区二区在线观看| 国产日韩成人精品| 欧美bbbbb| 欧美日韩一级二级| 国产精品看片你懂得| 蜜臀av在线播放一区二区三区| 成人黄色软件下载| 精品精品国产高清一毛片一天堂| 依依成人精品视频| 国产99一区视频免费| 在线播放视频一区| 亚洲码国产岛国毛片在线| 国产电影一区二区三区| 91精品国产综合久久精品app| 亚洲欧美国产77777| 成熟亚洲日本毛茸茸凸凹| 日韩一卡二卡三卡| 亚洲成人精品影院| 色菇凉天天综合网| 国产精品久久影院| 国产主播一区二区三区| 91精品国产综合久久婷婷香蕉| 亚洲一区视频在线| 91色视频在线| 日韩一区日韩二区| 成人免费高清视频| 中文字幕的久久| 国产99久久精品| 久久久精品人体av艺术| 韩国欧美国产1区| 精品久久一区二区三区| 日本美女视频一区二区| 91精品国产综合久久久蜜臀粉嫩| 亚洲永久免费av| 在线观看视频一区| 亚洲午夜三级在线|