* Refreshes the view.
*/
private synchronized void refresh() {
// This way we can use result without fear that scanResult was changed in the meantime on another thread.
// We could synchronize the methods that can change scanResult too, but that would just be extra overhead.
IScanResult result = scanResult;
if(result != null) {
List<ISensor> sensorsList = result.getSensorsList();
List<IActuator> actuatorsList = result.getActuatorsXList();
Option[] sensorsArray = new Option[sensorsList.size()];
int sensorIndex;
int sensorsNumber = sensorsList.size();
ISensor sensor;