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

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

?? multisteprace.java

?? JAVA圖形特效,詳細介紹SWING等的效果開發
?? JAVA
字號:
import java.awt.Point;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.SwingUtilities;
import org.jdesktop.animation.timing.Animator;
import org.jdesktop.animation.timing.Animator.RepeatBehavior;
import org.jdesktop.animation.timing.interpolation.Interpolator;
import org.jdesktop.animation.timing.interpolation.KeyFrames;
import org.jdesktop.animation.timing.interpolation.KeyTimes;
import org.jdesktop.animation.timing.interpolation.KeyValues;
import org.jdesktop.animation.timing.interpolation.PropertySetter;
import org.jdesktop.animation.timing.interpolation.SplineInterpolator;
import org.jdesktop.animation.timing.triggers.ActionTrigger;
/*
 * MultiStepRace.java
 *
 * Created on May 3, 2007, 2:45 PM
 *
 * 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 the TimingFramework project 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.
 */

/**
 * The full-blown demo with all of the bells and whistles.  This one uses
 * the facilities shown in all of the other variations, but adds 
 * both multi-step and non-linear interpolation.  It does this by
 * creating a KeyFrames object to hold the times/values/splines
 * used for each segment of the race.  It also adds an animation for
 * the rotation of the car (since the car should turn as it goes around the
 * curves) and sound effects (just to go completely overboard).
 *
 * @author Chet
 */
public class MultiStepRace {
    
    protected Animator animator;
    private SoundEffects soundEffects;
    public static final int RACE_TIME = 10000;
    
    
    /** Creates a new instance of BasicRace */
    public MultiStepRace(String appName) {
        RaceGUI basicGUI = new RaceGUI(appName);
        
        // We're going to need a more involved PropertyRange object
        // that has all curves of the track in it, as well as 
        // non-linear movement around the curves
        Point values[] = {
            TrackView.START_POS,
            TrackView.FIRST_TURN_START, TrackView.FIRST_TURN_END,
            TrackView.SECOND_TURN_START, TrackView.SECOND_TURN_END,
            TrackView.THIRD_TURN_START, TrackView.THIRD_TURN_END,
            TrackView.FOURTH_TURN_START, 
            TrackView.START_POS};
        KeyValues keyValues = KeyValues.create(values);
        // Calculate the keyTimes based on the distances that must be
        // traveled on each leg of the journey
        double totalDistance = 0;
        double segmentDistance[] = new double[values.length];
        for (int i = 0; i < (values.length - 1); ++i) {
            segmentDistance[i] = values[i].distance(values[i + 1]);
            totalDistance += segmentDistance[i];
        }
        segmentDistance[(values.length-1)] = 
                values[(values.length - 1)].distance(values[0]);
        totalDistance += segmentDistance[(values.length-1)];
        float times[] = new float[values.length];
        float elapsedTime = 0.0f;
        times[0] = 0.0f;
        times[values.length - 1] = 1.0f;
        for (int i = 0; i < (values.length - 2); ++i) {
            times[i + 1] = elapsedTime + (float)(segmentDistance[i] / totalDistance);
            elapsedTime = times[i + 1];
        }
        KeyTimes keyTimes = new KeyTimes(times);

        // For realistic movement, we want a big acceleration
        // on the straightaways
        Interpolator initialSpline = new SplineInterpolator(1.00f, 0.00f, 0.2f, .2f);
        Interpolator straightawaySpline = new SplineInterpolator(0.50f, 0.20f, .50f, .80f);
        Interpolator curveSpline = new SplineInterpolator(0.50f, 0.20f, .50f, .80f);
        Interpolator finalSpline = new SplineInterpolator(0.50f, 0.00f, .50f, 1.00f);
        KeyFrames keyFrames = new KeyFrames(keyValues, keyTimes,
                initialSpline, curveSpline, straightawaySpline, curveSpline,
                straightawaySpline, curveSpline,
                straightawaySpline, finalSpline);
        // This PropertySetter enables the animation for the car movement all 
        // the way around the track
        PropertySetter modifier = new PropertySetter(basicGUI.getTrack(), 
                "carPosition", keyFrames);
        animator = new Animator(RACE_TIME, Animator.INFINITE,
                RepeatBehavior.LOOP, modifier);
        
        // Now create similar keyframes for rotation of car
        keyValues = KeyValues.create(360, 315, 270, 225, 180, 135, 90, 45, 0);
        Interpolator straightawayTurnSpline = new SplineInterpolator(1.0f, 0.0f, 1.0f, 0.0f);
        Interpolator curveTurnSpline = new SplineInterpolator(0.0f, 0.5f, 0.5f, 1.0f);
        keyFrames = new KeyFrames(keyValues, keyTimes, 
                straightawayTurnSpline, curveTurnSpline, 
                straightawayTurnSpline, curveTurnSpline, 
                straightawayTurnSpline, curveTurnSpline, 
                straightawayTurnSpline, curveTurnSpline);
        modifier = new PropertySetter(basicGUI.getTrack(), "carRotation", 
                keyFrames);
        animator.addTarget(modifier);
        
        // Finally, add sound effects, triggered by the same animator
        soundEffects = new SoundEffects(keyFrames);
        animator.addTarget(soundEffects);
        
        // Instead of manually tracking the events, have the framework do
        // the work by setting up a trigger
        JButton goButton = basicGUI.getControlPanel().getGoButton();
        JButton stopButton = basicGUI.getControlPanel().getStopButton();
        ActionTrigger trigger = ActionTrigger.addTrigger(goButton, animator);
        stopButton.addActionListener(new Stopper(animator));
    }

