?? userdata.java
字號(hào):
import java.awt.Color;
import java.util.Date;
import java.util.*;
import javax.swing.plaf.metal.DefaultMetalTheme;
import java.io.Serializable;
/** This class contains information about a single user.An object of this class is
* saved on the disk so that it can be retrieved later.
*/
class UserData implements Serializable{
private Color background=new Color(255,200,164);
private Color lessonColor=new Color(128,0,0);
private Color typingColor=new Color(0,64,0);
private Color errorColor=Color.red;
private DefaultMetalTheme theme=new DefaultTheme();
private int typingFontSize=14;
private String typingStyle="Classic";
private String bMusic="",eSound="";
//---------------------------------------------------------//
private String name;
private int speed;
private int accuracy;
private int level;
private Date registrationDate;
private long typingPeriod;
private long words;
UserData(String name){
this.name=name;
if(registrationDate==null){
registrationDate=Calendar.getInstance().getTime();
}
}
public Color getBackground(){
return background;
}
public void setBackground(Color c){
background=c;
}
public Color getTypingColor(){
return typingColor;
}
public void setTypingColor(Color c){
typingColor=c;
}
public Color getErrorColor(){
return errorColor;
}
public void setErrorColor(Color c){
errorColor=c;
}
public Color getLessonColor(){
return lessonColor;
}
public void setLessonColor(Color c){
lessonColor=c;
}
public DefaultMetalTheme getTheme(){
return theme;
}
public void setTheme(DefaultMetalTheme t){
theme=t;
}
public int getTypingFontSize(){
return typingFontSize;
}
public void setTypingFontSize(int size){
typingFontSize=size;
}
public String getTypingStyle(){
return typingStyle;
}
public void setTypingStyle(String style){
typingStyle=style;
}
public String getBackgroundMusic(){
return bMusic;
}
public void setBackgroundMusic(String bMusic){
this.bMusic=bMusic;
}
public String getErrorSound(){
return eSound;
}
public void setErrorSound(String eSound){
this.eSound=eSound;
}
//-------------------------------------------------------------------//
public String getName(){
return name;
}
public void setName(String n){
name=n;
}
public int getSpeed(){
return speed;
}
public void setSpeed(int s){
speed=s;
}
public int getAccuracy(){
return accuracy;
}
public void setAccuracy(int a){
accuracy=a;
}
public int getLevel(){
return level;
}
public void setLevle(int l){
level=l;
}
public Date getRegistrationDate(){
return registrationDate;
}
public void setRegistrationDate(Date d){
registrationDate=d;
}
public long getTypingPeriod(){
return typingPeriod;
}
public void setTypingPeriod(long p){
typingPeriod=p;
}
public long getWords(){
return words;
}
public void setWords(long w){
words=w;
}
public String toString(){
return getName();
}
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -