{
try {
Thread.sleep( 200 );
} catch( Exception e ) {}
XBitmap xBitmap = null;
com.sun.star.awt.Rectangle aRect = null;
boolean bPaint = false;
synchronized( m_oRequestsLock )
{
if ( m_bToPaint )
{
xBitmap = m_xBitmap;
aRect = m_aRect;
m_bToPaint = false;
bPaint = true;
}
}
if ( bPaint )
{
// System.out.println( "The bitmap is going to be painted!" );
XDevice xDevice = (XDevice)UnoRuntime.queryInterface( XDevice.class, m_xWindow );
if ( xDevice != null )
{
// System.out.println( "Step1" );
XGraphics xGraphics = xDevice.createGraphics();
if ( xBitmap != null )
{
// System.out.println( "Step2" );
XDisplayBitmap xDisplayBitmap = xDevice.createDisplayBitmap( xBitmap );
com.sun.star.awt.Size aSize = xBitmap.getSize();
xGraphics.draw( xDisplayBitmap, 0, 0, aSize.Width, aSize.Height,
aRect.X, aRect.Y, aRect.Width, aRect.Height );
}
// System.out.println( "Step3" );