2 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3 * Copyright (C) 2009-2010 - DIGITEO - Pierre Lando
5 * This file must be used under the terms of the CeCILL.
6 * This source file is licensed as described in the file COPYING, which
7 * you should have received as part of this distribution. The terms
8 * are also available at
9 * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
12 package org.scilab.modules.renderer.JoGLView.interaction;
14 import org.scilab.modules.renderer.JoGLView.DrawerVisitor;
17 * @author Pierre Lando
19 public class InteractionManager implements RubberBoxListener {
22 private RubberBox rubberBox;
24 /** The drag, zoom, rotate interaction manager */
25 DragZoomRotateInteraction dragZoomRotateInteraction;
28 * Default constructor.
29 * @param drawerVisitor parent drawer visitor.
31 public InteractionManager(DrawerVisitor drawerVisitor) {
32 dragZoomRotateInteraction = new DragZoomRotateInteraction(drawerVisitor);
33 dragZoomRotateInteraction.setEnable(true);
35 rubberBox = new RubberBox(drawerVisitor);
36 rubberBox.addListener(this);
37 drawerVisitor.addPostRendering(rubberBox);
42 * @exception Throwable the <code>Exception</code> raised by this method
44 public void finalize() throws Throwable {
45 rubberBox.removeListener(this);
50 * Called to start zooming.
52 public void startInteractiveZoom() {
53 dragZoomRotateInteraction.setEnable(false);
54 rubberBox.setEnable(true);
58 public void rubberBoxEnd() {
59 dragZoomRotateInteraction.setEnable(true);