|Flickering in custom feedback figure [message #548351]
||Wed, 21 July 2010 14:45
Registered: April 2010
for my diagram nodes I recreated the Eclipse editor tabs "close X". Should work like this:
- When there is no mouse hover and the node is not selected, the X is not shown
- When the mouse hovers over some part of the node but not the area of the close button, the close button is rendered white with black outline
- When the Node is selected, but the mouse does not hover over the close button, the close button is always rendered, even if the ouse leaves the area of the node again
- When the mouse hovers over the close button, the X is rendered light red.
- When pressed, the X should shift a bit to the bottom right
- If the mouse is released over the X, the node should be closed, i.e. removed from the diagram (I represent project files that continue to exist after the operation, so the close metaphor applies).
So using a custom SelectionEditPolicy registered as SELECTION_FEEDBACK_POLICY I managed to get the the first four points more or less right. My close button is a Figure inserted into the SCALABLE_FEEDBACK_LAYER parsing its own mouse events via the MouseListener and MouseMotionListener interfaces. For that to work, I had to manually enable that label, as it is disabled by default (would be nice, if the documentation could reflect that design choice somewhere. I've spend half a day debugging and questioning myself before finding the problem somewhere in the GEF source code.)
The problem now is the following: If the mouse enters the area of the close button it starts to flicker when the node is not selected. Often it just decides to disappear completely when the mouse comes to a halt hovering over it. The problem seems to be that "eraseTargetFeedback" in the policy is called.
Also I do not get any mouse release event, so the best I could do right now is to delete the node on mouse down, which is not so super user friendly. I support undo, but the user should be allowed to change her mind after mouse down, move the mouse away from the X and release without consequence.
The first problem indicates, that the close button "sucks up" the mouse hover events from the node, while the second indicates, that the the mouse click seems to be sucked up by the underlying node. Can both of these problems persist in the same space-time-continuum (i.e. GEF)
Any insights/ideas/recommendations are appreciated.
Powered by FUDForum
. Page generated in 0.01536 seconds