324 /** 325 * edu.ucsd.calit2.TransBorderTool.CompassListener interface method 326 * Called when user is facing a waypoint 327 * Displays waypointAheadAlert pertaining to type of waypoint 328 */ 329 public void witchingEvent(TBCoordinates mc) { 330 aheadCoords = mc; 331 if (display.getCurrent().equals(tbDowsingCompass)) { 332 waypointAheadAlert.setString(tbDowsingCompass.getInfo(mc)); 333 waypointAheadAlert.setImage(aheadCoords.getIcon()); 334 double distance = tbDowsingCompass.distanceTo(mc); 335 if (distance > SEARCH_DISTANCE) { 336 display.vibrate(100); 337 } else if (distance > 1000) { 338 display.vibrate(300); 339 } else if (distance > 500) { 340 display.vibrate(500); 341 } else if (distance > 100) { 342 display.vibrate(800); 343 } 344 display.setCurrent(waypointAheadAlert); 345 display.vibrate(1000); 346 playAudioFile("found.wav", false); 347 } 348 }