Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Endless NPE on arrow keys #2

Open
frankbenoit opened this issue Sep 28, 2018 · 3 comments
Open

Endless NPE on arrow keys #2

frankbenoit opened this issue Sep 28, 2018 · 3 comments

Comments

@frankbenoit
Copy link

When i start the SimpleMindMapApplication and i use the keyboard arrow keys, left/right the view is moving left right. But after some key presses, the console prints endless stacktraces.

Is this an error in the application or in GEF?
I use GEF 5.0.1

....
	at java.lang.Thread.run(Thread.java:745)
java.lang.NullPointerException
	at org.eclipse.gef.mvc.fx.handlers.PanOnStrokeHandler.updateScrollPosition(PanOnStrokeHandler.java:272)
	at org.eclipse.gef.mvc.fx.handlers.PanOnStrokeHandler$1.handle(PanOnStrokeHandler.java:163)
	at javafx.animation.AnimationTimer$AnimationTimerReceiver.lambda$handle$484(AnimationTimer.java:57)
	at java.security.AccessController.doPrivileged(Native Method)
	at javafx.animation.AnimationTimer$AnimationTimerReceiver.handle(AnimationTimer.java:56)
	at com.sun.scenario.animation.AbstractMasterTimer.timePulseImpl(AbstractMasterTimer.java:357)
	at com.sun.scenario.animation.AbstractMasterTimer$MainLoop.run(AbstractMasterTimer.java:267)
	at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:506)
	at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:490)
	at com.sun.javafx.tk.quantum.QuantumToolkit.lambda$runToolkit$404(QuantumToolkit.java:319)
	at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
	at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
	at com.sun.glass.ui.win.WinApplication.lambda$null$148(WinApplication.java:191)
	at java.lang.Thread.run(Thread.java:745)
java.lang.NullPointerException
	at org.eclipse.gef.mvc.fx.handlers.PanOnStrokeHandler.updateScrollPosition(PanOnStrokeHandler.java:272)
	at org.eclipse.gef.mvc.fx.handlers.PanOnStrokeHandler$1.handle(PanOnStrokeHandler.java:163)
	at javafx.animation.AnimationTimer$AnimationTimerReceiver.lambda$handle$484(AnimationTimer.java:57)
	at java.security.AccessController.doPrivileged(Native Method)
	at javafx.animation.AnimationTimer$AnimationTimerReceiver.handle(AnimationTimer.java:56)
	at com.sun.scenario.animation.AbstractMasterTimer.timePulseImpl(AbstractMasterTimer.java:357)
	at com.sun.scenario.animation.AbstractMasterTimer$MainLoop.run(AbstractMasterTimer.java:267)
	at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:506)
	at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:490)
	at com.sun.javafx.tk.quantum.QuantumToolkit.lambda$runToolkit$404(QuantumToolkit.java:319)
	at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
	at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
	at com.sun.glass.ui.win.WinApplication.lambda$null$148(WinApplication.java:191)
	at java.lang.Thread.run(Thread.java:745)
java.lang.NullPointerException
	at org.eclipse.gef.mvc.fx.handlers.PanOnStrokeHandler.updateScrollPosition(PanOnStrokeHandler.java:272)
	at org.eclipse.gef.mvc.fx.handlers.PanOnStrokeHandler$1.handle(PanOnStrokeHandler.java:163)
	at javafx.animation.AnimationTimer$AnimationTimerReceiver.lambda$handle$484(AnimationTimer.java:57)
	at java.security.AccessController.doPrivileged(Native Method)
	at javafx.animation.AnimationTimer$AnimationTimerReceiver.handle(AnimationTimer.java:56)
	at com.sun.scenario.animation.AbstractMasterTimer.timePulseImpl(AbstractMasterTimer.java:357)
	at com.sun.scenario.animation.AbstractMasterTimer$MainLoop.run(AbstractMasterTimer.java:267)
	at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:506)
	at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:490)
	at com.sun.javafx.tk.quantum.QuantumToolkit.lambda$runToolkit$404(QuantumToolkit.java:319)
	at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
	at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
	at com.sun.glass.ui.win.WinApplication.lambda$null$148(WinApplication.java:191)
	at java.lang.Thread.run(Thread.java:745)
....
@mwienand
Copy link
Contributor

Thank you for reporting the issue!

I was looking into it and this should be a bug in GEF that only happens when panning is aborted due to the internal AnimationTimer not being stopped. The timer calls updateScrollPosition() leading to the exception. I created Bugzilla https://bugs.eclipse.org/bugs/show_bug.cgi?id=541744 to keep track of the issue.

In order to resolve the issue, we need to stop the AnimationTimer when the panning handler is aborted.

However, I wonder why the handler is aborted without the viewer losing focus. So you would need to verify if panning works for you or if it stops randomly (due to the handler being aborted).

@miklossy
Copy link
Contributor

I recorded a screencast that reproduces the problem:
screencast

@nakag
Copy link

nakag commented Sep 1, 2019

I had a same issue.
It may be focus problem.
In my case, it was fixed by this commit.

nakag/gef5.mvc.examples@36c8d34#diff-02407d1b3cb61fdc2e841a0ea3dd0e8cR90

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants