Welcome to Scribd. Sign in or start your free trial to enjoy unlimited e-books, audiobooks & documents.Find out more
Download
Standard view
Full view
of .
Look up keyword
Like this
0Activity
0 of .
Results for:
No results containing your search query
P. 1
step no 3

step no 3

Ratings: (0)|Views: 1|Likes:
Published by Salman Virani

More info:

Published by: Salman Virani on Oct 18, 2012
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as DOCX, PDF, TXT or read online from Scribd
See more
See less

10/18/2012

pdf

text

original

 
Import java.util.Vector;Import javax.microedition.lcdui.*;Class PhotoFrame extends Canvas implements Runnable(Private int style;Private int speed;Private Vector images;Private imt index;Private int imageX;Private int imageY;Private int imagewidth,imageHeight;Private Thread thread;Private Image image;Private Image bimage;Private long paintTime;Private long statsTime;Int frameCount;Int frameRate;PhotoFrame(){Image=Image.createImage(getwidth(),getHeight());setStyle(0);setSpeed(0);}Void setImages(Vector images){This.images=images;If(images.size()>0){Image image=(Image)images.elementAt(0);imageWidth=image.getWidth();imageHeight=image.getheight();}Else{imageWidth=0;inageHeight=0;}Index=0;imageX=(getWidth()-imageWidth)/2;imageY=(getHeight()-imageHeight)/2;genFrame(style,imageX,imageY,imageWidth,imageHeight);}
 
Void next(){If(images==null||++index>=images.size()){Index=0;}}Void previous(){if(images!=null&&--index<0){Index=images.size()-1;}Else{index=0;}}Void reset(){Images=null;Thread=null;}Protected void keyPressed(int keyCode){int action=getGameAction(keyCode);Switch(action){Case RIGHT:If(thread==nu;;){Next();Repaint();}Break;Case LEFT:If (thread==null){Previous();Repaint();}Break;Case FIRE:
 
If(thread==null){thread=new Thread(this);Thread.start();}Else{Synchronized(this){this.notify();}Thread=null;}Break;}}Protected void keyRepeated(int keyCode){keyPressed(keyCode);}Void setSpeed(int speed){keyPressed(keyCode);}voidsetSpeed(int speed){this.speed=speed;statsTime=0;}Int getSpeed(){return speed;}Void setStyle(int style){This.style=style;genFrame(style,imageX,imageY,imageWidth,IMAGEhEIGHT);}Int getStyle(){Return style;}Protected void showNotify(){if(images!=null&&images.size()>1)

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->