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

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

?? linenumberedborder.java

?? MSP IM Source code 2008 update
?? JAVA
字號:
package se.sics.mspsim.extutil.highlight;import java.awt.Color;import java.awt.Component;import java.awt.FontMetrics;import java.awt.Graphics;import java.awt.Insets;import javax.swing.border.AbstractBorder;/** * Draws line numbers next to each line, in the same font as the text. * Currently, this can only be used with a <tt>SyntaxHighlighter</tt> , since it * relies on the <tt>getRows()</tt> and <tt>getLineCount()</tt> methods. A * possible extension, create an interface to return this rows/linecount. *  * @author Paul Durbin (McDurby@yahoo.com) * @created January 29, 2002 */public class LineNumberedBorder extends AbstractBorder {  private static final long serialVersionUID = -3812536735962506061L;  /**   * The line numbers should be drawn on the left side of the component.   */  public static int LEFT_SIDE = -2;  /**   * The line numbers should be drawn on the right side of the component.   */  public static int RIGHT_SIDE = -1;  /**   * The line number should be right justified.   */  public static int RIGHT_JUSTIFY = 0;  /**   * The line number should be left justified.   */  public static int LEFT_JUSTIFY = 1;  /**   * Indicates the justification of the text of the line number.   */  private int lineNumberJustification = RIGHT_JUSTIFY;  /**   * Indicates the location of the line numbers, w.r.t. the component.   */  private int location = LEFT_SIDE;  private Color separatorColor = null;  public LineNumberedBorder(int location, int justify) {    setLocation(location);    setLineNumberJustification(justify);  }  public Insets getBorderInsets(Component c) {    return getBorderInsets(c, new Insets(0, 0, 0, 0));  }  /**   * This modifies the insets, by adding space for the line number on the left.   * Should be modified to add space on the right, depending upon Locale.   *    * @param c   *                Description of the Parameter   * @param insets   *                Description of the Parameter   * @return The borderInsets value   */  public Insets getBorderInsets(Component c, Insets insets) {    // if c is not a SyntaxHighlighter...nothing is done...    if (c instanceof SyntaxHighlighter) {      int width = lineNumberWidth((SyntaxHighlighter) c);      if (location == LEFT_SIDE) {        insets.left = width;      } else {        insets.right = width;      }    }    return insets;  }  public int getLineNumberJustification() {    return lineNumberJustification;  }  public void setLineNumberJustification(int justify) {    if (justify == RIGHT_JUSTIFY || justify == LEFT_JUSTIFY) {      lineNumberJustification = justify;    }  }  public int getLocation() {    return location;  }  public void setLocation(int loc) {    if (loc == RIGHT_SIDE || loc == LEFT_SIDE) {      location = loc;    }  }  public Color getSeparatorColor() {    return separatorColor;  }  public void setSeparatorColor(Color c) {    this.separatorColor = c;  }  /**   * Returns the width, in pixels, of the maximum line number, plus a trailing   * space.   *    * @param textArea   *                Description of the Parameter   * @return Description of the Return Value   */  private int lineNumberWidth(SyntaxHighlighter textArea) {    //    // note: should this be changed to use all nines for the lineCount?    // for example, if the number of rows is 111...999 could be wider    // (in pixels) in a proportionally spaced font...    //    int lineCount = Math.max(textArea.getRows(), textArea.getLineCount() + 1);    return textArea.getFontMetrics(textArea.getFont()).stringWidth(        lineCount + " ");  }  //  // NOTE: This method is called every time the cursor blinks...  // so...optimize (later and if possible) for speed...  //  public void paintBorder(Component c, Graphics g, int x, int y, int width,      int height) {    java.awt.Rectangle clip = g.getClipBounds();    FontMetrics fm = g.getFontMetrics();    int fontHeight = fm.getHeight();    // starting location at the "top" of the page...    // y is the starting baseline for the font...    // should "font leading" be applied?    int ybaseline = y + fm.getAscent();    //    // now determine if it is the "top" of the page...or somewhere else    //    int startingLineNumber = (clip.y / fontHeight) + 1;    //    // use any one of the following if's:    //    // if (startingLineNumber != 1)    if (ybaseline < clip.y) {      //      // not within the clip rectangle...move it...      // determine how many fontHeight's there are between      // y and clip.y...then add that many fontHeights      //      ybaseline =          y + startingLineNumber * fontHeight - (fontHeight - fm.getAscent());    }    //    // options:    // . write the number rows in the document (current)    // . write the number of existing lines in the document (to do)    // see getLineCount()    //    // determine which the "drawing" should end...    // add fontHeight: make sure...part of the line number is drawn    //    // could also do this by determining what the last line    // number to draw.    // then the "while" loop whould change accordingly.    //    // int yend = y + clip.height + fontHeight;    // int yend = ybaseline + height + fontHeight; // original    int yend = ybaseline + height;    if (yend > (y + height)) {      yend = y + height;    }    SyntaxHighlighter jta = (SyntaxHighlighter) c;    int lineWidth = lineNumberWidth(jta);    // base x position of the line number    int lnxstart = x;    if (location == LEFT_SIDE) {      // x (LEFT) or (x + lineWidth) (RIGHT)      // (depends upon justification)      if (lineNumberJustification == LEFT_JUSTIFY) {        lnxstart = x;      } else {        // RIGHT JUSTIFY        lnxstart = x + lineWidth;      }    } else {      // RIGHT SIDE      // (y + width) - lineWidth (LEFT) or (y + width) (RIGHT)      // (depends upon justification)      if (lineNumberJustification == LEFT_JUSTIFY) {        lnxstart = (y + width) - lineWidth;      } else {        // RIGHT JUSTIFY        lnxstart = (y + width);      }    }    g.setColor(c.getForeground());    //    // loop until out of the "visible" region...    //    int length =        ("" + Math.max(jta.getRows(), jta.getLineCount() + 1)).length();    while (ybaseline < yend) {      //      // options:      // . left justify the line numbers      // . right justify the line numbers      //      if (lineNumberJustification == LEFT_JUSTIFY) {        g.drawString(startingLineNumber + " ", lnxstart, ybaseline);      } else {        // right justify        String label = padLabel(startingLineNumber, length, true);        g.drawString(label, lnxstart - fm.stringWidth(label), ybaseline);      }      ybaseline += fontHeight;      startingLineNumber++;    }    if (separatorColor != null) {      g.setColor(separatorColor);      if (location == LEFT_SIDE) {        lnxstart = x + lineWidth - 1;      } else {        lnxstart = width - lineWidth;      }      g.drawLine(lnxstart, 0, lnxstart, height);    }  }  // paintComponent  /**   * Create the string for the line number. NOTE: The <tt>length</tt> param   * does not include the <em>optional</em> space added after the line number.   *    * @param lineNumber   *                to stringize   * @param length   *                the length desired of the string   * @param addSpace   *                Description of the Parameter   * @return the line number for drawing   */  private static String padLabel(int lineNumber, int length, boolean addSpace) {    StringBuffer buffer = new StringBuffer();    buffer.append(lineNumber);    for (int count = (length - buffer.length()); count > 0; count--) {      buffer.insert(0, ' ');    }    if (addSpace) {      buffer.append(' ');    }    return buffer.toString();  }}// LineNumberedBorder

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久久噜噜噜久久中文字幕色伊伊| 7777精品伊人久久久大香线蕉的 | 精品国产乱码久久久久久图片 | 亚洲人成网站在线| 亚洲视频网在线直播| 亚洲欧美日韩一区二区三区在线观看| 国产精品少妇自拍| 国产精品乱码人人做人人爱| 国产精品久久久久久久岛一牛影视| 久久久精品日韩欧美| 欧美国产精品一区| 亚洲色欲色欲www| 亚洲欧美激情一区二区| 一区二区在线观看视频在线观看| 亚洲激情在线激情| 日韩和欧美的一区| 国产在线播放一区| av电影天堂一区二区在线| 99精品国产一区二区三区不卡| 91色在线porny| 欧美裸体一区二区三区| 精品国产三级a在线观看| 国产精品久线在线观看| 五月婷婷综合网| 精品一区二区三区影院在线午夜| 国产麻豆成人精品| 91精品91久久久中77777| 欧美一级淫片007| 中文在线一区二区| 日韩专区一卡二卡| 国产91丝袜在线18| 精品视频123区在线观看| 久久众筹精品私拍模特| 亚洲欧美另类小说视频| 精品亚洲成a人| 色婷婷亚洲综合| 2024国产精品| 丝袜脚交一区二区| 99久久综合狠狠综合久久| 日韩一区二区免费在线电影 | 亚洲国产一区视频| 激情综合色综合久久| 色综合久久久久| 久久久午夜精品| 日韩和欧美的一区| 色94色欧美sute亚洲13| 久久精品欧美一区二区三区不卡| 亚洲成人黄色影院| 大胆欧美人体老妇| 精品国产乱码久久久久久浪潮 | 成人性生交大片免费看中文| 91精品久久久久久久99蜜桃| 中文字幕av一区二区三区高| 美女网站色91| 7777精品伊人久久久大香线蕉完整版 | 亚洲精品美腿丝袜| 国产91综合一区在线观看| 日韩精品一区二区三区四区视频| 亚洲大片免费看| 91久久人澡人人添人人爽欧美| 国产日韩欧美综合在线| 黄网站免费久久| 欧美一级在线视频| 日韩中文欧美在线| 欧美蜜桃一区二区三区| 亚洲免费在线电影| 91在线云播放| 亚洲欧美另类综合偷拍| 色综合久久88色综合天天免费| 国产精品久久影院| 99精品欧美一区二区蜜桃免费 | 一区二区国产盗摄色噜噜| 波多野结衣一区二区三区| 国产日韩欧美激情| 国产毛片精品国产一区二区三区| 欧美大片日本大片免费观看| 久久国产精品色婷婷| 2023国产精华国产精品| 国产乱码字幕精品高清av| 久久亚洲免费视频| 成人在线视频一区二区| 亚洲色图视频免费播放| 欧洲av一区二区嗯嗯嗯啊| 亚洲第一主播视频| 日韩欧美亚洲一区二区| 国产一二三精品| 中文字幕一区二区三区视频| 欧美性猛交xxxx黑人交| 美女免费视频一区二区| www国产成人免费观看视频 深夜成人网| 国产乱人伦偷精品视频免下载| 精品999久久久| www.亚洲人| 亚洲高清一区二区三区| 精品成人一区二区| 不卡在线观看av| 午夜欧美大尺度福利影院在线看| 日韩欧美成人一区| 成人午夜免费电影| 天天综合网 天天综合色| 久久这里只有精品6| 91黄视频在线| 国产综合久久久久影院| 亚洲精品视频免费观看| 欧美一区二区啪啪| 成人夜色视频网站在线观看| 亚洲国产成人91porn| 久久精品日产第一区二区三区高清版| 色综合天天做天天爱| 久久激情五月激情| 悠悠色在线精品| 精品国产免费一区二区三区四区| gogo大胆日本视频一区| 蜜桃视频一区二区三区在线观看| 国产精品女上位| 欧美欧美欧美欧美首页| 99久久久无码国产精品| 久久国产精品一区二区| 一区二区在线观看不卡| 久久久久国产精品人| 欧美剧在线免费观看网站| 成人av在线影院| 久久99深爱久久99精品| 一区二区三区av电影| 欧美激情艳妇裸体舞| 欧美一区日韩一区| 日本久久一区二区三区| 成人午夜激情片| 激情图片小说一区| 日韩国产欧美三级| 亚洲综合免费观看高清完整版在线| 欧美精品一区二区三区一线天视频| 欧美性生活大片视频| 91丨porny丨首页| 成人亚洲一区二区一| 国产一区二区电影| 精品一区二区三区免费观看 | 99r精品视频| 成人一区二区三区视频在线观看| 精品亚洲aⅴ乱码一区二区三区| 午夜精品一区二区三区三上悠亚| 中文字幕字幕中文在线中不卡视频| 精品国产乱码久久久久久闺蜜| 欧美日本在线看| 欧美日本一道本| 欧美日韩aaaaa| 91麻豆精品国产91| 日韩欧美一级二级三级久久久| 日韩一区二区精品在线观看| 欧美一级日韩免费不卡| 日韩视频在线永久播放| 日韩午夜精品电影| 欧美tickling网站挠脚心| 日韩欧美色综合| 2022国产精品视频| 欧美国产精品专区| 亚洲人成7777| 亚洲午夜影视影院在线观看| 日韩专区欧美专区| 精品一区二区三区久久久| 韩国三级中文字幕hd久久精品| 国产精品自拍av| 波多野结衣中文字幕一区 | 色94色欧美sute亚洲线路二| 欧美亚洲高清一区二区三区不卡| 在线观看免费亚洲| 91精品国产综合久久精品麻豆 | 精品福利在线导航| 久久久另类综合| 亚洲欧美激情插| 丝袜美腿一区二区三区| 国产精品综合在线视频| 91在线视频免费91| 欧美一区二区二区| 欧美国产日韩亚洲一区| 一区二区在线观看免费| 蜜臀99久久精品久久久久久软件| 国产成人精品免费网站| 在线国产电影不卡| 久久久久久日产精品| 亚洲免费在线视频一区 二区| 日本欧美加勒比视频| 懂色av一区二区三区蜜臀| 在线视频你懂得一区二区三区| 欧美一级电影网站| 国产精品久久久久久妇女6080| 日韩av在线发布| 成人美女视频在线观看| 欧美精品tushy高清| 国产欧美一区二区精品婷婷| 亚洲国产美女搞黄色| 国产又黄又大久久| 欧美日韩久久久| 中文字幕巨乱亚洲| 麻豆精品一区二区av白丝在线| yourporn久久国产精品| 精品国产伦一区二区三区免费| 亚洲高清免费观看高清完整版在线观看 | 高清日韩电视剧大全免费| 欧美精品18+|