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

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

?? stopwatch.java

?? 一套j2me的UI界面庫
?? JAVA
字號:
package org.j4me.examples.ui;

import java.util.*;
import javax.microedition.lcdui.*;
import org.j4me.ui.*;
import org.j4me.ui.components.*;

/**
 * The stopwatch can be started and stopped to time an event.
 * When restarted the watch resets back to zero seconds before
 * timing.
 * <p>
 * Demonstrates how to use an empty canvas.  It also demonstrates
 * manually laying out a component (specifically a <code>Label</code>)
 * on a canvas.
 */
public class Stopwatch
	extends DeviceScreen
{
	/**
	 * The screen to return to once this one is canceled.
	 */
	private final DeviceScreen previous;
	
	/**
	 * The system time that the stopwatch started.  If the stopwatch
	 * isn't running, this will be -1.
	 */
	private long startTime = -1;
	
	/**
	 * A label showing how much time has elapsed.  This is painted onto
	 * the center of the canvas while the stopwatch is running.
	 */
	private Label elapsedTime;
	
	/**
	 * A timer to handle stopwatch timing.
	 */
	private Timer timer;
	
	/**
	 * Initializes the screen.
	 * 
	 * @param previous is the screen that this one will return to when
	 *  the user backs out of it.
	 */
	public Stopwatch (DeviceScreen previous)
	{
		this.previous = previous;
		
		setTitle( "Stopwatch" );
		setMenuText( "Back", "Start" );
		
		// Create the label that shows the time.
		elapsedTime = new Label();
		elapsedTime.setLabel( "Press Start to begin" );
		elapsedTime.setHorizontalAlignment( Graphics.HCENTER );
		Font font = Font.getFont( Font.FACE_MONOSPACE, Font.STYLE_BOLD, Font.SIZE_LARGE );
		elapsedTime.setFont( font );
	}

	/**
	 * Called when the user presses the left side button which takes us
	 * back to the previous screen.
	 */
	protected void declineNotify ()
	{
		if ( previous != null )
		{
			previous.show();
		}
	}

	/**
	 * Called when the user presses the right side button which starts
	 * or stops the stopwatch.
	 */
	protected void acceptNotify ()
	{
		if ( startTime < 0 )
		{
			setMenuText( getLeftMenuText(), "Stop" );
			
			// Start the clock.
			startTime = System.currentTimeMillis();
			
			if ( timer != null )
			{
				timer.cancel();
			}
			
			timer = new Timer();
			timer.schedule( new StopwatchTimerTask(), 0, 15 );  // Every 15 milliseconds
		}
		else
		{
			setMenuText( getLeftMenuText(), "Start" );
			
			// Stop the clock.
			startTime = -1;
			
			if ( timer != null )
			{
				timer.cancel();
				timer = null;
			}
		}
		
		repaint();
	}

	/**
	 * Called when any key is pressed.
	 * 
	 * @see org.j4me.ui.DeviceScreen#keyPressed(int)
	 */
	protected void keyPressed (int keyCode)
	{
		// Let the fire key start/stop the timer.
		if ( keyCode == FIRE )
		{
			acceptNotify();
		}
			
		// Forward the event for further processing.
		super.keyPressed( keyCode );
	}

	/**
	 * Implements stopwatch functionality.
	 */
	private final class StopwatchTimerTask
		extends TimerTask
	{
		public void run ()
		{
			synchronized ( Stopwatch.this )
			{
				long duration = System.currentTimeMillis() - startTime;
				long milliseconds = duration % 1000;
				long seconds = duration / 1000;
				long minutes = seconds / 60;
				seconds %= 60;
	
				StringBuffer buffer = new StringBuffer();
				buffer.append( minutes );
				buffer.append( ":" );
				
				if ( seconds < 10 ) buffer.append( "0" );
				buffer.append( seconds );
				buffer.append( "." );
				
				if ( milliseconds < 10 ) buffer.append( "00" );
				else if ( milliseconds < 100 ) buffer.append( "0" );
				buffer.append( milliseconds );
				
				String time = buffer.toString();
				elapsedTime.setLabel( time );
				
				repaint();
			}
		}
	}

	/**
	 * When the canvas becomes visible notify the component it is
	 * going to be displayed.  This lets it initialize any resources
	 * it requires.
	 * 
	 * @see DeviceScreen#showNotify()
	 */
	public void showNotify ()
	{
		// Inform the components they are visible.
		elapsedTime.show( true );
	}

	/**
	 * When the canvas is removed notify the component it is
	 * no longer displayed.  This lets it clean up any resources it
	 * used.
	 * 
	 * @see DeviceScreen#hideNotify()
	 */
	public void hideNotify ()
	{
		// Inform the components they are no longer visible.
		elapsedTime.show( false );
		
		// Stop the timer.
		if ( timer != null )
		{
			timer.cancel();
			timer = null;
		}
	}

	/**
	 * Paints the blank area of the canvas.  This just shows how long
	 * the timer has been running.
	 */
	protected synchronized void paint (Graphics g)
	{
		int width = getWidth();
		int height = getHeight();
		
		// Get the height of the elapsed time label.
		Theme theme = UIManager.getTheme();
		int[] dimensions = elapsedTime.getPreferredSize( theme, width, height );
		int labelHeight = dimensions[1];
		
		// Vertically center the label.
		int labelY = (height - labelHeight) / 2;
			
		// Paint the label.
		elapsedTime.paint( g, theme, this, 0, labelY, width, height, true );
	}
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
麻豆91在线看| 一区二区三区在线不卡| 在线观看国产日韩| 成人精品一区二区三区四区 | caoporn国产一区二区| 国内精品免费**视频| 国产美女娇喘av呻吟久久| 国产综合久久久久影院| 日本视频中文字幕一区二区三区| 婷婷中文字幕一区三区| 亚洲高清免费观看 | 不卡的看片网站| 国产精品亚洲一区二区三区在线 | 秋霞成人午夜伦在线观看| 日韩精品91亚洲二区在线观看 | 高清在线不卡av| 国产.欧美.日韩| 99热99精品| 在线观看成人免费视频| 在线播放一区二区三区| 日韩午夜在线影院| 国产精品另类一区| 亚洲另类在线一区| 免费成人小视频| 国内精品久久久久影院色| 国产精品资源网站| 色噜噜狠狠色综合欧洲selulu| 欧美视频在线一区| 久久久久亚洲综合| 亚洲精品国产无套在线观| 午夜精品爽啪视频| 国产精品一区二区视频| 欧洲人成人精品| 日韩欧美一区二区视频| 亚洲天堂2014| 蜜臀久久99精品久久久久久9| 国产白丝网站精品污在线入口| 一本久久综合亚洲鲁鲁五月天 | 精品久久久久久最新网址| 欧美国产丝袜视频| 午夜久久福利影院| 99久久精品国产毛片| 欧美一区二区三区免费视频| 国产精品久久一级| 美女国产一区二区| 欧美在线观看18| 国产日韩视频一区二区三区| 亚洲一区电影777| 福利一区福利二区| 精品日本一线二线三线不卡| 一区二区三区色| 国产河南妇女毛片精品久久久| 欧美日韩黄色影视| 亚洲欧美中日韩| 国内精品嫩模私拍在线| 欧美日韩国产精品自在自线| 综合自拍亚洲综合图不卡区| 欧美aa在线视频| 欧美精品视频www在线观看| 日韩毛片高清在线播放| 国产精品自拍网站| 欧美一区二区精品在线| 亚洲一级片在线观看| 99精品国产99久久久久久白柏| 日韩精品一区国产麻豆| 亚洲一卡二卡三卡四卡五卡| 成人一区二区三区中文字幕| 久久中文娱乐网| 日韩中文字幕区一区有砖一区| 一本到高清视频免费精品| 国产精品视频在线看| 国产精品亚洲专一区二区三区 | 91麻豆文化传媒在线观看| 久久精品亚洲麻豆av一区二区| 日韩精品电影在线| 欧美高清激情brazzers| 尤物在线观看一区| 日本电影亚洲天堂一区| 亚洲黄色小视频| 在线观看日韩毛片| 亚洲成人www| 6080亚洲精品一区二区| 午夜精品福利一区二区蜜股av| 欧美日韩一区二区在线视频| 亚洲成a天堂v人片| 日韩一卡二卡三卡国产欧美| 日韩电影一二三区| 日韩一区二区高清| 国产成人免费视频网站高清观看视频| 国产亚洲欧美一级| 99vv1com这只有精品| 亚洲一区二区3| 欧美日产在线观看| 国产真实乱子伦精品视频| 国产视频一区在线观看| av日韩在线网站| 亚瑟在线精品视频| 久久影音资源网| 色呦呦网站一区| 图片区小说区国产精品视频| 日韩一卡二卡三卡四卡| 丁香婷婷综合激情五月色| 亚洲精品自拍动漫在线| 欧美精品一二三四| 粉嫩绯色av一区二区在线观看| 亚洲素人一区二区| 日韩欧美中文字幕制服| 成人丝袜高跟foot| 亚洲成av人片在线| 欧美激情中文字幕| 欧美日韩色一区| 国产精品一区一区| 亚洲mv在线观看| 国产亚洲短视频| 欧美三级中文字幕| 国产成+人+日韩+欧美+亚洲| 亚洲图片欧美色图| 国产日产欧美一区| 91精品婷婷国产综合久久性色| 国产盗摄精品一区二区三区在线 | 4hu四虎永久在线影院成人| 国产乱码精品一区二区三| 又紧又大又爽精品一区二区| 精品国产免费一区二区三区四区 | 国产调教视频一区| 3d成人动漫网站| 成+人+亚洲+综合天堂| 久久成人av少妇免费| 一区二区三区在线播放| 久久久国际精品| 久久伊99综合婷婷久久伊| 日本乱人伦aⅴ精品| 高清久久久久久| 国产乱子伦视频一区二区三区 | 激情五月激情综合网| 亚洲图片自拍偷拍| 亚洲色图清纯唯美| 国产三级久久久| wwww国产精品欧美| 日韩精品一区二区三区视频| 欧美精品tushy高清| 欧美视频在线播放| 欧美午夜影院一区| 91美女福利视频| 色综合久久久久综合| 成人小视频在线观看| 国产成人精品亚洲午夜麻豆| 激情综合色综合久久| 蜜臀av性久久久久蜜臀aⅴ四虎| 亚洲成av人片在线观看无码| 亚洲成人综合网站| 亚洲一二三专区| 天天综合网天天综合色| 日日摸夜夜添夜夜添精品视频 | 成人免费电影视频| 丁香六月综合激情| 99久免费精品视频在线观看| 成人中文字幕电影| 99免费精品在线| 91麻豆国产自产在线观看| 91片黄在线观看| 在线观看一区日韩| 欧美一区二区三区在线视频| 日韩欧美国产1| 久久久久高清精品| 国产精品免费视频一区| 国产精品国产三级国产普通话99 | 91小视频免费观看| 一本到不卡精品视频在线观看| 色国产精品一区在线观看| 欧美蜜桃一区二区三区| 日韩写真欧美这视频| 久久综合丝袜日本网| 中文字幕视频一区| 亚洲18女电影在线观看| 免费人成精品欧美精品| 国产一级精品在线| 91色.com| 日韩午夜激情免费电影| 国产三级精品视频| 亚洲福中文字幕伊人影院| 婷婷开心久久网| 国产成人免费在线观看| 一本色道久久综合狠狠躁的推荐| 91精品国产综合久久香蕉麻豆| 精品国产乱码久久久久久久| 国产精品乱码妇女bbbb| 日韩激情一区二区| 成人一级视频在线观看| 99久久精品国产精品久久 | 国内外精品视频| 色综合天天性综合| 日韩一区二区精品在线观看| 国产精品福利一区| 久久99久久精品欧美| 在线日韩国产精品| 欧美激情一区三区| 欧美aa在线视频| 欧美日韩国产成人在线91| 最新欧美精品一区二区三区|