001    package data.events;
002    
003    import java.util.EventObject;
004    
005    import data.*;
006    
007    /**
008     * An event indicating a change in a Catalog's contents.
009     *
010     * @see ListenableCatalog
011     *
012     * @author Steffen Zschaler
013     * @version 2.0 19/08/1999
014     * @since v2.0
015     */
016    public class CatalogChangeEvent<T extends CatalogItem> extends EventObject {
017    
018        /**
019             * ID for serialization.
020             */
021            private static final long serialVersionUID = 3908959651396115296L;
022    
023            /**
024         * The CatalogItem affected by the change.
025         *
026         * @serial
027         */
028        private T m_ciAffected;
029    
030        /**
031         * The DataBasket that was used to perform the operation.
032         *
033         * @serial
034         */
035        private DataBasket m_dbBasket;
036    
037        /**
038         * Create a new CatalogChangeEvent.
039         *
040         * @param lcSource the Catalog that triggers the event.
041         * @param ciAffected the affected CatalogItem.
042         * @param db the DataBasket that was used to perform the operation.
043         */
044        public CatalogChangeEvent(ListenableCatalog<T> lcSource, T ciAffected, DataBasket db) {
045            super(lcSource);
046    
047            m_ciAffected = ciAffected;
048            m_dbBasket = db;
049        }
050    
051        /**
052         * Get the item that is affected by the change.
053         *
054         * @override Never.
055         */
056        public T getAffectedItem() {
057            return m_ciAffected;
058        }
059    
060        /**
061         * Get the DataBasket that was used to perform the operation.
062         *
063         * @override Never.
064         */
065        public DataBasket getBasket() {
066            return m_dbBasket;
067        }
068    }