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

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

?? token.java~1~

?? 具有不同語法高亮的編輯器實例
?? JAVA~1~
?? 第 1 頁 / 共 2 頁
字號:
	 */
	public Token getNextToken() {
		return nextToken;
	}


/*****************************************************************************/


	/**
	 * Returns the position in the document that represents the last character
	 * in the token that will fit into <code>endBeforeX-startX</code> pixels.
	 * For example, if you're using a monospaced 8-pixel-per-character font,
	 * have the token "while" and <code>startX</code> is <code>0</code> and
	 * <code>endBeforeX</code> is <code>30</code>, this method will return the
	 * document position of the "i" in "while", because the "i" ends at pixel
	 * <code>24</code>, while the "l" ends at <code>32</code>.  If not even the
	 * first character fits in <code>endBeforeX-startX</code>, the first
	 * character's position is still returned so calling methods don't go into
	 * infinite loops.
	 *
	 * @param fm The font metrics used to paint the token.
	 * @param e How to expand tabs.
	 * @param startX The x-coordinate at which the token will be painted.  This
	 *               is needed because of tabs.
	 * @param endBeforeX The x-coordinate for which you want to find the last
	 *                   character of <code>t</code> which comes before it.
	 * @return The last document position that will fit in the specified amount
	 *         of pixels.
	 */
	/*
	 * @see #getTokenListOffsetBeforeX
	 * FIXME:  This method does not compute correctly!  It needs to be abstract
	 * and implemented by subclasses.
	 */
	public int getOffsetBeforeX(FontMetrics fm, TabExpander e, float startX,
							float endBeforeX) {

		int i = textOffset;
		int stop = i + textCount;
		float x = startX;

		while (i<stop) {
			if (text[i]=='\t')
				x = e.nextTabStop(x, 0);
			else
				x += fm.charWidth(text[i]);
			if (x>endBeforeX) {
				// If not even the first character fits into the space, go
				// ahead and say the first char does fit so we don't go into
				// an infinite loop.
				int intoToken = Math.max(i-textOffset, 1);
				return offset + intoToken;
			}
			i++;
		}

		// If we got here, the whole token fit in (endBeforeX-startX) pixels.
		return stop-1;

	}


/*****************************************************************************/


	/**
	 * Returns the width of this token given the specified parameters.
	 *
	 * @param fm The metrics of the font used to paint the token.
	 * @param e Describes how to expand tabs.  This parameter cannot be
	 *          <code>null</code>.
	 * @param x0 The pixel-location at which the token begins.  This is needed
	 *           because of tabs.
	 * @return The width of the token, in pixels.
	 * @see #getWidthUpTo
	 */
	public float getWidth(FontMetrics fm, TabExpander e, float x0) {
		return getWidthUpTo(textCount, fm, e, x0);
	}


/*****************************************************************************/


	/**
	 * Returns the width of a specified number of characters in this token.
	 * For example, for the token "while", specifying a value of <code>3</code>
	 * here returns the width of the "whi" portion of the token.<p>
	 *
	 * This method is abstract so subclasses who paint themselves differently
	 * (i.e., {@link VisibleWhitespaceToken} is painted a tad differently than
	 * {@link DefaultToken} when rendering hints are enabled) can still return
	 * accurate results.
	 *
	 * @param numChars The number of characters for which to get the width.
	 * @param fm The font metrics used to paint this token.
	 * @param e How to expand tabs.  This value cannot be <code>null</code>.
	 * @param x0 The pixel-location at which this token begins.  This is needed
	 *           because of tabs.
	 * @return The width of the specified number of characters in this token.
	 * @see #getWidth
	 */
	public abstract float getWidthUpTo(int numChars, FontMetrics fm,
										TabExpander e, float x0);


/*****************************************************************************/


	/**
	 * Returns whether or not this token is "paintable;" i.e., whether or not
	 * the type of this token is one such that it has an associated syntax
	 * style.  What this boils down to is whether the token type is greater
	 * than <code>Token.NULL</code>.
	 *
	 * @return Whether or not this token is paintable.
	 */
	public boolean isPaintable() {
		return type>Token.NULL;
	}


