亚洲欧美第一页_禁久久精品乱码_粉嫩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. * @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一区二区三区免费野_久草精品视频
粉嫩欧美一区二区三区高清影视| 国产一区 二区| 国产欧美一区二区精品忘忧草| 色综合天天综合网国产成人综合天| 蜜芽一区二区三区| 一区二区三区视频在线观看| 久久久不卡网国产精品一区| 91麻豆精品国产91久久久久久久久 | 欧美电影在哪看比较好| 成人一区二区三区视频在线观看 | 久久久不卡影院| 欧美久久久久久久久| 一本大道综合伊人精品热热| 国产一区二区在线视频| 日本欧美加勒比视频| 亚洲精品成人精品456| 国产精品网站在线观看| 日韩久久免费av| 在线欧美小视频| 成人精品视频一区| 丁香激情综合五月| 国产在线精品一区二区不卡了| 日韩精品亚洲专区| 性做久久久久久免费观看欧美| 亚洲精品视频一区| 亚洲天堂中文字幕| 国产精品剧情在线亚洲| 中文字幕一区二区三区四区 | 欧美影视一区二区三区| 99re这里只有精品视频首页| 成人黄色网址在线观看| 国产成人精品一区二| 国产成人三级在线观看| 久久国产福利国产秒拍| 久久精品国产99国产| 日本不卡的三区四区五区| 青青草成人在线观看| 热久久一区二区| 美腿丝袜亚洲色图| 久久国产生活片100| 免费av成人在线| 精品一区精品二区高清| 蜜臀va亚洲va欧美va天堂| 麻豆国产欧美日韩综合精品二区| 日韩不卡一二三区| 婷婷开心久久网| 欧美96一区二区免费视频| 免费在线观看成人| 精品一区二区av| 国产成人精品免费在线| 北岛玲一区二区三区四区| 99国产精品久久久久久久久久久 | 欧美伦理视频网站| 51久久夜色精品国产麻豆| 欧美美女网站色| 精品国产第一区二区三区观看体验 | www.性欧美| 色哟哟在线观看一区二区三区| 欧美色网一区二区| 欧美一区二区三区精品| 精品国产一区久久| 中文字幕制服丝袜一区二区三区| 一色屋精品亚洲香蕉网站| 亚洲一区二区三区三| 日日欢夜夜爽一区| 国产成人精品午夜视频免费| 91麻豆国产香蕉久久精品| 欧美性生活久久| 久久综合九色综合欧美亚洲| 欧美激情一区二区三区全黄| 亚洲综合区在线| 精品一区二区三区在线观看国产 | 国产精品麻豆一区二区| 亚洲一区二区影院| 免费成人在线网站| 99久久伊人网影院| 日韩女同互慰一区二区| 国产精品久久久久久久蜜臀| 欧美日韩一本到| 国产亚洲精品精华液| 亚洲另类中文字| 免费观看在线色综合| jlzzjlzz亚洲日本少妇| 欧美一区二区福利视频| 亚洲国产精品传媒在线观看| 午夜av区久久| 成人97人人超碰人人99| 5月丁香婷婷综合| 国产精品国产自产拍高清av | 国产一区二区在线影院| 在线观看一区不卡| 欧美国产一区二区在线观看| 五月天激情综合| 91亚洲男人天堂| 国产亚洲欧美日韩在线一区| 亚洲一二三四久久| 国产经典欧美精品| 91.com在线观看| 亚洲六月丁香色婷婷综合久久 | 亚洲精品视频自拍| 国产成人在线网站| 日韩三级中文字幕| 洋洋成人永久网站入口| 不卡一区二区中文字幕| 日韩欧美亚洲国产精品字幕久久久 | 成人av网址在线观看| 精品国精品国产| 蜜臀av一区二区| 欧美伦理影视网| 亚洲在线免费播放| 97se亚洲国产综合自在线不卡| 精品国产一区a| 日韩av成人高清| 欧美人狂配大交3d怪物一区| 亚洲三级在线看| 91亚洲精品一区二区乱码| 欧美国产精品久久| 99久久国产综合精品女不卡| 精品国产欧美一区二区| 免费在线观看不卡| 欧美精品久久一区| 亚洲va在线va天堂| 欧美日韩中文国产| 亚洲韩国一区二区三区| 91福利精品视频| 亚洲激情在线激情| 一本色道久久综合狠狠躁的推荐| 中文字幕不卡的av| 成人黄色国产精品网站大全在线免费观看| 精品久久久久av影院 | 欧洲av一区二区嗯嗯嗯啊| 中文字幕不卡在线播放| 成人精品在线视频观看| 久久老女人爱爱| 国产不卡视频在线观看| 欧美激情在线看| 91在线观看污| 一区二区三区在线观看视频 | 国产欧美日本一区二区三区| 国产·精品毛片| 国产精品久久久久久一区二区三区| 国产98色在线|日韩| 中文字幕一区二区三区乱码在线| av网站一区二区三区| 亚洲色图视频免费播放| 在线观看三级视频欧美| 五月婷婷欧美视频| 欧美一级理论片| 国产在线精品一区二区夜色 | 一个色妞综合视频在线观看| 在线观看亚洲精品| 午夜精品久久一牛影视| 欧美videossexotv100| 久久99精品久久久久婷婷| 国产片一区二区| 94-欧美-setu| 婷婷国产v国产偷v亚洲高清| 欧美一二三区在线| 国产成人免费9x9x人网站视频| 国产精品沙发午睡系列990531| 9色porny自拍视频一区二区| 亚洲自拍都市欧美小说| 91精品国产综合久久国产大片| 国模娜娜一区二区三区| 国产精品电影一区二区| 欧美亚洲一区二区在线观看| 捆绑调教一区二区三区| 久久综合99re88久久爱| 欧美体内she精高潮| 麻豆国产精品官网| 中文字幕在线免费不卡| 欧美日韩国产免费一区二区 | 中文字幕一区二区三区在线观看 | 中文字幕乱码亚洲精品一区| 91免费版在线| 日韩专区在线视频| 中文字幕精品综合| 91精品免费观看| a4yy欧美一区二区三区| 青娱乐精品视频在线| 欧美激情综合五月色丁香小说| 欧美性色aⅴ视频一区日韩精品| 久久成人av少妇免费| 中文字幕综合网| 久久五月婷婷丁香社区| 在线看国产一区| 成人视屏免费看| 午夜精品一区二区三区电影天堂 | 9i看片成人免费高清| 午夜伊人狠狠久久| 国产精品无人区| 日韩欧美高清一区| 91福利资源站| 国产成人精品免费视频网站| 日韩av在线发布| 亚洲精品免费在线播放| 国产欧美一区二区三区在线看蜜臀 | 激情文学综合网| 偷拍与自拍一区| 中文字幕中文字幕在线一区 |