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.

DrawingPanel3D and mouse post and replies

Return to the DrawingPanel3D and mouse thread
Login to post to this thread

Bug in DrawingPanel3D?
Juan M. Aguirregabiria
12 Posts

I have found a problem in a complex simulation I have been improving for weeks. As shown in the enclosed program, when one moves the mouse over a DrawingPanel3D while holding down the button one usually changes the projection direction.

But if you repeat the whole operation (click + move mouse + release button) once and again eventually an exception arises and, often, the program freezes (or issues repeated exceptions) and _reset() is unable to restore the initial settings.

In the enclosed simulation you might have to repeat the operation many times before the first exception is raised, but in my complex example it is raised very quickly: often the first time one tries to change the projection direction.

Exceptions similar to the following ones are raised:

-----------------------------

Exception in thread "Thread-12" java.lang.ArrayIndexOutOfBoundsException: 700

at

org.opensourcephysics.drawing3d.simple3d.SimpleElementTrail.computePositions(Unknown Source)

at

org.opensourcephysics.drawing3d.simple3d.SimpleElementTrail.processChanges(Unknown Source)

at org.opensourcephysics.drawing3d.Element.processChanges(Unknown Source)

-----------------------------

Exception in thread "Thread-12" java.lang.NullPointerException

      at

org.opensourcephysics.drawing3d.simple3d.SimpleElementTrail.computePositions(Unknown

Source)

      at

org.opensourcephysics.drawing3d.simple3d.SimpleElementTrail.processChanges(Unknown Source)

      at org.opensourcephysics.drawing3d.Element.processChanges(Unknown Source)

-------------------------------- 

Any fix for this problem?

Thanks

Attached File: 3d.zip


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