From 3c7d0329ef2e1d3294c65a7f5a9560a00569bb41 Mon Sep 17 00:00:00 2001 From: fros4943 Date: Mon, 15 Jun 2009 09:47:05 +0000 Subject: [PATCH] minor fixes: integer wrap in repaint method + check watchpoint cast --- tools/cooja/java/se/sics/cooja/plugins/TimeLine.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/cooja/java/se/sics/cooja/plugins/TimeLine.java b/tools/cooja/java/se/sics/cooja/plugins/TimeLine.java index 5a9420072..ff26e31ff 100644 --- a/tools/cooja/java/se/sics/cooja/plugins/TimeLine.java +++ b/tools/cooja/java/se/sics/cooja/plugins/TimeLine.java @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: TimeLine.java,v 1.7 2009/06/11 10:02:53 fros4943 Exp $ + * $Id: TimeLine.java,v 1.8 2009/06/15 09:47:05 fros4943 Exp $ */ package se.sics.cooja.plugins; @@ -992,7 +992,7 @@ public class TimeLine extends VisPlugin { String tooltip = "Mote: " + allMoteEvents.get(mote).mote + "
"; /* Time */ - long time = event.getPoint().x*currentPixelDivisor; + long time = event.getPoint().x*(long)currentPixelDivisor; tooltip += "Time (ms): " + (double)(time/Simulation.MILLISECOND) + "
"; /* Event */ @@ -1383,7 +1383,7 @@ public class TimeLine extends VisPlugin { public void addWatchpoint(WatchpointEvent ev) { /* Automatically toggle colors */ /* TODO Move color decision to watchpoint interface? */ - if (lastWatchpointEvent != null) { + if (lastWatchpointEvent != null && lastWatchpointEvent instanceof WatchpointEvent) { if (((WatchpointEvent)lastWatchpointEvent).color == Color.RED) { ((WatchpointEvent)ev).color = Color.GREEN; } else if (((WatchpointEvent)lastWatchpointEvent).color == Color.GREEN) {