亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
亚洲色图制服诱惑 | 亚洲精品一线二线三线无人区| 精品欧美乱码久久久久久 | 91美女福利视频| 欧美zozozo| 亚洲国产wwwccc36天堂| 成人午夜视频在线观看| 日韩片之四级片| 首页亚洲欧美制服丝腿| 色综合久久综合网欧美综合网| 国产午夜三级一区二区三| 日本欧美久久久久免费播放网| 91久久线看在观草草青青| 国产欧美久久久精品影院| 国产制服丝袜一区| 欧美一区二区三区免费| 午夜精品免费在线| 欧美三级三级三级爽爽爽| 亚洲激情校园春色| 一本大道av一区二区在线播放| 国产偷国产偷精品高清尤物| 久久精品国产99| 日韩欧美电影一二三| 久久精品国内一区二区三区| 91精品免费在线| 日韩1区2区日韩1区2区| 欧美精品日韩一本| 日韩制服丝袜av| 欧美一区二区久久久| 欧美aaaaa成人免费观看视频| 欧美色偷偷大香| 午夜欧美电影在线观看| 欧美精品在线观看一区二区| 日韩中文字幕一区二区三区| 欧美精品自拍偷拍动漫精品| 日韩精品亚洲一区二区三区免费| 欧美日本一区二区三区| 亚洲成av人在线观看| 91精品国产综合久久精品麻豆 | 国产精品白丝jk黑袜喷水| 久久免费视频色| 成人一二三区视频| 亚洲图片另类小说| 欧美性感一类影片在线播放| 日韩主播视频在线| 久久精品一区八戒影视| a级高清视频欧美日韩| 亚洲一区二区三区在线播放| 欧美日韩国产中文| 久久99久久久久久久久久久| 国产亲近乱来精品视频| 91九色02白丝porn| 青青草国产成人99久久| 国产精品欧美一区二区三区| 欧美一区二区三区爱爱| 精品午夜久久福利影院| 中文字幕一区二区三区不卡在线| 在线观看日韩高清av| 久久精品国产精品青草| 综合欧美亚洲日本| 欧美一区二区三区小说| 成人黄色片在线观看| 亚洲超丰满肉感bbw| 久久久国际精品| 欧美午夜精品免费| 国产成人精品网址| 亚洲成av人片一区二区三区| wwwwxxxxx欧美| 欧美在线观看一二区| 日本不卡的三区四区五区| 国产精品国产三级国产三级人妇 | 日本欧美韩国一区三区| 国产精品久久久久一区二区三区 | 成人免费va视频| 香蕉av福利精品导航| 亚洲国产高清aⅴ视频| 欧美丰满一区二区免费视频| 成人av在线一区二区| 蜜桃视频一区二区三区| 亚洲精品videosex极品| 国产欧美精品一区二区三区四区 | 在线综合视频播放| 91亚洲精华国产精华精华液| 国产一区二区三区观看| 天天综合网 天天综合色| 亚洲精品v日韩精品| 国产精品久久久久久久久久久免费看 | 欧美日韩一区二区欧美激情| 丁香亚洲综合激情啪啪综合| 免费av网站大全久久| 亚洲成人免费观看| 亚洲另类一区二区| 国产精品毛片无遮挡高清| 久久婷婷国产综合精品青草| 91精品国产91热久久久做人人| 在线观看精品一区| 91日韩在线专区| 成人aa视频在线观看| 国产高清在线观看免费不卡| 美国毛片一区二区| 日韩av电影免费观看高清完整版 | 亚洲图片欧美色图| 中文字幕亚洲在| 国产精品灌醉下药二区| 久久精品亚洲一区二区三区浴池| 中文字幕在线不卡一区| 国产精品污污网站在线观看| 久久久www成人免费毛片麻豆| 精品女同一区二区| 精品少妇一区二区三区日产乱码| 欧美一级国产精品| 日韩欧美中文字幕公布| 精品99久久久久久| 国产三级欧美三级日产三级99| 久久综合九色综合97婷婷女人 | 成人高清在线视频| 99国产精品国产精品毛片| 99精品视频在线免费观看| 91麻豆国产福利精品| 欧美亚洲图片小说| 欧美喷水一区二区| 日韩一本二本av| 久久无码av三级| 国产午夜久久久久| 1024成人网| 亚洲午夜在线电影| 蜜臀国产一区二区三区在线播放 | 日本少妇一区二区| 久久91精品久久久久久秒播| 国产成人亚洲综合a∨婷婷图片| 高清shemale亚洲人妖| 色婷婷综合视频在线观看| 欧美婷婷六月丁香综合色| 日韩欧美一区二区三区在线| 国产亚洲va综合人人澡精品| 亚洲乱码中文字幕| 日韩二区三区四区| 国产高清不卡一区| 91视频在线观看免费| 欧美人与禽zozo性伦| 2023国产精品视频| 亚洲人成伊人成综合网小说| 日本中文字幕不卡| 成人一区二区三区视频| 欧美久久婷婷综合色| 国产亚洲精品福利| 性做久久久久久久久| 国产91丝袜在线18| 欧美系列在线观看| 久久久久久日产精品| 亚洲妇熟xx妇色黄| 国产夫妻精品视频| 欧美日韩www| 国产精品对白交换视频| 奇米色一区二区三区四区| 成人18视频日本| 日韩欧美一级特黄在线播放| 日韩理论片一区二区| 久久99精品国产麻豆婷婷| 色综合久久精品| 久久久国产一区二区三区四区小说| 亚洲激情六月丁香| 国产成人免费视频一区| 91精品国产91综合久久蜜臀| 亚洲精品免费电影| 国产成人精品aa毛片| 欧美一区二区三区喷汁尤物| 亚洲精品水蜜桃| 国产电影精品久久禁18| 日韩欧美在线1卡| 亚洲一区二区欧美| 色综合久久综合中文综合网| 国产日产欧美精品一区二区三区| 丝袜美腿亚洲一区| 欧美视频一区在线观看| 亚洲嫩草精品久久| 成人福利视频网站| 欧美国产成人在线| 国产一区欧美一区| 91精品国产高清一区二区三区蜜臀 | 国产一区二区三区av电影| 欧美一区二区三级| 日韩福利视频导航| 欧美美女一区二区三区| 亚洲成人精品在线观看| 精品视频在线免费观看| 亚洲人妖av一区二区| 97精品电影院| 1024成人网| 色哟哟一区二区三区| 亚洲精品福利视频网站| 99国产精品国产精品毛片| 亚洲欧洲日韩女同| 91麻豆swag| 亚洲欧洲国产日韩| 日本韩国精品在线| 亚洲国产你懂的| 欧美日韩国产片| 裸体歌舞表演一区二区| 精品久久久久久久久久久久久久久|