@Override
    public Point2D getConnectionPoint(Point2D point) {
        float dx = (float) (point.getX() - getCentreX());
        float dy = (float) (point.getY() - getCentreY());
        
        double distance = Math.sqrt(dx * dx + dy * dy);
        if (distance == 0) 
            return point;
        else return new Point2D.Double(
            getCentreX() + dx * (size / 2) / distance,
            getCentreY() + dy * (size / 2) / distance);
    }