question: private void paintPreview ( int dx , int dy , float zoomfactor ) { if ( image != null ) { Graphics2D g2 = ( Graphics2D ) getGraphics ( ) ; UColor bg = renderer . getBackgroundColor ( ) ; g2 . setBackground ( new Color ( bg . getRed ( ) , bg . getGreen ( ) , bg . getBlue ( ) , bg . getAlpha ( ) ) ) ; int newWidth = Math . round ( image . getWidth ( null ) * zoomfactor ) ; int newHeight = ( int ) Math . round ( image . getHeight ( null ) * zoomfactor ) ; g2 . drawImage ( image , dx , dy , newWidth , newHeight , null ) ; if ( dx > 0 ) g2 . clearRect ( 0 , 0 , dx , getHeight ( ) ) ; else g2 . clearRect ( getWidth ( ) + dx , 0 , getWidth ( ) , getHeight ( ) ) ; if ( dy > 0 ) g2 . clearRect ( 0 , 0 , getWidth ( ) , dy ) ; else g2 . clearRect ( 0 , getHeight ( ) + dy , getWidth ( ) , getHeight ( ) ) ; } }
target:  Draws the off-screen image if exists at position (dx, dy) scaled by the specified factor.