You
can try this :
private void
zoomInButtonActionPerformed(ActionEvent evt) {
canvas.getInteractors().add(zoomInteractor);
}
/** * An interactor to perform a
zoom. * <p>Binding:
BUTTON1</p> */ protected
Interactor zoomInteractor = new AbstractZoomInteractor()
{ public boolean
startInteraction(InputEvent ie)
{ int mods
=
ie.getModifiers();
return
ie.getID() ==
MouseEvent.MOUSE_PRESSED;
} };
It
works but perhaps there is a better way to do this.
But
you will have to clear all interactors if you want to stop this
behaviour
(You
can also use the ActionMap to perform a zoom in...)
hope
this helps
Forgive me for yet again asking this question:
Interactors - what and how?
Specifically, I am constructing a UI with
JSVGCanvas as my main component. I have a button on the toolbar which I want
to use as a 'Zoom In'. When the user fires the event ...
private void
zoomInButtonActionPerformed(ActionEvent evt) {
// telll Interactor to Zoom In
??
}
Am I wrong in assuming that interactors can be
called like this. Or do I 'manually' set the viewbox/currentTransform. I
vaguely understand that Interactors are there and work just from the fact I
can use the mouse and CTRL keys to perform actions.
I noted that the Batik guys were giving a
presentation at SVG Open 2003 where they explained the use of Interactors. I
can view the abstarct but the presentation does not seem to be available. Is
it available? This would be most useful to me ;-). The documentation
(website/API) is relatively sketchy for an 'absolute
beginner'.
|
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]