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 | * PredictionAppenderCustomizer.java |
---|
19 | * Copyright (C) 2003 University of Waikato, Hamilton, New Zealand |
---|
20 | * |
---|
21 | */ |
---|
22 | |
---|
23 | package weka.gui.beans; |
---|
24 | |
---|
25 | import weka.gui.PropertySheetPanel; |
---|
26 | |
---|
27 | import java.awt.BorderLayout; |
---|
28 | import java.beans.Customizer; |
---|
29 | import java.beans.PropertyChangeListener; |
---|
30 | import java.beans.PropertyChangeSupport; |
---|
31 | |
---|
32 | import javax.swing.JPanel; |
---|
33 | |
---|
34 | /** |
---|
35 | * GUI Customizer for the prediction appender bean |
---|
36 | * |
---|
37 | * @author <a href="mailto:mhall@cs.waikato.ac.nz">Mark Hall</a> |
---|
38 | * @version $Revision: 1.3 $ |
---|
39 | */ |
---|
40 | |
---|
41 | public class PredictionAppenderCustomizer |
---|
42 | extends JPanel |
---|
43 | implements Customizer { |
---|
44 | |
---|
45 | /** for serialization */ |
---|
46 | private static final long serialVersionUID = 6884933202506331888L; |
---|
47 | |
---|
48 | private PropertyChangeSupport m_pcSupport = |
---|
49 | new PropertyChangeSupport(this); |
---|
50 | |
---|
51 | private PropertySheetPanel m_paEditor = |
---|
52 | new PropertySheetPanel(); |
---|
53 | |
---|
54 | public PredictionAppenderCustomizer() { |
---|
55 | setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 5, 5, 5)); |
---|
56 | |
---|
57 | setLayout(new BorderLayout()); |
---|
58 | add(m_paEditor, BorderLayout.CENTER); |
---|
59 | add(new javax.swing.JLabel("PredcitionAppenderCustomizer"), |
---|
60 | BorderLayout.NORTH); |
---|
61 | } |
---|
62 | |
---|
63 | /** |
---|
64 | * Set the object to be edited |
---|
65 | * |
---|
66 | * @param object a PredictionAppender object |
---|
67 | */ |
---|
68 | public void setObject(Object object) { |
---|
69 | m_paEditor.setTarget((PredictionAppender)object); |
---|
70 | } |
---|
71 | |
---|
72 | /** |
---|
73 | * Add a property change listener |
---|
74 | * |
---|
75 | * @param pcl a <code>PropertyChangeListener</code> value |
---|
76 | */ |
---|
77 | public void addPropertyChangeListener(PropertyChangeListener pcl) { |
---|
78 | m_pcSupport.addPropertyChangeListener(pcl); |
---|
79 | } |
---|
80 | |
---|
81 | /** |
---|
82 | * Remove a property change listener |
---|
83 | * |
---|
84 | * @param pcl a <code>PropertyChangeListener</code> value |
---|
85 | */ |
---|
86 | public void removePropertyChangeListener(PropertyChangeListener pcl) { |
---|
87 | m_pcSupport.removePropertyChangeListener(pcl); |
---|
88 | } |
---|
89 | } |
---|