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

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

?? etchasketch.java

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

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

/**
 * Makes the screen into an Etch A Sketch.  Moving the joystick causes
 * lines to be drawn.  The drawing can be erased with the "Shake" button.
 * <p>
 * This class demonstrates how to use a canvas class.  Canvas classes
 * are useful when the entire screen needs to be manually drawn.
 */
public class EtchASketch
	extends DeviceScreen
{
	/**
	 * The screen to return to once the user is done with this one.
	 */
	private final DeviceScreen parent;
	
	/**
	 * The list of points that have been sketched.  It is filled with
	 * <code>int[2]</code> arrays for each point.
	 */
	private Vector points = new Vector();
	
	/**
	 * The current point being drawn.  The first element is the X-coordinate
	 * and the second is the Y-coordinate.
	 */
	private int[] current = new int[2];
	
	/**
	 * Constructs the Etch A Sketch screen.
	 * 
	 * @param parent is the screen to return to when the user
	 *  hits the "Back" menu button.
	 */
	public EtchASketch (DeviceScreen parent)
	{
		this.parent = parent;
		
		// Adds the title bar to the canvas.
		// If title is null there won't be a title bar. 
		setTitle( "Etch A Sketch" );
		
		// Adds the menu options to the canvas.
		// These are invoked by the declineNotify() and
		// acceptNotify() methods respectively.
		setMenuText( "Back", "Shake" );
	}

	/**
	 * Called when this screen is made visible.  It sets the
	 * position of the cursor to the center of the screen.
	 * 
	 * @see DeviceScreen#showNotify()
	 */
	public void showNotify ()
	{
		current[0] = getWidth() / 2;
		current[1] = getHeight() / 2;
	}

	/**
	 * Called when the user presses the left menu button.
	 * This goes back to the previous screen.
	 * 
	 * @see DeviceScreen#declineNotify()
	 */
	protected void declineNotify ()
	{
		parent.show();
	}

	/**
	 * Called when the user presses the right menu button.
	 * This clears the screen.
	 * 
	 * @see DeviceScreen#acceptNotify()
	 */
	protected void acceptNotify ()
	{
		points = new Vector();
		repaint();
	}

	/**
	 * Called when the user presses a key.
	 * 
	 * @see DeviceScreen#keyPressed(int)
	 */
	protected void keyPressed (int key)
	{
		// Move the drawing point.
		move( key );
		
		// Continue processing the key event.
		super.keyPressed( key );
	}

	/**
	 * Called when the user holds down a key.
	 * 
	 * @see Canvas#keyRepeated(int)
	 */
	protected void keyRepeated (int key)
	{
		// Move the drawing point.
		move( key );
		
		// Continue processing the key event.
		super.keyRepeated( key );
	}
	
	/**
	 * Moves the current drawing point if <code>key</code> is a joystick
	 * moving event.
	 * 
	 * @param key is the key code activated by a key event.
	 */
	private void move (int key)
	{
		if ( key == LEFT || key == RIGHT || key == UP || key == DOWN )
		{
			// Record the current point to draw.
			points.addElement( new int[] { current[0], current[1] } );
			
			// Move the point.
			if ( (key == LEFT) && (current[0] > 0) )
			{
				current[0] -= 3;
			}
			else if ( (key == RIGHT) && (current[0] < getWidth() - 1) )
			{
				current[0] += 3;
			}
			else if ( (key == UP) && (current[1] > 0) )
			{
				current[1] -= 3;
			}
			else if ( (key == DOWN) && (current[1] < getScreenHeight() - 1) )
			{
				current[1] += 3;
			}
			
			// Repaint the screen to reflect the drawing.
			repaint();
		}
	}

	/**
	 * Moves the drawing point to where the stylus was pressed.
	 * 
	 * @see org.j4me.ui.DeviceScreen#pointerPressed(int, int)
	 */
	protected void pointerPressed (int x, int y)
	{
		move( x, y );
	}

	/**
	 * Moves the drawing point to where the stylus was dragged.
	 * 
	 * @see org.j4me.ui.DeviceScreen#pointerDragged(int, int)
	 */
	protected void pointerDragged (int x, int y)
	{
		move( x, y );
	}

	/**
	 * Moves the current drawing point for stylus events.
	 * 
	 * @param x is the horizontal position of the pointer.
	 * @param y is the vertical position of the pointer.
	 */
	private void move (int x, int y)
	{
		// Record the new point as the current.
		current[0] = x;
		current[1] = y;
		
		// Add the new point.
		points.addElement( new int[] { x, y } );
		
		// Repaint the screen to reflect the drawing.
		repaint();
	}

	/**
	 * Paints the current Etch A Sketch drawing.
	 * 
	 * @see DeviceScreen#paint(Graphics)
	 */
	protected void paint (Graphics g)
	{
		// Set the color of the line.
		Theme theme = UIManager.getTheme();
		int color = theme.getHighlightColor();
		g.setColor( color );
		
		// Draw lines between all points. 
		int[] lastPoint = null;
		Enumeration e = points.elements();
		
		while ( e.hasMoreElements() )
		{
			int[] newPoint = (int[])e.nextElement();
			
			if ( lastPoint != null )
			{
				g.drawLine( lastPoint[0], lastPoint[1], newPoint[0], newPoint[1] );
			}
			
			lastPoint = newPoint;
		}
	}
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产宾馆实践打屁股91| 日韩欧美精品在线视频| 国产精品久久久久久久浪潮网站| 国产精品一区不卡| 欧美国产日本韩| 成人午夜视频免费看| 中文字幕一区二区三区四区| 91在线高清观看| 亚洲午夜精品网| 日韩精品一区二区三区老鸭窝| 韩国av一区二区三区在线观看| 久久久久久久久久久久久夜| 风间由美一区二区三区在线观看 | av成人老司机| 亚洲免费三区一区二区| 欧美日韩视频不卡| 国产真实乱对白精彩久久| 国产欧美一区二区三区在线老狼| 99re热这里只有精品视频| 亚洲午夜影视影院在线观看| 日韩一二三四区| 国产激情一区二区三区桃花岛亚洲| 国产情人综合久久777777| 日本乱人伦aⅴ精品| 日韩中文欧美在线| 亚洲国产精品v| 欧美精三区欧美精三区| 国产成人一级电影| 亚洲高清一区二区三区| 精品福利一二区| 一本色道久久综合亚洲91| 老司机免费视频一区二区| 中文字幕亚洲精品在线观看 | 欧美色图免费看| 国产麻豆一精品一av一免费 | 日本不卡中文字幕| 国产精品欧美久久久久无广告| 欧美久久久久久久久久| 成人福利电影精品一区二区在线观看 | 国产91丝袜在线播放九色| 亚洲成av人在线观看| 欧美激情一区二区| 日韩午夜三级在线| 色综合中文综合网| 亚洲一本大道在线| 国产肉丝袜一区二区| 7777精品伊人久久久大香线蕉的 | 日韩精品一区二区三区在线 | 日本美女一区二区三区视频| 中文字幕一区二区三区色视频| 91精选在线观看| 色天天综合色天天久久| 国产91丝袜在线观看| 狠狠色综合播放一区二区| 亚洲成在人线在线播放| 亚洲精品视频在线观看网站| 亚洲国产高清不卡| 精品国产一区二区亚洲人成毛片| 欧美日韩亚州综合| 在线观看欧美日本| 91老司机福利 在线| 粉嫩av亚洲一区二区图片| 久久国产精品露脸对白| 青青草国产成人av片免费| 亚洲小说欧美激情另类| 亚洲一区在线观看网站| 亚洲欧美日韩国产一区二区三区 | 亚洲欧美日韩成人高清在线一区| 中文字幕精品一区二区三区精品| 欧美一区二区在线免费观看| 91精品在线观看入口| 欧美日韩国产在线观看| 欧美性猛交一区二区三区精品| 91在线免费播放| 一本到不卡精品视频在线观看| 一本色道a无线码一区v| 91麻豆福利精品推荐| 色丁香久综合在线久综合在线观看| 91亚洲大成网污www| 99精品黄色片免费大全| 91麻豆swag| 欧美午夜精品久久久久久孕妇| 欧美亚洲国产一区二区三区| 欧美系列一区二区| 欧美女孩性生活视频| 欧美一区日本一区韩国一区| 日韩欧美亚洲一区二区| 久久久亚洲精华液精华液精华液| 国产午夜精品久久久久久久 | 国产精品伊人色| 国产不卡在线视频| 色综合天天综合网天天狠天天| 色美美综合视频| 欧美日韩精品专区| 精品日韩在线观看| 中文字幕av资源一区| 依依成人精品视频| 日韩中文欧美在线| 国产精品一区一区| 欧美一区二区三区的| 欧美精品一区二区三| 国产精品欧美一级免费| 亚洲国产日韩精品| 国产在线麻豆精品观看| zzijzzij亚洲日本少妇熟睡| 日本韩国欧美国产| 精品国产91亚洲一区二区三区婷婷| 欧美韩国日本不卡| 亚洲成人av在线电影| 国产福利一区二区三区视频| 在线观看av一区二区| 久久久噜噜噜久久中文字幕色伊伊 | 国产欧美日本一区二区三区| 国产精品久久久久久久久久免费看| 一区二区三区中文字幕在线观看| 蜜臀av一区二区| 91免费版在线| 精品日韩一区二区三区免费视频| 亚洲欧洲三级电影| 蜜臀va亚洲va欧美va天堂| 99re热视频精品| 日韩免费视频一区二区| 亚洲欧美区自拍先锋| 久久99精品久久久久婷婷| 99久久er热在这里只有精品15| 337p亚洲精品色噜噜| 中文字幕av资源一区| 青青青爽久久午夜综合久久午夜| 99久久精品一区二区| 26uuu欧美| 亚洲不卡av一区二区三区| 国产成人午夜精品5599| 555www色欧美视频| 亚洲日本va在线观看| 国产精品伊人色| 日韩欧美国产小视频| 午夜欧美在线一二页| 97se亚洲国产综合自在线| 2022国产精品视频| 日本成人中文字幕| 精品污污网站免费看| 18欧美亚洲精品| 国产999精品久久| 欧美一区二区成人| 亚洲一二三四在线观看| 99热这里都是精品| 欧美极品少妇xxxxⅹ高跟鞋| 蜜臀精品久久久久久蜜臀 | 亚洲黄一区二区三区| 成人深夜福利app| 精品国产91亚洲一区二区三区婷婷| 亚洲香肠在线观看| 色婷婷激情一区二区三区| 一区精品在线播放| 99综合电影在线视频| 欧美激情综合五月色丁香| 九色综合狠狠综合久久| 日韩欧美一区在线| 人人爽香蕉精品| 欧美军同video69gay| 亚洲电影你懂得| 欧美色综合网站| 亚洲gay无套男同| 91精品蜜臀在线一区尤物| 天堂一区二区在线| 欧美精品第一页| 麻豆成人91精品二区三区| 日韩欧美成人激情| 韩国中文字幕2020精品| 欧美电视剧免费观看| 久久激情五月激情| 精品国产污网站| 国产一区二区三区精品视频 | 亚洲人成亚洲人成在线观看图片| 欧美唯美清纯偷拍| 五月婷婷综合在线| 日韩一区二区三区在线观看| 全国精品久久少妇| 26uuu国产电影一区二区| 国内一区二区在线| 国产区在线观看成人精品| 丁香天五香天堂综合| 欧美激情艳妇裸体舞| www.爱久久.com| 亚洲欧洲综合另类| 欧美日产国产精品| 久久av资源网| 国产情人综合久久777777| 99精品在线免费| 亚洲国产裸拍裸体视频在线观看乱了 | 久久女同性恋中文字幕| 成人在线一区二区三区| 亚洲免费在线视频| 制服丝袜亚洲色图| 国产精品一区二区黑丝| 亚洲精品国产一区二区精华液| 欧美伦理影视网| 丰满白嫩尤物一区二区| 亚洲午夜精品久久久久久久久| 日韩三级视频中文字幕|