From 7ac14fae6043922686401733a6ed0543aac7bc26 Mon Sep 17 00:00:00 2001 From: Enrico Joerns Date: Wed, 27 Aug 2014 23:34:21 +0200 Subject: [PATCH] [cooja] plugins/VariableWatcher: Added Tooltip that shows address, added address variable type, fixed columns width layout --- .../java/org/contikios/cooja/plugins/VariableWatcher.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/cooja/java/org/contikios/cooja/plugins/VariableWatcher.java b/tools/cooja/java/org/contikios/cooja/plugins/VariableWatcher.java index a87e2ec37..c485d1bf6 100644 --- a/tools/cooja/java/org/contikios/cooja/plugins/VariableWatcher.java +++ b/tools/cooja/java/org/contikios/cooja/plugins/VariableWatcher.java @@ -34,6 +34,7 @@ package org.contikios.cooja.plugins; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; +import java.awt.FlowLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.ItemEvent; @@ -663,8 +664,7 @@ public class VariableWatcher extends VisPlugin implements MotePlugin { valuePane.removeAll(); - JPanel linePane = new JPanel(); - linePane.setLayout(new BoxLayout(linePane, BoxLayout.X_AXIS)); + JPanel linePane = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0)); DefaultFormatterFactory defac = new DefaultFormatterFactory(hf); long address = moteMemory.getVariableAddress((String) varNameCombo.getSelectedItem()); @@ -677,12 +677,12 @@ public class VariableWatcher extends VisPlugin implements MotePlugin { for (int i = 0; i < elements; i++) { varValues[i] = new JFormattedTextField(defac); varValues[i].setColumns(6); + varValues[i].setToolTipText(String.format("0x%04x", address + i * typeSize)); linePane.add(varValues[i]); /* After 8 Elements, break line */ if ((i + 1) % 8 == 0) { valuePane.add(linePane); - linePane = new JPanel(); - linePane.setLayout(new BoxLayout(linePane, BoxLayout.X_AXIS)); + linePane = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0)); } } valuePane.add(linePane);