like the person in this thread:
viewtopic.php?f=3&t=116797&p=177379&hil ... an#p177379
I would like to change the keys which trigger certain actions. For example, panning should simply work by dragging with the left mouse button, and the "zoom by selecting" just by hitting the right mouse button.
However, in ChartPanel, panMask cannot be accessed, which seems to make it impossible for me to change this mask or the key trigger for panning in general.
Why isn't panMask protected or at least provides a protected setter? Then derived classes had a way to change this behavior.
I also don't understand why the logic for zooming in ChartPanel -> mouseClicked/mouseDragged/mouseReleased does not look for some mask as well, so that one could change the keys that trigger that zooming. It can be turned off, but I just want it to happen only on right click.
I can f.e. override mouseReleased like this:
Code: Select all
boolean rightMouseClick = SwingUtilities.isRightMouseButton(e);
boolean domainZoomable = isDomainZoomable();
boolean rangeZoomable = isRangeZoomable();
if(!rightMouseClick)
{
setMouseZoomable(false);
}
super.mouseReleased(e);
if(!rightMouseClick)
{
setDomainZoomable(domainZoomable);
setRangeZoomable(rangeZoomable);
}
Any suggestions for this problem?
Best regards,
Daniel