}
public String getRMB(String rmb_temp){
if(checkNum(rmb_temp)){
if(rmb_temp.endsWith(".")){
rmb_temp = rmb_temp.substring(0,rmb_temp.length()-1);
}
re_rmb= rmb.RMB(rmb_temp);
}else{
re_rmb="输入错误:"+rmb_temp;
}
return re_rmb;
}
public boolean checkNum(String str){
String numChar="0123456789.";
boolean breakBoolean = false;
for(int i=0;i<str.length();i++){
if(numChar.indexOf(str.substring(i,i+1))<0){
breakBoolean =true;
}
if(breakBoolean) break;
}
if(breakBoolean){
return false;
}else{
if(str.startsWith(".")){
return false;
}else{
return true;
}
}
}
public String[][] getParameterInfo() {
String[][] pinfo =
{
{"RGB_Back", "String", ""},
{"RGB_Fore", "String", ""},
{"WIGTH", "String", ""},
};
return pinfo;
}
private int[] getColor(String rgb){
int[] rgb_return = new int[3];
int index =0,nextIndex=0,len=0;
while((index =rgb.indexOf("|",nextIndex))>-1){
rgb_return[len]=getInt(rgb.substring(nextIndex,index));
nextIndex=index+1;
len++;
}
rgb_return[len]=getInt(rgb.substring(nextIndex));
return rgb_return;
}
private int getInt(String str){
try{
return Integer.parseInt(str);
}catch(Exception e){
return 0;
}
}
}
2.java包,欢迎索取lqhboy@163.com