// 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" );
// xGraphics.drawRect( aRect.X - 1, aRect.Y - 1, aRect.Width + 2, aRect.Height + 2 );
xGraphics.drawLine( aRect.X - 1, aRect.Y - 1,
aRect.X + aRect.Width + 1, aRect.Y - 1 );
xGraphics.drawLine( aRect.X + aRect.Width + 1, aRect.Y - 1,
aRect.X + aRect.Width + 1, aRect.Y + aRect.Height + 1 );
xGraphics.drawLine( aRect.X + aRect.Width + 1, aRect.Y + aRect.Height + 1,
aRect.X - 1, aRect.Y + aRect.Height + 1 );
xGraphics.drawLine( aRect.X - 1, aRect.Y + aRect.Height + 1,
aRect.X - 1, aRect.Y - 1 );
// draw resize squares
// System.out.println( "Step4" );
// xGraphics.drawRect( aRect.X - 2, aRect.Y - 2, 4, 4 );