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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? textpanel.java

?? 經(jīng) 典 的 數(shù) 據(jù) 結(jié) 構(gòu)
?? 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;    }}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91精品欧美久久久久久动漫| 欧美在线观看一区二区| 色婷婷av一区二区三区软件 | 欧美日韩一区在线| 日韩欧美一区二区久久婷婷| 中文字幕一区二区三区四区 | 亚洲婷婷在线视频| 激情欧美一区二区| 欧美日韩日日摸| 亚洲色图都市小说| 国产精品99久久久久久久vr| 精品视频1区2区3区| 亚洲欧美中日韩| 东方欧美亚洲色图在线| 日韩午夜在线影院| 性做久久久久久| 在线免费观看成人短视频| 欧美高清在线一区| 国产成人在线视频播放| 精品久久人人做人人爽| 日韩精品一区第一页| 99精品国产99久久久久久白柏| 精品国产乱码久久久久久蜜臀| 视频一区视频二区中文字幕| 91一区在线观看| 中文av字幕一区| 国产精品亚洲第一| 国产清纯白嫩初高生在线观看91 | 欧美无砖专区一中文字| 中文字幕一区二区三区四区不卡| 国产在线视频一区二区| 精品乱人伦一区二区三区| 理论电影国产精品| 26uuu久久天堂性欧美| 精品在线免费视频| 精品日韩一区二区三区免费视频| 日本v片在线高清不卡在线观看| 欧美性受极品xxxx喷水| 午夜精品免费在线| 91精品麻豆日日躁夜夜躁| 亚洲成人在线网站| 欧美一区二区三区爱爱| 青青青爽久久午夜综合久久午夜| 7777精品久久久大香线蕉| 免费视频最近日韩| 精品粉嫩aⅴ一区二区三区四区| 蜜桃久久久久久| 久久人人97超碰com| 高清在线成人网| 成人欧美一区二区三区白人| 99视频精品在线| 亚洲一区在线观看免费观看电影高清| 91成人在线观看喷潮| 无吗不卡中文字幕| 精品卡一卡二卡三卡四在线| 国产成人亚洲综合a∨婷婷| 中文字幕一区二区三区av| 91丝袜美腿高跟国产极品老师| 一区二区三区在线观看视频| 欧美日韩国产另类一区| 久久精品国产99国产精品| 国产精品日韩成人| 欧美色网站导航| 国产自产高清不卡| 亚洲天堂网中文字| 欧美美女bb生活片| 高清不卡一区二区| 亚洲一区二区三区精品在线| 日韩欧美国产三级| 99精品视频中文字幕| 亚洲成a人片综合在线| 久久一夜天堂av一区二区三区| 91亚洲国产成人精品一区二三| 天涯成人国产亚洲精品一区av| 久久色视频免费观看| 91麻豆国产在线观看| 久久99国产精品尤物| 亚洲国产成人午夜在线一区| 色香蕉成人二区免费| 久久99精品国产麻豆婷婷| 亚洲欧洲中文日韩久久av乱码| 欧美精品日韩综合在线| 91首页免费视频| 国产在线精品一区二区三区不卡| 亚洲女女做受ⅹxx高潮| 精品国产乱码久久久久久免费| 色狠狠一区二区| 91麻豆产精品久久久久久 | 国产一区二区不卡在线| 一区二区三区在线免费播放| 欧美极品少妇xxxxⅹ高跟鞋| 欧美日韩国产成人在线免费| 99久久久免费精品国产一区二区| 狠狠v欧美v日韩v亚洲ⅴ| 三级欧美在线一区| 亚洲一区视频在线| 亚洲日本va在线观看| 日本一区二区三区久久久久久久久不 | 久久综合久久鬼色| 在线观看日韩av先锋影音电影院| 国产激情一区二区三区四区| 蜜桃久久精品一区二区| 天堂一区二区在线| 亚洲精品视频一区| 自拍av一区二区三区| 欧美高清一级片在线观看| 精品久久久网站| 精品国产免费视频| 欧美videossexotv100| 91麻豆精品国产91久久久久久久久 | 国产三级欧美三级日产三级99| 欧美日韩高清在线播放| 日本韩国视频一区二区| 91麻豆产精品久久久久久| www.欧美色图| 99re热视频精品| 99精品视频在线观看免费| 久久99精品久久久久婷婷| 麻豆精品国产传媒mv男同| 日韩av一区二区在线影视| 天天做天天摸天天爽国产一区| 亚洲图片欧美色图| 偷窥少妇高潮呻吟av久久免费| 亚洲大片在线观看| 免费在线观看视频一区| 狠狠色丁香婷综合久久| 国内外成人在线| 国产一区亚洲一区| 国产99久久久国产精品免费看| 国产精品1区二区.| 95精品视频在线| 欧美三级一区二区| 欧美成人精品二区三区99精品| 精品久久久久香蕉网| 国产欧美一区二区精品性色超碰| 国产视频一区在线播放| 中文字幕亚洲欧美在线不卡| 亚洲尤物在线视频观看| 美女在线视频一区| 国产成人在线电影| 91电影在线观看| 99久久久精品| 性做久久久久久久久| 国产福利91精品| 精品乱码亚洲一区二区不卡| 91精品国产综合久久久久| 色婷婷久久99综合精品jk白丝| 国产剧情一区二区| 欧美日韩久久久久久| 欧美一级欧美一级在线播放| 欧美三区在线视频| 精品国产不卡一区二区三区| 亚洲国产欧美在线| 日本在线不卡视频一二三区| 精品一区中文字幕| 91在线观看地址| 精品久久久久一区| 亚洲视频中文字幕| 精品在线免费视频| 欧美色图一区二区三区| 国产婷婷一区二区| 天天综合网天天综合色| 成人听书哪个软件好| 欧美一级片在线| 亚洲一区二区在线视频| 国产福利一区二区| 欧美精选一区二区| 最近日韩中文字幕| 国产一区二区按摩在线观看| 欧美在线观看视频一区二区三区| 久久综合久久鬼色中文字| 香蕉加勒比综合久久| 99久久免费国产| 欧美午夜理伦三级在线观看| 亚洲一区二区欧美| 99久久久免费精品国产一区二区| 精品国产制服丝袜高跟| 蜜臀国产一区二区三区在线播放 | 久久久久久久久蜜桃| 欧美网站一区二区| 欧美一级高清片| 亚洲一区二区三区小说| 中文字幕av不卡| 欧美色综合网站| 亚洲电影中文字幕在线观看| av中文字幕不卡| 亚洲欧美日韩国产成人精品影院| 成人蜜臀av电影| ...av二区三区久久精品| 99精品国产一区二区三区不卡| 欧美经典一区二区| 国产精品1024| 亚洲另类在线制服丝袜| 51久久夜色精品国产麻豆| 日本欧美大码aⅴ在线播放| 日韩午夜激情电影| 高清日韩电视剧大全免费| 亚洲综合一区二区精品导航| 欧美人伦禁忌dvd放荡欲情| 日本亚洲视频在线|