Skip to Main Content

Event logging and playback ... playback problem

jerry kramskoyAug 28 2016

Hi,

I am trying to put together an event history mechanism, so I can record UI events (MouseEvent, KeyEvent ,,,) and play them back later.

My plan is to timestamp these events, and then re-inject them into the event mechanism.  I need this to help debugging, where I am occasionally hitting problems after a complex chain of UI activity, where the replay may give me a better chance of tracking these down.

The recording side is fine (I have set the event dispatcher for the Scene so I get all the events...

But I am struggling on the playback side, as event dispatch APIs need a EventDispatchChain.

e.g.

EventDispatchChain original = scene,getEventDispatcher();

My question is how I get hold of the dispatch chain for the scene?

EventDispatchChain dispatchChainTail = ???

original.dispatchEvent(e, dispatchChainTail);

The only way I've found so far that creates the chain is using

com.sun.javafx.event.EventUtil.fireEvent(...)

which creates the chain internally.  But I think this is too late in the overall event processing.

Any tips much appreciated.

Thanks, Jerry

Comments
Post Details
Added on Aug 28 2016
0 comments
119 views