[cooja] plugins/VariableWatcher: Added Tooltip that shows address, added address variable type, fixed columns width layout
This commit is contained in:
parent
d1e0311184
commit
7ac14fae60
|
@ -34,6 +34,7 @@ package org.contikios.cooja.plugins;
|
||||||
import java.awt.BorderLayout;
|
import java.awt.BorderLayout;
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
import java.awt.Dimension;
|
import java.awt.Dimension;
|
||||||
|
import java.awt.FlowLayout;
|
||||||
import java.awt.event.ActionEvent;
|
import java.awt.event.ActionEvent;
|
||||||
import java.awt.event.ActionListener;
|
import java.awt.event.ActionListener;
|
||||||
import java.awt.event.ItemEvent;
|
import java.awt.event.ItemEvent;
|
||||||
|
@ -663,8 +664,7 @@ public class VariableWatcher extends VisPlugin implements MotePlugin {
|
||||||
|
|
||||||
valuePane.removeAll();
|
valuePane.removeAll();
|
||||||
|
|
||||||
JPanel linePane = new JPanel();
|
JPanel linePane = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0));
|
||||||
linePane.setLayout(new BoxLayout(linePane, BoxLayout.X_AXIS));
|
|
||||||
|
|
||||||
DefaultFormatterFactory defac = new DefaultFormatterFactory(hf);
|
DefaultFormatterFactory defac = new DefaultFormatterFactory(hf);
|
||||||
long address = moteMemory.getVariableAddress((String) varNameCombo.getSelectedItem());
|
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++) {
|
for (int i = 0; i < elements; i++) {
|
||||||
varValues[i] = new JFormattedTextField(defac);
|
varValues[i] = new JFormattedTextField(defac);
|
||||||
varValues[i].setColumns(6);
|
varValues[i].setColumns(6);
|
||||||
|
varValues[i].setToolTipText(String.format("0x%04x", address + i * typeSize));
|
||||||
linePane.add(varValues[i]);
|
linePane.add(varValues[i]);
|
||||||
/* After 8 Elements, break line */
|
/* After 8 Elements, break line */
|
||||||
if ((i + 1) % 8 == 0) {
|
if ((i + 1) % 8 == 0) {
|
||||||
valuePane.add(linePane);
|
valuePane.add(linePane);
|
||||||
linePane = new JPanel();
|
linePane = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0));
|
||||||
linePane.setLayout(new BoxLayout(linePane, BoxLayout.X_AXIS));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
valuePane.add(linePane);
|
valuePane.add(linePane);
|
||||||
|
|
Loading…
Reference in a new issue