Low Level UI Components Event Handling           Cornelius Koo - 2005
Low Level• 2 Kind of interaction between User and  Canvas :  1. Commands  2. Low Level Events
Commands  Canvas• Canvas is a Displayable object.• It can accept Commands.• It can interact with CommandListener.        ...
Key Codes
Key Code Methodsjavax.microedition.lcdui.Canvas
Key Detection• To do a low level event handling, we must  detect keys and pointers.• This Detection process is implemented...
protected void keyPressed(int  keyCode) {  if (keyCode == KEY_NUM1)  ...  else if (keyCode == KEY_NUM2)  ...}
Game Action• A set of constant to facilitate event  handling for game appication.
Game Action Constants
Example MIDlet : TestGameAction.java
Converter Methods• public int getGameAction(int  keyCode)• public String getKeyName(int  keyCode)• public int getKeyCode(i...
Reference• Core J2ME Technology and MIDP. John  W. Muchow. Prentice Hall PTR, 2002.• Enterprise J2ME: Developing Mobile  J...
13 Low Level UI Event Handling
13 Low Level UI Event Handling
Upcoming SlideShare
Loading in...5
×

13 Low Level UI Event Handling

925

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
925
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
7
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

13 Low Level UI Event Handling

  1. 1. Low Level UI Components Event Handling Cornelius Koo - 2005
  2. 2. Low Level• 2 Kind of interaction between User and Canvas : 1. Commands 2. Low Level Events
  3. 3. Commands  Canvas• Canvas is a Displayable object.• It can accept Commands.• It can interact with CommandListener. Example MIDlet : TestCommandCanvas.java
  4. 4. Key Codes
  5. 5. Key Code Methodsjavax.microedition.lcdui.Canvas
  6. 6. Key Detection• To do a low level event handling, we must detect keys and pointers.• This Detection process is implemented through key code methods overriding.
  7. 7. protected void keyPressed(int keyCode) { if (keyCode == KEY_NUM1) ... else if (keyCode == KEY_NUM2) ...}
  8. 8. Game Action• A set of constant to facilitate event handling for game appication.
  9. 9. Game Action Constants
  10. 10. Example MIDlet : TestGameAction.java
  11. 11. Converter Methods• public int getGameAction(int keyCode)• public String getKeyName(int keyCode)• public int getKeyCode(int gameAction) Example MIDlet : TestLowLevelEvent.java
  12. 12. Reference• Core J2ME Technology and MIDP. John W. Muchow. Prentice Hall PTR, 2002.• Enterprise J2ME: Developing Mobile Java Applications. Michael Juntao Yuan. Prentice Hall PTR, 2003.• J2ME in A Nutshell. Kim Topley. Oreilly, 2002.
  1. Gostou de algum slide específico?

    Recortar slides é uma maneira fácil de colecionar informações para acessar mais tarde.

×