if (referenceAxis.equals(DiplayManagerTableModel.AXIS_2D)) {
final DeviceAttribute deviceAttribute = proxy.read_attribute(SENSORS_DATA_LIST);
final String[] sensorList = deviceAttribute.extractStringArray();
AttributeInfo info;
for (final String element : sensorList) {
info = proxy.get_attribute_info(element);
final Vector<String> row = new Vector<String>();
row.add(info.label);
rows.add(row);
if (info.equals(sensorName)) {
dataModelMap.put(element, new DataModel(element, info.label, "Z"));
defaultValue = false;
} else {
dataModelMap.put(element, new DataModel(element, info.label, ""));
}
}
// set the first sensor by default
if (defaultValue) {
info = proxy.get_attribute_info(sensorList[0]);
dataModelMap.put(sensorList[0], new DataModel(sensorList[0], info.label, "Z"));
sensorName = info.label;
}
final Vector<String> columnText = new Vector<String>();
columnText.add("Attribute name");
columnText.add("2D");
tableModel.setDataVector(rows, columnText);
if (mainTable.getColumnModel().getColumnCount() > 0) {
mainTable.getColumnModel().getColumn(0).setCellRenderer(new TableColumnRenderer());
final JComboBox combo = new JComboBox(new String[] { "", referenceAxis });
final ComboBoxEditor comboBoxCell = new ComboBoxEditor(combo);
if (mainTable.getColumnModel().getColumnCount() > 1) {
mainTable.getColumnModel().getColumn(1).setCellEditor(comboBoxCell);
}
}
} else {// 1D
// add TimeStamps
final Vector<String> rowTimestamps = new Vector<String>();
rowTimestamps.add(SENSORS_TIMESTAMPS);
rows.add(rowTimestamps);
dataModelMap.put(SENSORS_TIMESTAMPS, new DataModel(SENSORS_TIMESTAMPS, SENSORS_TIMESTAMPS, ""));
// add actuator
DeviceAttribute deviceAttribute = proxy.read_attribute(ACTUATORS_DATA_LIST);
final String[] actuatorList = deviceAttribute.extractStringArray();
AttributeInfo info;
for (final String element : actuatorList) {
info = proxy.get_attribute_info(element);
final Vector<String> row = new Vector<String>();
row.add(info.label);
rows.add(row);
if (info.equals(actuatorName)) {
dataModelMap.put(element, new DataModel(element, info.label, "X"));
defaultValue = false;
} else {
dataModelMap.put(element, new DataModel(element, info.label, ""));
}