001    package users.events;
002    
003    import java.util.EventObject;
004    
005    import users.*;
006    
007    /**
008     * An event indicating changes in a UserManager's list of users.
009     *
010     * @see UserManager
011     * @see User
012     * @see UserDataListener
013     *
014     * @author Steffen Zschaler
015     * @version 2.0 05/05/1999
016     * @since v2.0
017     */
018    public class UserDataEvent extends EventObject {
019    
020        /**
021         * The user affected by the change.
022         *
023         * @serial
024         */
025        private final User m_usrData;
026    
027        /**
028         * Create a new UserDataEvent giving the source and the user that was affected.
029         *
030         * @param source the source of this event, usually a UserManager
031         * @param usrData the user that was affected.
032         */
033        public UserDataEvent(Object source, User usrData) {
034            super(source);
035    
036            m_usrData = usrData;
037        }
038    
039        /**
040         * Get the affected user's name.
041         *
042         * @return the affected user's name.
043         *
044         * @override Never
045         */
046        public String getUserName() {
047            return m_usrData.getName();
048        }
049    
050        /**
051         * Get the affected user.
052         *
053         * @return the affected user.
054         *
055         * @override Never
056         */
057        public User getUser() {
058            return m_usrData;
059        }
060    }