6 |
|
import javax.swing.JTextField; |
7 |
|
import java.awt.GridLayout; |
8 |
|
import javax.swing.SwingUtilities; |
9 |
+ |
import uk.org.iscream.util.XMLPacket; |
10 |
|
|
11 |
|
/** |
12 |
|
* This is the most basic of DataComponents. |
64 |
|
* run this method. |
65 |
|
*/ |
66 |
|
public void run() { |
67 |
< |
_item.setText(_cache); |
67 |
> |
_item.setText(_cache); |
68 |
|
} |
69 |
|
|
70 |
|
/** |
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 |
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; |
139 |
|
protected JLabel _label; |
140 |
|
|
141 |
|
/** |
142 |
< |
* Remebers what the last value was, so we |
142 |
> |
* Remembers what the last value was, so we |
143 |
|
* only update if we have to. |
144 |
|
*/ |
145 |
< |
String _cache = ""; |
145 |
> |
protected String _cache = ""; |
146 |
|
|
147 |
|
/** |
148 |
|
* The length of the JTextField |