Line | Hits | Source |
---|---|---|
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 | * ViewScalingGraphMouse applies a scaling transform to the View | |
21 | * of the graph. This causes all elements of the graph to grow | |
22 | * larger or smaller. ViewScalingGraphMouse, by default, is activated | |
23 | * by the MouseWheel when the control key is pressed. The control | |
24 | * key modifier can be overridden in the contstructor. | |
25 | * | |
26 | * @author Tom Nelson | |
27 | */ | |
28 | 0 | public class ViewScalingControl implements ScalingControl { |
29 | ||
30 | /** | |
31 | * zoom the display in or out, depending on the direction of the | |
32 | * mouse wheel motion. | |
33 | */ | |
34 | public void scale(VisualizationViewer vv, float amount, Point2D from) { | |
35 | 0 | MutableTransformer viewTransformer = vv.getViewTransformer(); |
36 | 0 | viewTransformer.scale(amount, amount, from); |
37 | 0 | vv.repaint(); |
38 | 0 | } |
39 | } |
this report was generated by version 1.0.5 of jcoverage. |
copyright © 2003, jcoverage ltd. all rights reserved. |