@Override public void handleMousePressed(ChartCanvas canvas,MouseEvent e){
  Point2D pt=new Point2D.Double(e.getX(),e.getY());
  Rectangle2D dataArea=canvas.findDataArea(pt);
  if (dataArea != null) {
    this.startPoint=ShapeUtilities.getPointInRectangle(e.getX(),e.getY(),dataArea);
  }
 else {
    this.startPoint=null;
    canvas.clearLiveHandler();
  }
}

@ Override public void handleMousePressed ( ChartCanvas canvas , MouseEvent e ) { Point2D pt = new Point2D . Double ( e . getX ( ) , e . getY ( ) ) ; Rectangle2D dataArea = canvas . findDataArea ( pt ) ; if ( dataArea != null ) { this . startPoint = ShapeUtilities . getPointInRectangle ( e . getX ( ) , e . getY ( ) , dataArea ) ; } else { this . startPoint = null ; canvas . clearLiveHandler ( ) ; } }
handles a mouse pressed event by recording the initial mouse pointer location .
