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

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

?? animation.java

?? J2ME MIDP_Example_Applications
?? JAVA
字號:
// Copyright 2002 Nokia Corporation. 
// 
// THIS SOURCE CODE IS PROVIDED 'AS IS', WITH NO WARRANTIES WHATSOEVER, 
// EXPRESS OR IMPLIED, INCLUDING ANY WARRANTY OF MERCHANTABILITY, FITNESS 
// FOR ANY PARTICULAR PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE 
// OR TRADE PRACTICE, RELATING TO THE SOURCE CODE OR ANY WARRANTY OTHERWISE 
// ARISING OUT OF ANY PROPOSAL, SPECIFICATION, OR SAMPLE AND WITH NO 
// OBLIGATION OF NOKIA TO PROVIDE THE LICENSEE WITH ANY MAINTENANCE OR 
// SUPPORT. FURTHERMORE, NOKIA MAKES NO WARRANTY THAT EXERCISE OF THE 
// RIGHTS GRANTED HEREUNDER DOES NOT INFRINGE OR MAY NOT CAUSE INFRINGEMENT 
// OF ANY PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OWNED OR CONTROLLED 
// BY THIRD PARTIES 
// 
// Furthermore, information provided in this source code is preliminary, 
// and may be changed substantially prior to final release. Nokia Corporation 
// retains the right to make changes to this source code at 
// any time, without notice. This source code is provided for informational 
// purposes only. 
// 
// Nokia and Nokia Connecting People are registered trademarks of Nokia
// Corporation.
// Java and all Java-based marks are trademarks or registered trademarks of
// Sun Microsystems, Inc.
// Other product and company names mentioned herein may be trademarks or
// trade names of their respective owners.
// 
// A non-exclusive, non-transferable, worldwide, limited license is hereby 
// granted to the Licensee to download, print, reproduce and modify the 
// source code. The licensee has the right to market, sell, distribute and 
// make available the source code in original or modified form only when 
// incorporated into the programs developed by the Licensee. No other 
// license, express or implied, by estoppel or otherwise, to any other 
// intellectual property rights is granted herein.


package example.postcard;

import java.lang.IllegalArgumentException;
import java.util.Random;
import javax.microedition.lcdui.*;


// A class representing the animated image that floats in the Postcard

class Animation
{
    private static final Random RANDOM = new Random();

    private final AnimationSequence animationSequence;
    private final int w;
    private final int h;
    private final int xBoundary;
    private final int yBoundary;
    private final int wBoundary;
    private final int hBoundary;

    private int currentIndex = 0;
    private int ticks = 0;
    private int ticksSinceLastChangeX = 0;
    private int ticksSinceLastChangeY = 0;
    private int x = 0;
    private int y = 0;
    private int dx = 1;
    private int dy = 1;


    // An Animation is constructed from a sequence of animation images.
    // The Animation can move with a box bounded by {xBoundary, yBoundary}
    // and {xBoundary+wBoundary, yBoundary+hBoundary}.
    //
    // The parameter animationSequence is the sequence of animation
    // images used to create the animation. The bounding box where the
    // animation is allowed to move is bounded by: xBoundary, yBoundary,
    // wBoundary and hBoundary.

    Animation(AnimationSequence animationSequence,
                    int xBoundary, int yBoundary, int wBoundary, int hBoundary)
        throws IllegalArgumentException
    {
        if (animationSequence == null)
        {
            throw new IllegalArgumentException("null AnimationSequence");
        }

        this.animationSequence = animationSequence;
        this.w = animationSequence.getMaxImageWidth();
        this.h = animationSequence.getMaxImageHeight();
        if (w < wBoundary)
        {
            x = (xBoundary + wBoundary - w)/2;
        }
        if (h < hBoundary)
        {
            y = (yBoundary + hBoundary - h)/2;
        }
        this.xBoundary = xBoundary;
        this.yBoundary = yBoundary;
        this.wBoundary = wBoundary;
        this.hBoundary = hBoundary;
        dx = rand(3) - 1; // 0, -1 or 1
        dy = rand(3) - 1; // 0, -1 or 1
    }


    void tick()
    {
        ticks++;
        ticksSinceLastChangeX++;
        ticksSinceLastChangeY++;

        if ((ticks % 5) == 0)
        {
            if ((++currentIndex) >= animationSequence.size())
            {
                currentIndex = 0;
            }
        }

        move();
    }


    private void move()
    {
        // mostly continue as we are, but sometimes randomly change
        if ((ticksSinceLastChangeX > 20) && (rand(20) == 0))
        {
            dx = rand(3) - 1; // 0, -1 or 1
            ticksSinceLastChangeX = 0;
        }

        // if moving would take us off-canvas left or right, reverse
        if (((x + dx) < xBoundary) || ((x + dx + w) > (xBoundary + wBoundary)))
        {
            dx = -dx;
            ticksSinceLastChangeX = 0;
        }


        // mostly continue as we are, but sometimes randomly change
        if ((ticksSinceLastChangeY > 20) && (rand(20) == 0))
        {
            dy = rand(2) * 2 - 1; // -1 or 1
            ticksSinceLastChangeY = 0;
        }

        // if moving would take us off-canvas top or bottom, reverse
        if (((y + dy) < yBoundary) || ((y + dy + h) > (yBoundary + hBoundary)))
        {
            dy = -dy;
            ticksSinceLastChangeY = 0;
        }

        x += dx;
        y += dy;
    }


    void draw(Graphics g)
    {
        Image image = animationSequence.elementAt(currentIndex);
        g.drawImage(image, x, y, (Graphics.LEFT | Graphics.TOP));
    }


    // This method does not generate true random numbers.

    static int rand(int scale)
    {
        return (RANDOM.nextInt() << 1 >>> 1) % scale;
    }
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日本一区二区三区免费乱视频| 欧美中文一区二区三区| 免费久久精品视频| 午夜精品爽啪视频| 婷婷综合五月天| 精品制服美女丁香| 国产福利电影一区二区三区| 激情伊人五月天久久综合| 韩国女主播一区| eeuss国产一区二区三区| 日本韩国精品一区二区在线观看| 色婷婷久久一区二区三区麻豆| 欧美天堂亚洲电影院在线播放| 欧美日韩国产a| 粉嫩欧美一区二区三区高清影视| 一区二区免费在线| 日本不卡的三区四区五区| 免费日韩伦理电影| gogogo免费视频观看亚洲一| 色婷婷综合久久| 日韩一区二区三区高清免费看看| 久久综合久久综合久久综合| 亚洲欧洲精品天堂一级| 中文字幕日韩一区二区| 麻豆精品在线播放| 欧美日韩一区二区在线观看 | 欧美日韩精品一区二区天天拍小说 | 色老汉一区二区三区| 精品欧美乱码久久久久久1区2区| 国产精品国产成人国产三级| 日本不卡视频一二三区| 欧美丝袜丝交足nylons| 国产精品久久毛片a| 国产激情视频一区二区在线观看| 在线观看日产精品| 亚洲欧美日韩国产手机在线| 国产91在线看| 国产日韩欧美高清在线| 精品一区二区三区在线观看国产| 欧美亚洲一区二区在线| 一区二区三区在线不卡| 日本精品视频一区二区三区| 4438成人网| 国产精品视频一区二区三区不卡| 日韩成人免费电影| 欧美一区二区三区免费大片| 一区二区三区高清| 在线看日韩精品电影| 一区二区国产盗摄色噜噜| 在线免费观看日本欧美| 亚洲免费av观看| 欧美日韩国产另类不卡| 亚洲高清在线精品| 日韩一区二区三区在线观看| 久久99精品久久久久婷婷| 精品卡一卡二卡三卡四在线| 国产高清在线观看免费不卡| 日本一区二区三区视频视频| 日本二三区不卡| 麻豆91精品视频| 中文文精品字幕一区二区| 92精品国产成人观看免费| 亚洲成人精品一区二区| 精品国产91九色蝌蚪| 色综合久久88色综合天天免费| 午夜电影网亚洲视频| 一区在线中文字幕| 欧美群妇大交群的观看方式| 国产一区视频网站| 亚洲成人免费在线观看| 国产情人综合久久777777| 欧美系列一区二区| 9i看片成人免费高清| 乱一区二区av| 午夜精品福利久久久| 亚洲视频精选在线| 久久精品欧美一区二区三区不卡 | 国产免费观看久久| 在线看日韩精品电影| 成人精品免费网站| 久久精品999| 日韩激情一区二区| 亚洲综合在线第一页| 亚洲美女淫视频| 亚洲另类一区二区| 亚洲成人在线网站| 亚洲精品福利视频网站| 亚洲蜜臀av乱码久久精品蜜桃| 亚洲国产成人一区二区三区| 久久奇米777| 欧美激情一区二区三区全黄| 久久久久久夜精品精品免费| 精品国产乱子伦一区| 久久免费午夜影院| 一区二区中文视频| 亚洲图片激情小说| 亚洲婷婷综合色高清在线| 亚洲品质自拍视频网站| 一区二区三区美女| 麻豆久久久久久久| av网站一区二区三区| 欧美中文字幕久久| 精品日本一线二线三线不卡| 中文欧美字幕免费| 视频在线在亚洲| 国产精品一区专区| 色综合久久天天| 欧美mv日韩mv| 亚洲精品免费一二三区| 日韩精彩视频在线观看| 不卡一区二区中文字幕| 91美女片黄在线观看| 91在线云播放| 久久日韩精品一区二区五区| 国产精品免费久久| 日本成人在线电影网| 北条麻妃国产九九精品视频| 欧美高清视频不卡网| 国产精品美女久久久久aⅴ| 日本aⅴ免费视频一区二区三区| 国产高清精品久久久久| 日韩亚洲欧美成人一区| 亚洲精品高清在线观看| 国产+成+人+亚洲欧洲自线| 欧美巨大另类极品videosbest | 色av一区二区| 国产精品午夜春色av| 国产在线视视频有精品| 欧美高清视频不卡网| 偷窥少妇高潮呻吟av久久免费| av中文字幕在线不卡| 久久亚洲二区三区| 国产麻豆精品视频| 精品美女一区二区三区| 国产精品亚洲综合一区在线观看| 日韩一区二区三区三四区视频在线观看| 亚洲视频狠狠干| 欧美日韩成人在线| 国内国产精品久久| 国产午夜精品美女毛片视频| 国产最新精品免费| 中文字幕一区二区三区在线播放| 国产盗摄一区二区| 亚洲综合在线免费观看| 9191久久久久久久久久久| 久久草av在线| 亚洲视频一区在线| 国产一区二区三区在线观看免费| 欧美午夜电影在线播放| 日韩精品一二三区| 久久久久久免费毛片精品| av不卡免费在线观看| 亚洲国产另类av| 久久综合一区二区| 91福利在线免费观看| 久久福利视频一区二区| 中文av一区二区| 日韩欧美资源站| 在线观看亚洲一区| 成人精品视频一区二区三区尤物| 亚洲网友自拍偷拍| 国产精品久久毛片av大全日韩| 欧美日韩精品综合在线| 成人国产电影网| 久久99精品国产.久久久久| 一区二区三区在线免费播放| 日韩三级在线观看| 欧美日韩日日骚| 色噜噜夜夜夜综合网| 风流少妇一区二区| 国内成人精品2018免费看| 污片在线观看一区二区| 亚洲在线成人精品| 日韩理论片中文av| 国产精品美女久久久久av爽李琼| 精品国产一区二区三区忘忧草 | 国产精品成人一区二区三区夜夜夜| 日韩三级视频在线看| 亚洲精品在线电影| 久久嫩草精品久久久久| 欧美经典三级视频一区二区三区| 欧美精品一区二区三区在线| 久久久久久久久一| 日本一区二区动态图| 自拍偷拍亚洲综合| 亚洲成a人片综合在线| 日韩不卡一二三区| 国产乱码精品一区二区三区av| 国产麻豆成人传媒免费观看| 国产成人日日夜夜| 色婷婷av一区二区三区gif| 欧美综合在线视频| 欧美一区二区三区四区五区| av亚洲精华国产精华| 色婷婷综合久久久中文一区二区| 在线观看日韩精品| 精品国产自在久精品国产| 国产视频911| 视频一区在线播放| 成人小视频在线观看|