I'm looking for an algorithm (coded in Java would be nice, but anything clear enough to translate to Java is fine) to draw a 4-connected line. It seems that [Bresenham's algorithm](http://tech-algorithm.com/articles/drawing-line-using-bresenham-algorithm/) is the most widely used, but all the understandable implementations I've found are 8-connected. OpenCV's [cvline](http://opencv.willowgarage.com/documentation/cpp/drawing_functions.html#cv-line) function apparently has a 4-connected version, but the source code is, to me, as a mediocre and nearly C-illiterate programmer, impenetrable. Various other searches have turned up nothing. 

Thanks for any help anyone can provide.