mirror of
https://github.com/nasa/trick.git
synced 2025-04-14 06:26:41 +00:00
fix TV bug where you could not convert multiple variables at the same time, also add set units field closes #940
This commit is contained in:
parent
a6dbf0fa33
commit
ea6ff1b233
@ -156,6 +156,9 @@ public class TVApplication extends RunTimeTrickApplication implements VariableLi
|
||||
/** field for manually entering variables */
|
||||
JXTextField manualField;
|
||||
|
||||
/** field for manually entering variables */
|
||||
JXTextField unitField;
|
||||
|
||||
/** check box for toggling Variable Tree visibility */
|
||||
protected JCheckBoxMenuItem variableTreeCheckBox;
|
||||
|
||||
@ -1703,6 +1706,7 @@ public class TVApplication extends RunTimeTrickApplication implements VariableLi
|
||||
});
|
||||
}};
|
||||
|
||||
|
||||
constraints.weightx = 1;
|
||||
add(manualField, constraints);
|
||||
constraints.weightx = 0;
|
||||
@ -1723,8 +1727,37 @@ public class TVApplication extends RunTimeTrickApplication implements VariableLi
|
||||
}
|
||||
}
|
||||
}), constraints);
|
||||
|
||||
constraints = new GridBagConstraints() {{
|
||||
gridy = 1;
|
||||
fill = BOTH;
|
||||
}};
|
||||
|
||||
|
||||
add(new JXLabel(" Set Units: "), constraints);
|
||||
|
||||
unitField = new JXTextField() {{
|
||||
setAction(new AbstractAction() {
|
||||
{
|
||||
putValue(SHORT_DESCRIPTION, "Manually change units for all selected rows");
|
||||
}
|
||||
public void actionPerformed(ActionEvent actionEvent) {
|
||||
try {
|
||||
variableTable.setValueAt(getText(), 0, 2);
|
||||
}
|
||||
catch (IndexOutOfBoundsException indexOutOfBoundsException) {
|
||||
JOptionPane.showMessageDialog(getMainFrame(),
|
||||
"No variables selected", "No variables selected",
|
||||
JOptionPane.ERROR_MESSAGE);
|
||||
}
|
||||
}
|
||||
});
|
||||
}};
|
||||
constraints.weightx = 1;
|
||||
add(unitField, constraints);
|
||||
}};
|
||||
|
||||
|
||||
add(manualPanel, BorderLayout.SOUTH);
|
||||
}}) {{
|
||||
setName("innerSplitPane");
|
||||
|
@ -431,7 +431,6 @@ public class VariableTable extends JXTable {
|
||||
variable + "\" units to \"" + units + "\"");
|
||||
ioException.printStackTrace(System.err);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user