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

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

?? timerpanel.java

?? chess 一個beguanyu國際象棋的一個Java源碼
?? JAVA
字號:
/*  TimerPanel - A component to display a timer.  Copyright (C) 2003 The Java-Chess team <info@java-chess.de>  This program is free software; you can redistribute it and/or  modify it under the terms of the GNU General Public License  as published by the Free Software Foundation; either version 2  of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful,  but WITHOUT ANY WARRANTY; without even the implied warranty of  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the  GNU General Public License for more details.  You should have received a copy of the GNU General Public License  along with this program; if not, write to the Free Software  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.*/package de.java_chess.javaChess.renderer2d;import java.awt.*;import java.awt.event.*;import java.util.*;import javax.swing.*;/** * This class implements the functionality to display a timer */public class TimerPanel extends JPanel implements Runnable {    // Static variables    /**     * The width of the display in pixels.     */    static final int _displayWidth = 70;    /**     * The height if of the display in pixels.     */    static final int _displayHeight = 16;    // Instance variables    /**     * The action listeners.     */    private ArrayList _actionListeners;    /**     * The timer thread.     */    private volatile Thread _timerThread;    /**     * A label to display the time.     */    private JLabel _display;    /**     * The time left in milliseconds.     */    private long _time;    /**     * The remaining time until timeout.     */    long _remainingTime;    /**     * The direction of the counting.     */    private boolean _countdown;    // Constructors    /**     * Create a new timer panel.     *     * @param countdown Flag to indicate, if we count downwards.     */    public TimerPanel( boolean countdown) {	setCountingDirection( countdown);	_actionListeners = new ArrayList();	_display = new JLabel("0:00:00", JLabel.RIGHT);	_display.setPreferredSize( new Dimension( _displayWidth, _displayHeight));        _display.setHorizontalTextPosition(SwingConstants.CENTER);	add( _display);    }    // Methods    /**     * Add a action listener to this timer.     *     * @param listener The action listener to add.     */    public void addActionListener( ActionListener listener) {	_actionListeners.add( listener);    }    /**     * Notify the waiting action listeners.     *     * @param event The action event to send.     */    private void notifyListeners( ActionEvent event) {	// Iterate over all the listeners and send them the event.	for( Iterator iterator = _actionListeners.iterator(); iterator.hasNext(); ) {	    ActionListener listener = (ActionListener)iterator.next();	    listener.actionPerformed( event);	}    }    /**     * Set the length of the countdown in seconds.     *     * @param time The length of the countdown.     */    public void setCountdown( int time) {	_remainingTime = _time = 1000L * (long)time;	display( _time);    }    /**     * Start the timer.     */    public void start() {	if( _time > 0L) {	    if( _timerThread == null) {		_timerThread = new Thread( this);		_timerThread.start();	    }	}    }    /**     * Stop the timer.     */    public void stop() {	// If there is a running thread.	if( _timerThread != null) {	    Thread timerThread = _timerThread;  // Copy it.	    _timerThread = null;                // Signal to stop the thread.	    try {		timerThread.join();             // And wait for the thread to end.	    } catch( InterruptedException ignored) {}	}    }    /**     * The actual thread method.     */    public void run() {	long startTime = System.currentTimeMillis();  // The time when this run started.	long runningTime;                             // The length of this run.	try {	    // While there's still time left and noone stopped the thread.	    do {		Thread.sleep( 100);  // Wait 1/10 of a second.		runningTime = System.currentTimeMillis() - startTime;		display( _remainingTime - runningTime);  // decrease the time by a second and display it.	    } while( ( _remainingTime >= runningTime) && (Thread.currentThread() == _timerThread));	    	    _remainingTime -= runningTime;  // Substract the length of this thinking time.	    // Now notify all the action listeners, that the timer has stopped.	    notifyListeners( new ActionEvent( this, ActionEvent.ACTION_PERFORMED, ( _remainingTime < 0L) ? "timeout" : "interrupted"));	} catch( InterruptedException ignored) {}    }    /**     * Display the current time.     *     * @param time The current time in milliseconds.     */    void display( long time) {	// Don't display negative time.	if( time < 0L) {	    time = 0L;	}	if( ! isCountdown()) {	    time = _time - time;	}	int timeSec = (int)( time / 1000L);  // Display accurate to  1 s.	StringBuffer timeString = new StringBuffer();	int hours = timeSec / 3600;	timeString.append( "" + hours);	int minutes = ( timeSec / 60) % 60;	timeString.append( ( ( minutes < 10) ?  ":0" : ":") + minutes);	int seconds = timeSec % 60;	timeString.append( ( ( seconds < 10) ? ":0" : ":") + seconds);	_display.setText( timeString.toString());	_display.paintImmediately( 0, 0, _displayWidth, _displayHeight);    }    /**     * Check, if this timer counts downwards.     *     * @return true, if the counter counts downwards.     */    private final boolean isCountdown() {	return _countdown;    }        /**     * Set the counting direction.     *     * @param countdown Flag to indicate, if we want a countdown.     */    private final void setCountingDirection( boolean countdown) {	_countdown = countdown;    }    /**     * Get the remaining time in seconds.     *     * @return The remaining time in seconds.     */    public int getRemainingTime() {	return (int)( _time / 1000L);    }    public void alignText()    {      this._display.setHorizontalTextPosition(SwingConstants.CENTER);      this._display.setHorizontalAlignment(SwingConstants.CENTER);    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩视频一区二区三区| 国产欧美va欧美不卡在线| 精品一区二区久久久| 一区二区理论电影在线观看| 日韩欧美中文一区| 欧美这里有精品| 成人一区二区三区视频| 午夜电影一区二区三区| 国产精品国产三级国产普通话蜜臀| 欧美人狂配大交3d怪物一区| 成人黄色在线视频| 久久精品国产网站| 五月天激情小说综合| 亚洲欧洲99久久| 久久久久久久久久久久久女国产乱| 国产欧美久久久精品影院| 欧美日韩精品欧美日韩精品一 | 亚洲成人免费影院| 日本一区二区三区四区| 精品国产凹凸成av人网站| 欧洲av一区二区嗯嗯嗯啊| 99精品在线免费| 国产99久久久精品| 国产在线精品一区在线观看麻豆| 日韩精品国产精品| 亚洲欧美一区二区三区久本道91 | av在线不卡电影| 国产一区二区三区在线观看精品| 日韩国产高清影视| 亚洲国产精品久久不卡毛片| 亚洲手机成人高清视频| 国产精品美女久久久久高潮| 国产欧美一区二区三区鸳鸯浴| www国产成人| 久久久一区二区三区| 久久这里只有精品6| 精品区一区二区| 久久综合九色综合欧美亚洲| 精品成人a区在线观看| 日韩免费高清电影| 日韩美女视频在线| 精品国产乱码久久| 2021中文字幕一区亚洲| 久久精品人人爽人人爽| 国产亲近乱来精品视频| 日本午夜一本久久久综合| 亚洲国产成人91porn| 亚洲福利国产精品| 日韩制服丝袜av| 日韩av一二三| 国产一区二区h| 国产91综合网| 97久久超碰精品国产| 欧美午夜电影在线播放| 欧美三级日韩三级| 日韩精品中文字幕一区二区三区| 欧美成人精品二区三区99精品| 久久这里只有精品6| 日本一区二区成人在线| 自拍偷自拍亚洲精品播放| 一区二区欧美精品| 蜜臂av日日欢夜夜爽一区| 国产精品一区免费在线观看| 波多野结衣一区二区三区| 在线观看国产精品网站| 7777精品伊人久久久大香线蕉经典版下载 | 成人激情小说网站| 91久久精品日日躁夜夜躁欧美| 欧美日韩精品欧美日韩精品一| 日韩精品一区二区在线观看| 欧美国产一区视频在线观看| 亚洲精品欧美在线| 麻豆91免费看| 成人免费视频免费观看| 欧美亚洲国产一区二区三区va| 9191久久久久久久久久久| 久久精品亚洲乱码伦伦中文| 亚洲精品免费在线| 精品一区二区三区香蕉蜜桃| 91在线丨porny丨国产| 91精品国产欧美一区二区18| 日本一区二区动态图| 爽好久久久欧美精品| 国产福利91精品| 欧美日韩亚州综合| 国产三级欧美三级| 亚洲大型综合色站| 成人av资源站| 日韩视频一区在线观看| 亚洲精品老司机| 国产一区二区三区免费| 欧美日韩视频不卡| 国产精品青草综合久久久久99| 亚洲444eee在线观看| 国产成人精品亚洲777人妖| 777亚洲妇女| 亚洲免费在线电影| 国产精品91一区二区| 91精品国产一区二区三区香蕉 | 亚洲图片欧美视频| 国产精品一二三区在线| 欧美精品18+| 亚洲视频在线一区| 国产成人夜色高潮福利影视| 欧美伦理电影网| 亚洲人精品一区| 国产精品18久久久久| 这里只有精品99re| 亚洲一区视频在线| 99精品黄色片免费大全| 久久综合成人精品亚洲另类欧美 | 亚洲色大成网站www久久九九| 美腿丝袜亚洲色图| 欧美日韩亚洲综合一区| 亚洲激情自拍视频| 成人av动漫在线| 国产欧美一区二区三区在线老狼 | 久久电影国产免费久久电影| 在线观看亚洲一区| 亚洲色图19p| 丁香桃色午夜亚洲一区二区三区| 日韩美女视频在线| 蓝色福利精品导航| 日韩一级免费观看| 日本三级亚洲精品| 91精品久久久久久久99蜜桃 | 亚洲欧美日韩国产一区二区三区 | 欧美一区二区三区公司| 亚洲成人自拍偷拍| 欧美四级电影网| 亚洲自拍另类综合| 日本道色综合久久| 亚洲精品国产一区二区精华液| a级高清视频欧美日韩| 国产精品不卡在线| 91网站在线播放| 一区二区视频在线看| 91美女精品福利| 亚洲一二三专区| 欧美亚洲自拍偷拍| 亚洲一区二区免费视频| 欧美亚洲禁片免费| 日韩电影在线免费观看| 欧美成人乱码一区二区三区| 精品无人区卡一卡二卡三乱码免费卡| 欧美成人精品二区三区99精品| 极品少妇一区二区| 国产婷婷色一区二区三区在线| 懂色av噜噜一区二区三区av| 国产精品久久久久久久午夜片 | 欧美色视频在线| 同产精品九九九| 日韩三区在线观看| 国产综合一区二区| 国产精品日日摸夜夜摸av| 一本一道久久a久久精品| 亚洲成人av一区二区| 日韩一区二区高清| 成人免费毛片app| 亚洲专区一二三| 欧美日韩成人综合| 国产在线精品一区二区夜色 | 国产成人久久精品77777最新版本| 中文乱码免费一区二区| 色婷婷亚洲综合| 奇米色一区二区三区四区| 久久精品一区四区| 91久久线看在观草草青青| 日韩中文欧美在线| 国产精品蜜臀av| 6080国产精品一区二区| 国产精品自拍在线| 亚洲地区一二三色| 国产色产综合色产在线视频| 日本韩国一区二区| 国产精品一级二级三级| 亚洲高清免费观看| 久久久www成人免费毛片麻豆| 97se狠狠狠综合亚洲狠狠| 日本欧美肥老太交大片| 国产精品素人视频| 制服丝袜亚洲精品中文字幕| 国产精品1区2区| 丝袜诱惑亚洲看片| 国产精品视频麻豆| 欧美一级日韩一级| 91视视频在线观看入口直接观看www| 日韩高清国产一区在线| 亚洲欧美在线高清| 精品福利一二区| 欧美日韩成人一区| heyzo一本久久综合| 蜜桃精品视频在线| 亚洲综合一区二区| 国产精品美女久久福利网站| 欧美一区二区视频在线观看2020| 99久久国产综合精品色伊 | 国产91富婆露脸刺激对白 | 色综合天天综合网天天狠天天| 免费在线视频一区|