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

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

?? jedittextarea.java

?? jedit中獨立出來的語法高亮組件
?? JAVA
?? 第 1 頁 / 共 4 頁
字號:
/* * JEditTextArea.java - jEdit's text component * Copyright (C) 1999 Slava Pestov * * You may use and modify this package for any purpose. Redistribution is * permitted, in both source and binary form, provided that this notice * remains intact in all source distributions of this package. */package org.syntax.jedit;import org.syntax.jedit.tokenmarker.*;  import javax.swing.event.*;import javax.swing.text.*;import javax.swing.undo.*;import javax.swing.*;import java.awt.datatransfer.*;import java.awt.event.*;import java.awt.*;import java.util.Enumeration;import java.util.Vector;/** * jEdit's text area component. It is more suited for editing program * source code than JEditorPane, because it drops the unnecessary features * (images, variable-width lines, and so on) and adds a whole bunch of * useful goodies such as: * <ul> * <li>More flexible key binding scheme * <li>Supports macro recorders * <li>Rectangular selection * <li>Bracket highlighting * <li>Syntax highlighting * <li>Command repetition * <li>Block caret can be enabled * </ul> * It is also faster and doesn't have as many problems. It can be used * in other applications; the only other part of jEdit it depends on is * the syntax package.<p> * * To use it in your app, treat it like any other component, for example: * <pre>JEditTextArea ta = new JEditTextArea(); * ta.setTokenMarker(new JavaTokenMarker()); * ta.setText("public class Test {\n" *     + "    public static void main(String[] args) {\n" *     + "        System.out.println(\"Hello World\");\n" *     + "    }\n" *     + "}");</pre> * * @author Slava Pestov * @version $Id: JEditTextArea.java,v 1.36 1999/12/13 03:40:30 sp Exp $ */public class JEditTextArea extends JComponent{	/**	 * Adding components with this name to the text area will place	 * them left of the horizontal scroll bar. In jEdit, the status	 * bar is added this way.	 */	public static String LEFT_OF_SCROLLBAR = "los";	/**	 * Creates a new JEditTextArea with the default settings.	 */	public JEditTextArea()	{		this(TextAreaDefaults.getDefaults());	}	/**	 * Creates a new JEditTextArea with the specified settings.	 * @param defaults The default settings	 */	public JEditTextArea(TextAreaDefaults defaults)	{		// Enable the necessary events		enableEvents(AWTEvent.KEY_EVENT_MASK);		// Initialize some misc. stuff		painter = new TextAreaPainter(this,defaults);		documentHandler = new DocumentHandler();		listenerList = new EventListenerList();		caretEvent = new MutableCaretEvent();		lineSegment = new Segment();		bracketLine = bracketPosition = -1;		blink = true;		// Initialize the GUI		setLayout(new ScrollLayout());		add(CENTER,painter);		add(RIGHT,vertical = new JScrollBar(JScrollBar.VERTICAL));		add(BOTTOM,horizontal = new JScrollBar(JScrollBar.HORIZONTAL));		// Add some event listeners		vertical.addAdjustmentListener(new AdjustHandler());		horizontal.addAdjustmentListener(new AdjustHandler());		painter.addComponentListener(new ComponentHandler());		painter.addMouseListener(new MouseHandler());		painter.addMouseMotionListener(new DragHandler());		addFocusListener(new FocusHandler());		// Load the defaults		setInputHandler(defaults.inputHandler);		setDocument(defaults.document);		editable = defaults.editable;		caretVisible = defaults.caretVisible;		caretBlinks = defaults.caretBlinks;		electricScroll = defaults.electricScroll;		popup = defaults.popup;		// We don't seem to get the initial focus event?		focusedComponent = this;	}	/**	 * Returns if this component can be traversed by pressing	 * the Tab key. This returns false.	 */	public final boolean isManagingFocus()	{		return true;	}	/**	 * Returns the object responsible for painting this text area.	 */	public final TextAreaPainter getPainter()	{		return painter;	}	/**	 * Returns the input handler.	 */	public final InputHandler getInputHandler()	{		return inputHandler;	}	/**	 * Sets the input handler.	 * @param inputHandler The new input handler	 */	public void setInputHandler(InputHandler inputHandler)	{		this.inputHandler = inputHandler;	}	/**	 * Returns true if the caret is blinking, false otherwise.	 */	public final boolean isCaretBlinkEnabled()	{		return caretBlinks;	}	/**	 * Toggles caret blinking.	 * @param caretBlinks True if the caret should blink, false otherwise	 */	public void setCaretBlinkEnabled(boolean caretBlinks)	{		this.caretBlinks = caretBlinks;		if(!caretBlinks)			blink = false;		painter.invalidateSelectedLines();	}	/**	 * Returns true if the caret is visible, false otherwise.	 */	public final boolean isCaretVisible()	{		return (!caretBlinks || blink) && caretVisible;	}	/**	 * Sets if the caret should be visible.	 * @param caretVisible True if the caret should be visible, false	 * otherwise	 */	public void setCaretVisible(boolean caretVisible)	{		this.caretVisible = caretVisible;		blink = true;		painter.invalidateSelectedLines();	}	/**	 * Blinks the caret.	 */	public final void blinkCaret()	{		if(caretBlinks)		{			blink = !blink;			painter.invalidateSelectedLines();		}		else			blink = true;	}	/**	 * Returns the number of lines from the top and button of the	 * text area that are always visible.	 */	public final int getElectricScroll()	{		return electricScroll;	}	/**	 * Sets the number of lines from the top and bottom of the text	 * area that are always visible	 * @param electricScroll The number of lines always visible from	 * the top or bottom	 */	public final void setElectricScroll(int electricScroll)	{		this.electricScroll = electricScroll;	}	/**	 * Updates the state of the scroll bars. This should be called	 * if the number of lines in the document changes, or when the	 * size of the text are changes.	 */	public void updateScrollBars()	{		if(vertical != null && visibleLines != 0)		{			vertical.setValues(firstLine,visibleLines,0,getLineCount());			vertical.setUnitIncrement(2);			vertical.setBlockIncrement(visibleLines);		}		int width = painter.getWidth();		if(horizontal != null && width != 0)		{			horizontal.setValues(-horizontalOffset,width,0,width * 5);			horizontal.setUnitIncrement(painter.getFontMetrics()				.charWidth('w'));			horizontal.setBlockIncrement(width / 2);		}	}	/**	 * Returns the line displayed at the text area's origin.	 */	public final int getFirstLine()	{		return firstLine;	}	/**	 * Sets the line displayed at the text area's origin without	 * updating the scroll bars.	 */	public void setFirstLine(int firstLine)	{		if(firstLine == this.firstLine)			return;		int oldFirstLine = this.firstLine;		this.firstLine = firstLine;		if(firstLine != vertical.getValue())			updateScrollBars();		painter.repaint();	}	/**	 * Returns the number of lines visible in this text area.	 */	public final int getVisibleLines()	{		return visibleLines;	}	/**	 * Recalculates the number of visible lines. This should not	 * be called directly.	 */	public final void recalculateVisibleLines()	{		if(painter == null)			return;		int height = painter.getHeight();		int lineHeight = painter.getFontMetrics().getHeight();		int oldVisibleLines = visibleLines;		visibleLines = height / lineHeight;		updateScrollBars();	}	/**	 * Returns the horizontal offset of drawn lines.	 */	public final int getHorizontalOffset()	{		return horizontalOffset;	}	/**	 * Sets the horizontal offset of drawn lines. This can be used to	 * implement horizontal scrolling.	 * @param horizontalOffset offset The new horizontal offset	 */	public void setHorizontalOffset(int horizontalOffset)	{		if(horizontalOffset == this.horizontalOffset)			return;		this.horizontalOffset = horizontalOffset;		if(horizontalOffset != horizontal.getValue())			updateScrollBars();		painter.repaint();	}	/**	 * A fast way of changing both the first line and horizontal	 * offset.	 * @param firstLine The new first line	 * @param horizontalOffset The new horizontal offset	 * @return True if any of the values were changed, false otherwise	 */	public boolean setOrigin(int firstLine, int horizontalOffset)	{		boolean changed = false;		int oldFirstLine = this.firstLine;		if(horizontalOffset != this.horizontalOffset)		{			this.horizontalOffset = horizontalOffset;			changed = true;		}		if(firstLine != this.firstLine)		{			this.firstLine = firstLine;			changed = true;		}		if(changed)		{			updateScrollBars();			painter.repaint();		}		return changed;	}	/**	 * Ensures that the caret is visible by scrolling the text area if	 * necessary.	 * @return True if scrolling was actually performed, false if the	 * caret was already visible	 */	public boolean scrollToCaret()	{		int line = getCaretLine();		int lineStart = getLineStartOffset(line);		int offset = Math.max(0,Math.min(getLineLength(line) - 1,			getCaretPosition() - lineStart));		return scrollTo(line,offset);	}	/**	 * Ensures that the specified line and offset is visible by scrolling	 * the text area if necessary.	 * @param line The line to scroll to	 * @param offset The offset in the line to scroll to	 * @return True if scrolling was actually performed, false if the	 * line and offset was already visible	 */	public boolean scrollTo(int line, int offset)	{		// visibleLines == 0 before the component is realized		// we can't do any proper scrolling then, so we have		// this hack...		if(visibleLines == 0)		{			setFirstLine(Math.max(0,line - electricScroll));			return true;		}		int newFirstLine = firstLine;		int newHorizontalOffset = horizontalOffset;		if(line < firstLine + electricScroll)		{			newFirstLine = Math.max(0,line - electricScroll);		}		else if(line + electricScroll >= firstLine + visibleLines)		{			newFirstLine = (line - visibleLines) + electricScroll + 1;			if(newFirstLine + visibleLines >= getLineCount())				newFirstLine = getLineCount() - visibleLines;			if(newFirstLine < 0)				newFirstLine = 0;		}		int x = _offsetToX(line,offset);		int width = painter.getFontMetrics().charWidth('w');		if(x < 0)		{			newHorizontalOffset = Math.min(0,horizontalOffset				- x + width + 5);		}		else if(x + width >= painter.getWidth())		{			newHorizontalOffset = horizontalOffset +				(painter.getWidth() - x) - width - 5;		}		return setOrigin(newFirstLine,newHorizontalOffset);	}	/**	 * Converts a line index to a y co-ordinate.	 * @param line The line	 */	public int lineToY(int line)	{		FontMetrics fm = painter.getFontMetrics();		return (line - firstLine) * fm.getHeight()			- (fm.getLeading() + fm.getMaxDescent());	}	/**	 * Converts a y co-ordinate to a line index.	 * @param y The y co-ordinate	 */	public int yToLine(int y)	{		FontMetrics fm = painter.getFontMetrics();		int height = fm.getHeight();		return Math.max(0,Math.min(getLineCount() - 1,			y / height + firstLine));	}	/**	 * Converts an offset in a line into an x co-ordinate. This is a	 * slow version that can be used any time.	 * @param line The line	 * @param offset The offset, from the start of the line	 */	public final int offsetToX(int line, int offset)	{		// don't use cached tokens		painter.currentLineTokens = null;		return _offsetToX(line,offset);	}	/**	 * Converts an offset in a line into an x co-ordinate. This is a	 * fast version that should only be used if no changes were made	 * to the text since the last repaint.	 * @param line The line	 * @param offset The offset, from the start of the line	 */	public int _offsetToX(int line, int offset)	{		TokenMarker tokenMarker = getTokenMarker();		/* Use painter's cached info for speed */		FontMetrics fm = painter.getFontMetrics();		getLineText(line,lineSegment);		int segmentOffset = lineSegment.offset;		int x = horizontalOffset;		/* If syntax coloring is disabled, do simple translation */		if(tokenMarker == null)		{			lineSegment.count = offset;			return x + Utilities.getTabbedTextWidth(lineSegment,				fm,x,painter,0);		}		/* If syntax coloring is enabled, we have to do this because		 * tokens can vary in width */		else		{			Token tokens;			if(painter.currentLineIndex == line				&& painter.currentLineTokens != null)				tokens = painter.currentLineTokens;			else			{				painter.currentLineIndex = line;				tokens = painter.currentLineTokens					= tokenMarker.markTokens(lineSegment,line);			}			Toolkit toolkit = painter.getToolkit();			Font defaultFont = painter.getFont();			SyntaxStyle[] styles = painter.getStyles();			for(;;)			{				byte id = tokens.id;				if(id == Token.END)				{					return x;				}				if(id == Token.NULL)					fm = painter.getFontMetrics();				else					fm = styles[id].getFontMetrics(defaultFont);				int length = tokens.length;				if(offset + segmentOffset < lineSegment.offset + length)				{					lineSegment.count = offset - (lineSegment.offset - segmentOffset);					return x + Utilities.getTabbedTextWidth(						lineSegment,fm,x,painter,0);				}				else				{					lineSegment.count = length;					x += Utilities.getTabbedTextWidth(						lineSegment,fm,x,painter,0);					lineSegment.offset += length;				}				tokens = tokens.next;			}		}	}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
av中文字幕一区| 久久久精品天堂| 国产真实乱子伦精品视频| 国产精品网曝门| 日韩精品一区二区三区四区视频| 欧美性色欧美a在线播放| 粉嫩高潮美女一区二区三区 | 国产婷婷色一区二区三区四区| 欧美乱妇20p| 欧美日韩激情一区二区三区| 欧美日韩国产高清一区二区三区 | 国产精品丝袜91| 青青草国产精品97视觉盛宴| 午夜久久福利影院| 亚洲成人三级小说| 青青青爽久久午夜综合久久午夜| 99热精品国产| 国产日韩欧美a| 一区二区三区中文字幕精品精品| 亚洲特黄一级片| 亚洲综合色网站| 精品一区二区三区日韩| 国产精品1区2区| 色老汉一区二区三区| 色哟哟精品一区| 日韩一区二区麻豆国产| 国产午夜精品久久久久久免费视| 丝袜a∨在线一区二区三区不卡| 国产精品亚洲专一区二区三区| 日韩一区二区麻豆国产| 免费成人在线观看| 欧美日韩国产不卡| 婷婷综合久久一区二区三区| 欧美色图片你懂的| 久久久噜噜噜久久中文字幕色伊伊| 日本在线不卡视频| av在线播放一区二区三区| 国产亚洲综合在线| 国产不卡视频在线播放| 国产蜜臀97一区二区三区| 国产精品一区二区三区乱码| 国产欧美久久久精品影院| 国产精品羞羞答答xxdd | 91精品久久久久久久99蜜桃| 国产日产精品一区| 成人av免费网站| 日韩一区二区麻豆国产| 久久成人综合网| 欧美日韩精品三区| 日韩福利视频网| 欧美变态口味重另类| 亚洲卡通动漫在线| 国产在线一区观看| 国产精品福利一区| 国产一区二区按摩在线观看| 欧美日韩一区视频| 久久国产精品免费| 亚洲国产成人私人影院tom| 石原莉奈在线亚洲二区| 日韩欧美在线不卡| 成人免费视频视频在线观看免费| 欧美一区二区三区免费视频| 亚洲激情自拍视频| 欧美一区二区三区在线电影| 国产一区二区三区四区五区美女 | 国产精品传媒在线| 日本高清免费不卡视频| 奇米精品一区二区三区在线观看一| 久久亚洲免费视频| 亚洲成a天堂v人片| 久久综合狠狠综合| 色诱视频网站一区| 精品写真视频在线观看| 中文字幕佐山爱一区二区免费| 6080yy午夜一二三区久久| 国产 欧美在线| 亚洲成av人影院| 国产欧美日韩另类一区| 在线免费不卡电影| 亚洲黄色性网站| 337p日本欧洲亚洲大胆色噜噜| 不卡一区二区三区四区| 三级成人在线视频| 中文字幕亚洲区| 99久久久精品免费观看国产蜜| 国产精品乱码人人做人人爱| 在线观看免费成人| 成人免费看黄yyy456| 欧美aaaaa成人免费观看视频| 亚洲欧美偷拍卡通变态| 欧美在线一区二区三区| 国产麻豆成人精品| 日本不卡视频在线| 亚洲综合一区二区| 国产精品二三区| 久久精品人人做| 日韩一卡二卡三卡| 欧美三级乱人伦电影| av在线一区二区三区| 国产综合色精品一区二区三区| 一区二区欧美国产| 国产精品久久久久一区二区三区共| 欧美一区欧美二区| 欧美日韩一区二区在线视频| 99久久精品国产导航| 国产麻豆欧美日韩一区| 日本 国产 欧美色综合| 五月天一区二区| 亚洲国产日日夜夜| 欧美日韩成人高清| 色哟哟在线观看一区二区三区| 成人国产一区二区三区精品| 国产激情91久久精品导航| 亚洲天堂av一区| 综合中文字幕亚洲| 中文字幕在线观看不卡| 国产精品伦一区| 久久久美女毛片| 爽爽淫人综合网网站| 亚洲一区二区视频在线| 亚洲午夜精品在线| 亚洲第一狼人社区| 亚洲丶国产丶欧美一区二区三区| 一个色综合网站| 亚洲成人av在线电影| 日本亚洲欧美天堂免费| 老司机午夜精品| 国产成人在线看| av电影在线观看一区| 日本道精品一区二区三区| 欧美丝袜自拍制服另类| 7777女厕盗摄久久久| 日韩欧美亚洲国产精品字幕久久久 | 在线观看日韩av先锋影音电影院| 91网上在线视频| 久久机这里只有精品| 久久精品国产一区二区三区免费看 | 国产高清精品网站| a4yy欧美一区二区三区| 日本久久电影网| 欧美一级在线视频| 中文字幕电影一区| 一区二区三区四区不卡在线| 无码av免费一区二区三区试看| 久久精品国产77777蜜臀| 国产成人亚洲综合a∨婷婷| 99re热视频这里只精品| 欧美日韩成人综合天天影院| 精品国产乱码久久久久久牛牛| 欧美群妇大交群中文字幕| 日韩午夜在线播放| 国产精品免费av| 亚洲成在人线免费| 国内精品久久久久影院薰衣草| 成人午夜av电影| 欧美日韩日日夜夜| 久久亚洲一区二区三区明星换脸 | 欧美电影免费观看高清完整版在 | 在线影院国内精品| 欧美精品一区二区三区四区| 亚洲天堂2014| 精品一区二区三区免费毛片爱| 91蜜桃在线免费视频| 日韩手机在线导航| 亚洲欧美色一区| 国产美女一区二区三区| 欧美裸体bbwbbwbbw| 国产精品人人做人人爽人人添| 婷婷丁香久久五月婷婷| 成人97人人超碰人人99| 欧美一区二区成人6969| 亚洲综合色噜噜狠狠| 国产不卡视频一区| 欧美成人女星排名| 亚洲永久免费av| 91小视频在线| 国产日韩亚洲欧美综合| 水蜜桃久久夜色精品一区的特点| 93久久精品日日躁夜夜躁欧美| 久久男人中文字幕资源站| 午夜av一区二区三区| 在线免费不卡视频| 一区在线播放视频| 成人深夜视频在线观看| 2020国产精品自拍| 日韩精品电影在线| 欧美视频中文字幕| 亚洲人成影院在线观看| 成人精品免费视频| www精品美女久久久tv| 青青青伊人色综合久久| 777a∨成人精品桃花网| 亚洲aaa精品| 欧美亚洲综合色| 亚洲图片欧美综合| 在线免费观看日本一区| 一区二区高清在线| 91国偷自产一区二区开放时间 | av不卡一区二区三区| 国产精品狼人久久影院观看方式|