The paint Method
Enumerates through the CounterAlarm Vector
- Paints a green circle if below the threshold; a red one otherwise
-
public void paint(Graphics g) {
Enumeration e = counters.elements();
while (e.hasMoreElements()) {
(CounterAlarm)e.nextElement();
int ctrval = ctrAlarm.ctr.getVal();
if (ctrval >= ctrAlarm.err)
g.fillOval(50+i*30, 30, 20, 20);
g.drawOval(50+i*30, 30, 20, 20);