1 |
|
//---PACKAGE DECLARATION--- |
2 |
+ |
uk.ac.ukc.iscream.conient.datacomponents; |
3 |
|
|
4 |
|
//---IMPORTS--- |
4 |
– |
import javax.swing.JPanel; |
5 |
|
|
6 |
|
/** |
7 |
< |
* This is the abstract class for all |
8 |
< |
* data components. |
7 |
> |
* This interface is used by all |
8 |
> |
* components that will be used to display |
9 |
> |
* inbound data. The HostDisplayPanel class |
10 |
> |
* uses it as a generic way to tell a specific |
11 |
> |
* class that holds data to update its data with |
12 |
> |
* a given String value. |
13 |
|
* |
14 |
< |
* This is an abstract class based on a JPanel ensuring |
15 |
< |
* that all components can be handled like a JPanel. It |
16 |
< |
* extends the JPanel by adding a specific setValue function |
13 |
< |
* this tells the component to update its data display however it |
14 |
< |
* sees fit. This value is the string value obtained from an |
15 |
< |
* XML packet, it is up to the component to convert and display |
16 |
< |
* as it chooses, if there is a problem doing this then it |
17 |
< |
* can throw a DataFormatException to indicate the problem. |
14 |
> |
* A related class is the VisibleDataComponent |
15 |
> |
* abstract class, this is specifically for components |
16 |
> |
* that will display data. |
17 |
|
* |
18 |
|
* @author $Author$ |
19 |
|
* @version $Id$ |
20 |
|
*/ |
21 |
< |
abstract class DataComponent extends JPanel { |
21 |
> |
public interface DataComponent { |
22 |
|
|
23 |
|
//---FINAL ATTRIBUTES--- |
24 |
|
|
36 |
|
//---PRIVATE METHODS--- |
37 |
|
|
38 |
|
//---ACCESSOR/MUTATOR METHODS--- |
39 |
< |
|
39 |
> |
|
40 |
|
/** |
41 |
|
* This takes the String value of the parameter that this component |
42 |
|
* is monitoring direct from the packet, it then performs all |
45 |
|
* @param value the value for this data component |
46 |
|
* @throws DataFormatException if there was a problem converting the data for display |
47 |
|
*/ |
48 |
< |
public abstract void setValue(String value) throws DataFormatException; |
48 |
> |
public void setValue(String value) throws DataFormatException; |
49 |
|
|
50 |
|
//---ATTRIBUTES--- |
51 |
|
|