Added line clipping code from JFreeChart