Пример #1
0
 @Override
 public void findAndInit(Object obj) {
   if (nmeaSensor != null) {
     return;
   }
   if (obj instanceof NmeaSensor) {
     NmeaSensor sensor = (NmeaSensor) obj;
     if (sensor.isSensorType(SensorType.GPS)) {
       nmeaSensor = sensor;
       nmeaSensor.addGpsListener(this);
     }
   }
 }
Пример #2
0
 @Override
 public void findAndUndo(Object obj) {
   if (obj == nmeaSensor) {
     nmeaSensor.removeGpsListener(this);
   }
 }