Coverage details for edu.uci.ics.jung.visualization.control.LayoutScalingControl

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.control;
13  
14 import java.awt.geom.Point2D;
15  
16 import edu.uci.ics.jung.visualization.VisualizationViewer;
17 import edu.uci.ics.jung.visualization.transform.MutableTransformer;
18  
19 /**
20  * LayoutScalingControl applies a scaling transformation to the graph layout.
21  * The Vertices get closer or farther apart, but do not themselves change
22  * size. ScalingGraphMouse uses MouseWheelEvents to apply the scaling.
23  *
24  * @author Tom Nelson
25  */
260public class LayoutScalingControl implements ScalingControl {
27  
28     /**
29      * zoom the display in or out, depending on the direction of the
30      * mouse wheel motion.
31      */
32     public void scale(VisualizationViewer vv, float amount, Point2D from) {
33         
340        Point2D ivtfrom = vv.inverseViewTransform(from);
350        MutableTransformer modelTransformer = vv.getLayoutTransformer();
360        modelTransformer.scale(amount, amount, ivtfrom);
370        vv.repaint();
380    }
39 }

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.