!******************************************************************************!
! Test for NXM-2841. Drag/zoom box flickers and/or does not 
! render when GRAPHICS set to Swing|SwingDB
! @author J. Czechowski IV
!******************************************************************************!
startmacro/psdThin=16
  switch INTERACTIVE  interAct     GET DEF=TRUE  SDEF=TRUE  ! for normal interactive test(s)
  switch COREGRAPHICS coreGraphics GET DEF=FALSE SDEF=TRUE  ! for a quick check of graphics - more extreme tests - since 3.8.1

  invoke z:jvmHangFix nxm.sys.lib.Shell.getJVMHangWorkaround()
  res z:mytrue true
  invoke ,, nxm.sys.lib.Shell.setJVMHangWorkaround(^mytrue)

  if interAct or coreGraphics then
    res oldLookAndFeel env.theme
    lookandfeel Ocean

    pipe init
      include "datasim.inc"
      panel/jsetup="nxm.sys.test.test_plot_flicker"
      plot/theme=WoB/ID=plotLine   _psdThin  TYPE=Line
      plot/theme=WoB/ID=plotRaster _psdThin  TYPE=Raster
    pipe off
    lookandfeel oldLookAndFeel
  endif

  invoke ,, nxm.sys.lib.Shell.setJVMHangWorkaround(^jvmHangFix)
endmacro

!******************************************************************************!
procedure processMessage m:msg
  !say "msg.name ^msg.name, data ^msg.data fid ^msg.fid"

  if msg.name eqs "MAIN" then
    assert/text="^reg.main.name " msg.data eqss "PASS"
    pipe stop
  else
    ! do nothing
    say "Unhandled message name: ^msg.name from fid: ^msg.fid data: ^msg.data"
  endif
return
