@Override
    public boolean contains(Point2D point) {
        double x1 = getConnectionPoints()[0].getX();
        double x2 = getConnectionPoints()[1].getX();
        double y1 = getConnectionPoints()[0].getY();
        double y2 = getConnectionPoints()[1].getY();
        
        // middle point of (x1, y1) (x2, y2)
        double mx1 = (x1+x2)/2;
        double my1 = (y1+y2)/2;
        // middle point of ctrl point to (mx1,my1)
        double mx = (mx1+ctrlX)/2;
        double my = (my1+ctrlY)/2;
        
        if(new Line2D.Double(x1,y1,mx,my).ptSegDist(point) < 5 || 
           new Line2D.Double(x2,y2,mx,my).ptSegDist(point) < 5) 
            
            return true;
        
 
            return false;
    }