2
* This program is free software; you can redistribute it and/or modify
3
* it under the terms of the GNU General Public License as published by
4
* the Free Software Foundation; either version 2 of the License, or
5
* (at your option) any later version.
7
* This program is distributed in the hope that it will be useful,
8
* but WITHOUT ANY WARRANTY; without even the implied warranty of
9
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
* GNU General Public License for more details.
12
* You should have received a copy of the GNU General Public License
13
* along with this program; if not, write to the Free Software
14
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18
* HistoryChangedEvent.java
19
* Copyright (C) 2005 University of Waikato, Hamilton, New Zealand
23
package weka.gui.sql.event;
25
import java.util.EventObject;
27
import javax.swing.DefaultListModel;
30
* An event that is generated when a history is modified.
32
* @see HistoryChangedListener
33
* @author FracPete (fracpete at waikato dot ac dot nz)
34
* @version $Revision: 1.2 $
36
public class HistoryChangedEvent
39
/** for serialization */
40
private static final long serialVersionUID = 7476087315774869973L;
42
/** the name of the history */
43
protected String m_HistoryName;
45
/** the history model */
46
protected DefaultListModel m_History;
49
* constructs the event
50
* @param name the name of the history
51
* @param history the model of the history
53
public HistoryChangedEvent( Object source,
55
DefaultListModel history ) {
63
* returns the name of the history
65
public String getHistoryName() {
70
* returns the history model
72
public DefaultListModel getHistory() {
77
* returns the event in a string representation
78
* @return the event in a string representation
80
public String toString() {
83
result = super.toString();
84
result = result.substring(0, result.length() - 1); // remove "]"
85
result += ",name=" + getHistoryName()
86
+ ",history=" + getHistory()