Source code: org/relayirc/chatengine/ChatEngineEvent.java
1
2 /*
3 * FILE: ChatEngineEvent.java
4 *
5 * The contents of this file are subject to the Mozilla Public License
6 * Version 1.0 (the "License"); you may not use this file except in
7 * compliance with the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
9 *
10 * Software distributed under the License is distributed on an "AS IS"
11 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
12 * License for the specific language governing rights and limitations
13 * under the License.
14 *
15 * The Original Code is Relay IRC chat client.
16 *
17 * The Initial Developer of the Original Code is David M. Johnson.
18 * Portions created by David M. Johnson are Copyright (C) 1998.
19 * All Rights Reserved.
20 *
21 * Contributor(s): No contributors to this file.
22 */
23 package org.relayirc.chatengine;
24 import org.relayirc.util.*;
25
26 import java.util.EventObject;
27
28 ///////////////////////////////////////////////////////////////////////
29 /**
30 * Event fired by a ChatEngine. Has either a Channel object, a Server
31 * object, a string status message or no value; other fields will be null.
32 * @author David M. Johnson.
33 */
34 public class ChatEngineEvent extends EventObject {
35
36 private Channel _channel = null;
37 private Server _server = null;
38 private String _message = null;
39
40 //------------------------------------------------------------------
41 /** Event with no associated value. */
42 public ChatEngineEvent(ChatEngine src) {
43 super(src);
44 }
45 //------------------------------------------------------------------
46 /** Event associated with a channel. */
47 public ChatEngineEvent(ChatEngine src, Channel channel) {
48 super(src);
49 _channel = channel;
50 }
51 //------------------------------------------------------------------
52 /** Event associated with server. */
53 public ChatEngineEvent(ChatEngine src, Server server) {
54 super(src);
55 _server = server;
56 }
57 //------------------------------------------------------------------
58 /**
59 * Event associated with status message. ChatEngine sends out
60 * status messages as events.
61 */
62 public ChatEngineEvent(ChatEngine src, String message) {
63 super(src);
64 _message = message;
65 }
66 //------------------------------------------------------------------
67
68 /** Get associated Channel object, or null if not applicable. */
69 public Channel getChannel() {return _channel;}
70
71 /** Get associated Server object, or null if not applicable. */
72 public Server getServer() {return _server;}
73
74 /** Get associated message, or null if not applicable. */
75 public String getMessage() {return _message;}
76 }
77