1 |
|
//---PACKAGE DECLARATION--- |
2 |
< |
package uk.ac.ukc.iscream.conient.datacomponents; |
2 |
> |
package uk.org.iscream.conient.datacomponents; |
3 |
|
|
4 |
|
//---IMPORTS--- |
5 |
|
import javax.swing.JLabel; |
9 |
|
import javax.swing.JComboBox; |
10 |
|
import java.text.DateFormat; |
11 |
|
import javax.swing.SwingUtilities; |
12 |
+ |
import uk.org.iscream.util.XMLPacket; |
13 |
|
|
14 |
|
/** |
15 |
|
* This component displays the users currently logged |
42 |
|
_label = new JLabel(name + ": "); |
43 |
|
_label.setHorizontalAlignment(JLabel.RIGHT); |
44 |
|
setLayout(new GridLayout(1, 2)); |
45 |
< |
_item.addItem("-uninitialised-"); |
45 |
> |
_item.addItem("-uninitialised-"); |
46 |
|
add(_label); |
47 |
|
add(_item); |
48 |
|
} |
81 |
|
|
82 |
|
//---ACCESSOR/MUTATOR METHODS--- |
83 |
|
|
84 |
< |
/** |
85 |
< |
* This takes the String value of the parameter that this component |
85 |
< |
* is monitoring direct from the packet, it then performs all |
84 |
> |
/** |
85 |
> |
* This takes the packet to obtain the value from, it then performs all |
86 |
|
* approriate conversions and adds this class to the Swing Event |
87 |
|
* Dispatching queue. |
88 |
|
* |
89 |
< |
* @param value the value for this data component |
89 |
> |
* @param packet the XMLPacket to get the data from |
90 |
|
* @throws DataFormatException if there was a problem converting the data for display |
91 |
|
*/ |
92 |
< |
public void setValue(String value) throws DataFormatException { |
92 |
> |
public void setValue(XMLPacket packet) throws DataFormatException { |
93 |
> |
String value = packet.getParam(_attribute); |
94 |
|
try { |
95 |
|
if (!_cache.equals(value)) { |
96 |
|
_cache = value; |