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

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

?? textpanel.java

?? Java算法大全(近100種算法打包),內容詳實,很好的學習資料.
?? 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. * <p> * This method should NOT have to be called manually. * @see TextFrame * @see AlgAnimFrame */public class TextPanel extends Panel {    String file_name;    String[] lines;    private int n_lines;    private int highlight;    private int width = 300;    private int height = 400;    private int delay = 400;    private int max_lines = 1000;    private Dimension offscreensize = null;    private Image offscreen = null;    private Graphics offGraphics = null;    private static final int dx = 2;    private Font font;    private int font_size = 10;    private int line_space = 14;    private 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#getStart     */    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);    }    /**     * Get the number of lines of source code to be displayed on the text panel.     * @return The number of lines of source code to be displayed on the      *		text frame.     */    public int getNumLines() {	return n_lines;    }    /**     * Get the number of pixels used by each line of text.     * @return The number of pixels allocated for each line of text.     */    public int getLineSpace() {	return line_space;    }    /**     * Get the first line of the source code that will be displayed.     * This attribute is used to couple the text panel to a vertical scrollbar     * in the TextFrame.      * @return The first line of source code that will be displayed.     *      */    public int getStart() {	return start;    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产女同互慰高潮91漫画| 欧美一区二区三区在线观看视频| 亚洲午夜久久久久久久久电影院| 日韩一区二区在线观看视频 | 天天av天天翘天天综合网| 国产欧美日韩在线| 日韩欧美一级片| 欧美久久久影院| 欧美中文字幕亚洲一区二区va在线 | 日韩写真欧美这视频| 午夜一区二区三区视频| 欧美电影免费观看高清完整版在 | 亚洲一区二区综合| 久久久久国产精品麻豆ai换脸| 欧美精品xxxxbbbb| 欧美一级视频精品观看| www.一区二区| 成人激情图片网| 粉嫩蜜臀av国产精品网站| 精品一区中文字幕| 老司机精品视频线观看86| 欧美96一区二区免费视频| 日日骚欧美日韩| 日产欧产美韩系列久久99| 天天色综合天天| 婷婷开心激情综合| 日韩不卡一二三区| 狠狠色狠狠色综合系列| 国产酒店精品激情| 成人18精品视频| 日本电影亚洲天堂一区| 欧美体内she精高潮| 日韩一区二区三区四区五区六区| 777亚洲妇女| 中文字幕欧美区| 亚洲综合激情另类小说区| 日韩av成人高清| 成人在线视频一区二区| 色综合天天视频在线观看| 欧美二区三区的天堂| 久久综合精品国产一区二区三区| 亚洲欧洲国产日韩| 日产精品久久久久久久性色| 福利视频网站一区二区三区| 91麻豆123| 久久日韩精品一区二区五区| 亚洲免费观看高清完整版在线 | 欧美另类z0zxhd电影| 久久夜色精品国产欧美乱极品| 亚洲视频每日更新| 精品亚洲国内自在自线福利| 色综合网色综合| 欧美激情艳妇裸体舞| 日韩精品91亚洲二区在线观看| 成人网在线播放| 精品免费视频.| 天天爽夜夜爽夜夜爽精品视频| 不卡一区二区三区四区| 欧美一级一区二区| 日韩国产成人精品| 欧美视频一区二区| 一区二区三区蜜桃| 97se亚洲国产综合自在线| 久久新电视剧免费观看| 精品女同一区二区| 亚洲人成7777| 成人开心网精品视频| 欧美电影影音先锋| 青娱乐精品在线视频| 制服丝袜中文字幕亚洲| 亚洲福利电影网| 欧美日韩综合色| 亚洲福中文字幕伊人影院| 欧美人狂配大交3d怪物一区| 玉足女爽爽91| 欧美日韩一区国产| 亚洲成人动漫精品| 91精品国产aⅴ一区二区| 日韩精品一卡二卡三卡四卡无卡| 亚洲成av人**亚洲成av**| 国产精品99精品久久免费| 久久嫩草精品久久久精品| 国产成人免费在线观看| 国产精品丝袜在线| 色综合天天综合网天天看片| 亚洲精品v日韩精品| 欧美日本韩国一区二区三区视频 | 国产一区二区免费在线| 国产欧美一区二区三区在线看蜜臀 | 日韩片之四级片| 国产91精品免费| 亚洲精品成a人| 精品88久久久久88久久久| 成人免费毛片高清视频| 亚洲h在线观看| 国产调教视频一区| 欧美一区日本一区韩国一区| 国产成人免费网站| 日韩主播视频在线| 国产精品久久免费看| 精品视频一区 二区 三区| 国产经典欧美精品| 日本欧美一区二区在线观看| 国产精品亲子伦对白| 日韩欧美一区二区免费| 色噜噜偷拍精品综合在线| 久久精品国产一区二区| 亚洲精品第1页| 一区精品在线播放| 亚洲欧洲日产国码二区| 欧美一区二区三区思思人| 91丨九色丨蝌蚪丨老版| 成人免费看片app下载| 美女精品一区二区| 日韩国产在线一| 亚洲综合av网| 亚洲在线视频免费观看| 亚洲少妇最新在线视频| 国产亚洲午夜高清国产拍精品 | 亚洲精选在线视频| 亚洲欧美中日韩| 国产精品美女久久久久aⅴ| 久久综合九色综合97婷婷女人| 欧美大胆人体bbbb| 日韩精品最新网址| 久久久久久日产精品| 26uuu国产电影一区二区| 久久久精品影视| 欧美经典一区二区| 中文字幕一区二区三区精华液 | 不卡免费追剧大全电视剧网站| 经典三级一区二区| 欧美日韩午夜影院| 欧美日韩一级黄| 日韩三级视频在线观看| 久久久一区二区三区| 中文字幕av资源一区| 一区二区中文字幕在线| 亚洲影院久久精品| 日韩精品一二三| 国产一区二区三区蝌蚪| 成人小视频在线| 51精品视频一区二区三区| 久久夜色精品一区| 亚洲高清中文字幕| 粉嫩欧美一区二区三区高清影视| 在线国产电影不卡| 精品国产乱码久久| 亚洲国产另类av| 成人av片在线观看| 91精品久久久久久蜜臀| 视频在线观看一区| 国产毛片一区二区| 91色在线porny| 欧美一区二区三区四区久久| 国产精品免费aⅴ片在线观看| 亚洲成av人片| 日本精品一区二区三区四区的功能| 欧美一区二区性放荡片| 亚洲精品乱码久久久久久黑人| 精品综合免费视频观看| 欧美视频一区二区三区| 国产精品第一页第二页第三页| 秋霞午夜鲁丝一区二区老狼| 91精品1区2区| 亚洲精选一二三| 在线看国产日韩| 亚洲图片欧美激情| caoporn国产精品| 国产欧美精品一区二区色综合 | 国产欧美一区在线| 天天av天天翘天天综合网色鬼国产 | 日韩福利视频网| 欧美精品精品一区| 亚洲一区二区视频| 欧美系列一区二区| 奇米影视在线99精品| 日韩一区二区免费在线电影| 蜜臀av亚洲一区中文字幕| 5566中文字幕一区二区电影| 午夜精品视频在线观看| 欧美精品三级在线观看| 麻豆国产精品视频| 亚洲国产高清在线观看视频| 欧美午夜宅男影院| 青娱乐精品在线视频| 久久久久高清精品| 成人h精品动漫一区二区三区| 国产精品视频观看| 欧美在线一区二区| 狠狠色狠狠色综合| 国产精品久久久久久久久免费丝袜| aaa欧美色吧激情视频| 亚洲自拍偷拍图区| 久久综合久久综合亚洲| 99久久夜色精品国产网站| 午夜成人免费电影| 国产精品麻豆网站| 欧美一级片在线观看| 国产精品一线二线三线精华|