|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.microedition.midlet.MIDlet
example.photoalbum.PhotoAlbum
public class PhotoAlbum
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 | |
---|---|
PhotoAlbum()
Construct a new PhotoAlbum MIDlet and initialize the base options and main PhotoFrame to be used when the MIDlet is started. |
Method Summary | |
---|---|
(package private) void |
closeOptions()
Close the options store. |
void |
commandAction(javax.microedition.lcdui.Command c,
javax.microedition.lcdui.Displayable s)
Respond to commands. |
protected void |
destroyApp(boolean unconditional)
Destroy must cleanup everything not handled by the garbage collector. |
void |
itemStateChanged(javax.microedition.lcdui.Item item)
Listener for changes to options. |
(package private) void |
openOptions()
Open the store that holds the saved options. |
protected void |
pauseApp()
Pause is used to release the memory used by Image. |
(package private) void |
restoreOptions()
Restore the options from persistent storage. |
void |
run()
The Run method is used to load the images. |
(package private) void |
saveOptions()
Save the options to persistent storage. |
protected void |
startApp()
Start up the Hello MIDlet by setting the PhotoFrame and loading the initial images. |
Methods inherited from class javax.microedition.midlet.MIDlet |
---|
checkPermission, getAppProperty, notifyDestroyed, notifyPaused, platformRequest, resumeRequest |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PhotoAlbum()
Method Detail |
---|
protected void startApp()
startApp
in class javax.microedition.midlet.MIDlet
protected void pauseApp()
pauseApp
in class javax.microedition.midlet.MIDlet
protected void destroyApp(boolean unconditional)
destroyApp
in class javax.microedition.midlet.MIDlet
unconditional
- true if this MIDlet should always cleanuppublic void commandAction(javax.microedition.lcdui.Command c, javax.microedition.lcdui.Displayable s)
commandAction
in interface javax.microedition.lcdui.CommandListener
c
- the command that triggered this callbacks
- the screen that contained the commandpublic void itemStateChanged(javax.microedition.lcdui.Item item)
itemStateChanged
in interface javax.microedition.lcdui.ItemStateListener
item
- - the item whose value has changed.public void run()
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 createImage
run
in interface java.lang.Runnable
void openOptions()
void saveOptions()
void restoreOptions()
void closeOptions()
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |