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
|