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 | * StripChartCustomizer.java |
---|
19 | * Copyright (C) 2002 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 strip chart bean |
---|
36 | * |
---|
37 | * @author <a href="mailto:mhall@cs.waikato.ac.nz">Mark Hall</a> |
---|
38 | * @version $Revision: 1.4 $ |
---|
39 | */ |
---|
40 | public class StripChartCustomizer |
---|
41 | extends JPanel |
---|
42 | implements Customizer { |
---|
43 | |
---|
44 | /** for serialization */ |
---|
45 | private static final long serialVersionUID = 7441741530975984608L; |
---|
46 | |
---|
47 | private PropertyChangeSupport m_pcSupport = |
---|
48 | new PropertyChangeSupport(this); |
---|
49 | |
---|
50 | private PropertySheetPanel m_cvEditor = |
---|
51 | new PropertySheetPanel(); |
---|
52 | |
---|
53 | public StripChartCustomizer() { |
---|
54 | setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 5, 5, 5)); |
---|
55 | |
---|
56 | setLayout(new BorderLayout()); |
---|
57 | add(m_cvEditor, BorderLayout.CENTER); |
---|
58 | add(new javax.swing.JLabel("StripChartCustomizer"), |
---|
59 | BorderLayout.NORTH); |
---|
60 | } |
---|
61 | |
---|
62 | /** |
---|
63 | * Set the StripChart object to be customized |
---|
64 | * |
---|
65 | * @param object a StripChart |
---|
66 | */ |
---|
67 | public void setObject(Object object) { |
---|
68 | m_cvEditor.setTarget((StripChart)object); |
---|
69 | } |
---|
70 | |
---|
71 | /** |
---|
72 | * Add a property change listener |
---|
73 | * |
---|
74 | * @param pcl a <code>PropertyChangeListener</code> value |
---|
75 | */ |
---|
76 | public void addPropertyChangeListener(PropertyChangeListener pcl) { |
---|
77 | m_pcSupport.addPropertyChangeListener(pcl); |
---|
78 | } |
---|
79 | |
---|
80 | /** |
---|
81 | * Remove a property change listener |
---|
82 | * |
---|
83 | * @param pcl a <code>PropertyChangeListener</code> value |
---|
84 | */ |
---|
85 | public void removePropertyChangeListener(PropertyChangeListener pcl) { |
---|
86 | m_pcSupport.removePropertyChangeListener(pcl); |
---|
87 | } |
---|
88 | } |
---|