final JComboBox delimiters = new JComboBox(DELIMITERS);
delimiters.setSelectedItem(LabelValue.getElement(DELIMITERS, stationData.getLoggingGlbParameter("delim")));
delimiters.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
LabelValue element = (LabelValue) delimiters.getSelectedItem();
if (!element.getValue().equals(stationData.getLoggingGlbParameter("decimalSeparator"))) {
stationData.setLoggingGlbParameter("delim", element.getValue());
} else {
JOptionPane.showMessageDialog(MeasurePanel.this,
"Delimiter and Decimal separator cannot be the same. Please make sure that they are different.",
"Error", JOptionPane.ERROR_MESSAGE);
delimiters.setSelectedItem(LabelValue.getElement(DELIMITERS, stationData.getLoggingGlbParameter("delim")));
}
}
});
label.setLabelFor(delimiters);
logSettings.add(label);
logSettings.add(delimiters);
label = new JLabel("Decimal separator:");
final JComboBox decimals = new JComboBox(DECIMAL);
decimals.setSelectedItem(LabelValue.getElement(DECIMAL, stationData.getLoggingGlbParameter("decimalSeparator")));
label.setLabelFor(decimals);
decimals.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
LabelValue element = (LabelValue) decimals.getSelectedItem();
if (!element.getValue().equals(stationData.getLoggingGlbParameter("delim"))) {
stationData.setLoggingGlbParameter("decimalSeparator", element.getValue());
} else {
JOptionPane.showMessageDialog(MeasurePanel.this,
"Delimiter and Decimal separator cannot be the same. Please make sure that they are different.",
"Error", JOptionPane.ERROR_MESSAGE);
decimals.setSelectedItem(LabelValue.getElement(DECIMAL, stationData.getLoggingGlbParameter("decimalSeparator")));