From e8c11209da080ace1048a04d4e6b8f49cb0bdb74 Mon Sep 17 00:00:00 2001 From: nifi Date: Mon, 6 Jul 2009 14:04:21 +0000 Subject: [PATCH] added notification to model when removing events --- .../java/se/sics/cooja/plugins/LogListener.java | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/tools/cooja/java/se/sics/cooja/plugins/LogListener.java b/tools/cooja/java/se/sics/cooja/plugins/LogListener.java index d97a7f95c..6a5660c39 100644 --- a/tools/cooja/java/se/sics/cooja/plugins/LogListener.java +++ b/tools/cooja/java/se/sics/cooja/plugins/LogListener.java @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: LogListener.java,v 1.18 2009/07/03 13:37:41 fros4943 Exp $ + * $Id: LogListener.java,v 1.19 2009/07/06 14:04:21 nifi Exp $ */ package se.sics.cooja.plugins; @@ -250,16 +250,13 @@ public class LogListener extends VisPlugin { public void removedLogOutput(final LogOutputEvent ev) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { - LogData toRemove = null; - for (LogData data: logs) { - if (data.ev == ev) { - toRemove = data; + for (int i = 0, n = logs.size(); i < n; i++) { + if (logs.get(i).ev == ev) { + logs.remove(i); + model.fireTableRowsDeleted(i, i); break; } } - if (toRemove != null) { - logs.remove(toRemove); - } } }); }