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

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

?? defaultlinestyler.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.custom;import org.eclipse.swt.graphics.*;import org.eclipse.swt.internal.Compatibility;import java.util.Vector;class DefaultLineStyler implements LineStyleListener, LineBackgroundListener {	StyledTextContent content;	StyleRange styles[] = new StyleRange[0];	int styleCount = 0;	// the number of styles		int styleExpandExp = 1; // the expansion exponent, used to increase the styles array exponentially	int lineExpandExp = 1; 	// the expansion exponent, used to increase the lines array exponentially	int lineCount = 0;	Color lineBackgrounds[];	/**  * Creates a new default line styler. * <p> * * @param content the text to which the styles apply */public DefaultLineStyler(StyledTextContent content) {	this.content = content;	lineCount = content.getLineCount();	lineBackgrounds = new Color[lineCount];}	/**  * Inserts a style at the given location. * <p> * * @param style	the new style * @param index	the index at which to insert the style (the new style * 	will reside at this index) * */void insertStyle(StyleRange style, int index) {	insertStyles(new StyleRange[] {style}, index);}/**  * Insert the styles at the given location. * <p> * * @param insertStyles	the new styles * @param index	the index at which to insert the styles (the first new style * 	will reside at this index) * */void insertStyles(StyleRange[] insertStyles, int index) {	int size = styles.length;	int insertCount = insertStyles.length;	int spaceNeeded = styleCount + insertCount - size;	if (spaceNeeded > 0) {		StyleRange[] newStyles = new StyleRange[size+spaceNeeded];		System.arraycopy(styles, 0, newStyles, 0, size);		styles = newStyles;	}	// shift the styles down to make room for the new styles	System.arraycopy(styles, index, styles, index + insertCount, styleCount - index);	// add the new styles	System.arraycopy(insertStyles, 0, styles, index, insertCount);	styleCount = styleCount + insertCount;}/**  * Inserts a style, merging it with adjacent styles if possible. * <p> * * @param style	the new style * @param index	the index at which to insert the style (the new style * 	will reside at this index) * @return true if the style was inserted, false if the style was merged with an adjacent  * 	style */boolean insertMergeStyle(StyleRange style, int index) {	if (mergeStyleBefore(style, index)) return false;	if (mergeStyleAfter(style, index)) return false;	insertStyle(style, index);	return true;}/**  * Merges the style with the style before it if possible. * <p> * * @param style	the new style * @param index	the index at which to attempt the merge. * @return true if the style was merged, false otherwise */boolean mergeStyleBefore(StyleRange style, int index) {	// see if the style is similar to the style before it and merge the	// styles if possible	if (index > 0) {		StyleRange previous = styles[index-1];		if (style.similarTo(previous)) {			// the start of style needs to be in the range of the previous style			// and the end of style needs to be < the start of the next style			int previousEnd = previous.start + previous.length;			if ((style.start <= previousEnd) && (style.start >= previous.start)) {				int styleEnd = style.start + style.length;				if ((index == styleCount) || (styleEnd <= styles[index].start)) {					previous.length = style.start + style.length - previous.start;					return true;				}			}		}	}	return false;}/**  * Merges the style with the style after it if possible. * <p> * * @param style	the new style * @param index	the index at which to attempt the merge. * @return true if the style was merged, false otherwise */boolean mergeStyleAfter(StyleRange style, int index) {	// see if the style is similar to the style that will be after it and 	// merge the styles if possible	if (index < styleCount) {		StyleRange next = styles[index];		if (style.similarTo(next)) {			// the end of style needs to be in the range of the next style and			// the start of style needs to be > the end of the previous style			int styleEnd = style.start + style.length;			int nextEnd = next.start + next.length;			if ((styleEnd <= nextEnd) && (styleEnd >= next.start)) {				if ((index == 0) || (style.start >= styles[index-1].start + styles[index-1].length)) {					next.length = next.start + next.length - style.start;					next.start = style.start;					return true;				}			}		}	}	return false;}/**  * Removes style information that is defined for the range of text in <code>clearStyle</code>. * <p> * * @param clearStyle the style information to use for clearing  */ void clearStyle(StyleRange clearStyle) {	Point pt = getOverlappingStyles(clearStyle.start, clearStyle.length);	int clearStyleEnd = clearStyle.start + clearStyle.length - 1;		// no overlapped styles exist	if ((pt == null) || (pt.y == 0)) return; 	// the newStyle overlaps one or more of the existing styles	// pt.x is the index of the first overlapped style, pt.y is the number of overlapped	// styles	int count = 0;	int deleteStyle = -1;	int deleteCount = 0;	for (int i=pt.x; count<pt.y; i++) {		StyleRange overlap = styles[i];		int overlapEnd = overlap.start + overlap.length - 1;		if (overlap.start < clearStyle.start) {			if (overlapEnd <= clearStyleEnd) {				// the end of overlap needs to be cleared				overlap.length=clearStyle.start - overlap.start;			} else {				// middle of overlap needs to be cleared, this will				// cause overlap to be broken into two				StyleRange endStyle = (StyleRange)overlap.clone();				endStyle.start = clearStyleEnd + 1;				endStyle.length = overlapEnd - clearStyleEnd;				overlap.length = clearStyle.start - overlap.start;				insertStyle(endStyle, i+1);				break;			}		} else {			if (overlapEnd <= clearStyleEnd) {					// entire overlap needs to be cleared				if (deleteStyle == -1) {					deleteStyle = i;				} 				deleteCount++;			} else {				// beginning of overlap needs to be cleared				overlap.start=clearStyleEnd + 1;				overlap.length=overlapEnd - overlap.start + 1;				break;			}		}						count++;	}	deleteStyles(deleteStyle, deleteCount);}/** * Increases the <code>linebackgrounds</code> array to accomodate new line background * information. * <p> * * @param numLines the number to increase the array by */void expandLinesBy(int numLines) {	int size = lineBackgrounds.length;	if (size - lineCount >= numLines) {		return;	}	Color[] newLines = new Color[size+Math.max(Compatibility.pow2(lineExpandExp), numLines)];	System.arraycopy(lineBackgrounds, 0, newLines, 0, size);	lineBackgrounds = newLines;	lineExpandExp++;}/**  * Deletes the style at <code>index</code>. * <p> * * @param index	the index of the style to be deleted */void deleteStyle(int index) {	deleteStyles(index, 1);}/**  * Delete count styles starting at <code>index</code>. * <p> * * @param index	the index of the style to be deleted * @param count	the number of styles to be deleted */void deleteStyles(int index, int count) {	if ((count == 0) || (index < 0)) return;	// shift the styles up 	System.arraycopy(styles, index + count, styles, index, styleCount - (index + count));	for (int i=0; i<count; i++) {		styles[styleCount - i - 1] = null;	}	styleCount = styleCount - count;}/**  * Returns the styles that are defined. * <p> * * @return the copied array of styles */StyleRange [] getStyleRanges() {	StyleRange[] newStyles = new StyleRange[styleCount];	System.arraycopy(styles, 0, newStyles, 0, styleCount);	return newStyles;}/** * Handles the get line background color callback. * <p> * * @param event.lineOffset line number (input)	 * @param event.lineText line text (input) * @param event.background line background color (output) */public void lineGetBackground(LineBackgroundEvent event) {	int lineIndex = content.getLineAtOffset(event.lineOffset);	event.lineBackground = lineBackgrounds[lineIndex];}/** * Handles the get line style information callback. * <p> * * @param event.lineOffset line number (input)	 * @param event.lineText line text (input) * @param event.styles array of StyleRanges, need to be in order (output) */public void lineGetStyle(LineStyleEvent event) {	int lineStart = event.lineOffset;	int lineEnd = lineStart + event.lineText.length();	int high = searchForStyle(lineStart, lineEnd);	StyleRange style = null;	Vector lineStyles = new Vector();	// index will represent a style that 	// -- starts after the line (end processing)	// -- ends before the line (continue processing)	// -- starts before the line, ends in the line (add range)	// -- starts in the line, ends in the line (add range)	// -- starts in the line, ends after the line (add range)	// -- starts before the line, ends after the line (add range)	for (int index = high; index < styleCount; index++) {		style = styles[index];		if (style.start > lineEnd)			// style starts after the line, end looping 			break;		int styleEnd = style.start + style.length - 1;		if (styleEnd >= lineStart) lineStyles.addElement(style);	}	event.styles = new StyleRange[lineStyles.size()];	lineStyles.copyInto(event.styles);}/**  * Searches for the first style in the <code>start</code> - <code>end</code> range. * <p> * * @return the index of the first style that overlaps the input range   */int searchForStyle(int start, int end) {	int high = styleCount;	int low = -1;	int index = high;	// find the index of the first style for the given range, use a binary search	while (high - low > 1) {		index = (high + low) / 2;		StyleRange style = styles[index];		int styleEnd = style.start + style.length - 1;		if (start <= style.start || end <= styleEnd || (start > style.start && styleEnd >= start && styleEnd < end)) {			high = index;					}		else {			low = index;		}	}	return high;}/**  * Updates the line background colors to reflect a new color.  Called by StyledText. * <p> * * @param startLine index of the first line to color * @param lineCount number of lines to color starting at startLine * @param background the background color for the lines */ void setLineBackground(int startLine, int count, Color background) {	for (int i=startLine; i<startLine + count; i++) {		lineBackgrounds[i]=background;	}}/**  * Update the styles to reflect the new style.  <code>newStyle</code> will  * replace any old style for the range.  When this method is called, the  * DefaultLineStyler may merge the new style with an existing style (if possible). * Called by StyledText when a style is added.  Called by StyledText. * <p> * * @param newStyle the new style information. */ void setStyleRange(StyleRange newStyle) {

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品一区免费视频| 精品国产一区二区在线观看| 久久99久国产精品黄毛片色诱| 亚洲欧美电影一区二区| 欧美韩国一区二区| 国产欧美日韩在线视频| 欧美国产欧美综合| 国产精品激情偷乱一区二区∴| 亚洲国产精品精华液ab| 中文字幕永久在线不卡| 亚洲精品写真福利| 亚洲综合清纯丝袜自拍| 日韩国产在线观看一区| 日日摸夜夜添夜夜添国产精品| 久久久精品影视| 欧美日韩电影一区| 精品视频一区二区三区免费| 91激情在线视频| 欧美男生操女生| 日韩一区二区三区四区五区六区| 欧美一区二区三区在线看| 精品国产乱码久久久久久夜甘婷婷 | 91精品国产综合久久久久久漫画| 色综合一区二区| 在线观看www91| 欧美日韩一区 二区 三区 久久精品| 狠狠色丁香婷婷综合| 夜夜亚洲天天久久| 美女爽到高潮91| 成人激情电影免费在线观看| 97se亚洲国产综合在线| 欧美男男青年gay1069videost | 国产精品综合二区| av亚洲精华国产精华精华| 欧美天堂一区二区三区| 精品va天堂亚洲国产| 中文字幕欧美一| 看片网站欧美日韩| 99精品国产热久久91蜜凸| 欧美一区二区视频免费观看| 中文一区在线播放| 日韩中文字幕av电影| 粉嫩一区二区三区在线看| 欧美无砖专区一中文字| 国产欧美日韩三级| 视频在线观看国产精品| 波多野结衣的一区二区三区| 91精品久久久久久蜜臀| 国产精品久久久久久久久免费相片| 午夜a成v人精品| 97se亚洲国产综合自在线不卡| 欧美一区二区三区免费视频| 亚洲免费在线观看| 国产福利不卡视频| 欧美α欧美αv大片| 一级中文字幕一区二区| 成人h动漫精品一区二| 日韩一区二区三区在线观看| 亚洲国产精品麻豆| 色婷婷一区二区三区四区| 国产精品国产自产拍高清av| 国内精品写真在线观看| 欧美一区二区视频网站| 亚洲福利一区二区| 91精品福利视频| 亚洲婷婷在线视频| 国产精品小仙女| 国产欧美va欧美不卡在线| 麻豆精品一区二区| 91精品国产色综合久久不卡蜜臀| 一区二区视频在线看| 91婷婷韩国欧美一区二区| 欧美国产丝袜视频| 国产91高潮流白浆在线麻豆| 久久一区二区视频| 国产精品一区2区| 国产亚洲欧美激情| 国产+成+人+亚洲欧洲自线| 一区二区三区av电影| 色呦呦国产精品| 亚洲国产一区二区三区| 欧洲精品在线观看| 亚洲成年人网站在线观看| 欧美色图在线观看| 日韩精彩视频在线观看| 日韩一区二区麻豆国产| 久久精品国产澳门| 久久久午夜精品| 99re在线精品| 亚洲成av人在线观看| 欧美高清视频一二三区 | 久久99九九99精品| 欧美一级二级三级蜜桃| 毛片基地黄久久久久久天堂| 日韩欧美一区二区久久婷婷| 国内精品第一页| 国产清纯白嫩初高生在线观看91| 成年人网站91| 亚洲精品中文在线| 日韩一级片网站| 成人免费视频播放| 亚洲电影一级黄| 精品福利二区三区| 色综合久久久久| 久久超碰97中文字幕| 国产精品久久夜| 3751色影院一区二区三区| 韩国精品一区二区| 亚洲精品日日夜夜| 欧美xxxx在线观看| 色先锋久久av资源部| 麻豆精品国产91久久久久久| 中文字幕制服丝袜成人av| 欧美性三三影院| 国产91丝袜在线18| 日本不卡免费在线视频| 亚洲私人影院在线观看| 日韩视频免费观看高清完整版 | 亚洲欧美在线高清| 日韩一区二区三区四区五区六区| 成人av集中营| 免费在线观看一区二区三区| 国产精品不卡一区| www国产精品av| 欧美一区二区视频免费观看| 91蝌蚪porny九色| 久久99国产精品久久99| 亚洲一二三四久久| 中国色在线观看另类| 日韩美女视频在线| 欧美日韩一区二区三区不卡| 成人毛片在线观看| 国产一区二区三区免费观看| 日韩不卡一区二区三区| 亚洲男帅同性gay1069| 精品999在线播放| 91麻豆精品国产91久久久使用方法 | 欧美精品亚洲二区| 色综合久久中文字幕| 成人免费高清在线观看| 国产精品资源网| 经典三级在线一区| 欧美a一区二区| 日本不卡不码高清免费观看| 亚洲国产一区二区在线播放| 一区二区三区精品视频在线| 中文字幕一区二区三区四区 | 一本一道久久a久久精品综合蜜臀| 国模套图日韩精品一区二区| 日本麻豆一区二区三区视频| 亚洲福利视频一区| 午夜视频一区二区三区| 亚洲成在人线免费| 亚洲第一在线综合网站| 亚洲国产精品久久人人爱蜜臀 | 国产毛片精品一区| 国产老肥熟一区二区三区| 黑人巨大精品欧美黑白配亚洲| 青椒成人免费视频| 免费在线看成人av| 久久精品国产久精国产| 国产麻豆精品视频| 成人精品亚洲人成在线| 99国产精品久| 国产精品国产自产拍在线| 日日夜夜免费精品| 综合精品久久久| 亚洲综合久久av| 亚洲成人高清在线| 麻豆精品一二三| 国产二区国产一区在线观看| 国产成人午夜精品影院观看视频| 国产成都精品91一区二区三| 成人av网站在线观看免费| 91精品福利视频| 日韩欧美国产一区二区在线播放| 日韩欧美不卡在线观看视频| 国产日韩精品视频一区| 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆 | 欧美自拍丝袜亚洲| 成人激情av网| 色8久久精品久久久久久蜜 | 亚洲精品成a人| 亚欧色一区w666天堂| 看电影不卡的网站| 成人动漫在线一区| 欧美一区二区网站| 久久奇米777| 亚洲一区二区欧美| 国内精品国产成人国产三级粉色| 不卡的电影网站| 67194成人在线观看| 国产精品美女久久久久aⅴ国产馆| 一区二区三区免费在线观看| 久久国产麻豆精品| 色狠狠色噜噜噜综合网| 欧美videofree性高清杂交| 亚洲乱码日产精品bd| 国产在线播放一区二区三区| 欧美日韩久久久|