added notification to model when removing events

This commit is contained in:
nifi 2009-07-06 14:04:21 +00:00
parent 091bdb080f
commit e8c11209da

View file

@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * 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; package se.sics.cooja.plugins;
@ -250,16 +250,13 @@ public class LogListener extends VisPlugin {
public void removedLogOutput(final LogOutputEvent ev) { public void removedLogOutput(final LogOutputEvent ev) {
java.awt.EventQueue.invokeLater(new Runnable() { java.awt.EventQueue.invokeLater(new Runnable() {
public void run() { public void run() {
LogData toRemove = null; for (int i = 0, n = logs.size(); i < n; i++) {
for (LogData data: logs) { if (logs.get(i).ev == ev) {
if (data.ev == ev) { logs.remove(i);
toRemove = data; model.fireTableRowsDeleted(i, i);
break; break;
} }
} }
if (toRemove != null) {
logs.remove(toRemove);
}
} }
}); });
} }