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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? sortitem.java

?? 一個小公司要求給寫的很簡單的任務管理系統。
?? JAVA
字號:
/* * @(#)SortItem.java	1.20 06/02/22 *  * Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved. *  * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: *  * -Redistribution of source code must retain the above copyright notice, this *  list of conditions and the following disclaimer. *  * -Redistribution in binary form must reproduce the above copyright notice,  *  this list of conditions and the following disclaimer in the documentation *  and/or other materials provided with the distribution. *  * Neither the name of Sun Microsystems, Inc. or the names of contributors may  * be used to endorse or promote products derived from this software without  * specific prior written permission. *  * This software is provided "AS IS," without a warranty of any kind. ALL  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING * ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE * OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") * AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE * AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST  * REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL,  * INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY  * OF LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,  * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. *  * You acknowledge that this software is not designed, licensed or intended * for use in the design, construction, operation or maintenance of any * nuclear facility. *//* * @(#)SortItem.java	1.20 06/02/22 */import java.awt.*;import java.awt.event.*;import java.io.InputStream;import java.util.Hashtable;import java.net.*;/** * A simple applet class to demonstrate a sort algorithm. * You can specify a sorting algorithm using the "alg" * attribyte. When you click on the applet, a thread is * forked which animates the sorting algorithm. * * @author James Gosling * @version 	1.20, 02/22/06 */public class SortItem    extends java.applet.Applet    implements Runnable, MouseListener {    /**     * The thread that is sorting (or null).     */    private Thread kicker;    /**     * The array that is being sorted.     */    int arr[];    /**     * The high water mark.     */    int h1 = -1;    /**     * The low water mark.     */    int h2 = -1;    /**     * The name of the algorithm.     */    String algName;    /**     * The sorting algorithm (or null).     */    SortAlgorithm algorithm;    Dimension initialSize = null;     /**     * Fill the array with random numbers from 0..n-1.     */    void scramble() {	initialSize = getSize();	int a[] = new int[initialSize.height / 2];	double f = initialSize.width / (double) a.length;	for (int i = a.length; --i >= 0;) {	    a[i] = (int)(i * f);	}	for (int i = a.length; --i >= 0;) {	    int j = (int)(i * Math.random());	    int t = a[i];	    a[i] = a[j];	    a[j] = t;	}	arr = a;    }    /**     * Pause a while.     * @see SortAlgorithm     */    void pause() {	pause(-1, -1);    }    /**     * Pause a while, and draw the high water mark.     * @see SortAlgorithm     */    void pause(int H1) {	pause(H1, -1);    }    /**     * Pause a while, and draw the low&high water marks.     * @see SortAlgorithm     */    void pause(int H1, int H2) {	h1 = H1;	h2 = H2;	if (kicker != null) {	    repaint();	}	try {Thread.sleep(20);} catch (InterruptedException e){}    }    /**     * Initialize the applet.     */    public void init() {	String at = getParameter("alg");	if (at == null) {	    at = "BubbleSort";	}	algName = at + "Algorithm";	scramble();	resize(100, 100);	addMouseListener(this);    }    public void start() {        h1 = h2 = -1;         scramble();        repaint();        showStatus(getParameter("alg"));    }    /**     * Deallocate resources of applet.     */    public void destroy() {        removeMouseListener(this);    }    /**     * Paint the array of numbers as a list     * of horizontal lines of varying lengths.     */    public void paint(Graphics g) {        int a[] = arr;        int y = 0;        int deltaY = 0, deltaX = 0, evenY = 0, evenX = 0;         Dimension currentSize = getSize();        int currentHeight = currentSize.height;        int currentWidth = currentSize.width;        // Check to see if the applet has been resized since it         // started running.  If so, need the deltas to make sure         // the applet is centered in its containing panel.          // The evenX and evenY are because the high and low         // watermarks are calculated from the top, but the rest         // of the lines are calculated from the bottom, which         // can lead to a discrepancy if the window is not an         // even size.          if (!currentSize.equals(initialSize)) {             evenY = (currentHeight - initialSize.height) % 2;            evenX = (currentWidth - initialSize.width) % 2;            deltaY = (currentHeight - initialSize.height) / 2;            deltaX = (currentWidth - initialSize.width) / 2;            if (deltaY < 0) {                 deltaY = 0;                 evenY = 0;             }            if (deltaX < 0) {                 deltaX = 0;                 evenX = 0;             }        }	// Erase old lines	g.setColor(getBackground());	y = currentHeight - deltaY - 1;	for (int i = a.length; --i >= 0; y -= 2) {	    g.drawLine(deltaX + arr[i], y, currentWidth, y);	}	// Draw new lines	g.setColor(Color.black);	y = currentHeight - deltaY - 1;	for (int i = a.length; --i >= 0; y -= 2) {	    g.drawLine(deltaX, y, deltaX + arr[i], y);	}	if (h1 >= 0) {	    g.setColor(Color.red);	    y = deltaY + evenY + h1 * 2 + 1;	    g.drawLine(deltaX, y, deltaX + initialSize.width, y);	}	if (h2 >= 0) {	    g.setColor(Color.blue);	    y = deltaY + evenY + h2 * 2 + 1;	    g.drawLine(deltaX, y, deltaX + initialSize.width, y);	}    }    /**     * Update without erasing the background.     */    public void update(Graphics g) {	paint(g);    }    /**     * Run the sorting algorithm. This method is     * called by class Thread once the sorting algorithm     * is started.     * @see java.lang.Thread#run     * @see SortItem#mouseUp     */    public void run() {	try {	    if (algorithm == null) {		algorithm = (SortAlgorithm)Class.forName(algName).newInstance();		algorithm.setParent(this);	    }	    algorithm.init();	    algorithm.sort(arr);	} catch(Exception e) {	}    }    /**     * Stop the applet. Kill any sorting algorithm that     * is still sorting.     */    public synchronized void stop() {	if (algorithm != null){            try {		algorithm.stop();            } catch (IllegalThreadStateException e) {                // ignore this exception            }            kicker = null;	}    }    /**     * For a Thread to actually do the sorting. This routine makes     * sure we do not simultaneously start several sorts if the user     * repeatedly clicks on the sort item.  It needs to be     * synchronized with the stop() method because they both     * manipulate the common kicker variable.     */    private synchronized void startSort() {	if (kicker == null || !kicker.isAlive()) {	    kicker = new Thread(this);	    kicker.start();	}    }    public void mouseClicked(MouseEvent e) {        showStatus(getParameter("alg"));    }    public void mousePressed(MouseEvent e) {    }    /**     * The user clicked in the applet. Start the clock!     */    public void mouseReleased(MouseEvent e) {        startSort();        e.consume();    }    public void mouseEntered(MouseEvent e) {    }    public void mouseExited(MouseEvent e) {    }    public String getAppletInfo() {        return "Title: SortDemo \nAuthor: James Gosling 1.17f, 10 Apr 1995 \nA simple applet class to demonstrate a sort algorithm.  \nYou can specify a sorting algorithm using the 'alg' attribute.  \nWhen you click on the applet, a thread is forked which animates \nthe sorting algorithm.";    }    public String[][] getParameterInfo() {        String[][] info = {          {"alg", "string", "The name of the algorithm to run.  You can choose from the provided algorithms or suppply your own, as long as the classes are runnable as threads and their names end in 'Algorithm.'  BubbleSort is the default.  Example:  Use 'QSort' to run the QSortAlgorithm class."}        };        return info;    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
中文字幕一区二区视频| 久草中文综合在线| 麻豆中文一区二区| 成人激情av网| 日韩一级二级三级精品视频| 最新日韩在线视频| 精品一区二区在线观看| 91国内精品野花午夜精品| 精品三级在线看| 亚洲国产成人91porn| www.欧美亚洲| 26uuu精品一区二区在线观看| 一区二区三区蜜桃网| 国产黄色精品网站| 欧美一区二区在线不卡| 一区二区三区日本| 色婷婷久久一区二区三区麻豆| 国产欧美日韩综合| 黄色小说综合网站| 日韩欧美一级二级三级久久久| 亚洲欧美另类综合偷拍| 成人a免费在线看| 国产无遮挡一区二区三区毛片日本| 亚洲123区在线观看| 91久久线看在观草草青青| 中文字幕精品—区二区四季| 国产在线不卡视频| 欧美刺激午夜性久久久久久久| 亚洲高清三级视频| 欧美日韩视频一区二区| 夜夜嗨av一区二区三区网页| 91一区二区三区在线观看| 国产精品久久久久一区二区三区共| 韩国成人在线视频| 久久众筹精品私拍模特| 精品一区二区三区香蕉蜜桃| 欧美一级xxx| 老司机精品视频一区二区三区| 制服丝袜亚洲播放| 另类小说图片综合网| 精品国产乱码久久久久久1区2区| 麻豆国产91在线播放| 日韩精品中文字幕在线一区| 久久爱www久久做| 精品成人一区二区三区四区| 久久成人综合网| 久久久精品影视| 色综合天天做天天爱| 一区二区三区.www| 91精品黄色片免费大全| 久久电影网站中文字幕| 欧美国产丝袜视频| 欧美最新大片在线看| 日本在线播放一区二区三区| 欧美videos大乳护士334| 国产乱码精品一区二区三区av| 国产性天天综合网| www.色综合.com| 五月天亚洲婷婷| 久久综合久久久久88| 成人禁用看黄a在线| 一区二区久久久久久| 日韩视频在线观看一区二区| 高清日韩电视剧大全免费| 伊人开心综合网| 日韩免费电影一区| 91麻豆国产精品久久| 婷婷开心激情综合| 国产欧美一区二区精品婷婷| 色一区在线观看| 免费观看成人鲁鲁鲁鲁鲁视频| 国产日韩成人精品| 欧美日韩国产综合一区二区| 国产一区二区在线电影| 夜夜嗨av一区二区三区四季av| 精品区一区二区| 91福利视频久久久久| 国产精品99久久久久久似苏梦涵| 亚洲欧美一区二区三区国产精品| 欧美精品v日韩精品v韩国精品v| 国产成人精品综合在线观看| 亚洲成av人影院| 中文字幕亚洲综合久久菠萝蜜| 91麻豆精品国产91| 91女人视频在线观看| 国产一区免费电影| 亚洲成人av在线电影| 国产精品久久久一区麻豆最新章节| 欧美日本精品一区二区三区| 成人高清在线视频| 蜜桃av一区二区| 亚洲一区二区三区三| 国产欧美1区2区3区| 欧美一区二区成人| 在线观看成人小视频| 成人高清免费观看| 国产乱理伦片在线观看夜一区| 日本伊人精品一区二区三区观看方式| 国产精品电影院| 久久一区二区视频| 欧美一区二区在线观看| 在线观看成人小视频| 99精品视频一区| 99在线精品视频| 国产.精品.日韩.另类.中文.在线.播放| 五月婷婷综合网| 午夜免费欧美电影| 一区二区三区免费网站| 亚洲欧美自拍偷拍色图| 国产精品你懂的| 国产精品人妖ts系列视频| 久久综合色婷婷| 久久亚洲精品国产精品紫薇| 日韩美女视频一区二区在线观看| 欧美美女黄视频| 欧美猛男男办公室激情| 欧美日韩三级视频| 欧美日韩dvd在线观看| 欧美日韩一级二级三级| 欧美天堂一区二区三区| 欧美综合亚洲图片综合区| 91看片淫黄大片一级在线观看| 99麻豆久久久国产精品免费| 成人av在线影院| 99久久99久久综合| 色呦呦一区二区三区| 欧亚洲嫩模精品一区三区| 91福利在线看| 欧美日韩和欧美的一区二区| 91精品国产综合久久精品麻豆| 欧美丰满少妇xxxxx高潮对白 | 国产精品人人做人人爽人人添| 国产日韩高清在线| 亚洲欧洲综合另类在线| 亚洲成人高清在线| 免费欧美在线视频| 国模冰冰炮一区二区| 粉嫩久久99精品久久久久久夜 | 91麻豆精东视频| 欧美色视频在线| 欧美一区二区黄| 国产午夜精品理论片a级大结局| 欧美韩国一区二区| 亚洲另类在线一区| 日本美女一区二区三区| 国产乱淫av一区二区三区| av资源网一区| 欧美电影在哪看比较好| 欧美精品一区二区三区久久久| 亚洲国产精品激情在线观看| 一区二区三区在线看| 日韩和欧美一区二区| 国产成人av一区二区| 欧洲精品在线观看| 不卡一区中文字幕| 欧美美女一区二区在线观看| 久久久亚洲午夜电影| 亚洲视频电影在线| 久久精品国产成人一区二区三区 | 欧美视频在线一区二区三区| 日韩情涩欧美日韩视频| 日韩理论片网站| 久久精品72免费观看| 成人免费av在线| 日韩欧美一区二区久久婷婷| 亚洲欧洲精品一区二区三区不卡| 偷拍日韩校园综合在线| 国产大陆亚洲精品国产| 欧美日韩精品是欧美日韩精品| 国产日韩在线不卡| 久久精品国产精品亚洲红杏| 91视视频在线观看入口直接观看www | 99视频在线精品| 欧美www视频| 五月天婷婷综合| 99久久精品国产精品久久| 日韩欧美在线综合网| 一区二区三区电影在线播| 国产剧情一区二区三区| 欧美午夜在线观看| 国产精品热久久久久夜色精品三区| 午夜视频在线观看一区二区三区| 成人午夜av在线| 精品国产凹凸成av人网站| 亚洲午夜免费电影| 91亚洲大成网污www| 国产欧美日韩在线视频| 麻豆精品一区二区| 欧美丰满高潮xxxx喷水动漫| 亚洲激情图片一区| av电影在线不卡| 国产精品你懂的在线| 国产裸体歌舞团一区二区| 欧美大片一区二区三区| 日韩精品一级二级| 欧美日韩国产美| 亚洲午夜av在线| 欧美日本一区二区三区四区| 亚洲一区二区三区四区五区中文| 91啪亚洲精品|