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

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

?? textpanel.java

?? 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. * <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一区二区三区免费野_久草精品视频
亚洲自拍偷拍网站| 成人福利视频网站| 懂色av一区二区三区免费观看| 成人高清伦理免费影院在线观看| 69精品人人人人| 一区二区在线看| 成人美女视频在线观看| 精品久久99ma| 日本在线观看不卡视频| 色婷婷久久一区二区三区麻豆| 久久久亚洲综合| 日韩**一区毛片| 欧美性生活一区| 亚洲免费观看高清在线观看| 国产成人综合自拍| 亚洲精品一区二区三区蜜桃下载| 五月激情综合网| 欧美丝袜丝nylons| 亚洲国产综合视频在线观看| 91麻豆国产在线观看| 国产亚洲成av人在线观看导航| 亚洲成人免费看| 欧美三级欧美一级| 一区二区三区.www| 欧美日韩一区三区四区| 亚洲欧洲日韩在线| 99久久精品久久久久久清纯| 国产精品国产自产拍高清av| 成人黄色av网站在线| 国产精品美女久久久久aⅴ国产馆 国产精品美女久久久久av爽李琼 国产精品美女久久久久高潮 | 国产精品一二三四五| 欧美一级免费大片| 免费成人你懂的| 精品国产伦一区二区三区观看方式| 日韩电影免费一区| 911精品国产一区二区在线| 亚洲成av人影院在线观看网| 欧美日韩卡一卡二| 日韩国产精品久久久久久亚洲| 日韩一区二区免费视频| 久久精品国产精品青草| 久久蜜桃av一区精品变态类天堂| 国产一区 二区 三区一级| 国产日韩欧美电影| 成人国产精品免费观看动漫| 日韩毛片视频在线看| 91国偷自产一区二区开放时间 | 亚洲综合色在线| 欧美日本精品一区二区三区| 亚洲v日本v欧美v久久精品| 91精品国模一区二区三区| 精品一区二区在线视频| 中文一区二区完整视频在线观看| www.66久久| 亚洲午夜久久久久| 欧美精品一区二区三区在线播放| 国产成人精品在线看| 亚洲女女做受ⅹxx高潮| 91精品国产综合久久福利| 国产米奇在线777精品观看| 亚洲欧洲性图库| 欧美人xxxx| 国产成a人亚洲| 夜夜操天天操亚洲| 久久男人中文字幕资源站| 99综合电影在线视频| 日韩二区在线观看| 欧美韩国日本综合| 欧美日韩亚洲综合在线| 国产成人无遮挡在线视频| 亚洲成av人片在线观看| 国产亚洲欧美日韩在线一区| 欧洲精品中文字幕| 国产精品一区专区| 爽好久久久欧美精品| 国产精品欧美精品| 日韩女优av电影| 欧美亚洲国产一区在线观看网站| 久久激情五月婷婷| 天天综合网天天综合色| 国产精品久久福利| 欧美精品一区二区高清在线观看 | 国产伦精品一区二区三区免费| 亚洲欧美日韩中文播放| 久久精品夜色噜噜亚洲a∨| 欧美日韩另类一区| 色噜噜久久综合| 丁香啪啪综合成人亚洲小说| 美女视频黄 久久| 亚洲成人综合视频| 一区二区三区免费| 国产精品久久一级| 国产午夜亚洲精品午夜鲁丝片 | 色老汉一区二区三区| 国产乱码精品一区二区三 | 国产精品77777竹菊影视小说| 日韩高清不卡一区二区三区| 一区二区三区精品| 亚洲欧洲另类国产综合| 亚洲国产成人自拍| 国产亚洲精品7777| 久久久久久久久久久久久女国产乱 | 日本黄色一区二区| 99vv1com这只有精品| 成人精品亚洲人成在线| 久久99久久99精品免视看婷婷 | 午夜精品一区在线观看| 亚洲黄色av一区| 亚洲精选视频免费看| 国产精品久久久久久妇女6080| 久久久久国产精品人| 国产日产精品1区| 国产日韩高清在线| 中文在线资源观看网站视频免费不卡 | 成人久久久精品乱码一区二区三区| 成人精品免费视频| 国产乱码精品一区二区三区忘忧草 | 亚洲人成影院在线观看| 中文字幕制服丝袜成人av| 2欧美一区二区三区在线观看视频| 日韩免费高清av| 国产亚洲女人久久久久毛片| 国产日产精品一区| 自拍偷拍亚洲欧美日韩| 亚洲日本护士毛茸茸| 亚洲第一综合色| 蜜桃视频一区二区| 国产99久久久精品| 99久久精品国产麻豆演员表| 91久久精品网| 日韩一卡二卡三卡国产欧美| 26uuuu精品一区二区| 欧美国产精品一区二区三区| 欧美激情在线观看视频免费| 亚洲欧洲av色图| 午夜免费久久看| 精品亚洲免费视频| 色综合久久久久| 欧美日韩国产影片| 亚洲精品一区二区三区99| 中文字幕在线不卡视频| 亚洲一区二区精品久久av| 美女一区二区三区在线观看| 国产成人小视频| 欧美日韩午夜影院| 国产欧美精品一区二区色综合| 一区二区三区高清在线| 免费不卡在线视频| 91在线免费视频观看| 欧美一区中文字幕| 国产精品久久福利| 免费成人美女在线观看.| 99精品国产热久久91蜜凸| 91精品久久久久久久久99蜜臂| 日本一区二区三区在线观看| 天堂蜜桃91精品| 91在线免费视频观看| 欧美成人激情免费网| 一区二区欧美视频| 99精品在线观看视频| 91精品国产一区二区三区蜜臀| 国产精品对白交换视频| 另类综合日韩欧美亚洲| 91日韩精品一区| 久久久精品tv| 另类小说图片综合网| 色综合中文字幕国产| 日韩一区国产二区欧美三区| 综合久久久久综合| 国产美女精品在线| 日韩一区二区在线播放| 亚洲一区二区三区中文字幕| 国产福利精品导航| 精品理论电影在线| 午夜伦欧美伦电影理论片| 色婷婷精品大视频在线蜜桃视频| 国产日韩影视精品| 韩日av一区二区| 欧美精选午夜久久久乱码6080| 亚洲精品美腿丝袜| 99久久国产综合精品麻豆| 久久精品人人爽人人爽| 精品一区二区三区在线视频| 欧美日韩午夜影院| 无吗不卡中文字幕| 欧美影视一区在线| 亚洲一区二区三区四区五区中文| 不卡的av在线| 国产精品久久久久永久免费观看| 国精产品一区一区三区mba桃花 | 欧美一区二区三区爱爱| 亚洲国产日产av| 欧美体内she精视频| 亚洲精品中文字幕在线观看| 色综合天天天天做夜夜夜夜做| 国产精品美女久久久久aⅴ国产馆 国产精品美女久久久久av爽李琼 国产精品美女久久久久高潮 | 久久精品免视看| 国产精品综合久久| 欧美精彩视频一区二区三区| 国产精品一区二区三区99|