question: protected void createGrid ( ) { grid . clear ( ) ; for ( int r = 0 ; r <= rows ; ++ r ) { grid . add ( new LineSegment ( leftMargin , graphHeight - ( bottomMargin + r * pixelsPerYTic ) , leftMargin + width , graphHeight - ( bottomMargin + r * pixelsPerYTic ) ) ) ; } for ( int c = 0 ; c <= cols ; ++ c ) { grid . add ( new LineSegment ( leftMargin + c * pixelsPerXTic , graphHeight - bottomMargin , leftMargin + c * pixelsPerXTic , graphHeight - ( bottomMargin + height ) ) ) ; } }
target:  Create a grid of tick lines