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
* ClustererCustomizer.java
19
* Copyright (C) 2004 University of Waikato, Hamilton, New Zealand
23
package weka.gui.beans;
25
import weka.gui.GenericObjectEditor;
26
import weka.gui.PropertySheetPanel;
28
import java.awt.BorderLayout;
29
import java.beans.Customizer;
30
import java.beans.PropertyChangeListener;
31
import java.beans.PropertyChangeSupport;
33
import javax.swing.JPanel;
36
* GUI customizer for the Clusterer wrapper bean
38
* @author <a href="mailto:mutter@cs.waikato.ac.nz">Stefan Mutter</a>
39
* @version $Revision: 1.5 $
41
public class ClustererCustomizer
43
implements Customizer {
45
/** for serialization */
46
private static final long serialVersionUID = -2035688458149534161L;
49
GenericObjectEditor.registerEditors();
52
private PropertyChangeSupport m_pcSupport =
53
new PropertyChangeSupport(this);
55
private weka.gui.beans.Clusterer m_dsClusterer;
57
private PropertySheetPanel m_ClustererEditor =
58
new PropertySheetPanel();
61
public ClustererCustomizer() {
63
setLayout(new BorderLayout());
64
add(m_ClustererEditor, BorderLayout.CENTER);
70
* Set the Clusterer object to be edited
72
* @param object an <code>Object</code> value
74
public void setObject(Object object) {
75
m_dsClusterer = (weka.gui.beans.Clusterer)object;
76
m_ClustererEditor.setTarget(m_dsClusterer.getClusterer());
81
* Add a property change listener
83
* @param pcl a <code>PropertyChangeListener</code> value
85
public void addPropertyChangeListener(PropertyChangeListener pcl) {
86
m_pcSupport.addPropertyChangeListener(pcl);
90
* Remove a property change listener
92
* @param pcl a <code>PropertyChangeListener</code> value
94
public void removePropertyChangeListener(PropertyChangeListener pcl) {
95
m_pcSupport.removePropertyChangeListener(pcl);