Forward ported the fixes made for issue #148.
Fixed incorrect location for docking data.
Fixed a minor painting issue:

- in case the one is viewing the display in great detail, that is,
  using a large zoom factor, the cursor flags are not painted
  correctly. It appears this is caused by some optimization used
  internally in Swing.