Sunday 15 January 2012

user interface - JavaFX drag in order to modify nodes -


I am here because my research and testing does not take me anywhere.

I have created a small calendar application and now I want to improve the user interface with good controls. I'm trying to get an interface where you can drag it by creating an event (as you can do in Google Agenda, in fact this is a school project and I want to reproduce this week's scene ).

For this purpose, I have tried this approach: for each room in the area (a gridpan, which contains VBoxes), I set the handlers to get that facility (set ontrack detected , SetOnMouseDrag unregistered and setOnMouseDrag released). And it works well, but in some cases it does not work (if the mouse runs on another incident, which does not have any operator, drag feature stop).

As I saw this very heavy and under the fake (3 handlers x 7 column x 48 ryz = 1008 handlers !!), I thought about other methods, but I started in Java FX I do not know if there is any other mechanism to do this. (I had thought about a transparent layout / panel which handles this feature and works like "touch screen" on my application, but I did not get a satisfactory answer). Does anyone tell me about this kind of problem? For a good example of trying to achieve the Google agenda behavior for creating an event with the mouse (I do not have to manage the overlap of events). Thanks in advance !! I post a picture of how it looks to the actual scene. actual view

So I suggest that I only attached the gridpan to my handler (and not every "cell" as I did before): setOnDragDetected, setOnMouseDragOver, setOnMouseDragReleased and setOnMouseDragExited.

Operators are triggered on the gridpan, moving the mouse over other elements does not turn off the feature.

With this I reduced the number of handlers, simplified the code (as I do not need to manage additional behavior as a motivator on any other child).

Thank you!


No comments:

Post a Comment