Panning with left click, without modifier key?

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
barbarius
Posts: 74
Joined: Tue Jul 27, 2010 9:33 am
antibot: No, of course not.

Panning with left click, without modifier key?

Post by barbarius » Thu Aug 19, 2010 3:47 pm

I'm using JFreeChart 1.0.13 and just found the Pannable interface on Developer Guide so I'm using it.

I put a button to toggle panning on/off on my program. I want to have my panning without a modifier key and with left click (not right click) when I toggle on.
My idea is somehow to extend ChartPanel class (which has the mouse events) and override some mouse events maybe, but I have no idea how this modifier key works.
Thanks in advance

barbarius
Posts: 74
Joined: Tue Jul 27, 2010 9:33 am
antibot: No, of course not.

Re: Panning with left click, without modifier key?

Post by barbarius » Fri Aug 20, 2010 5:39 pm

okay it already works with left mouse button drag.

I also found the modifier key part in ChartPanel, i ll make a toggling mechanism on modifier key so instead of modifier key, a toggle button will be used.

barbarius
Posts: 74
Joined: Tue Jul 27, 2010 9:33 am
antibot: No, of course not.

Re: Panning with left click, without modifier key?

Post by barbarius » Fri Aug 20, 2010 6:28 pm

Bumped into another problem..

I am trying to use my custom ChartPanel class but because of the Overlay interface's method with parameters (sth, ChartPanel) inside the Chartpanel class , I cant create my CustomChartPanel class!

any solutions to use the source code of ChartPanel class?

EDIT: Okay I also used my custom Overlay class now its done. I m using a boolean toggle variable check instead of modifier key check for panning and it works. No thanks to anybody :D

Locked