Java Doc for PhotoAlbum.java in  » IDE-Netbeans » mobility » example » photoalbum » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » IDE Netbeans » mobility » example.photoalbum 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


example.photoalbum.PhotoAlbum

PhotoAlbum
public class PhotoAlbum extends MIDlet implements CommandListener,ItemStateListener,Runnable(Code)
The PhotoAlbum MIDlet provides the commands and screens that implement a simple photograph and animation album. The images and animations to be displayed are configured in the descriptor file with attributes.

Options are provided to to vary the speed of display and the frame style.




Constructor Summary
public  PhotoAlbum()
     Construct a new PhotoAlbum MIDlet and initialize the base options and main PhotoFrame to be used when the MIDlet is started.

Method Summary
 voidcloseOptions()
     Close the options store.
public  voidcommandAction(Command c, Displayable s)
     Respond to commands.
protected  voiddestroyApp(boolean unconditional)
     Destroy must cleanup everything not handled by the garbage collector.
public  voiditemStateChanged(Item item)
     Listener for changes to options.
 voidopenOptions()
     Open the store that holds the saved options.
protected  voidpauseApp()
     Pause is used to release the memory used by Image.
 voidrestoreOptions()
     Restore the options from persistent storage.
public  voidrun()
     The Run method is used to load the images. A form is used to report the progress of loading images and when the loading is complete they are displayed. Any errors that occur are reported using an Alert. Images previously loaded into the PhotoFrame are discarded before loading.

Load images from resource files using Image.createImage. Images may be in resource files or accessed using http: The first image is loaded to determine whether it is a single image or a sequence of images and to make sure it exists. If the name given is the complete name of the image then it is a singleton. Otherwise it is assumed to be a sequence of images with the name as a prefix.

 voidsaveOptions()
     Save the options to persistent storage.
protected  voidstartApp()
     Start up the Hello MIDlet by setting the PhotoFrame and loading the initial images.


Constructor Detail
PhotoAlbum
public PhotoAlbum()(Code)
Construct a new PhotoAlbum MIDlet and initialize the base options and main PhotoFrame to be used when the MIDlet is started.




Method Detail
closeOptions
void closeOptions()(Code)
Close the options store.



commandAction
public void commandAction(Command c, Displayable s)(Code)
Respond to commands. Commands are added to each screen as they are created. Each screen uses the PhotoAlbum MIDlet as the CommandListener. All commands are handled here:
  • Select on Image List - display the progress form and start the thread to read in the images.
  • Options - display the options form.
  • Ok on the Options form - returns to the PhotoFrame.
  • Back - display the Image List, deactivating the PhotoFrame.
  • Cancel - display the image List and stop the thread loading images.
  • Exit - images are released and notification is given that the MIDlet has exited.

Parameters:
  c - the command that triggered this callback
Parameters:
  s - the screen that contained the command



destroyApp
protected void destroyApp(boolean unconditional)(Code)
Destroy must cleanup everything not handled by the garbage collector. In this case there is nothing to cleanup. Save the options for the next restart.
Parameters:
  unconditional - true if this MIDlet should always cleanup



itemStateChanged
public void itemStateChanged(Item item)(Code)
Listener for changes to options. The new values are set in the PhotoFrame.
Parameters:
  item - - the item whose value has changed.



openOptions
void openOptions()(Code)
Open the store that holds the saved options. If an error occurs, put up an Alert.



pauseApp
protected void pauseApp()(Code)
Pause is used to release the memory used by Image. When restarted the images will be re-created. Save the options for the next restart.



restoreOptions
void restoreOptions()(Code)
Restore the options from persistent storage. The options are read from record 1 and set in the frame and if the optionsForm has been created in the respective ChoiceGroups.



run
public void run()(Code)
The Run method is used to load the images. A form is used to report the progress of loading images and when the loading is complete they are displayed. Any errors that occur are reported using an Alert. Images previously loaded into the PhotoFrame are discarded before loading.

Load images from resource files using Image.createImage. Images may be in resource files or accessed using http: The first image is loaded to determine whether it is a single image or a sequence of images and to make sure it exists. If the name given is the complete name of the image then it is a singleton. Otherwise it is assumed to be a sequence of images with the name as a prefix. Sequence numbers (n) are 0, 1, 2, 3, .... The full resource name is the concatenation of name + n + ".png".

If an OutOfMemoryError occurs the sequence of images is truncated and an alert is used to inform the user. The images loaded are displayed.
See Also:   createImage




saveOptions
void saveOptions()(Code)
Save the options to persistent storage. The options are retrieved ChoiceGroups and stored in Record 1 of the store which is reserved for it. The two options are stored in bytes 0 and 1 of the record.



startApp
protected void startApp()(Code)
Start up the Hello MIDlet by setting the PhotoFrame and loading the initial images.



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.