// file: $ISIP_IFC/class/java/ConnectionManager/DemoNetworkEvent.java // version: $Id: DemoNetworkEvent.java 10231 2005-09-13 14:29:38Z stanley $ // import necessary java libraries // import java.awt.*; /** * This class creates a network event by following the architecture of * the awt events. */ public class DemoNetworkEvent extends AWTEvent { //------------------------------------------------------------------------- // // public constants // //------------------------------------------------------------------------- /** * Message type (message received) represented by this event. */ public static final int NETWORK_MESSAGE_RECEIVED = 2000; /** * Message type (disconnected) represented by this event. */ public static final int NETWORK_DISCONNECTED = 3000; //------------------------------------------------------------------------ // // protected data // //----------------------------------------------------------------------- /** * Message represented by this event. */ protected String message_d; //------------------------------------------------------------------------- // // public methods // //------------------------------------------------------------------------- /** * Uses the AWTEvent constructor to create the * event and then sets the message member data to * the parameter message . * * @param source_a the source of the event * @param id_a the ID represents this event * @param message_a the String represents this message */ public DemoNetworkEvent(Object source_a, int id_a, String message_a) { super(source_a, id_a); this.message_d = message_a; } //------------------------------------------------------------------------- // // class-specific public methods: // set methods // //------------------------------------------------------------------------- /** * Set the message represented by this event * * @param message_a a message represented by this event. * * @return a boolean value indicating status. */ public boolean setMessage(String message_a) { message_d = message_a; return true; } //------------------------------------------------------------------------- // // class-specific public methods: // get methods // //------------------------------------------------------------------------- /** * Get the message represented by this event * * @return the string represent the message. */ public String getMessage() { return message_d; } }