亚洲欧美第一页_禁久久精品乱码_粉嫩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. * <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在线视频免费观看| 久久一区二区三区四区| 欧美一区二区三区免费大片| 国产亚洲精品7777| 日本女优在线视频一区二区| 99re视频精品| 久久无码av三级| 日韩成人免费电影| 91福利国产成人精品照片| 国产日韩综合av| 美女视频黄a大片欧美| 精品视频色一区| 亚洲自拍与偷拍| 不卡的av电影| 国产精品妹子av| 国产91高潮流白浆在线麻豆| 久久免费精品国产久精品久久久久| 天天综合色天天综合色h| 91视频你懂的| 亚洲精品中文字幕乱码三区| 白白色 亚洲乱淫| 中文在线资源观看网站视频免费不卡 | 国产精品视频一二| 国产伦精品一区二区三区视频青涩 | 成人av免费在线| 久久这里只有精品视频网| 蜜臀精品一区二区三区在线观看| 欧美视频在线播放| 婷婷丁香激情综合| 91精品国产综合久久小美女| 五月婷婷综合网| 日韩一区二区三区在线| 蜜臀av亚洲一区中文字幕| 欧美一区二区三区免费大片| 久久国产三级精品| 久久亚洲综合色| 99久久精品免费精品国产| 中文字幕中文字幕中文字幕亚洲无线| www.在线欧美| 亚洲人快播电影网| 欧美色网一区二区| 午夜私人影院久久久久| 日韩一级大片在线| 国模一区二区三区白浆| 中文字幕在线视频一区| 91久久精品一区二区三| 日欧美一区二区| 精品三级在线观看| 国产**成人网毛片九色| 亚洲免费大片在线观看| 欧美精品日韩一本| 国产一区二区三区四区五区入口| 国产午夜精品久久| 91国模大尺度私拍在线视频 | 国产精品美女久久久久aⅴ国产馆| 成人一级片网址| 亚洲一区在线视频| 日韩欧美电影在线| 成人黄页毛片网站| 三级欧美在线一区| 国产三级一区二区| 欧美性猛交一区二区三区精品| 久草精品在线观看| 亚洲欧美偷拍另类a∨色屁股| 欧美精品黑人性xxxx| 国产乱码精品一品二品| 亚洲最新视频在线观看| 久久久精品日韩欧美| 欧美午夜在线观看| 国产很黄免费观看久久| 亚洲在线视频网站| 欧美激情中文字幕| 欧美一二三四在线| 在线看一区二区| 国产精品自产自拍| 热久久一区二区| 亚洲精品自拍动漫在线| 久久精品一区二区三区四区| 91激情五月电影| 国产成人精品免费| 日本三级韩国三级欧美三级| 亚洲人成小说网站色在线| 欧美mv日韩mv亚洲| 欧美一区二区三区在线视频| caoporm超碰国产精品| 懂色av一区二区三区免费观看 | 337p亚洲精品色噜噜噜| 91丨九色丨蝌蚪丨老版| 国产麻豆视频精品| 蜜桃av一区二区| 无码av中文一区二区三区桃花岛| 亚洲欧美综合色| 中文在线一区二区| 国产亚洲欧美在线| 精品国产电影一区二区| 777亚洲妇女| 欧美群妇大交群的观看方式| 一本大道久久a久久精二百| 丰满少妇在线播放bd日韩电影| 老汉av免费一区二区三区| 日本色综合中文字幕| 午夜私人影院久久久久| 亚洲成a人片在线观看中文| 亚洲欧美激情小说另类| 亚洲欧美日韩综合aⅴ视频| 中文字幕精品一区二区三区精品| 久久只精品国产| 久久午夜免费电影| 久久久亚洲精品一区二区三区| 欧美激情一区二区三区不卡| 欧美在线短视频| 一色桃子久久精品亚洲| 国产精品卡一卡二卡三| 亚洲国产精品激情在线观看| 久久久国产精华| 亚洲影视资源网| 欧美v国产在线一区二区三区| 中文字幕一区二区三区色视频| 天天影视涩香欲综合网| 国产高清久久久| 欧美精品一二三| 中文字幕亚洲综合久久菠萝蜜| 日韩不卡一二三区| 91碰在线视频| 久久久夜色精品亚洲| 一区二区三区国产| 国产精品99久久久| 欧美蜜桃一区二区三区| 成人欧美一区二区三区小说| 激情综合色丁香一区二区| 91黄色免费网站| 国产精品久久久久久亚洲毛片 | 午夜成人在线视频| 99久久精品免费| 国产欧美一二三区| 久久99精品久久久久| 欧美日韩国产精品成人| 亚洲人123区| 国产91清纯白嫩初高中在线观看| 日韩三级.com| 亚洲国产wwwccc36天堂| 91免费国产在线| 国产精品天干天干在线综合| 久久99精品久久久久婷婷| 欧美日韩精品欧美日韩精品 | 另类小说一区二区三区| 欧美日韩小视频| 一区二区三区四区在线| 99久久综合色| 国产精品人人做人人爽人人添| 国产精品综合一区二区三区| 日韩一区国产二区欧美三区| 午夜精品福利在线| 欧美亚洲动漫制服丝袜| 亚洲一区二区三区四区中文字幕| 成人av影视在线观看| 国产精品污污网站在线观看| 国产一区在线观看视频| ww久久中文字幕| 国产黄色成人av| 欧美激情一二三区| jvid福利写真一区二区三区| 亚洲国产精品99久久久久久久久| 国产999精品久久久久久| 亚洲国产激情av| 99视频国产精品| 樱花影视一区二区| 精品视频免费在线| 日韩高清国产一区在线| 精品区一区二区| 国产一区欧美二区| 国产亚洲成aⅴ人片在线观看| 国产sm精品调教视频网站| 国产精品你懂的| 91蝌蚪porny九色| 亚洲国产日日夜夜| 日韩精品一区二区三区中文不卡| 久99久精品视频免费观看| 久久久亚洲精品一区二区三区| 成人精品视频一区| 亚洲免费观看在线视频| 51午夜精品国产| 国产精品一区二区黑丝| 成人免费小视频| 欧美日韩不卡一区| 国产一区二区三区综合| 亚洲天堂免费看| 欧美一区二区三区免费视频| 国产精品1024| 亚洲午夜在线视频| 精品噜噜噜噜久久久久久久久试看| 国产精品一区2区| 亚洲精品国产无天堂网2021| 欧美高清视频www夜色资源网| 国产自产视频一区二区三区| 日韩理论电影院| 欧美一区二区在线视频| 国产成人午夜高潮毛片| 亚洲一区二区免费视频| 精品久久久久久久久久久久包黑料|