KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > zirc > msg > MSGPart


1 package zirc.msg ;
2
3 import zirc.base.* ;
4 import zirc.gui.* ;
5
6 //zIrc, irc client.
7
// Copyright (C) 2004 CoolBytes(Stephane claret, Andre Aymon, Alban Zumofen) coolbytes@hotmail.com
8
//
9
// This program is free software; you can redistribute it and/or
10
// modify it under the terms of the GNU General Public License
11
// as published by the Free Software Foundation; either version 2
12
// of the License, or (at your option) any later version.
13
//
14
// This program is distributed in the hope that it will be useful,
15
// but WITHOUT ANY WARRANTY; without even the implied warranty of
16
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
// GNU General Public License for more details.
18

19 /**
20  * <p>Title: MSGpart</p>
21  * <p>Description: </p>
22  * <p>Copyright: Copyright (c) 2004</p>
23  * <p>Company: CoolBytes(Stephane Claret, Andre Aymon, Alban Zumofen) coolbytes@hotmail.com</p>
24  * @version 1.0
25  */

26
27
28 public class MSGPart extends MSGJoin
29 {
30   public MSGPart(IRCconnexion _IRCchan, String JavaDoc _name, String JavaDoc _chan, String JavaDoc _line)
31   {
32     super(_IRCchan, _name, _chan, _line) ;
33     chan = _chan ;
34   }
35
36 //juste rajoute le bleu
37
protected void setColor(StringBuffer JavaDoc _htmlMsg)
38   {
39     _htmlMsg.insert(0, "<font color=" + vectColors[2] + ">") ;
40     _htmlMsg.append("</font>") ;
41   }
42
43 //parser le message
44
public String JavaDoc parseMessagePourAffichage(String JavaDoc _txtAffiche)
45   {
46     return user + " a quitte " + chan ;
47   }
48
49   public void reagit()
50   {
51
52     //si qqn d'autre, chercher la fen concern�e
53
ChatFrame cht = ircChan.GetFenetreDuChan(chan) ;
54     if (cht != null)
55     {
56
57       //le message sera affich� dans la chatframe trouv�e
58
this.frm = cht ;
59
60       //si c'est nous
61
if (ircChan.GetUser_nickName().equalsIgnoreCase(user))
62       {
63         cht.setDepartAnnonce(true) ;
64         cht.destroy() ;
65       }
66       else
67       {
68         cht.removeUserFromChan(user) ;
69       }
70     }
71
72   }
73
74   protected boolean informeUser()
75   {
76     return false ;
77   }
78
79 }
80
Popular Tags