/*****************************************************************************/


	/**
	 * Returns whether or not this token is whitespace.
	 *
	 * @return <code>true</code> iff this token is whitespace.
	 */
	public boolean isWhitespace() {
		return type==WHITESPACE;
	}


/*****************************************************************************/


	/**
	 * Returns the bounding box for the specified document location.  The
	 * location must be in the specified token list; if it isn't,
	 * <code>null</code> is returned.
	 *
	 * @param textArea The text area from which the token list was derived.
	 * @param e How to expand tabs.
	 * @param pos The position in the document for which to get the bounding
	 *            box in the view.
	 * @param x0 The pixel x-location that is the beginning of
	 *           <code>tokenList</code>.
	 * @param rect The rectangle in which we'll be returning the results.  This
	 *             object is reused to keep from frequent memory allocations.
	 * @return The bounding box for the specified position in the model.
	 */
	public abstract Rectangle listOffsetToView(RSyntaxTextArea textArea,
								TabExpander e, int pos, int x0,
								Rectangle rect);


/*****************************************************************************/


	/**
	 * Makes this token start at the specified offset into the document.<p>
	 *
	 * This method is abstract because some token implementations may need
	 * to adjust cached values, such as widths
	 * (such as <code>GlyphVectorToken</code>).
	 *
	 * @param pos The offset into the document this token should start at.
	 *            Note that this token must already contain this position; if
	 *            it doesn't, an exception is thrown.
	 */
	public abstract void makeStartAt(int pos);


/*****************************************************************************/


	/**
	 * Paints this token.
	 *
	 * @param g The graphics context in which to paint.
	 * @param x The x-coordinate at which to paint.
	 * @param y The y-coordinate at which to paint.
	 * @param scheme The syntax highlighting scheme to use.
	 * @param host The text area this token is in.
	 * @param e How to expand tabs.
	 * @return The x-coordinate representing the end of the painted text.
	 */
	public final float paint(Graphics2D g, float x, float y,
								SyntaxScheme scheme,
								RSyntaxTextArea host, TabExpander e) {
		return paint(g, x,y, scheme, host, e, 0);
	}


/*****************************************************************************/


	/**
	 * Paints this token.
	 *
	 * @param g The graphics context in which to paint.
	 * @param x The x-coordinate at which to paint.
	 * @param y The y-coordinate at which to paint.
	 * @param scheme The syntax highlighting scheme to use.
	 * @param host The text area this token is in.
	 * @param e How to expand tabs.
	 * @param clipStart The left boundary of the clip rectangle in which we're
	 *        painting.  This optimizes painting by allowing us to not paint
	 *        paint when this token is "to the left" of the clip rectangle.
	 * @return The x-coordinate representing the end of the painted text.
	 */
	public abstract float paint(Graphics2D g, float x, float y,
							SyntaxScheme scheme, RSyntaxTextArea host,
							TabExpander e, float clipStart);


/*****************************************************************************/


	/**
	 * Paints the background of a token.
	 *
	 * @param x The x-coordinate of the token.
	 * @param y The y-coordinate of the token.
	 * @param width The width of the token (actually, the width of the part of
	 *              the token to paint).
	 * @param height The height of the token.
	 * @param g The graphics context with which to paint.
	 * @param fontAscent The ascent of the token's font.
	 * @param host The text area.
	 * @param color The color with which to paint.
	 */
	protected void paintBackground(float x, float y, float width, float height,
							Graphics2D g, int fontAscent,
							RSyntaxTextArea host, Color color) {		
		g.setXORMode(host.getBackground()); // Never null.
		g.setColor(color);
		g.fill(new Rectangle2D.Float(x,y-fontAscent, width,height));
		g.setPaintMode();
	}


/*****************************************************************************/


	/**
	 * Sets the value of this token to a particular segment of a document.
	 * The "next token" value is cleared.
	 *
	 * @param line The segment from which to get the token.
	 * @param beg The first character's position in <code>line</code>.
	 * @param end The last character's position in <code>line</code>.
	 * @param offset The offset into the document at which this token begins.
	 * @param type A token type listed as "generic" above.
	 */
	public void set(final char[] line, final int beg, final int end,
							final int offset, final int type) {
		this.text = line;
		this.textOffset = beg;
		this.textCount = end - beg + 1;
		this.type = type;
		this.offset = offset;
		nextToken = null;
	}


/*****************************************************************************/


	/**
	 * Sets the "next token" pointer of this token to point to the specified
	 * token.
	 *
	 * @param nextToken The new next token.
	 * @see #getNextToken
	 */
	public void setNextToken(Token nextToken) {
		this.nextToken = nextToken;
	}


/*****************************************************************************/


	/**
	 * Returns the position in the document corresponding to the specified
	 * position in this token's internal char array (<code>textOffset</code> -
	 * <code>textOffset+textCount-1</code>).<p>
	 * Note that this method does NOT do any bounds checking; you can pass in
	 * an invalid token position, and you will not receive an Exception or any
	 * other indication that the returned document position is invalid.  It is
	 * up to the user to ensure valid input.
	 *
	 * @param pos A position in the token's internal char array
	 *        (<code>textOffset</code> - <code>textOffset+textCount</code>).
	 * @return The corresponding position in the document.
	 * @see #documentToToken
	 */
	public int tokenToDocument(int pos) {
		return pos + (offset-textOffset);
	}


/*****************************************************************************/


	/**
	 * Returns this token as a <code>String</code>, which is useful for
	 * debugging.
	 *
	 * @return A string describing this token.
	 */
	public String toString() {
		return "[Token: " +
				(type==Token.NULL ? "<null token>" :
					"text: '" +
						(text==null ? "<null>" :
						new String(text, textOffset, textCount)) + "'; " +
		       		"offset: " + offset + "; type: " + type + "; " +
			   		"isPaintable: " + isPaintable() +
			   		"; nextToken==null: " + (nextToken==null)) +
			   "]";
	}


/*****************************************************************************/

}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日日夜夜一区二区| 欧美日韩免费电影| 欧美日韩在线播| 久久亚洲欧美国产精品乐播| 一区二区高清免费观看影视大全 | 日韩一区二区三| 亚洲美女一区二区三区| 精品亚洲成av人在线观看| 91亚洲精品一区二区乱码| 精品国产一区二区三区久久影院 | 国产精品护士白丝一区av| 久久国产精品第一页| 在线播放一区二区三区| 一区二区三区免费看视频| 成人黄色片在线观看| 精品国产乱码久久久久久久| 丝袜亚洲另类丝袜在线| 欧美主播一区二区三区| 亚洲丝袜另类动漫二区| 国产91精品一区二区麻豆亚洲| 日韩美女在线视频| 调教+趴+乳夹+国产+精品| 欧美在线三级电影| 一区二区三区中文在线| 在线观看日韩高清av| 亚洲你懂的在线视频| 99re6这里只有精品视频在线观看| 日本一区二区三区四区在线视频 | 精品一区二区国语对白| 91精品久久久久久久久99蜜臂| 五月天激情综合| 欧美日韩国产区一| 午夜a成v人精品| 欧美一区二区二区| 久久成人免费网站| 久久亚洲精品国产精品紫薇| 国产美女在线精品| 国产精品久久毛片a| 91麻豆自制传媒国产之光| 亚洲精品乱码久久久久久黑人 | 亚洲综合激情另类小说区| 日本二三区不卡| 午夜精品免费在线| 91精品国产麻豆| 国产在线精品视频| 亚洲国产高清在线| 欧美三级电影在线观看| 美腿丝袜一区二区三区| 亚洲精品在线观看网站| av不卡在线观看| 亚洲综合丁香婷婷六月香| 91精品国产综合久久精品性色| 韩日精品视频一区| 五月天亚洲精品| 欧美不卡激情三级在线观看| 懂色av一区二区三区免费看| 一区二区三区四区亚洲| 欧美一区二区三区免费| 懂色av中文字幕一区二区三区 | 欧美日韩高清一区二区| 青草国产精品久久久久久| 国产欧美综合在线| 欧美日韩一区不卡| 国产高清不卡一区二区| 亚洲国产中文字幕| 国产日韩欧美制服另类| 欧美主播一区二区三区| 国产精品一级二级三级| 亚洲九九爱视频| 久久综合色婷婷| 欧美亚洲国产一卡| 国产成a人无v码亚洲福利| 亚洲综合无码一区二区| 日本一区免费视频| 555夜色666亚洲国产免| 99视频精品全部免费在线| 琪琪一区二区三区| 17c精品麻豆一区二区免费| 日韩欧美黄色影院| 91精品福利视频| 成人综合在线观看| 日本不卡一区二区三区高清视频| 国产精品久久久久一区二区三区共| 欧美日韩色综合| 成人av动漫在线| 国产一区在线视频| 天堂成人国产精品一区| 亚洲精品视频免费看| 久久精品视频在线免费观看| 欧美一区二区三区精品| 日本大香伊一区二区三区| 高清久久久久久| 精品一区二区三区日韩| 日本成人中文字幕在线视频 | 欧美精品精品一区| 91在线观看污| 成人看片黄a免费看在线| 国产在线国偷精品免费看| 丝袜美腿亚洲一区二区图片| 亚洲六月丁香色婷婷综合久久 | 在线观看网站黄不卡| 99re成人精品视频| 99视频一区二区| 99国产精品国产精品久久| 高清在线观看日韩| 成人丝袜高跟foot| 国产不卡在线播放| 国产aⅴ综合色| 国产精品一级在线| 成人性生交大片免费看视频在线 | 国产中文一区二区三区| 蜜臂av日日欢夜夜爽一区| 日韩电影免费一区| 日精品一区二区| 日本欧美肥老太交大片| 麻豆精品一区二区| 久久99国产精品免费| 国产精品一线二线三线精华| 国产精品影视在线| 成人av免费网站| 色视频一区二区| 欧美日韩美少妇| 欧美福利视频导航| 欧美大片顶级少妇| 久久久亚洲国产美女国产盗摄| 国产欧美一区二区精品久导航 | 久久99精品久久久久| 国模一区二区三区白浆| 丁香激情综合国产| 欧美影院精品一区| 91精品国产综合久久精品性色 | 北条麻妃一区二区三区| 99久久国产综合精品色伊| 欧美色老头old∨ideo| 91麻豆精品国产91久久久久久久久| 日韩精品自拍偷拍| 国产亚洲综合在线| 亚洲精品免费一二三区| 日韩成人一区二区三区在线观看| 免费观看91视频大全| 成熟亚洲日本毛茸茸凸凹| 色欧美片视频在线观看| 欧美一级在线免费| 国产精品免费免费| 日本免费新一区视频| 成人午夜免费av| 欧美精品 国产精品| 国产色产综合色产在线视频| 亚洲色图丝袜美腿| 美腿丝袜在线亚洲一区 | 精品国产百合女同互慰| 国产精品视频线看| 日韩国产精品久久久| 丁香另类激情小说| 欧美一区二区三区思思人| 国产精品成人免费精品自在线观看 | 色综合久久久久久久久| 欧美成人一区二区三区片免费| 亚洲欧美一区二区不卡| 精品午夜久久福利影院| 在线区一区二视频| 久久精品免费在线观看| 视频一区视频二区中文字幕| jizz一区二区| 久久亚区不卡日本| 图片区小说区区亚洲影院| 99久久精品情趣| 久久免费美女视频| 日韩精品一区第一页| 91蝌蚪porny九色| 久久蜜桃香蕉精品一区二区三区| 亚洲愉拍自拍另类高清精品| 成人午夜在线视频| 久久五月婷婷丁香社区| 日韩电影免费一区| 欧美系列日韩一区| 亚洲精品国产高清久久伦理二区| 国产一区三区三区| 欧美大片日本大片免费观看| 日韩精品三区四区| 欧美吻胸吃奶大尺度电影| 亚洲乱码国产乱码精品精98午夜 | 99久久久精品免费观看国产蜜| 精品国产精品一区二区夜夜嗨| 爽好久久久欧美精品| 欧美日韩中文精品| 一区二区三区日韩| 欧美综合欧美视频| 一区二区三区国产| 91久久奴性调教| 亚洲一级片在线观看| 91高清视频在线| 一级特黄大欧美久久久| 91免费国产视频网站| 亚洲欧洲精品一区二区三区| 成人午夜看片网址| 国产精品成人免费| 一本大道av伊人久久综合| 亚洲人午夜精品天堂一二香蕉| av综合在线播放|