亚洲欧美第一页_禁久久精品乱码_粉嫩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老师片黄在线观看| 日韩一区二区视频在线观看| 国产精品伦一区| 成人av电影在线网| 亚洲少妇30p| 欧美伊人久久久久久午夜久久久久| 最好看的中文字幕久久| 欧美综合欧美视频| 日韩电影在线免费观看| 亚洲精品在线观看网站| 成人免费三级在线| 亚洲一二三区视频在线观看| 欧美一二三四区在线| 国产福利91精品| 亚洲男人电影天堂| 欧美精品久久99久久在免费线| 麻豆精品国产传媒mv男同| 中文字幕av一区二区三区免费看 | 99久久久久久| 亚洲黄网站在线观看| 欧美一区二区三区视频免费播放| 黄色小说综合网站| 亚洲乱码中文字幕综合| 69av一区二区三区| 国产iv一区二区三区| 亚洲成a人片综合在线| 精品国产一二三| 在线国产电影不卡| 国内精品视频666| 亚洲精品久久久蜜桃| 精品1区2区在线观看| 99riav一区二区三区| 久久精品国产在热久久| 亚洲精品一二三| 欧美成人精品1314www| 色综合久久综合网97色综合| 久久精品国产精品亚洲综合| 亚洲精品乱码久久久久久日本蜜臀| 日韩免费高清电影| 在线观看一区二区精品视频| 轻轻草成人在线| 91天堂素人约啪| 日本丰满少妇一区二区三区| 久久久久亚洲蜜桃| 色天天综合色天天久久| 国产一区二区三区精品视频| 亚洲一二三区在线观看| 久久精品一区蜜桃臀影院| 欧美日韩精品免费| 99精品国产91久久久久久| 国产一区二区福利视频| 男女男精品视频网| 亚洲激情五月婷婷| 国产精品福利一区| 久久久蜜臀国产一区二区| 欧美一级片在线看| 欧美日韩国产一区| 91福利国产精品| 99久久精品免费看国产| 成人影视亚洲图片在线| 狠狠网亚洲精品| 精品一区二区日韩| 日本成人中文字幕在线视频| 日本高清视频一区二区| 中文字幕一区二区三区在线不卡| 日韩欧美国产高清| 7777精品伊人久久久大香线蕉经典版下载 | 国产欧美日韩激情| 欧美不卡一二三| 91精品国产欧美一区二区成人 | 欧美二区三区的天堂| 91激情在线视频| 91国模大尺度私拍在线视频| 97久久精品人人澡人人爽| 东方欧美亚洲色图在线| 福利电影一区二区三区| 国产成人久久精品77777最新版本 国产成人鲁色资源国产91色综 | 欧美videofree性高清杂交| 成人永久aaa| 成人av网站在线观看免费| 欧美精品一二三| 在线视频观看一区| 91久久奴性调教| 91激情在线视频| 在线成人高清不卡| 日韩女优电影在线观看| 精品国精品国产尤物美女| 久久人人超碰精品| 国产精品久久久久婷婷| 国产精品国产三级国产aⅴ原创 | 亚洲在线成人精品| 亚洲国产欧美一区二区三区丁香婷| 亚洲国产精品综合小说图片区| 亚洲成人一二三| 麻豆国产一区二区| 国产成人鲁色资源国产91色综| 成人sese在线| 欧美无砖专区一中文字| 日韩视频在线你懂得| 久久久久久一二三区| 成人欧美一区二区三区| 亚洲成av人在线观看| 久久精品国产亚洲aⅴ | 99精品视频一区二区| 欧美亚洲动漫精品| 日韩视频永久免费| 国产欧美精品国产国产专区| 玉足女爽爽91| 免费日韩伦理电影| 成人综合在线观看| 欧美亚洲国产一卡| 亚洲免费高清视频在线| 亚洲午夜一区二区| 狠狠色综合播放一区二区| 波多野结衣中文字幕一区二区三区 | 精品国产凹凸成av人导航| 欧美激情一区二区三区蜜桃视频| 一区二区三区四区av| 久久99国产精品免费| 91麻豆产精品久久久久久| 日韩一区二区三免费高清| 国产精品电影一区二区| 日韩高清在线观看| 99视频一区二区三区| 欧美成人伊人久久综合网| 日韩一区中文字幕| 国产最新精品免费| 欧美视频日韩视频在线观看| 国产日韩欧美不卡在线| 日韩精品久久理论片| 99re热视频精品| 久久在线观看免费| 天堂在线亚洲视频| 99精品热视频| 成人福利视频网站| 亚洲国产乱码最新视频| 国产精品亚洲一区二区三区在线| 在线视频一区二区免费| 久久精品欧美日韩精品| 麻豆精品在线视频| 欧美三区在线观看| 亚洲欧洲日本在线| 国产成人精品在线看| 精品日韩99亚洲| 丝袜美腿高跟呻吟高潮一区| 91视视频在线观看入口直接观看www | 97精品久久久久中文字幕| 精品国产污网站| 丝袜国产日韩另类美女| 色婷婷综合久色| 欧美高清一级片在线观看| 狠狠色狠狠色综合| 日韩欧美三级在线| 天堂蜜桃91精品| 欧美日韩国产影片| 亚洲高清视频中文字幕| 91官网在线免费观看| 综合色中文字幕| 99久久综合精品| 国产精品对白交换视频| 成人福利视频在线| 欧美日韩成人在线| 日韩电影在线看| 国产99久久久国产精品免费看| 91视频你懂的| 中文字幕乱码久久午夜不卡 | 日韩欧美电影在线| 天堂影院一区二区| 欧美一区2区视频在线观看| 午夜精品一区在线观看| 777久久久精品| 老司机免费视频一区二区三区| 欧美男同性恋视频网站| 天天操天天色综合| 日韩欧美高清在线| 国模一区二区三区白浆| 久久久久国产一区二区三区四区| 九一九一国产精品| 久久亚洲捆绑美女| 成人精品免费网站| 亚洲欧美一区二区不卡| 欧美专区日韩专区| 日本美女一区二区三区| 欧美tickling网站挠脚心| 精品在线免费视频| 久久精品亚洲麻豆av一区二区 | 一本大道久久a久久精品综合| 国产精品色哟哟网站| 成人在线一区二区三区| 亚洲日本免费电影| 欧美色爱综合网| 九色porny丨国产精品| 欧美国产丝袜视频| 在线观看视频欧美| 久久国内精品自在自线400部| 欧美激情一区不卡| 欧美高清一级片在线| 韩国一区二区在线观看| 国产剧情一区在线| 一区二区三区四区不卡在线|