make clean method public

This commit is contained in:
Fredrik Osterlind 2012-01-26 16:03:01 +01:00
parent 2a86f7a5ad
commit 08ba0b83dc
1 changed files with 15 additions and 13 deletions

View File

@ -620,26 +620,28 @@ public class TimeLine extends VisPlugin {
}; };
private Action clearAction = new AbstractAction("Clear logs") { private Action clearAction = new AbstractAction("Clear logs") {
private static final long serialVersionUID = -4592530582786872403L; private static final long serialVersionUID = -4592530582786872403L;
private void clearLogs() {
for (MoteEvents me : allMoteEvents) {
me.clear();
}
repaint();
}
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
if (simulation.isRunning()) { if (simulation.isRunning()) {
simulation.invokeSimulationThread(new Runnable() { simulation.invokeSimulationThread(new Runnable() {
public void run() { public void run() {
clearLogs(); clear();
} }
}); });
} else { } else {
clearLogs(); clear();
} }
} }
}; };
public void clear() {
for (MoteEvents me : allMoteEvents) {
me.clear();
}
repaint();
}
private class MoteStatistics { private class MoteStatistics {
Mote mote; Mote mote;
long onTimeRedLED = 0, onTimeGreenLED = 0, onTimeBlueLED = 0; long onTimeRedLED = 0, onTimeGreenLED = 0, onTimeBlueLED = 0;