1 /* ====================================== 2 * JFreeChart : a free Java chart library 3 * ====================================== 4 * 5 * Project Info: http://www.jfree.org/jfreechart/index.html 6 * Project Lead: David Gilbert (david.gilbert@object-refinery.com); 7 * 8 * (C) Copyright 2000-2003, by Object Refinery Limited and Contributors. 9 * 10 * This library is free software; you can redistribute it and/or modify it under the terms 11 * of the GNU Lesser General Public License as published by the Free Software Foundation; 12 * either version 2.1 of the License, or (at your option) any later version. 13 * 14 * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 15 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 * See the GNU Lesser General Public License for more details. 17 * 18 * You should have received a copy of the GNU Lesser General Public License along with this library; 19 * if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, 20 * MA 02111-1307, USA. 21 * 22 * ----------------------- 23 * DatasetChangeEvent.java 24 * ----------------------- 25 * (C) Copyright 2000-2003, by Object Refinery Limited. 26 * 27 * Original Author: David Gilbert (for Object Refinery Limited); 28 * Contributor(s): -; 29 * 30 * $Id: DatasetChangeEvent.java,v 1.2 2003/06/04 22:58:26 mungady Exp $ 31 * 32 * Changes (from 24-Aug-2001) 33 * -------------------------- 34 * 24-Aug-2001 : Added standard source header. Fixed DOS encoding problem (DG); 35 * 15-Oct-2001 : Move to new package (com.jrefinery.data.*) (DG); 36 * 22-Oct-2001 : Renamed DataSource.java --> Dataset.java etc. (DG); 37 * 11-Jun-2002 : Separated the event source from the dataset to cover the case where the dataset 38 * is changed to null in the Plot class. Updated Javadocs (DG); 39 * 04-Oct-2002 : Fixed errors reported by Checkstyle (DG); 40 * 41 */ 42 43 package org.jfree.data; 44 45 /** 46 * A change event that encapsulates information about a change to a dataset. 47 * 48 * @author David Gilbert 49 */ 50 public class DatasetChangeEvent extends java.util.EventObject { 51 52 /** 53 * The dataset that generated the change event. 54 */ 55 private Dataset data; 56 57 /** 58 * Constructs a new event. 59 * <P> 60 * The source is either the dataset or the Plot class. The dataset can be 61 * null (in this case the source will be the Plot class). 62 * 63 * @param source the source of the event. 64 * @param data the dataset that generated the event. 65 */ 66 public DatasetChangeEvent(Object source, Dataset data) { 67 super(source); 68 this.data = data; 69 } 70 71 /** 72 * Returns the dataset that generated the event. 73 * 74 * @return the dataset. 75 */ 76 public Dataset getDataset() { 77 return data; 78 } 79 80 } 81