1 |
tdb |
1.7 |
/* |
2 |
|
|
* i-scream central monitoring system |
3 |
tdb |
1.8 |
* http://www.i-scream.org.uk |
4 |
tdb |
1.7 |
* Copyright (C) 2000-2002 i-scream |
5 |
|
|
* |
6 |
|
|
* This program is free software; you can redistribute it and/or |
7 |
|
|
* modify it under the terms of the GNU General Public License |
8 |
|
|
* as published by the Free Software Foundation; either version 2 |
9 |
|
|
* of the License, or (at your option) any later version. |
10 |
|
|
* |
11 |
|
|
* This program is distributed in the hope that it will be useful, |
12 |
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 |
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 |
|
|
* GNU General Public License for more details. |
15 |
|
|
* |
16 |
|
|
* You should have received a copy of the GNU General Public License |
17 |
|
|
* along with this program; if not, write to the Free Software |
18 |
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
19 |
|
|
*/ |
20 |
|
|
|
21 |
ajm |
1.1 |
//---PACKAGE DECLARATION--- |
22 |
tdb |
1.6 |
package uk.org.iscream.cms.conient.datacomponents; |
23 |
ajm |
1.1 |
|
24 |
|
|
//---IMPORTS--- |
25 |
|
|
import javax.swing.JPanel; |
26 |
tdb |
1.9 |
import uk.org.iscream.cms.util.XMLPacket; |
27 |
ajm |
1.1 |
|
28 |
|
|
/** |
29 |
|
|
* This is the abstract class for all |
30 |
|
|
* data components that will display data on the screen. |
31 |
ajm |
1.3 |
* <br><br> |
32 |
ajm |
1.1 |
* This is an abstract class based on a JPanel ensuring |
33 |
|
|
* that all components can be handled like a JPanel. It |
34 |
|
|
* extends the JPanel by adding a specific setValue function |
35 |
|
|
* this tells the component to update its data display however it |
36 |
|
|
* sees fit. This value is the string value obtained from an |
37 |
|
|
* XML packet, it is up to the component to convert and display |
38 |
|
|
* as it chooses, if there is a problem doing this then it |
39 |
|
|
* can throw a DataFormatException to indicate the problem. |
40 |
ajm |
1.3 |
* <br><br> |
41 |
|
|
* As all extending components will be data components, it also |
42 |
|
|
* implements the DataComponent interface, which should thus be |
43 |
|
|
* imlemented by all extending compoents. |
44 |
|
|
* <br><br> |
45 |
|
|
* All extending components should implement the run() method of |
46 |
|
|
* this class as it implements the Runnable interface. This run |
47 |
|
|
* method should contain the code to update the actual GUI |
48 |
|
|
* component of this class. In the setValue() method which they |
49 |
|
|
* should also be implementing, the code should add the |
50 |
|
|
* data component to the Swing Event Dispatch queue. eg, |
51 |
|
|
* <br><br> |
52 |
|
|
* SwingUtilities.invokeLater(this); |
53 |
|
|
* |
54 |
ajm |
1.1 |
* |
55 |
tdb |
1.7 |
* @author $Author: tdb $ |
56 |
tdb |
1.9 |
* @version $Id: VisibleDataComponent.java,v 1.8 2002/05/21 16:47:11 tdb Exp $ |
57 |
ajm |
1.1 |
*/ |
58 |
ajm |
1.3 |
public abstract class VisibleDataComponent extends JPanel implements Runnable, DataComponent { |
59 |
ajm |
1.1 |
|
60 |
|
|
//---FINAL ATTRIBUTES--- |
61 |
|
|
|
62 |
|
|
/** |
63 |
|
|
* The current CVS revision of this class |
64 |
|
|
*/ |
65 |
tdb |
1.9 |
public final String REVISION = "$Revision: 1.8 $"; |
66 |
ajm |
1.1 |
|
67 |
|
|
//---STATIC METHODS--- |
68 |
|
|
|
69 |
|
|
//---CONSTRUCTORS--- |
70 |
|
|
|
71 |
|
|
//---PUBLIC METHODS--- |
72 |
|
|
|
73 |
|
|
//---PRIVATE METHODS--- |
74 |
|
|
|
75 |
|
|
//---ACCESSOR/MUTATOR METHODS--- |
76 |
|
|
|
77 |
|
|
//---ATTRIBUTES--- |
78 |
|
|
|
79 |
|
|
//---STATIC ATTRIBUTES--- |
80 |
|
|
|
81 |
ajm |
1.3 |
} |