Coverage details for edu.uci.ics.jung.visualization.ZoomPanGraphMouse

LineHitsSource
1 /*
2  * Copyright (c) 2005, the JUNG Project and the Regents of the University
3  * of California
4  * All rights reserved.
5  *
6  * This software is open-source under the BSD license; see either
7  * "license.txt" or
8  * http://jung.sourceforge.net/license.txt for a description.
9  * Created on Mar 8, 2005
10  *
11  */
12 package edu.uci.ics.jung.visualization;
13  
14 import edu.uci.ics.jung.visualization.control.LayoutScalingControl;
15 import edu.uci.ics.jung.visualization.control.PluggableGraphMouse;
16 import edu.uci.ics.jung.visualization.control.ScalingGraphMousePlugin;
17 import edu.uci.ics.jung.visualization.control.TranslatingGraphMousePlugin;
18  
19  
20 /**
21  * ZoomPanGraphMouse is a PluggableGraphMouse class that includes
22  * zoom via the mouse wheel, and pan via a mouse drag
23  *
24  *
25  * @author Tom Nelson
26  */
27 public class ZoomPanGraphMouse extends PluggableGraphMouse {
28  
29     protected TranslatingGraphMousePlugin translatingPlugin;
30     protected ScalingGraphMousePlugin scalingPlugin;
31  
32     /**
33      * create an instance with default zoom in/out values
34      * @deprecated no need to pass a VisualizationViewer in constructor
35      * @param vv the VisualizationViewer not used
36      */
37     public ZoomPanGraphMouse(VisualizationViewer vv) {
380        this(1.1f, 1/1.1f);
390    }
40  
41     /**
42      * create an instance with passed zoom in/out values
43      * @deprecated no need to pass a VisualizationViewer
44      * @param vv the VisualizationViewer - not used
45      * @param in zoom in value
46      * @param out zoom out value
47      */
48     public ZoomPanGraphMouse(VisualizationViewer vv, float in, float out) {
490        this(in, out);
500    }
51     
52     public ZoomPanGraphMouse() {
530        this(1.1f, 1/1.1f);
540    }
55     
560    public ZoomPanGraphMouse(float in, float out) {
570        translatingPlugin = new TranslatingGraphMousePlugin();
580        scalingPlugin = new ScalingGraphMousePlugin(new LayoutScalingControl(), 0, in, out);
590        add(translatingPlugin);
600        add(scalingPlugin);
610    }
62  
63     /**
64      * @param zoomAtMouse The zoomAtMouse to set.
65      */
66     public void setZoomAtMouse(boolean zoomAtMouse) {
670        scalingPlugin.setZoomAtMouse(zoomAtMouse);
680    }
69 }

this report was generated by version 1.0.5 of jcoverage.
visit www.jcoverage.com for updates.

copyright © 2003, jcoverage ltd. all rights reserved.
Java is a trademark of Sun Microsystems, Inc. in the United States and other countries.