public void mouseMoved(MouseEvent e){
  mouseSupport.fireMapMouseMoved(e);
  if (e.getSource() instanceof MapBean) {
    if (drawDistanceObjects && theMap != null) {
      double lat1, lat2, long1, long2;
      rPoint2=theMap.getCoordinates(e);
      theMap.repaint();
      if (infoDelegator != null) {
        Debug.message("mousemodedetail","DistanceMouseMode: firing mouse location");
        lat1=rPoint1.getY();
        long1=rPoint1.getX();
        lat2=rPoint2.getY();
        long2=rPoint2.getX();
        distance=GreatCircle.sphericalDistance(ProjMath.degToRad(lat1),ProjMath.degToRad(long1),ProjMath.degToRad(lat2),ProjMath.degToRad(long2));
        double azimuth=getSphericalAzimuth(lat1,long1,lat2,long2);
        double tmpDistance=totalDistance + distance;
        String infoLine=createDistanceInformationLine(rPoint2,tmpDistance,azimuth);
        InfoDisplayEvent info=new InfoDisplayEvent(this,infoLine,InformationDelegator.COORDINATE_INFO_LINE);
        infoDelegator.requestInfoLine(info);
      }
    }
 else {
      fireMouseLocation(e);
    }
  }
}

public void mouseMoved ( MouseEvent e ) { mouseSupport . fireMapMouseMoved ( e ) ; if ( e . getSource ( ) instanceof MapBean ) { if ( drawDistanceObjects && theMap != null ) { double lat1 , lat2 , long1 , long2 ; rPoint2 = theMap . getCoordinates ( e ) ; theMap . repaint ( ) ; if ( infoDelegator != null ) { Debug . message ( "mousemodedetail" , "DistanceMouseMode: firing mouse location" ) ; lat1 = rPoint1 . getY ( ) ; long1 = rPoint1 . getX ( ) ; lat2 = rPoint2 . getY ( ) ; long2 = rPoint2 . getX ( ) ; distance = GreatCircle . sphericalDistance ( ProjMath . degToRad ( lat1 ) , ProjMath . degToRad ( long1 ) , ProjMath . degToRad ( lat2 ) , ProjMath . degToRad ( long2 ) ) ; double azimuth = getSphericalAzimuth ( lat1 , long1 , lat2 , long2 ) ; double tmpDistance = totalDistance + distance ; String infoLine = createDistanceInformationLine ( rPoint2 , tmpDistance , azimuth ) ; InfoDisplayEvent info = new InfoDisplayEvent ( this , infoLine , InformationDelegator . COORDINATE_INFO_LINE ) ; infoDelegator . requestInfoLine ( info ) ; } } else { fireMouseLocation ( e ) ; } } }
get the line and circle ready for the map repaint based on where the mouse is , distance and azimuth angle as the mouse moves . display distance and azimuth angle in on the infodelegator .
