public void zoomToFit ( ) { //Tools.log("zoomToFit invoked"); sclPic . setScaleSize ( getSize ( ) ) ; // prevent useless rescale events when the picture is not ready if ( sclPic . getStatusCode ( ) == sclPic . LOADED || sclPic . getStatusCode ( ) == sclPic . READY ) { sclPic . createScaledPictureInThread ( Thread . MAX_PRIORITY ) ; } }
this method sets the desired scaled size of the ScalablePicture to the size of the JPanel and fires off a createScaledPictureInThread request if the ScalablePicture has been loaded or is ready .