Java code for the line drawing method in the straight line segment scanning method