亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
国产一区二区看久久| 日韩一级免费观看| 欧美一二三四区在线| 亚洲国产精品成人久久综合一区| 亚洲午夜视频在线| 成人丝袜高跟foot| 日韩欧美三级在线| 伊人婷婷欧美激情| 丁香婷婷深情五月亚洲| 91麻豆精品国产91久久久更新时间| 国产婷婷色一区二区三区四区 | 麻豆免费精品视频| 日本丰满少妇一区二区三区| 中文字幕电影一区| 国内精品视频一区二区三区八戒| 欧美情侣在线播放| 亚洲九九爱视频| jlzzjlzz欧美大全| 久久久久久久综合| 国产真实乱偷精品视频免| 欧美情侣在线播放| 亚洲已满18点击进入久久| 成人av在线播放网址| 久久婷婷成人综合色| 久久国产精品99久久久久久老狼| 欧美色综合天天久久综合精品| 亚洲激情一二三区| proumb性欧美在线观看| 亚洲欧洲www| 成人app在线观看| 国产精品女同互慰在线看| 国产精品自产自拍| 久久久久久电影| 国产一区二区精品久久91| 精品成人私密视频| 国产精品18久久久| 国产精品美女久久久久高潮| caoporn国产精品| 国产精品麻豆久久久| 不卡的电影网站| 亚洲乱码国产乱码精品精的特点| 91免费版在线看| 一二三四社区欧美黄| 欧美日韩一级黄| 青青草原综合久久大伊人精品优势| 欧美一区二区三区四区在线观看| 日韩精品免费视频人成| 欧美成人性福生活免费看| 韩国v欧美v日本v亚洲v| 国产片一区二区三区| 91丝袜国产在线播放| 亚洲一区二区视频在线| 91精品午夜视频| 韩国v欧美v亚洲v日本v| 亚洲欧洲性图库| 欧美精品视频www在线观看| 美女国产一区二区三区| 国产欧美日韩在线| 欧美午夜电影网| 国内精品写真在线观看| 最新成人av在线| 3d动漫精品啪啪1区2区免费| 国产一区二区看久久| 亚洲欧美偷拍三级| 欧美一卡二卡三卡四卡| 成年人网站91| 日产精品久久久久久久性色| 国产精品视频yy9299一区| 欧美三级在线看| 狠狠色丁香婷综合久久| 1024精品合集| 欧美变态tickle挠乳网站| 92精品国产成人观看免费| 日日夜夜免费精品视频| 国产精品久久久久久久裸模| 欧美一区二区在线视频| 风间由美一区二区三区在线观看| 亚洲国产一区二区三区 | 欧美无砖砖区免费| 国产成人精品1024| 日韩在线观看一区二区| 日本一区二区成人在线| 5566中文字幕一区二区电影| 日韩精品在线一区二区| 在线欧美日韩国产| 国产99精品视频| 日韩高清中文字幕一区| 中文字幕一区av| 久久婷婷国产综合国色天香| 欧美午夜影院一区| 不卡的av电影| 国内久久精品视频| 日产精品久久久久久久性色| 亚洲午夜免费电影| 日韩理论片一区二区| 久久亚洲综合av| 制服丝袜亚洲色图| 91精品办公室少妇高潮对白| 丰满亚洲少妇av| 紧缚捆绑精品一区二区| 裸体在线国模精品偷拍| 亚洲国产乱码最新视频| 中文字幕综合网| 国产精品久久久久毛片软件| 久久久久久久久一| 久久久精品综合| 日韩午夜av电影| 91麻豆精品91久久久久久清纯| 色妞www精品视频| 91美女片黄在线观看91美女| 国产精品中文有码| 国产一区二区中文字幕| 另类成人小视频在线| 蜜臀av国产精品久久久久 | 欧美日本韩国一区二区三区视频 | 亚洲自拍偷拍麻豆| 亚洲你懂的在线视频| 亚洲美女屁股眼交3| 亚洲天堂免费看| 亚洲乱码中文字幕综合| 亚洲色图视频网| 依依成人综合视频| 午夜精品福利一区二区蜜股av| 亚洲综合精品自拍| 三级影片在线观看欧美日韩一区二区| 一区二区三区**美女毛片| 一区二区三区精品视频| 亚洲夂夂婷婷色拍ww47| 亚洲电影在线播放| 免费人成精品欧美精品| 国产一区久久久| 成人av电影在线| 欧美亚洲高清一区| 91精品国产综合久久久蜜臀粉嫩 | 欧美怡红院视频| 在线综合+亚洲+欧美中文字幕| 91精品视频网| 日韩精品一区二区三区四区 | 亚洲电影视频在线| 奇米色777欧美一区二区| 久久www免费人成看片高清| 国产91高潮流白浆在线麻豆 | 日韩精品一区二区三区视频播放| 久久影院视频免费| 成人免费在线播放视频| 亚洲网友自拍偷拍| 精品一区二区三区免费观看| 粉嫩一区二区三区性色av| 色综合久久中文字幕综合网| 91精品国模一区二区三区| 久久久久久一二三区| 国产精品国产三级国产aⅴ入口| 亚洲国产精品一区二区久久| 极品少妇xxxx精品少妇偷拍| 99re66热这里只有精品3直播 | 久久国产精品第一页| 成人sese在线| 欧美精品精品一区| 国产精品久久久久久久久果冻传媒 | 国产91精品一区二区麻豆网站| 91亚洲资源网| 欧美xxx久久| 亚洲二区在线观看| 不卡在线视频中文字幕| 欧美精品乱码久久久久久按摩| 国产日产欧美一区| 蜜桃视频第一区免费观看| 97精品久久久午夜一区二区三区 | 国产另类ts人妖一区二区| 在线观看免费亚洲| 久久精品视频网| 首页国产丝袜综合| 99精品欧美一区| 久久久99久久| 日本一不卡视频| 91福利在线播放| 中文字幕一区二区三区在线观看| 免费在线一区观看| 一本久道久久综合中文字幕| 久久亚洲二区三区| 男人的j进女人的j一区| 色94色欧美sute亚洲13| 欧美国产日韩精品免费观看| 日本一不卡视频| 欧美人体做爰大胆视频| 一区二区三区在线观看国产| 成人国产亚洲欧美成人综合网| 欧美sm美女调教| 日韩国产欧美三级| 欧美日韩高清不卡| 亚洲综合网站在线观看| 91麻豆成人久久精品二区三区| 国产三级久久久| 国产一区二区成人久久免费影院| 欧美精品第1页| 偷窥少妇高潮呻吟av久久免费| 在线亚洲一区观看| 亚洲精品视频观看| 一本到不卡免费一区二区| 中文字幕在线不卡视频|