Outline-session 7 (09-April-2009) <ul><li>>> High-Level User Interface: Part I </li></ul><ul><li>-Image and Image Item </l...
Image and ImageItem <ul><li>>>Using imageItem class we can decide how should image display on a form. </li></ul><ul><li>>>...
Image and ImageItem <ul><li>>> Left screenshot:LAYOUT_NEWLINE_BEFORE | LAYOUT_RIGHT | LAYOUT_NEWLINE_AFTER. </li></ul><ul>...
Image Class <ul><li>>>Image on Mobile device come on two flavors: </li></ul><ul><li>>>Immutable Image: </li></ul><ul><li> ...
Image and ImageItem
Image Layout <ul><li>>>Image Layout is decide how should image appear in a mobile device </li></ul><ul><li>>>Layout is don...
ImageItem API
Layout Directives
Logical operation with Directive <ul><li>ImageItem.LAYOUT_RIGHT  00000000 000000 10 </li></ul><ul><li>ImageItem.LAYOUT_CEN...
List <ul><li>>>List are three format. </li></ul><ul><li>>> Multiple , Exclusive, Implicit </li></ul><ul><li>>> Example:Imp...
Event Handling for List <ul><li>>>Exclusive and Multiple List: </li></ul><ul><li>- No event is generated when a user chang...
Choice Group Vs List <ul><li>>>Similarity </li></ul><ul><li>-Both implement the Choice interface. This interface defines a...
Choice Group Vs List <ul><li>>>Difference  </li></ul><ul><li>-Implementation </li></ul><ul><li>-=- ChoiceGroup can have th...
List API
TextBox <ul><li>>>A TextBox is a multi-line text entry screen </li></ul><ul><li>>> we can restrict how many characters you...
TextBox Vs TextField <ul><li>>>Similarity </li></ul><ul><li>--Both share the input constraints as specified in the TextFie...
TextBox Vs TextField <ul><li>>>Difference  </li></ul><ul><li>Implementation: </li></ul><ul><li>-TextField, you can use an ...
TextBox API
Alert and AlertType <ul><li>>>Alert </li></ul><ul><li>- Alert is simple dialog box that will support both Image and Text. ...
Alert and AlertType <ul><li>>>Types of Alert </li></ul><ul><li>There are two type of Alerts. </li></ul><ul><li>1.Modal-The...
Alert and AlertType <ul><li>>>Alert Implementation: </li></ul><ul><li>Alert al; </li></ul><ul><li>al = new Alert(&quot;Err...
Alert API
Alert and AlertType sound support <ul><li>>> In addition to the visual attributes, you can associate a sound with an Alert...
Ticker <ul><li>>> Ticker can be &quot;attached&quot; to any Screen, including an Alert. </li></ul><ul><li>>> same Ticker c...
Upcoming SlideShare
Loading in …5
×

Session7 J2ME High Level User Interface(HLUI) part1-2

1,088 views

Published on

Session7 HLUI Part1-2

Published in: Technology, Education
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,088
On SlideShare
0
From Embeds
0
Number of Embeds
13
Actions
Shares
0
Downloads
36
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Session7 J2ME High Level User Interface(HLUI) part1-2

  1. 1. Outline-session 7 (09-April-2009) <ul><li>>> High-Level User Interface: Part I </li></ul><ul><li>-Image and Image Item </li></ul><ul><li>-List </li></ul><ul><li>-Text </li></ul><ul><li>- Alert and Alert Type </li></ul><ul><li>- Ticker </li></ul>
  2. 2. Image and ImageItem <ul><li>>>Using imageItem class we can decide how should image display on a form. </li></ul><ul><li>>> Centered Horizontally to the left or to the right. </li></ul><ul><li>>> Image Layout. </li></ul><ul><li>>>Left screenshot:LAYOUT_NEWLINE_BEFORE | </li></ul><ul><li>LAYOUT_CENTER | </li></ul><ul><li> LAYOUT_NEWLINE_AFTER </li></ul><ul><li>>>Right screenshot: </li></ul><ul><li>LAYOUT_NEWLINE_BEFORE | </li></ul><ul><li>LAYOUT_LEFT | </li></ul><ul><li>LAYOUT_NEWLINE_AFTER </li></ul>
  3. 3. Image and ImageItem <ul><li>>> Left screenshot:LAYOUT_NEWLINE_BEFORE | LAYOUT_RIGHT | LAYOUT_NEWLINE_AFTER. </li></ul><ul><li>>> Right screenshot: No Directives </li></ul>
  4. 4. Image Class <ul><li>>>Image on Mobile device come on two flavors: </li></ul><ul><li>>>Immutable Image: </li></ul><ul><li> -Image cannot be changed. </li></ul><ul><li>- Immutable image are created from image file , or content stored in the database. </li></ul><ul><li>-It can be placed on the Form, Choice Group, Item,Alert. </li></ul><ul><li>>>Mutable Image: </li></ul><ul><li>-Provides ultimate flexibility. </li></ul><ul><li>- allocating chunck of memory for create or draw image. </li></ul><ul><li>-we can draw Immutable image using paint() method its in Canvas Class. </li></ul>
  5. 5. Image and ImageItem
  6. 6. Image Layout <ul><li>>>Image Layout is decide how should image appear in a mobile device </li></ul><ul><li>>>Layout is done by ImageItem class </li></ul><ul><li>>> Example ImmutableImageFromFile.java </li></ul><ul><li>Choice Group with Image.java </li></ul><ul><li> ReadDisplayFile.java </li></ul>
  7. 7. ImageItem API
  8. 8. Layout Directives
  9. 9. Logical operation with Directive <ul><li>ImageItem.LAYOUT_RIGHT 00000000 000000 10 </li></ul><ul><li>ImageItem.LAYOUT_CENTER 00000000 000000 11 </li></ul><ul><li> ---------------------------- </li></ul><ul><li>logical OR 00000000 000000 11 </li></ul><ul><li>ImageItem.LAYOUT_CENTER 00000000 000000 11 </li></ul><ul><li>ImageItem.LAYOUT_NEWLINE_BEFORE 0000000 1 00000000 </li></ul><ul><li>------------------ </li></ul><ul><li>logical OR 0000000 1 00000011 </li></ul><ul><li>Mask off upper 8 bits 11111111 00000000 </li></ul><ul><li>------------------ </li></ul><ul><li>logical AND 0000000 1 00000000 </li></ul>
  10. 10. List <ul><li>>>List are three format. </li></ul><ul><li>>> Multiple , Exclusive, Implicit </li></ul><ul><li>>> Example:ImplicitList,MultipleChoiceList </li></ul>
  11. 11. Event Handling for List <ul><li>>>Exclusive and Multiple List: </li></ul><ul><li>- No event is generated when a user changes a list element. </li></ul><ul><li>-To determine the status of the various elements, you will need a break in the action(Command). </li></ul><ul><li>- For example, you may have a multiple-selection list on the screen with various application preferences. When a user chooses to &quot;Save,&quot; you could write the preferences to persistent storage. </li></ul><ul><li>>> Implicit List: </li></ul><ul><li>- event is immediately generated </li></ul><ul><li>- exclusive and multiple, the method commandAction() will be called </li></ul>
  12. 12. Choice Group Vs List <ul><li>>>Similarity </li></ul><ul><li>-Both implement the Choice interface. This interface defines a common set of methods : adding, deleting and getting elements, to name just a few. </li></ul><ul><li>- Both can show explicit choices (radio buttons) or multiple choices (check boxes). </li></ul><ul><li>>>Difference </li></ul><ul><li>-Appearance </li></ul><ul><li> *A ChoiceGroup appears as part of a Form. </li></ul><ul><li>* A List occupies the display as a single entity </li></ul>
  13. 13. Choice Group Vs List <ul><li>>>Difference </li></ul><ul><li>-Implementation </li></ul><ul><li>-=- ChoiceGroup can have the following types: </li></ul><ul><li>MULTIPLE: Any number of elements can be selected (Checkbox) </li></ul><ul><li>EXCLUSIVE: One element is selected at any given time (Radio Group) </li></ul><ul><li>-=- List can have the following types: </li></ul><ul><li> MULTIPLE: Any number of elements can be selected (Checkbox) </li></ul><ul><li>EXCLUSIVE: One element is selected at any given time (Radio Group) </li></ul><ul><li>IMPLICIT: Selection of an element generates an event (Menu) </li></ul><ul><li>-=- Event processing for a ChoiceGroup can use either an ItemStateListener to detectchanges, which will result in a call to the method itemStateChanged(). </li></ul><ul><li>-=- With a list you also have the option to use a Command object to initiate an event </li></ul>
  14. 14. List API
  15. 15. TextBox <ul><li>>>A TextBox is a multi-line text entry screen </li></ul><ul><li>>> we can restrict how many characters you would like the TextBox to hold. </li></ul><ul><li>>> SimpleClipBoard.java </li></ul>
  16. 16. TextBox Vs TextField <ul><li>>>Similarity </li></ul><ul><li>--Both share the input constraints as specified in the TextField class. </li></ul><ul><li>-- Both have a maximum capacity that may be different than what can be displayed on the device at any one time. Scrolling will be provided by the implementation as necessary </li></ul><ul><li>>>Difference </li></ul><ul><li>Appearance: </li></ul><ul><li>-A TextField is a subclass of Item, and therefore appears as part of a Form </li></ul><ul><li>-A TextBox is the only component visible </li></ul>
  17. 17. TextBox Vs TextField <ul><li>>>Difference </li></ul><ul><li>Implementation: </li></ul><ul><li>-TextField, you can use an ItemStateListener to detect changes that will result in a call to the method itemStateChanged() </li></ul><ul><li>-TextBox events are handled exclusively through Command objects. </li></ul>
  18. 18. TextBox API
  19. 19. Alert and AlertType <ul><li>>>Alert </li></ul><ul><li>- Alert is simple dialog box that will support both Image and Text. </li></ul><ul><li>-Use of Alert is to show a warning or error message. </li></ul><ul><li>-we can control the three visual attribute title,Image,Text </li></ul><ul><li>>> Limitation </li></ul><ul><li>-Command object is not allowed in the Alert. </li></ul><ul><li>-User interaction is entirely managed by the </li></ul><ul><li>implementation. </li></ul><ul><li>-Can’t add TextField or TextBox. </li></ul>
  20. 20. Alert and AlertType <ul><li>>>Types of Alert </li></ul><ul><li>There are two type of Alerts. </li></ul><ul><li>1.Modal-The Alert is on the display until a user dismisses it. </li></ul><ul><li>2.Timed-The Alert is on the display for the specific no., of MS . </li></ul><ul><li>>> Default alert for Device. </li></ul><ul><li>--getDefaultTimeout()- A return value equivalent to Alert.FOREVER indicates modal </li></ul><ul><li>>> Value Description </li></ul><ul><li>FOREVER Specifies the Alert is visible until acknowledged by the user (also known as modal). </li></ul>
  21. 21. Alert and AlertType <ul><li>>>Alert Implementation: </li></ul><ul><li>Alert al; </li></ul><ul><li>al = new Alert(&quot;Error&quot;, &quot;Error Message &quot;, null, null); </li></ul><ul><li>al.setTimeout(Alert.FOREVER); </li></ul><ul><li>>> two methods in the Display class to show the Alert </li></ul><ul><li>1. display.setCurrent(alTest, fmMain); </li></ul><ul><li>2. display.setCurrent(alTest); </li></ul>
  22. 22. Alert API
  23. 23. Alert and AlertType sound support <ul><li>>> In addition to the visual attributes, you can associate a sound with an Alert </li></ul><ul><li>>> There are five pre-define sound that tide with various condition </li></ul><ul><li>-error, warning, information, confirmation, alarm </li></ul><ul><li>>> Play sound in two way </li></ul><ul><ul><li>al = new Alert(&quot;Alert&quot;, &quot;Message &quot;, null, AlertType.WARNING); </li></ul></ul><ul><ul><li>al = new Alert(&quot;Alert&quot;, &quot;Message &quot;, null, null); </li></ul></ul><ul><ul><li>... </li></ul></ul><ul><ul><li>al.setType(AlertType.WARNING); </li></ul></ul><ul><ul><li>2. AlertType.INFO.playSound(myDisplay); </li></ul></ul><ul><li>>>Example SoundAlert.java </li></ul><ul><li>>>ModalAlert.java </li></ul>
  24. 24. Ticker <ul><li>>> Ticker can be &quot;attached&quot; to any Screen, including an Alert. </li></ul><ul><li>>> same Ticker can be shared among Screens, giving the illusion that the Ticker is attached to the device display </li></ul><ul><li>>> Ticker API </li></ul><ul><li>>>Example :SharedTicker.java </li></ul>

×