}
public void removedLogOutput(LogOutputEvent ev) {
}
public void newLogOutput(LogOutputEvent ev) {
/* Log output */
Mote mote = ev.getMote();
LogEvent logEvent = new LogEvent(ev);
/* TODO Optimize */
for (MoteEvents moteEvents: allMoteEvents) {
if (moteEvents.mote == mote) {
moteEvents.addLog(logEvent);
break;
}
}
}
});
for (Mote m: simulation.getMotes()) {
addMote(m);
}
/* Update timeline for the duration of the plugin */
repaintTimelineTimer.start();
gui.addMoteHighlightObserver(moteHighlightObserver = new Observer() {
public void update(Observable obs, Object obj) {
if (!(obj instanceof Mote)) {
return;
}
final Timer timer = new Timer(100, null);
final Mote mote = (Mote) obj;
timer.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
/* Count down */
if (timer.getDelay() < 90) {
timer.stop();