mirror of
https://github.com/nasa/trick.git
synced 2025-06-15 05:38:19 +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:
@ -156,6 +156,9 @@ public class TVApplication extends RunTimeTrickApplication implements VariableLi
|
|||||||
/** field for manually entering variables */
|
/** field for manually entering variables */
|
||||||
JXTextField manualField;
|
JXTextField manualField;
|
||||||
|
|
||||||
|
/** field for manually entering variables */
|
||||||
|
JXTextField unitField;
|
||||||
|
|
||||||
/** check box for toggling Variable Tree visibility */
|
/** check box for toggling Variable Tree visibility */
|
||||||
protected JCheckBoxMenuItem variableTreeCheckBox;
|
protected JCheckBoxMenuItem variableTreeCheckBox;
|
||||||
|
|
||||||
@ -1703,6 +1706,7 @@ public class TVApplication extends RunTimeTrickApplication implements VariableLi
|
|||||||
});
|
});
|
||||||
}};
|
}};
|
||||||
|
|
||||||
|
|
||||||
constraints.weightx = 1;
|
constraints.weightx = 1;
|
||||||
add(manualField, constraints);
|
add(manualField, constraints);
|
||||||
constraints.weightx = 0;
|
constraints.weightx = 0;
|
||||||
@ -1723,8 +1727,37 @@ public class TVApplication extends RunTimeTrickApplication implements VariableLi
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}), constraints);
|
}), 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);
|
add(manualPanel, BorderLayout.SOUTH);
|
||||||
}}) {{
|
}}) {{
|
||||||
setName("innerSplitPane");
|
setName("innerSplitPane");
|
||||||
|
@ -431,7 +431,6 @@ public class VariableTable extends JXTable {
|
|||||||
variable + "\" units to \"" + units + "\"");
|
variable + "\" units to \"" + units + "\"");
|
||||||
ioException.printStackTrace(System.err);
|
ioException.printStackTrace(System.err);
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user