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

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

?? smallball.java

?? 手機語音開發
?? JAVA
字號:
/* * * Copyright (c) 2007, 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: * *  * Redistributions of source code must retain the above copyright *    notice, this list of conditions and the following disclaimer. *  * Redistributions 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 nor the names of its contributors *    may be used to endorse or promote products derived from this software *    without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */package example.audiodemo;import javax.microedition.lcdui.*;import javax.microedition.media.control.*;/** * A SmallBall is a lightweight animated ball that runs in its own thread. * It moves within a rectangular region, bouncing off the walls. */class SmallBall implements Runnable {    // random number generator    static java.util.Random random = new java.util.Random();    // Global flag to temporarily pause all balls    public static boolean paused = false;    private static final int DEFAULT_DELAY = 80;    private static final int MIN_DELAY = 40;    private static final int MAX_DELAY = 320;    private static final int DELAY_INCREMENT = 40;    private static final int POS_MULTIPLIER = 3;        // controls the speed of all balls; delay in milliseconds    static int delay = DEFAULT_DELAY;    // the matrix to transform the direction based on the    // current direction and which wall was hit    static int[][] matrix =        {            { 1, -1, -1, 1, 1, 1 },            { -1, -1, 1, 1, -1, 1 },            null,            { 1, 1, -1, -1, 1, -1 },            { -1, 1, 1, -1, -1, -1 }        };    // the region in which the ball moves    int top, left, width, height;    // the position and radius of the ball    int posX, posY;    int radius = 5;    int ballSize = radius * 2;    // the direction of the ball is controlled by these two variables    int deltaX, deltaY;    // a handle onto the singleton Graphics object    Graphics g;    Canvas canvas;    int note = ToneControl.C4;    int clr = 0;    // public variables to control the behaviour of the thread    public boolean stop; // = false    // if true, this thread will call repaint()    public boolean doRepaint; // = false;    /**     * Constructor defines the region in which the ball moves as well     * as its starting position.     */    SmallBall(Canvas c, int left, int top, int width, int height) {        super();        canvas = c;        this.left = left + 1;        this.top = top + 1;        this.width = width - ((2 * radius) + 2);        this.height = height - ((2 * radius) + 2);        // use positive random #s        this.posX = ((random.nextInt() >>> 1) % (this.width - 20)) + 10;        this.posY = ((random.nextInt() >>> 1) % (this.height - 20)) + 10;        deltaX = random.nextInt() & 1;        deltaY = random.nextInt() & 1;        if (deltaX == 0) {            deltaX = -1;        }        if (deltaY == 0) {            deltaY = -1;        }        stop = true;    }    static void slower() {        delay += DELAY_INCREMENT;        if (delay > MAX_DELAY) {            delay = MAX_DELAY;        }    }    static void faster() {        delay -= DELAY_INCREMENT;        if (delay < MIN_DELAY) {            delay = MIN_DELAY;        }    }    /**     * Returns the speed in percent of     * the DEFAULT_DELAY     */    static int getSpeedPercent() {        int ret = 100; // start with 100%        int thisDelay = delay;        while (thisDelay > DEFAULT_DELAY) {            thisDelay /= 2;            ret -= 10;        }        while (thisDelay < DEFAULT_DELAY) {            thisDelay *= 2;            ret += 10;        }        return ret;    }    public void setNote(int note) {        this.note = note;    }    /**     * Starts the ball running.     */    public void run() {        int right = left + width;        int bottom = top + height;        while (!stop) {            ballSize = radius * 2;            // calculate a direction of the ball as an integer in the range            // -2 .. 2 (excluding 0)            int direction = deltaX + deltaY;            if (direction == 0) {                direction = deltaX + (2 * deltaY);            }            // is the current position colliding with any wall            int collision = 0;            if ((posX <= left) || (posX >= right)) {                collision++;            }            if ((posY <= top) || (posY >= bottom)) {                collision += 2;            }            // change the direction appropriately if there was a collision            if (collision != 0) {                try {                    javax.microedition.media.Manager.playTone(note, 100 /*ms*/, 100);                } catch (Exception ex) {                    System.out.println("failed to play tone");                }                collision = (collision - 1) * 2;                deltaX = matrix[direction + 2][collision];                deltaY = matrix[direction + 2][collision + 1];            }            // calculate the new position and queue a repaint            posX += POS_MULTIPLIER * deltaX;            posY += POS_MULTIPLIER * deltaY;            if (doRepaint) {                canvas.repaint();            }            // use the delay to control the speed of the ball            // if the MIDlet is paused, keep on waiting            do {                try {                    // if paused, always wait 100 millis,                    // regardless of ball speed                    Thread.sleep(paused ? 100 : delay);                } catch (InterruptedException e) {                }            } while (paused && !stop);        }    }    /**     * Paint the ball.     */    void paint(Graphics g) {        g.setColor(clr);        g.fillArc(posX, posY, ballSize, ballSize, 0, 360);    }    public void setColor(int clr) {        this.clr = clr;    }    public String toString() {        return super.toString() + " x = " + posX + ", y = " + posY;    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国模一区二区三区白浆| 国产久卡久卡久卡久卡视频精品| 欧美另类一区二区三区| 日韩三级伦理片妻子的秘密按摩| 国产精品理论在线观看| 日韩精品免费专区| av午夜一区麻豆| 欧美成人官网二区| 一区二区三区四区乱视频| 国产另类ts人妖一区二区| 欧美亚洲自拍偷拍| 中文字幕精品一区二区精品绿巨人 | 国产精品888| 91美女在线视频| 国产精品久久久久四虎| 奇米四色…亚洲| 色综合久久六月婷婷中文字幕| 久久久精品综合| 日韩av中文在线观看| 欧美综合一区二区| 亚洲免费观看在线观看| 成人午夜私人影院| 久久无码av三级| 日韩和欧美一区二区| 欧美日韩情趣电影| 亚洲午夜羞羞片| 在线中文字幕不卡| 一区二区三区.www| 色噜噜狠狠色综合中国| 亚洲欧洲日韩女同| 99久久久精品| 一区二区三区中文字幕精品精品| 99视频热这里只有精品免费| 日韩伦理av电影| 99re免费视频精品全部| 亚洲美女少妇撒尿| 在线观看视频欧美| 亚洲成av人片一区二区| 在线不卡中文字幕| 美女在线观看视频一区二区| 日韩精品中文字幕在线一区| 精品一区二区三区久久久| 久久蜜桃av一区二区天堂| 国产精品影音先锋| 中文字幕一区二区三区不卡| 91色在线porny| 亚洲成va人在线观看| 欧美一区二区三区在线看| 麻豆久久久久久久| 国产亚洲精品bt天堂精选| 成人伦理片在线| 一区二区三区四区乱视频| 欧美日韩亚洲综合在线 | 4hu四虎永久在线影院成人| 日韩不卡一二三区| 久久久久久**毛片大全| 波多野结衣视频一区| 亚洲免费在线播放| 日韩视频一区二区三区在线播放| 久久99精品视频| 综合自拍亚洲综合图不卡区| 欧美中文字幕一二三区视频| 美女在线观看视频一区二区| 欧美韩日一区二区三区四区| 欧美优质美女网站| 久久se这里有精品| 136国产福利精品导航| 欧美精选一区二区| 成人综合婷婷国产精品久久 | 久久久五月婷婷| 99精品一区二区| 日本成人在线电影网| 国产精品久久久久久久久免费桃花| 在线免费观看日本一区| 精品亚洲国内自在自线福利| 亚洲日本乱码在线观看| 日韩欧美国产三级| 91蜜桃婷婷狠狠久久综合9色| 人禽交欧美网站| 日韩毛片高清在线播放| 日韩视频永久免费| 色婷婷久久久亚洲一区二区三区 | 91精品国产丝袜白色高跟鞋| 成人深夜视频在线观看| 视频一区在线播放| 日韩理论片在线| 久久精品亚洲一区二区三区浴池| 欧美亚洲综合久久| 99这里都是精品| 国产在线播放一区| 日韩国产精品久久| 亚洲裸体在线观看| 国产日韩三级在线| 欧美www视频| 欧美精品久久久久久久久老牛影院| 高清不卡在线观看| 久久99精品久久只有精品| 视频在线观看国产精品| 亚洲精品国产精品乱码不99| 国产日韩视频一区二区三区| 欧美成人免费网站| 欧美肥胖老妇做爰| 欧美性一区二区| 91视频观看视频| a级精品国产片在线观看| 国产成人午夜视频| 国产尤物一区二区在线| 久久精品免费看| 蜜桃视频一区二区三区在线观看| 亚洲精品日日夜夜| 中文字幕视频一区| 国产精品久久久久久久久晋中| 久久综合九色综合欧美98| 精品国产99国产精品| 91精品国产91久久久久久最新毛片| 色狠狠一区二区| 91成人免费电影| 欧美嫩在线观看| 在线播放欧美女士性生活| 欧美欧美欧美欧美首页| 欧美日本在线视频| 91精选在线观看| 日韩一级完整毛片| 日韩精品一区二区三区四区| 日韩精品中文字幕在线一区| 亚洲精品在线电影| 欧美激情一区二区三区四区| 国产精品美女久久久久久久久| 欧美国产日本韩| 亚洲乱码国产乱码精品精的特点 | 韩国成人精品a∨在线观看| 国产在线精品国自产拍免费| 国产成人av一区二区| 成人app网站| 91福利社在线观看| 欧美日本一区二区三区四区| 日韩欧美一级二级三级久久久| 欧美成人一区二区三区| 中文字幕久久午夜不卡| 亚洲黄色小说网站| 午夜精品爽啪视频| 久久不见久久见免费视频1| 国产激情精品久久久第一区二区| 成人精品国产一区二区4080| 色噜噜狠狠成人中文综合| 欧美美女一区二区三区| 精品国产91洋老外米糕| 中文字幕在线不卡一区二区三区| 一区二区三区在线高清| 免费高清成人在线| 成人性视频免费网站| 91福利小视频| 26uuu国产电影一区二区| 自拍偷自拍亚洲精品播放| 日韩黄色小视频| av在线综合网| 日韩欧美一级精品久久| 日韩一区日韩二区| 日本中文在线一区| 91在线高清观看| 精品福利一二区| 亚洲电影第三页| 成人av中文字幕| 日韩一区二区免费在线观看| 自拍偷自拍亚洲精品播放| 美女高潮久久久| 91黄色在线观看| 欧美激情自拍偷拍| 男男视频亚洲欧美| 色哟哟日韩精品| 久久久久国产精品麻豆ai换脸 | 国产成人亚洲综合a∨猫咪| 欧美日韩久久不卡| 亚洲天堂精品在线观看| 国产综合久久久久久久久久久久 | 欧美精品日韩一区| 亚洲欧洲国产日本综合| 国产一区二区调教| 91精品国产高清一区二区三区| 亚洲视频免费看| 粉嫩av一区二区三区粉嫩 | 不卡的av在线播放| 精品卡一卡二卡三卡四在线| 亚洲午夜久久久久久久久电影网 | 成人午夜免费视频| 精品国产亚洲一区二区三区在线观看 | 亚洲人成影院在线观看| 国产一区二区三区视频在线播放| 欧美乱妇一区二区三区不卡视频| 一区二区三区在线不卡| 91亚洲精品乱码久久久久久蜜桃 | 亚洲丝袜另类动漫二区| 国产精品夜夜嗨| 精品国产免费久久| 久久国产日韩欧美精品| 欧美一区二区三区免费大片| 石原莉奈一区二区三区在线观看| 欧美亚洲国产一区二区三区va| 亚洲欧洲制服丝袜| 色域天天综合网|