-
Notifications
You must be signed in to change notification settings - Fork 28
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
ASLPieceMover: on drag gesture use correct component #1744
base: develop
Are you sure you want to change the base?
ASLPieceMover: on drag gesture use correct component #1744
Conversation
Would you explain why you believe this change to be correct? |
@uckelman the code in ASLPieceMover.java is very similar to the code in Vassal's PieceMover class. As far as I can tell, drawWin is always going to be passed from either method to SwingUtilities.convertPointToScreen() as null. And it will therefore cause an NPE in convertPointToScreen. Am I misunderstanding something? If the call from PieceMover does cause an NPE, is it being handled somewhere? If so, we are probably missing that in ASLPIeceMover. Thanks. |
That's not right. This also seems not to address the change. |
|
Where do you see where |
I could see a case for using |
It's in the version of The fact that |
Understood. When we were making changes to ASLPieceMover as part of the creation of a zoom function that differentially zooms counters and boards, the person coding was having issues overriding parts of PieceMover, especially Abstract DragHandler. So we ended up copying lots of PieceMover as you say. Agree that it would make some sense to scale that back. |
<<It's in the version of AbstractDragHandler in Vassal. I hadn't realized the one here differs. You're getting an NPE because you're missing the code in setDrawWinToOwnerOf which would prevent it.>> Opening PieceMover from VASSAL3.7.12 in my dev environment, I can find 4 references to "setDrawWinToOwnerOf".
Looking at ASLPieceMover in VASL6.6.9-beta2.vmod, I can find (1), (3), and (4) but NOT (2) the concrete implementation in class DragHandlerNoImage. It seems to me that without the concrete implementation of the method, any calls to it will result in a null response. One issue we have is that, using my dev environment on my PC, I cannot trap a call to setDrawWinToOwnerOf. Neither of the two calling methods in DragHandlerNoImage seem to be triggered. However, two Linux users have reported NPE bugs coming specifically from the dragGestureRecognized() method. It is not clear to me why that method is being called on their devices and not on mine. I have replicated the steps they use that consistently generate the NPE and I cannot do it. I am going to create new version of VASL-6.6.9 that will contain the missing concrete implementation in ASLPieceMover and see if that solves the issue for our two Linux users. Then I will return to the larger question of how to avoid replacing AbstractDragHandler in ASLPieceMover. |
This was pushed yesterday as commit #1772 . It will be in the upcoming VASL6.6.9-beta4.vmod release. |
No description provided.