    /**
     * Handle clicks on the Stop button to stop the race
     */
    private class Stopper implements ActionListener {
        Animator timer;
        Stopper(Animator timer) {
            this.timer = timer;
        }
        public void actionPerformed(ActionEvent ae) {
            timer.stop();
        }
    }

    public static void main(String args[]) {
        Runnable doCreateAndShowGUI = new Runnable() {
            public void run() {
                MultiStepRace race = new MultiStepRace("Multi Step Race");
            }
        };
        SwingUtilities.invokeLater(doCreateAndShowGUI);
    }
    
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
夜夜嗨av一区二区三区网页 | 一区二区在线观看视频 | 99久久er热在这里只有精品15| 日韩国产成人精品| 亚洲免费在线电影| 亚洲免费大片在线观看| 欧美aaaaa成人免费观看视频| 免费人成黄页网站在线一区二区| 91玉足脚交白嫩脚丫在线播放| 92国产精品观看| 26uuu久久天堂性欧美| 日韩欧美不卡一区| 久久综合久久综合亚洲| 亚洲午夜电影在线观看| 天涯成人国产亚洲精品一区av| 青青草原综合久久大伊人精品优势| thepron国产精品| 99久久夜色精品国产网站| 精品国产不卡一区二区三区| 中文字幕av不卡| 亚洲精品美腿丝袜| aaa国产一区| 国产精品久久久久久久久快鸭| 国产精品成人一区二区三区夜夜夜 | 日韩一卡二卡三卡| 国产午夜一区二区三区| 综合久久久久久久| 日本91福利区| 欧美美女一区二区| 精品国产乱码久久久久久免费| 日本中文字幕不卡| 欧美男男青年gay1069videost| 精品奇米国产一区二区三区| 日韩理论在线观看| 91免费精品国自产拍在线不卡| 中文字幕一区二区三区不卡| 日本中文在线一区| 91精品国产一区二区| 中文字幕一区二区三区不卡在线| 成人免费观看av| 日韩午夜激情视频| 九九精品一区二区| 在线亚洲精品福利网址导航| 日韩欧美的一区| 精品一区中文字幕| 中文字幕二三区不卡| 99综合电影在线视频| 亚洲综合清纯丝袜自拍| 国产91富婆露脸刺激对白| 欧美片在线播放| 狂野欧美性猛交blacked| 色妞www精品视频| 欧美色男人天堂| 国产精品久久久久久亚洲毛片 | 成人免费视频免费观看| 日韩理论片网站| 欧美日韩成人综合| 韩国av一区二区三区在线观看| 欧美天堂一区二区三区| 中文字幕在线不卡| 欧美日韩在线不卡| 韩日av一区二区| 最新国产の精品合集bt伙计| 欧美日韩亚洲不卡| 国产美女精品在线| 欧美一级二级三级蜜桃| 国产成人在线观看免费网站| 久久午夜电影网| 色老汉一区二区三区| 九九九精品视频| 亚洲乱码国产乱码精品精的特点 | 色综合天天性综合| 久久美女艺术照精彩视频福利播放| 蜜桃视频在线观看一区| 欧美精品粉嫩高潮一区二区| 国产精品99久久久| 国产人成亚洲第一网站在线播放| 狠狠色综合播放一区二区| 最新成人av在线| 久久综合狠狠综合久久激情| 色一情一伦一子一伦一区| 激情图片小说一区| 亚洲综合在线视频| 中文在线一区二区| 日韩午夜激情免费电影| 色美美综合视频| 国产高清不卡一区| 免费人成网站在线观看欧美高清| 亚洲色图都市小说| 国产欧美一区视频| 欧美一区二区三区电影| 色婷婷久久99综合精品jk白丝| 国产一区二三区好的| 亚洲一区在线看| 国产精品的网站| 国产色产综合色产在线视频| 欧美一级日韩免费不卡| 欧美在线综合视频| 91麻豆蜜桃一区二区三区| 国产福利一区二区三区在线视频| 日韩成人一级大片| 婷婷久久综合九色国产成人| 一区二区三区欧美| 亚洲精品国产精品乱码不99| 国产精品久久久久久久岛一牛影视| 欧美大片在线观看一区二区| 欧美一区二区三区免费在线看| 欧美日韩日日夜夜| 欧美亚洲综合在线| 91精品1区2区| 在线观看精品一区| 一本久道中文字幕精品亚洲嫩| av一区二区三区在线| 99视频在线精品| 91免费国产在线观看| 91视频91自| 欧美天堂亚洲电影院在线播放| 色国产精品一区在线观看| 91美女在线观看| 色婷婷久久综合| 欧美日韩亚洲国产综合| 欧美高清视频www夜色资源网| 欧美日本精品一区二区三区| 在线不卡中文字幕播放| 欧美一区二区三区系列电影| 日韩一级二级三级精品视频| 欧美成人video| 久久久精品tv| 国产精品久久夜| 亚洲最新在线观看| 三级亚洲高清视频| 亚洲男女一区二区三区| 亚洲国产视频直播| 蜜桃av一区二区三区电影| 韩国理伦片一区二区三区在线播放 | 久久精品国产第一区二区三区| 久久精品国产网站| 成人影视亚洲图片在线| 91老师片黄在线观看| 正在播放亚洲一区| 色欧美片视频在线观看| 欧美精品99久久久**| 国产亚洲欧美在线| 一色桃子久久精品亚洲| 天堂影院一区二区| 国产精品综合在线视频| 日本大香伊一区二区三区| 欧美一区二区三区影视| 中文字幕国产一区| 午夜伦欧美伦电影理论片| 国产乱一区二区| 91精品1区2区| 久久久噜噜噜久噜久久综合| 亚洲欧美日韩在线不卡| 免费成人在线视频观看| 99精品久久久久久| 日韩精品在线看片z| 中文字幕一区二| 欧美aⅴ一区二区三区视频| 国产99久久久国产精品潘金| 欧美日韩不卡一区| 亚洲国产高清aⅴ视频| 日韩国产在线观看| 91美女在线观看| 久久奇米777| 午夜欧美一区二区三区在线播放| 国产成人午夜99999| 欧美一区二区三区免费在线看 | 韩国精品在线观看| 欧美午夜影院一区| 日本一区二区视频在线| 日本欧美一区二区三区| 在线精品视频免费播放| 欧美极品另类videosde| 蜜臀久久久久久久| 欧美日韩在线不卡| 亚洲免费在线播放| 波多野结衣91| 日本一区二区三区四区在线视频| 日韩电影免费在线看| 欧美午夜一区二区三区免费大片| 中文字幕精品综合| 国产成人综合亚洲网站| 日韩精品在线网站| 日韩成人一级大片| 欧美日韩一级片网站| 亚洲在线观看免费视频| 91香蕉视频污| 亚洲人妖av一区二区| 99视频有精品| 国产精品成人一区二区三区夜夜夜| 国产一区二区按摩在线观看| 欧美不卡一区二区三区四区| 日韩成人免费在线| 日韩一区二区三区四区| 青青青爽久久午夜综合久久午夜| 4438x成人网最大色成网站| 亚洲综合一区在线| 欧美性极品少妇| 日韩中文字幕不卡|