示例#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);
   }
 }