|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.microedition.lcdui.Displayable
javax.microedition.lcdui.Canvas
example.photoalbum.PhotoFrame
class PhotoFrame
This PhotoFrame provides the picture frame and drives the animation of the frames and the picture. It handles the starting and stopping of the Animation and contains the Thread used to do the timing and requests that the Canvas be repainted periodically. It controls the border style and animation speed.
Field Summary | |
---|---|
(package private) int |
frameCount
Number of frames since last frame rate report |
(package private) int |
frameRate
Last reported frame rate (for re-paint) |
Fields inherited from class javax.microedition.lcdui.Canvas |
---|
DOWN, FIRE, GAME_A, GAME_B, GAME_C, GAME_D, KEY_NUM0, KEY_NUM1, KEY_NUM2, KEY_NUM3, KEY_NUM4, KEY_NUM5, KEY_NUM6, KEY_NUM7, KEY_NUM8, KEY_NUM9, KEY_POUND, KEY_STAR, LEFT, RIGHT, UP |
Constructor Summary | |
---|---|
PhotoFrame()
Create a new PhotoFrame. |
Method Summary | |
---|---|
(package private) int |
getSpeed()
Get the speed at which animation occurs. |
(package private) int |
getStyle()
Get the style being used for borders. |
protected void |
hideNotify()
Notified when the Canvas is no longer visible. |
(package private) boolean |
intersectsClip(javax.microedition.lcdui.Graphics g,
int x,
int y,
int w,
int h)
Return true if the specified rectangle does not intersect the clipping rectangle of the graphics object. |
protected void |
keyPressed(int keyCode)
Handle key events. |
protected void |
keyRepeated(int keyCode)
Handle key repeat events as regular key events. |
(package private) void |
next()
Advance to the next image and wrap around if necessary. |
protected void |
paint(javax.microedition.lcdui.Graphics g)
Paint is called whenever the canvas should be redrawn. |
(package private) void |
previous()
Back up to the previous image. |
(package private) void |
reset()
Reset the PhotoFrame so it holds minimal resources. |
void |
run()
Runs the animation and makes the repaint requests. |
(package private) void |
setImages(java.util.Vector images)
Set the array of images to be displayed. |
(package private) void |
setSpeed(int speed)
Set the animation speed. |
(package private) void |
setStyle(int style)
Set the frame style. |
protected void |
showNotify()
Notified when Canvas is made visible. |
Methods inherited from class javax.microedition.lcdui.Canvas |
---|
getGameAction, getKeyCode, getKeyName, hasPointerEvents, hasPointerMotionEvents, hasRepeatEvents, isDoubleBuffered, keyReleased, pointerDragged, pointerPressed, pointerReleased, repaint, repaint, serviceRepaints, setFullScreenMode, sizeChanged |
Methods inherited from class javax.microedition.lcdui.Displayable |
---|
addCommand, getHeight, getTicker, getTitle, getWidth, isShown, removeCommand, setCommandListener, setTicker, setTitle |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
int frameCount
int frameRate
Constructor Detail |
---|
PhotoFrame()
Method Detail |
---|
void setImages(java.util.Vector images)
images
- a vector of images to be displayed.void next()
void previous()
void reset()
protected void keyPressed(int keyCode)
keyPressed
in class javax.microedition.lcdui.Canvas
keyCode
- of the key pressedprotected void keyRepeated(int keyCode)
keyRepeated
in class javax.microedition.lcdui.Canvas
keyCode
- of the key repeatedvoid setSpeed(int speed)
speed
- speedo of animation 0-3;int getSpeed()
setSpeed
void setStyle(int style)
Style:
style
- the style of the border; 0 = none, 1 = simple,
2 = fancy.int getStyle()
protected void showNotify()
showNotify
in class javax.microedition.lcdui.Canvas
protected void hideNotify()
hideNotify
in class javax.microedition.lcdui.Canvas
boolean intersectsClip(javax.microedition.lcdui.Graphics g, int x, int y, int w, int h)
g
- the Graphics context to check.x
- the x value of the upper left corner of the rectangley
- the y value of the upper left corner of the rectanglew
- the width of the rectangleh
- the height of the rectangle
public void run()
run
in interface java.lang.Runnable
protected void paint(javax.microedition.lcdui.Graphics g)
paint
in class javax.microedition.lcdui.Canvas
g
- the Graphics context to which to draw
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |