You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by Shekhar Bhati <sh...@gmail.com> on 2009/06/04 10:40:24 UTC

Issue in panning and scrollbar using batik

Hi,

I am using Batik in my application to render images on browser.
I am facing an issue with panning,which is,when i release the mouse after
panning it horizontally it works fine, but when I pan it vertically and as
the vertical scrollbar appears it refreshes the document and take the image
at the original position.
It happens only when there is no vertical scrollbar originally and after
panning it has to appear.So vertical scrollbar flashes and the refreshes the
image.
In case of horizontal scrollbar it is working fine.
*

public* *class* SVGScrollPane *extends* JSVGScrollPane

{

myjsvgcanvas viewer;

*public* SVGScrollPane(JSVGCanvas canvas){

*super*(canvas);

horizontal.getModel().removeChangeListener(hsbListener);

vertical.getModel().removeChangeListener(vsbListener);

MySBListener hsbListener1 = *new* MySBListener(*false*);

MySBListener vsbListener1 = *new* MySBListener(*true*);

horizontal.getModel().addChangeListener(hsbListener1);

vertical.getModel().addChangeListener(vsbListener1);

}

*protected* *class* MySBListener *extends* SBListener *implements*ChangeListener

{

*public* MySBListener(*boolean* vertical) {

*super*(vertical);

}

*public* *synchronized* *void* stateChanged(ChangeEvent e) {

setScrollPosition();

}

}

 }
nad I instantiate this scrollbar on my applet,.....

And I have extended AbstractPanInteractor with following code :
*

int* mods = ie.getModifiers();

*return
*

ie.getID() == MouseEvent.*MOUSE_PRESSED* &&

(mods & InputEvent.*BUTTON1_MASK*) != 0 &&

(mods & InputEvent.*ALT_MASK*) != 0;

to do panning with Alt+left click..
Any suggestion...