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

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

?? textpanel.java

?? 該資料含有常用的計算機算法資料
?? JAVA
字號:
/* TextPanel class */import java.util.StringTokenizer;import java.awt.*;import java.io.*;import java.net.*;/** * Text panel to display the source code of the animation algorithm. * This class is initialized in the <code>TextFrame</code> class * construction during the main frame initialization. * Each line of the source code starting with <code>/*-</code> will be ignored. * The line after <code>/*-------</code> is considered as the first line of * text being displayed. * The line before <code>//-</code> is the last line of source code being * displayed. The text after this line will no longer be parsed. * See also <A href="AlgThread.html"><code>AlgThread</code></A> for special * symbol used in displaying source code in text panel. * @see TextFrame * @see AlgAnimFrame */public class TextPanel extends Panel {    String file_name;    String[] lines;    /**     * The number of lines of source code to be displayed on the text frame.     */    public int n_lines;    int highlight;    int width = 300;    int height = 400;    int delay = 400;    int max_lines = 1000;    Dimension offscreensize = null;    Image offscreen = null;    Graphics offGraphics = null;    static final int dx = 2;    Font font;    /**     * The number of pixels allocated for each line of text.     */    public int line_space = 14;    int font_size = 10;    /**     * This attribute is used to couple the text panel to a vertical scrollbar     * in the TextFrame. It indicates the first line of source code that     * will be displayed.     */    public int start;    static final String ignore_trigger = "/*-";    static final String start_sign = "/*-------";    static final String end_sign = "//-";    private StringBuffer trim(String s) {        int pos;        StringBuffer sb;        pos = s.indexOf(ignore_trigger);        if (pos >= 0) {            sb = new StringBuffer(s.substring(0,pos)); //sb.setLength(pos);        } else             sb = new StringBuffer( s );        return sb;    }                    private String expandtabs( StringBuffer sb ) {        int i, len;        len = sb.length();        i = 0;        while( i < len ) {            if ( sb.charAt( i ) == '\t' ) {	      for (int k = 0; k < 8; k++) {                sb.setCharAt(i,' ');                sb.insert(i,' ');                len++;	      }            }            i++;        }        return sb.toString();            }    private void SetFont( Graphics g ) {        FontMetrics fm;        this.setBackground( Color.white );        font = new Font( "Dialog", Font.PLAIN, font_size );        fm = g.getFontMetrics( font );        line_space = fm.getHeight() + 1;        g.setFont( font );    }    private int ReadSource( DataInputStream ds ) {        int cnt = 0;        StringBuffer sb;                        try {            while( true ) {                String s;                if ( (s = ds.readLine()) != null ) {                    if ( s.startsWith( start_sign ) ) {                        n_lines = 0;                        cnt = 0;                    } else if (s.trim().startsWith(ignore_trigger)) {                        continue;                    } else if (s.startsWith(end_sign)) {                        break;                    } else {                        sb = trim( s );                        /* Copy the buffer into a string */                        lines[cnt++] = expandtabs( sb );                    }                 } else                    break;            }        } catch( IOException e ) {}        return cnt;    }    /**     * Creates a text panel based on the source file specified in the String     * passed in as the parameter.     * @param fn Filename of the source code     */    public TextPanel( String fn ) {        FileInputStream instream;        file_name = fn;        File source = new File( file_name );                if ( source.exists() && source.isFile() ) {            try {                lines = new String[ max_lines ];                instream = new FileInputStream( source );            } catch( IOException e ) {}            /* Read the file */        } else            System.out.println("Cant access [" + file_name + "]");    }            /**     * Creates a text frame based on the URL specified by     * the parameter.     * @param sourceURL URL of the source code     * @see URL     */    public TextPanel( URL sourceURL) {        InputStream source = null;        StringBuffer sb;        n_lines = 0;	start = 0;        file_name = sourceURL.toString();	try {	    source = sourceURL.openStream();	} catch( IOException e ) {        }        if ( source != null ) {            lines = new String[ max_lines ];            /* Read the file */            DataInputStream ds = new DataInputStream( source );            n_lines = ReadSource( ds );        }                                 highlight = -1;            }    /**     * Highlight a certain line of the source code. The highlighted line     * is displayed in RED while the other normal lines are displayed     * in BLACK. The first line of the source has a line index of <b>0</b>.     * @param h The line to be highlighted     */    public void Highlight( int h ) {        highlight = h;        this.repaint();    }    /**     * Returns the initial dimension of the text panel. This method     * will be called by the layout manager during the corresponding     * frame initialization.     */    public Dimension getPreferredSize() {        int h = line_space * (n_lines + 1) - start * line_space;        return new Dimension( width, h );    }        /**     * Return the minimum allowed dimension of the text panel.     */    public Dimension getMinimumSize() {        int h = line_space * (n_lines + 1) - start * line_space;        return new Dimension( width, h );    }        /**     * This method is invoked when the <code>repaint()</code> method of the     * parent class is called. This method eliminates flashing during animation.     */    public void update(Graphics g) {        Dimension d = size();        if (d.width < 1 || d.height < 1)            return;        if ((offscreen == null) || (d.width != offscreensize.width) ||                (d.height != offscreensize.height)) {            offscreen = createImage(d.width, d.height);            offscreensize = d;            offGraphics = offscreen.getGraphics();        }        offGraphics.setColor(Color.white);        offGraphics.fillRect(0, 0, d.width, d.height);        paint(offGraphics);        g.drawImage(offscreen, 0, 0, null);    }        /**     * Set the first line to display.     * @param start First line to display     * @see TextPanel#start     */    public void setStart(int start) {	this.start = start;    }    /**     * This method print the source code starting from the first line specified     * by <code>setStart(int)</code> on the text panel.     * @param g Graphical context of the text panel.     */    public void paint( Graphics g ) {        int i, x, y;        SetFont( g );        x = dx; y = line_space;        g.setColor( Color.black );        for (i=start;i<n_lines;i++) {            if( i == highlight ) {                g.setColor( Color.red );            }            g.drawString( lines[i], x, y );            g.setColor( Color.black );            y += line_space;                        }        //g.drawString("EOF",x,y);    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美又粗又大又爽| av一本久道久久综合久久鬼色| 日韩精品一区二区三区蜜臀| 成人精品在线视频观看| 亚洲成人免费电影| 日本一二三不卡| 日韩欧美一区二区视频| 成人丝袜高跟foot| 久久精品国产在热久久| 尤物在线观看一区| 国产日韩欧美亚洲| 69p69国产精品| 99久久国产综合精品女不卡 | 亚洲中国最大av网站| 欧美精品一区二区三区在线播放 | 日韩电影在线免费观看| 国产欧美精品一区二区三区四区| 91日韩一区二区三区| 精品一区二区三区在线观看| 亚洲欧美aⅴ...| 26uuu精品一区二区在线观看| 欧洲精品一区二区| 丁香婷婷综合网| 另类欧美日韩国产在线| 亚洲小少妇裸体bbw| 国产精品美女一区二区| 精品对白一区国产伦| 欧美伦理电影网| 99精品黄色片免费大全| 久久国产三级精品| 日本不卡高清视频| 亚洲成a天堂v人片| 亚洲国产综合91精品麻豆| 国产精品三级电影| 中文一区在线播放| 欧美电视剧免费全集观看| 国产成人在线网站| 国产成人精品免费网站| 日韩影院在线观看| 丝袜美腿亚洲色图| 亚洲一区欧美一区| 樱花影视一区二区| 亚洲精品你懂的| 国产精品盗摄一区二区三区| 国产色婷婷亚洲99精品小说| 日韩免费观看高清完整版 | 国产女主播视频一区二区| 日韩网站在线看片你懂的| 欧美一区二区三区免费大片| 欧美日韩和欧美的一区二区| 色婷婷一区二区| av在线综合网| 丰满白嫩尤物一区二区| 国产一区日韩二区欧美三区| 久久国内精品视频| 国产高清亚洲一区| 国产成人在线视频免费播放| 成人aaaa免费全部观看| 久久久久亚洲综合| 91精品国产一区二区三区| 波多野结衣在线一区| 国产乱人伦精品一区二区在线观看| 亚洲综合一区在线| 亚洲黄一区二区三区| 欧美一级久久久久久久大片| 欧美丝袜丝交足nylons图片| 国产成人精品综合在线观看| 国产精品99久久久久久宅男| 美女网站在线免费欧美精品| 亚洲精品久久久久久国产精华液| 国产日韩精品一区二区三区 | 粉嫩高潮美女一区二区三区| 国产精品 日产精品 欧美精品| 99这里只有精品| 日韩激情中文字幕| 中文子幕无线码一区tr| 中文字幕一区二区不卡| 高清国产午夜精品久久久久久| 日韩一区二区三区免费观看| 国产成人精品影院| 99精品一区二区| 欧美日韩一区二区三区在线看| 7777精品伊人久久久大香线蕉完整版| 欧美电影影音先锋| 久久久久成人黄色影片| 国产欧美日韩另类视频免费观看| 亚洲精品va在线观看| 麻豆国产欧美一区二区三区| 欧美日韩一级片在线观看| 欧美日韩三级在线| 久久精品一区八戒影视| 亚洲视频每日更新| 日本va欧美va精品| 波多野结衣中文字幕一区二区三区 | 欧美一区欧美二区| 精品国产91乱码一区二区三区 | 亚洲精品亚洲人成人网| 夜夜精品浪潮av一区二区三区| 免费成人在线网站| 不卡电影免费在线播放一区| 欧美日韩一区视频| 国产精品嫩草影院av蜜臀| 亚洲国产一区二区三区青草影视| 激情综合色综合久久| 色噜噜狠狠成人中文综合| 欧美日韩在线播放| 亚洲欧美综合网| 蜜臀久久久99精品久久久久久| 99麻豆久久久国产精品免费| 欧美理论电影在线| 自拍偷拍国产亚洲| 美美哒免费高清在线观看视频一区二区| www.欧美日韩| 久久综合精品国产一区二区三区| 亚洲图片欧美综合| av激情成人网| 久久综合色天天久久综合图片| 亚洲国产精品尤物yw在线观看| 懂色av一区二区三区免费观看 | 精品国产乱码久久久久久老虎| 亚洲精品国产无天堂网2021| 国产在线国偷精品免费看| 欧美日韩综合在线| 自拍偷拍欧美精品| 大胆欧美人体老妇| 欧美精品一区二区蜜臀亚洲| 午夜精品久久久| 色琪琪一区二区三区亚洲区| 久久久www成人免费毛片麻豆| 激情国产一区二区| 欧美一级免费观看| 天堂va蜜桃一区二区三区漫画版 | 国产成人三级在线观看| 欧美在线一区二区三区| 亚洲人xxxx| 91视频免费观看| 亚洲国产成人在线| 国产91精品在线观看| 国产亚洲综合av| 国产一区二区影院| 久久先锋影音av| 久久99日本精品| 精品日韩成人av| 日韩成人免费电影| 3d成人动漫网站| 日日夜夜免费精品视频| 91麻豆精品国产无毒不卡在线观看 | 欧美精品一区二区不卡| 久久激情五月婷婷| 欧美xxx久久| 国产最新精品免费| 国产亚洲欧美日韩日本| 成人福利视频网站| 欧美极品少妇xxxxⅹ高跟鞋 | 亚洲成av人片在线| 91麻豆精品91久久久久久清纯 | 国产精品久久久久久久久果冻传媒 | 一区二区三区高清不卡| 欧美午夜电影网| 午夜私人影院久久久久| 欧美精品亚洲二区| 乱中年女人伦av一区二区| 精品福利av导航| 丁香天五香天堂综合| 国产精品欧美一级免费| 91啪在线观看| 午夜欧美一区二区三区在线播放| 欧美亚洲精品一区| 免费成人小视频| 国产亲近乱来精品视频| 波多野洁衣一区| 亚洲国产欧美另类丝袜| 欧美一区二区三区在线| 韩国成人福利片在线播放| 国产精品久久二区二区| 日本高清不卡视频| 五月天一区二区三区| 日韩精品中文字幕一区二区三区 | 亚洲国产综合人成综合网站| 91精品国产黑色紧身裤美女| 国产一区二区免费看| 一区二区在线电影| 欧美精品xxxxbbbb| 国产乱码精品一品二品| 亚洲男人的天堂网| 日韩一区二区高清| 高清国产一区二区三区| 亚洲高清久久久| 久久青草欧美一区二区三区| 一本一道久久a久久精品| 奇米色一区二区三区四区| 国产片一区二区| 欧美日韩视频专区在线播放| 国产精品综合视频| 亚洲一区二区三区免费视频| 国产日韩欧美综合在线| 日本韩国一区二区| 国产v综合v亚洲欧| 免费成人在线视频观看| 一区二区三区欧美亚洲|