?? acksvrmsg.java
字號:
// Decompiled by Jad v1.5.7g. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi
import javax.microedition.lcdui.*;
public class AckSvrMsg
implements CommandListener, HttpPosterListener
{//應答服務器消息;
protected Command cmdGetInfor;
protected Command cmdAdd;
protected Command cmdAgree;
protected Command cmdRefuse;
protected Command cmdBack;
protected Command cmdBackToForm;
protected Command cmdCancel;
private Form form1;
private String sUIN;
private TextBox inputBox;
private Command cmdOkToSend;
private boolean bInited;
public AckSvrMsg()
{
cmdGetInfor = null;
cmdAdd = null;
cmdAgree = null;
cmdRefuse = null;
cmdBack = null;
cmdBackToForm = null;
cmdCancel = null;
form1 = null;
sUIN = null;
bInited = false;
}
public void init()
{
cmdGetInfor = new Command(KQQMIDlet.sysString.sGetInfor, 1, 2);
cmdAdd = new Command(KQQMIDlet.sysString.sAddToFriendList, 1, 2);
cmdAgree = new Command(KQQMIDlet.sysString.sAgree, 1, 1);
cmdRefuse = new Command(KQQMIDlet.sysString.sRefuse, 1, 1);
cmdBack = new Command(KQQMIDlet.sysString.sCancel, 2, 3);
cmdBackToForm = new Command(KQQMIDlet.sysString.sCancel, 2, 3);
cmdCancel = new Command(KQQMIDlet.sysString.sBack, 2, 3);
form1 = new Form(KQQMIDlet.sysString.sSystemMessage);
form1.addCommand(cmdBack);
form1.setCommandListener(this);
}
public void show(int i, String s, String s1)
{
if(!bInited)
{
init();
bInited = true;
}
switch(i)
{
case 1: // '\001'
sUIN = s;
form1.append(KQQMIDlet.sysString.MakeCombineMsg(KQQMIDlet.sysString.sAddUFriend, s));
form1.addCommand(cmdGetInfor);
form1.addCommand(cmdAdd);
KQQMIDlet.display.setCurrent(form1);
break;
case 2: // '\002'
sUIN = s;
form1.append(KQQMIDlet.sysString.GetCombineMsg(15, s) + "\n" + s1);
form1.addCommand(cmdAgree);
form1.addCommand(cmdRefuse);
form1.addCommand(cmdGetInfor);
form1.addCommand(cmdAdd);
KQQMIDlet.display.setCurrent(form1);
break;
case 3: // '\003'
KQQMIDlet.instance.showMessage(KQQMIDlet.sysString.sSystemMessage, KQQMIDlet.sysString.GetCombineMsg(64, s), this, cmdCancel, null);
break;
case 4: // '\004'
KQQMIDlet.instance.showMessage(KQQMIDlet.sysString.sSystemMessage, KQQMIDlet.sysString.GetCombineMsg(105, s) + "\n" + s1, this, cmdCancel, null);
break;
}
}
public void commandAction(Command command, Displayable displayable)
{
if(command == cmdAdd)
{
form1.removeCommand(cmdAdd);
KQQMIDlet.addFriend.show(form1, sUIN);
return;
}
if(command == cmdGetInfor)
{
KQQMIDlet.finger.doGetInfor(sUIN, form1);
return;
}
if(command == cmdAgree)
{
form1.removeCommand(cmdAgree);
form1.removeCommand(cmdRefuse);
KQQMIDlet.httpPoster.ackAddFriend(sUIN, "0", "", this);
return;
}
if(command == cmdRefuse)
{
inputBox = new TextBox(KQQMIDlet.sysString.sAttachMessage, "", 40, 0);
cmdOkToSend = new Command(KQQMIDlet.sysString.sYes, 1, 1);
inputBox.addCommand(cmdOkToSend);
inputBox.addCommand(cmdBackToForm);
inputBox.setCommandListener(this);
KQQMIDlet.display.setCurrent(inputBox);
return;
}
if(command == cmdBack)
{
KQQMIDlet.mainForm.show();
KQQMIDlet.finger.cancelPre(form1);
PkgTools.EmptyForm(form1);
form1.removeCommand(cmdAdd);
form1.removeCommand(cmdAgree);
form1.removeCommand(cmdGetInfor);
form1.removeCommand(cmdRefuse);
return;
}
if(command == cmdBackToForm)
{
KQQMIDlet.display.setCurrent(form1);
return;
}
if(command == cmdCancel)
{
KQQMIDlet.mainForm.show();
return;
}
try
{
if(command == cmdOkToSend)
{
String s = inputBox.getString();
KQQMIDlet.httpPoster.ackAddFriend(sUIN, "1", PkgTools.Encodecgi(s), this);
form1.removeCommand(cmdAgree);
form1.removeCommand(cmdRefuse);
KQQMIDlet.display.setCurrent(form1);
return;
}
}
catch(Exception exception) { }
return;
}
public void receiveHttpResponse(String s)
{
String s1 = PkgTools.GetParaVal("CMD", s).toUpperCase();
String s2 = PkgTools.GetParaVal("RES", s);
if(s1.length() == 0 || s2.equals("3"))
{
KQQMIDlet.instance.showAlert(KQQMIDlet.sysString.sTQQ, KQQMIDlet.sysString.sTimeOut, null);
return;
} else
{
KQQMIDlet.friendList.showInfor(KQQMIDlet.sysString.sSended);
return;
}
}
public void handleHttpError(String s)
{
KQQMIDlet.instance.showAlert(KQQMIDlet.sysString.sTQQ, KQQMIDlet.sysString.sWrong, null);
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -