?? speaking.java
字號:
package chatroom;
import java.util.*;
/**
* Title: JSP聊天室
* Description: Java語言演示程序:JSP聊天室,用于北京師范大學計算機系Java課程教學示范。
* Copyright: Copyright (c) 2002
* Company: 北京師范大學計算中心
* @author 張慶利
* @version 1.0
*/
public class speaking{
String mySpeaking;
String sourceUserId;
String targetUserId;
String sourceUserName;
String targetUserName;
String face;
String color;
String radprivate;
public void setSpeaking(String theSpeaking,String theSourceUserId,String theTargetUserId,String theSourceUserName,String theTargetUserName,String theFace,String theColor,String theRadprivate){
mySpeaking=theSpeaking;
sourceUserId=theSourceUserId;
targetUserId=theTargetUserId;
sourceUserName=theSourceUserName;
targetUserName=theTargetUserName;
face=theFace;
color=theColor;
radprivate=theRadprivate;
}
public String returnSpeaking(String thisUserId){
String thisSpeaking=new String("");
if (radprivate.equals("system")){
if (color.equals("red"))
thisSpeaking="<font size=2 color=red>(公告)"+sourceUserName+"進入聊天室。</font><br>";
else
thisSpeaking="<font size=2 color=green>(公告)"+sourceUserName+"離開聊天室。</font><br>";
}
else{
if ((!radprivate.equals("yes")) || (targetUserId.equals(thisUserId)) || (sourceUserId.equals(thisUserId))){
if (targetUserId.equals("all"))
thisSpeaking="<font size=2 color="+color+">"+sourceUserName+"對大家"+returnFace(face)+"說:"+mySpeaking+"</font><br>";
else
thisSpeaking="<font size=2 color="+color+">"+sourceUserName+"對"+targetUserName+returnFace(face)+"說:"+mySpeaking+"</font><br>";
}
}
return thisSpeaking;
}
public String returnFace(String theFace){
int nn;
nn=Integer.parseInt(theFace);
String thisFace=new String("");
switch (nn){
case 1:thisFace="無";break;
case 2:thisFace="笑";break;
}
return thisFace;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -