Replies: 1 comment
-
I think the filter/extension mechanism can only be used for very basic modifications like swapping keys or adding/changing modifiers, moving the event type check from the registration to the default filter sounds like a good way to make this more flexible and would make the plugin code a little bit simpler on the way. The plugin keeps a list of all handlers (and their event types) to be able to remove and re-add them in case the plugin is removed from one chart and added to another. The event type is provided separately, because that is the API of The UX for touch sounds good, I'm wondering whether in the step afterwards we can somehow unify this, to have one application which works well with mouse as well as with touch or if there will have to be some switch. If we change things there, we should probably also handle multi-touch pinch to zoom, did you by chance look into this, too? (There is also #47 which would need some priority ordering between clicking on a data-point and clicking inside the chart. Not directly related, but if we are doing changes to the event handling anyway...) So these would be the steps toward better chartfx on touch:
|
Beta Was this translation helpful? Give feedback.
-
I'm currently experimenting with ChartFX on mobile, and I'm trying to replace the Zoomer's zoom-out handlers due to not having right click. I'm trying to implement
double-click
to zoom out 1 levellong/stationary click
to zoom out to originFor double click I can add a filter that checks for
event.getClickCount() > 1
, but I can't implement the stationary click because theMOUSE_CLICKED
subscription (see Zoomer.java#L1018) doesn't receive anyMOUSE_PRESSED
events. The zoomOrigin() method is luckily public, so I can disable the default listener and add a custom one.However, it'd be great if either (1) the event listeners would register to
MouseEvent.ANY
and add a check in the filter, or (2) the methods required to implement a custom handler were exposed (e.g. zoomOut())How did you intend the filter/extension mechanism to be used?
Beta Was this translation helpful? Give feedback.
All reactions