Drag for Pan, CTRL Drag for Zoom?

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
medloh
Posts: 16
Joined: Tue May 07, 2013 11:26 pm
antibot: No, of course not.

Drag for Pan, CTRL Drag for Zoom?

Post by medloh » Tue Aug 06, 2013 6:35 pm

We'd like to reverse the default behavior, and have mouse drags do panning, and CTRL drags do zooming. I was looking over the code in ChartPanel, and it looks like it would be doable with a few changes to mousePressed() and mouseDragged(). However I'm currently stuck with a binary version of JFreeChart a few years old, and can't change any of the source code. I can override classes and method though.

I tried overriding mousePressed() and mouseDragged(), but all the stuff I was needing to change (like panMask) are private so I don't have access to them in my subclass.

Any suggestions on how to reverse this from the default behavior if I can't change code in JFreeChart, and can only override stuff?

Locked