亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
国产成a人亚洲精品| 日韩精品成人一区二区在线| 一区2区3区在线看| 日韩av午夜在线观看| 国产v日产∨综合v精品视频| 91麻豆国产福利在线观看| 欧美剧情电影在线观看完整版免费励志电影| 欧美日本在线一区| 久久久精品免费免费| 亚洲一区二区三区中文字幕在线| 美国精品在线观看| 99视频精品在线| 91精品国产91久久久久久最新毛片 | 成人不卡免费av| 欧美日韩中文字幕一区二区| 欧美成人bangbros| 亚洲欧美精品午睡沙发| 奇米影视在线99精品| 99re66热这里只有精品3直播 | 精品一区二区三区香蕉蜜桃| 不卡区在线中文字幕| 7777精品伊人久久久大香线蕉的 | 精品一区二区精品| 97se亚洲国产综合自在线观| 日韩欧美一区二区免费| ...xxx性欧美| 国产一区二区三区四区五区入口| 色婷婷综合五月| 久久精品水蜜桃av综合天堂| 亚洲国产精品视频| 成人av高清在线| 欧美大黄免费观看| 亚洲第一在线综合网站| 成人高清av在线| 日韩视频免费观看高清完整版| 自拍偷拍国产精品| 国产精品影音先锋| 91精品国产高清一区二区三区| 亚洲精品欧美二区三区中文字幕| 九色综合狠狠综合久久| 欧美色爱综合网| 亚洲视频精选在线| 国产河南妇女毛片精品久久久| 欧美一级夜夜爽| 亚洲午夜免费福利视频| 97国产一区二区| 中文字幕av一区二区三区免费看| 美国十次了思思久久精品导航| 欧美熟乱第一页| √…a在线天堂一区| 国产激情一区二区三区四区 | 精品一区二区在线播放| 欧美另类久久久品| 一区二区三区日韩欧美精品| 成人性生交大片免费看中文| 日韩欧美aaaaaa| 日韩二区三区在线观看| 欧美片网站yy| 亚洲成人激情社区| 欧美亚洲一区三区| 亚洲国产综合人成综合网站| 91啪亚洲精品| 亚洲色图欧美激情| 91玉足脚交白嫩脚丫在线播放| 国产精品高清亚洲| 国产1区2区3区精品美女| 久久久久久久久久久电影| 狂野欧美性猛交blacked| 色综合色狠狠综合色| 亚洲精品水蜜桃| 色婷婷精品久久二区二区蜜臀av| 亚洲欧美韩国综合色| 91免费版pro下载短视频| 日韩理论片中文av| 91免费在线视频观看| 一区二区三区在线视频播放| 欧美亚洲综合色| 婷婷国产在线综合| 欧美一区二区精美| 精品在线播放午夜| 久久久精品人体av艺术| 国产成人亚洲精品青草天美| 日本一区二区在线不卡| 成人久久视频在线观看| 1区2区3区欧美| 在线视频你懂得一区二区三区| 一区二区三区精品| 欧美精品丝袜中出| 久久99精品国产麻豆不卡| 国产欧美视频一区二区三区| 高清久久久久久| 亚洲中国最大av网站| 欧美一区二区三区在线看| 精品一区二区三区久久久| 舔着乳尖日韩一区| 日韩一级在线观看| 国产在线国偷精品产拍免费yy| 国产欧美一区二区精品秋霞影院| a美女胸又www黄视频久久| 亚洲激情欧美激情| 91精品久久久久久久91蜜桃| 狠狠色伊人亚洲综合成人| 国产亚洲1区2区3区| 91影院在线观看| 爽好多水快深点欧美视频| 日韩欧美黄色影院| 岛国一区二区在线观看| 亚洲欧美激情小说另类| 日韩一区二区三区电影| 老司机午夜精品99久久| 久久嫩草精品久久久久| 91视频国产观看| 日本午夜一本久久久综合| 久久精品欧美日韩| 欧美伊人久久久久久午夜久久久久| 日韩国产欧美三级| 欧美国产日韩精品免费观看| 色天天综合久久久久综合片| 麻豆精品一二三| 亚洲视频一区二区免费在线观看| 欧美日韩国产免费一区二区 | 中文天堂在线一区| 91精品在线一区二区| 99视频精品在线| 免费看黄色91| 亚洲精品伦理在线| 精品国产91洋老外米糕| 一本大道久久a久久精品综合| 久久激情综合网| 一区二区三区四区精品在线视频| 欧美mv日韩mv亚洲| 色综合天天做天天爱| 精品一区二区日韩| 亚洲国产精品久久久久秋霞影院| 国产喷白浆一区二区三区| 91麻豆精品国产自产在线观看一区| 国产不卡在线一区| 蜜臀国产一区二区三区在线播放| 亚洲欧美一区二区在线观看| 日韩欧美亚洲国产精品字幕久久久| 91在线丨porny丨国产| 国内精品自线一区二区三区视频| 亚洲一二三四区不卡| 日本一二三不卡| 欧美成人a视频| 欧美日韩精品免费观看视频| 99久久精品国产一区二区三区 | 久久精品一区二区三区不卡 | 日韩国产精品久久| 一区二区三区高清在线| 中文字幕第一页久久| 精品国内片67194| 欧美性色aⅴ视频一区日韩精品| 成人性色生活片| 日本少妇一区二区| 亚洲一卡二卡三卡四卡五卡| 国产精品情趣视频| 日韩一级免费观看| 欧美日韩视频一区二区| 成人午夜碰碰视频| 国产剧情一区二区| 久久99久久99小草精品免视看| 夜色激情一区二区| 亚洲男人天堂av网| 中文字幕日韩av资源站| 国产精品九色蝌蚪自拍| 国产清纯在线一区二区www| 精品福利二区三区| 日韩三级高清在线| 911精品国产一区二区在线| 欧美性大战久久久| 欧美亚洲一区二区在线观看| 日本韩国欧美三级| 91福利在线观看| 欧美伊人久久久久久午夜久久久久| 一本久久综合亚洲鲁鲁五月天| 波多野结衣精品在线| 成人激情午夜影院| 成人av电影免费在线播放| 成人午夜电影久久影院| 成人精品国产一区二区4080| 国产不卡在线播放| 成人午夜av在线| av电影在线不卡| 91网站最新网址| 91福利社在线观看| 欧美性极品少妇| 制服丝袜中文字幕一区| 日韩欧美国产麻豆| 亚洲精品一区二区三区影院 | 欧美三区在线视频| 欧美日韩三级一区二区| 欧美日本一区二区| 日韩一区二区免费在线电影| 日韩一区二区三区四区| 久久影院午夜论| 国产精品乱码妇女bbbb| 1000精品久久久久久久久| 亚洲一二三四区| 久久精品国产99久久6|