001 package de.mospace.swing.event;
002
003 /* Mp3dings - manage mp3 meta-information
004 * Copyright (C) 2003 Moritz Ringler
005 * $Id: DataChangeEvent.java 12 2007-07-27 09:48:53Z ringler $
006 *
007 * This program is free software; you can redistribute it and/or
008 * modify it under the terms of the GNU General Public License
009 * as published by the Free Software Foundation; either version 2
010 * of the License, or (at your option) any later version.
011 *
012 * This program is distributed in the hope that it will be useful,
013 * but WITHOUT ANY WARRANTY; without even the implied warranty of
014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
015 * GNU General Public License for more details.
016 *
017 * You should have received a copy of the GNU General Public License
018 * along with this program; if not, write to the Free Software
019 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
020 */
021
022 import java.util.EventObject;
023
024 /**
025 * An event that informs listeners of one or more changes in the data
026 * of the source.
027 * @author Moritz Ringler
028 * @version $Revision: 12 $ ($Date: 2007-07-27 11:48:53 +0200 (Fr, 27 Jul 2007) $)
029 */
030 public class DataChangeEvent extends EventObject{
031 private int numOfChanges = 1;
032
033 /** Creates a new DataChangeEvent for a single change in the data of the
034 * source.
035 * @param source the event source
036 */
037 public DataChangeEvent(Object source){
038 super(source);
039 }
040
041 /** Creates a new DataChangeEvent for one or more changes in the data of the
042 * source.
043 * @param source the event source
044 * @param changeCount the number of changes in the data
045 */
046 public DataChangeEvent(Object source,
047 int changeCount){
048 super(source);
049 numOfChanges = changeCount;
050 }
051
052 /** Returns the change count for this DataChangeEvent.
053 * @return the number of changes in the data
054 */
055 public int getChangeCount(){
056 return numOfChanges;
057 }
058 }