public final void draw ( ) { AffineTransform transform = new AffineTransform ( this . transform ) ; transform . concatenate ( getAlignmentTransform ( ) ) ; // draw the background box this . graphics2d . setTransform ( transform ) ; this . graphics2d . setColor ( this . params . getBackgroundColor ( ) ) ; this . graphics2d . fillRect ( 0 , 0 , this . settings . getSize ( ) . width , this . settings . getSize ( ) . height ) ; //draw the labels this . graphics2d . setColor ( this . params . getFontColor ( ) ) ; drawLabels ( transform , this . params . getOrientation ( ) , this . params . getLabelRotation ( ) ) ; //sets the transformation for drawing the bar and do it final AffineTransform lineTransform = new AffineTransform ( transform ) ; setLineTranslate ( lineTransform ) ; if ( this . params . getOrientation ( ) == Orientation . VERTICAL_LABELS_LEFT || this . params . getOrientation ( ) == Orientation . VERTICAL_LABELS_RIGHT ) { final AffineTransform rotate = AffineTransform . getQuadrantRotateInstance ( 1 ) ; lineTransform . concatenate ( rotate ) ; } this . graphics2d . setTransform ( lineTransform ) ; this . graphics2d . setStroke ( new BasicStroke ( this . settings . getLineWidth ( ) ) ) ; this . graphics2d . setColor ( this . params . getColor ( ) ) ; drawBar ( ) ; }
Start the rendering of the scalebar .