APS Excellence in Physics Education Award
November 2019

Education Prize Logo
Science SPORE Prize
November 2011

NSF Logo
The Open Source Physics Project is supported by NSF DUE-0442581.

call method every time screen is drawn?

Return to the EJS Modeling forum
Login to post to this thread

Is it possible to call a method each time screen is drawn?
David Joiner
5 Posts

I've got a simulation that for which I need to be able to add lines directly to a drawing panel (pre computed/stored functions that change over time such that I can't just use a set of trails or traces). I also use the "skip" feature when drawing in order to speed the simulation. Is it possible to add code that is called every screen draw as opposed to every iteration step?

OSP Projects:
Open Source Physics - EJS Modeling
Physlet Physics
Physlet Quantum Physics
STP Book