Thanks for your reply!
It works almost perfectly, but i've got one more problem.
Taht's what i did in my code:
Code:
controller.getDocumentViewController().getViewContainer()
.addMouseWheelListener(new MouseWheelListener() {
@Override
public void mouseWheelMoved(MouseWheelEvent e) {
if ((e.getModifiers() & InputEvent.CTRL_MASK) == InputEvent.CTRL_MASK) {
if (e.getWheelRotation() > 0) {
controller.zoomOut();
} else {
controller.zoomIn();
}
}
}
});
but when i have multipage document and try to zoom out the page zoom and scroll down, so i removed scroll listener by adding a code before adding my listener:
Code:
controller.getDocumentViewController().getViewContainer().removeMouseWheelListener(controller
.getDocumentViewController().getViewContainer().getMouseWheelListeners()[0]);
and it works almost perfect, but when i zoom out a document and its smaller than the view it scrolls next page anyway and when i zoom in it scrolls previous page. Do i have to turn off some other listeners?
And what if i don't want to disable scroll but only turn it off when the ctrl key is down? you wrote:
patrick.corless wrote:
Finally the scrollpane used by the page view will scroll the page view by default. When you pick up on the ctr-wheel event you can get access to the scrollPane and disable the wheel during the zoom.
but how to do this and how to set scroll size? for example i want to scroll for 10 points down on mouse wheel dowm - i cant find methods for that :-(
Regards, Wojtas