[cooja] plugins/VariableWatcher: Fixes for value layout

- Fixed layout axis form x to page to show multi-line value fields.
- More flexible width calculation for value fields
This commit is contained in:
Enrico Joerns 2014-08-28 16:32:02 +02:00
parent 57719de18d
commit 171863a8c5

View File

@ -417,7 +417,7 @@ public class VariableWatcher extends VisPlugin implements MotePlugin {
// Variable value(s)
valuePane = new JPanel();
valuePane.setLayout(new BoxLayout(valuePane, BoxLayout.X_AXIS));
valuePane.setLayout(new BoxLayout(valuePane, BoxLayout.PAGE_AXIS));
hf = new ValueFormatter(
(VarTypes) varTypeCombo.getSelectedItem(),
@ -775,7 +775,7 @@ public class VariableWatcher extends VisPlugin implements MotePlugin {
varValues = new JFormattedTextField[elements];
for (int i = 0; i < elements; i++) {
varValues[i] = new JFormattedTextField(defac);
varValues[i].setColumns(6);
varValues[i].setColumns(((VarTypes) varTypeCombo.getSelectedItem()).getBytes() * 2 + 2);
varValues[i].setToolTipText(String.format("0x%04x", address + i * typeSize));
linePane.add(varValues[i]);
/* After 8 Elements, break line */