Java-2D 2D drawing, drawing straight lines, performing endpoint capture