亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
精品99一区二区三区| 91亚洲男人天堂| 欧美大片一区二区| 免费观看成人av| 日韩欧美视频一区| 国产在线视频一区二区三区| 精品久久人人做人人爱| 国产专区综合网| 国产精品国产三级国产三级人妇| 成人美女在线观看| 综合激情网...| 欧美亚洲一区二区三区四区| 日韩国产精品久久久| 日韩西西人体444www| 狠狠色丁香婷婷综合久久片| 亚洲国产成人一区二区三区| 91在线视频观看| 夜夜揉揉日日人人青青一国产精品| 欧美午夜宅男影院| 麻豆一区二区三| 国产精品免费看片| 欧美日本一区二区在线观看| 国产精品综合在线视频| 日韩伦理av电影| 正在播放一区二区| 懂色av噜噜一区二区三区av| 亚洲激情在线激情| 精品欧美一区二区三区精品久久| 国产69精品久久777的优势| 一区二区三区在线免费| 日韩精品中文字幕一区| 成人av影视在线观看| 亚洲va韩国va欧美va精品| 久久精品在这里| 在线观看www91| 国产综合久久久久影院| 一区二区三区在线高清| 2023国产精品| 欧美日韩亚州综合| 国产精品一区二区视频| 香蕉久久夜色精品国产使用方法| 国产亚洲精品7777| 欧美一区二区在线不卡| 94-欧美-setu| 黑人精品欧美一区二区蜜桃| 亚洲在线中文字幕| 中文字幕精品一区二区精品绿巨人| 欧美日韩国产美女| 99国产精品一区| 国产精品91一区二区| 天天av天天翘天天综合网| 国产精品伦理一区二区| 欧美成人一区二区三区在线观看| 日本福利一区二区| 成人一区二区视频| 精品写真视频在线观看| 午夜私人影院久久久久| 亚洲天堂2014| 欧美国产日韩亚洲一区| 欧美sm美女调教| 欧美丰满高潮xxxx喷水动漫| 色播五月激情综合网| www.亚洲人| 国产电影精品久久禁18| 蜜桃传媒麻豆第一区在线观看| 一级日本不卡的影视| 中文字幕一区二区三区在线观看| 久久久综合激的五月天| www日韩大片| 欧美成人a在线| 日韩一卡二卡三卡国产欧美| 欧美日韩一级视频| 精品视频在线视频| 欧美日韩欧美一区二区| 欧美影院午夜播放| 91福利在线观看| 色综合天天综合网国产成人综合天 | 91在线观看下载| 国产成人免费视频一区| 国产不卡免费视频| 国产成人综合亚洲91猫咪| 国产一区二区在线观看免费| 精品一区二区在线视频| 青青草97国产精品免费观看无弹窗版| 亚洲1区2区3区4区| 五月婷婷激情综合| 奇米精品一区二区三区在线观看| 日韩av一区二区三区| 日本欧美在线看| 看国产成人h片视频| 久久99精品视频| 国产一区美女在线| 岛国一区二区三区| 91美女片黄在线观看| 色一情一伦一子一伦一区| 在线看国产一区二区| 精品视频一区三区九区| 日韩一级片网站| 久久伊人中文字幕| 中文字幕免费在线观看视频一区| 欧美国产精品一区二区三区| 国产精品三级久久久久三级| 亚洲日本护士毛茸茸| 亚洲国产精品久久一线不卡| 日韩电影在线免费看| 久久99国产精品麻豆| 成人中文字幕合集| 欧美午夜精品一区二区三区| 日韩欧美一级片| 国产精品无圣光一区二区| 亚洲卡通动漫在线| 男男gaygay亚洲| 国产99久久久国产精品| 日本韩国精品在线| 日韩女优电影在线观看| 国产精品你懂的在线欣赏| 亚洲午夜精品网| 国产精品一级片在线观看| 色综合天天性综合| 91精品在线麻豆| 国产精品视频一二三| 午夜精品福利一区二区蜜股av| 久久国产精品99久久人人澡| 99国内精品久久| 欧美videos大乳护士334| 亚洲丝袜另类动漫二区| 久久99精品久久久久久| 色哟哟欧美精品| 欧美精品一区二区三区四区| 成人欧美一区二区三区1314| 欧美aaa在线| 97久久超碰精品国产| 欧美大白屁股肥臀xxxxxx| 亚洲精品老司机| 国产一区二区精品久久91| 欧美喷水一区二区| 亚洲日本中文字幕区| 国产在线一区二区综合免费视频| 欧美午夜精品久久久久久超碰| www一区二区| 日韩高清不卡在线| 91黄色免费看| 中文字幕av一区二区三区| 日本在线播放一区二区三区| 色就色 综合激情| 欧美国产丝袜视频| 激情综合一区二区三区| 9191精品国产综合久久久久久| 亚洲欧洲精品一区二区三区不卡| 精品一区二区三区av| 国产一区二区三区在线观看精品| 久久久久国产免费免费| 日韩精品亚洲专区| 欧美亚洲图片小说| 一区二区高清视频在线观看| 成人高清视频免费观看| 日韩欧美不卡在线观看视频| 天天综合网 天天综合色| 欧美疯狂做受xxxx富婆| 午夜国产不卡在线观看视频| 久久久精品国产免费观看同学| 粉嫩aⅴ一区二区三区四区五区| 捆绑变态av一区二区三区| 欧美日韩在线观看一区二区 | 亚洲色图清纯唯美| 国产精品一区二区免费不卡 | 91精品在线观看入口| 亚洲综合一二三区| 91国内精品野花午夜精品| 国产精品高潮久久久久无| 国产精品18久久久久久久久| 久久精品一区二区三区不卡牛牛 | 91黄色免费观看| 亚洲美女电影在线| 色爱区综合激月婷婷| 亚洲美女在线一区| 欧美午夜电影网| 日韩专区在线视频| 91精品欧美久久久久久动漫| 日本不卡一区二区三区高清视频| 欧美猛男男办公室激情| 男女男精品网站| 久久午夜色播影院免费高清| 国产在线精品一区二区夜色 | 黄页视频在线91| 久久久久久久久久久久久女国产乱| 看电影不卡的网站| 国产亚洲精品资源在线26u| 成人性生交大片| 亚洲欧洲精品一区二区精品久久久 | 亚洲第一综合色| 666欧美在线视频| 久久电影网电视剧免费观看| 国产欧美日韩在线观看| 91丝袜国产在线播放| 视频一区视频二区中文| 日韩欧美亚洲国产精品字幕久久久 | 欧美日韩亚洲综合在线 欧美亚洲特黄一级 | 一区二区三区中文字幕电影| 欧美精品18+|