~ubuntu-branches/ubuntu/precise/weka/precise

« back to all changes in this revision

Viewing changes to weka/gui/beans/ClustererCustomizer.java

  • Committer: Bazaar Package Importer
  • Author(s): Soeren Sonnenburg
  • Date: 2008-02-24 09:18:45 UTC
  • Revision ID: james.westby@ubuntu.com-20080224091845-1l8zy6fm6xipbzsr
Tags: upstream-3.5.7+tut1
ImportĀ upstreamĀ versionĀ 3.5.7+tut1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
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.
 
6
 *
 
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.
 
11
 *
 
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.
 
15
 */
 
16
 
 
17
/*
 
18
 *    ClustererCustomizer.java
 
19
 *    Copyright (C) 2004 University of Waikato, Hamilton, New Zealand
 
20
 *
 
21
 */
 
22
 
 
23
package weka.gui.beans;
 
24
 
 
25
import weka.gui.GenericObjectEditor;
 
26
import weka.gui.PropertySheetPanel;
 
27
 
 
28
import java.awt.BorderLayout;
 
29
import java.beans.Customizer;
 
30
import java.beans.PropertyChangeListener;
 
31
import java.beans.PropertyChangeSupport;
 
32
 
 
33
import javax.swing.JPanel;
 
34
 
 
35
/**
 
36
 * GUI customizer for the Clusterer wrapper bean
 
37
 *
 
38
 * @author <a href="mailto:mutter@cs.waikato.ac.nz">Stefan Mutter</a>
 
39
 * @version $Revision: 1.5 $
 
40
 */
 
41
public class ClustererCustomizer
 
42
  extends JPanel
 
43
  implements Customizer {
 
44
 
 
45
  /** for serialization */
 
46
  private static final long serialVersionUID = -2035688458149534161L;
 
47
 
 
48
  static {
 
49
     GenericObjectEditor.registerEditors();
 
50
  }
 
51
 
 
52
  private PropertyChangeSupport m_pcSupport = 
 
53
    new PropertyChangeSupport(this);
 
54
  
 
55
  private weka.gui.beans.Clusterer m_dsClusterer;
 
56
  
 
57
  private PropertySheetPanel m_ClustererEditor = 
 
58
    new PropertySheetPanel();
 
59
 
 
60
  
 
61
  public ClustererCustomizer() {
 
62
    
 
63
    setLayout(new BorderLayout());
 
64
    add(m_ClustererEditor, BorderLayout.CENTER);
 
65
  }
 
66
  
 
67
  
 
68
 
 
69
  /**
 
70
   * Set the Clusterer object to be edited
 
71
   *
 
72
   * @param object an <code>Object</code> value
 
73
   */
 
74
  public void setObject(Object object) {
 
75
    m_dsClusterer = (weka.gui.beans.Clusterer)object;
 
76
    m_ClustererEditor.setTarget(m_dsClusterer.getClusterer());
 
77
    
 
78
  }
 
79
 
 
80
  /**
 
81
   * Add a property change listener
 
82
   *
 
83
   * @param pcl a <code>PropertyChangeListener</code> value
 
84
   */
 
85
  public void addPropertyChangeListener(PropertyChangeListener pcl) {
 
86
    m_pcSupport.addPropertyChangeListener(pcl);
 
87
  }
 
88
 
 
89
  /**
 
90
   * Remove a property change listener
 
91
   *
 
92
   * @param pcl a <code>PropertyChangeListener</code> value
 
93
   */
 
94
  public void removePropertyChangeListener(PropertyChangeListener pcl) {
 
95
    m_pcSupport.removePropertyChangeListener(pcl);
 
96
  }
 
97
}