public void setValueAt(Object value, Object node, int column) {
if (node instanceof DefaultMutableTreeTableNode) {
DefaultMutableTreeTableNode mutableNode = (DefaultMutableTreeTableNode) node;
if (mutableNode.getUserObject() instanceof Cell) {
Cell cell = (Cell) mutableNode.getUserObject();
Sample sample = cell.getSample();
if (column <= FIXED_COLUMN_NUMBER) {
switch (column) {
case SAMPLE_NAME_INDEX:
sample.setSampleName(value.toString());
break;
case ORDER_INDEX:
String order = value.toString();
sample.initOrderList();
if (!order.equals("")) {
String[] orderTable = order.split(",");
if (orderTable != null) {
sample.initOrderList();
for (int i = 0; i < orderTable.length; i++) {
sample.addOrder(Integer.valueOf(orderTable[i]));
}
}
}
break;
}
} else {
// Whoohoo ColumnName is ActuatorName
// This is not a very strong matching
String actuator = getColumnName(column);
if (value instanceof Double){
Double dblValue = (Double)value;
sample.setPosition(actuator,dblValue);
}
}
}
}
}