Line | Hits | Source |
---|---|---|
1 | /* | |
2 | * Copyright (c) 2005, the JUNG Project and the Regents of the University of | |
3 | * California All rights reserved. | |
4 | * | |
5 | * This software is open-source under the BSD license; see either "license.txt" | |
6 | * or http://jung.sourceforge.net/license.txt for a description. | |
7 | * | |
8 | * Created on Aug 26, 2005 | |
9 | */ | |
10 | ||
11 | package edu.uci.ics.jung.visualization.control; | |
12 | ||
13 | import java.awt.event.InputEvent; | |
14 | ||
15 | /** | |
16 | * an implementation of the AbstractModalGraphMouse that includes plugins for | |
17 | * manipulating a view that is using a LensTransformer. | |
18 | * | |
19 | * @author Tom Nelson - RABA Techologies | |
20 | * | |
21 | */ | |
22 | public class ModalLensGraphMouse extends AbstractModalGraphMouse implements | |
23 | ModalGraphMouse { | |
24 | ||
25 | /** | |
26 | * not included in the base class | |
27 | */ | |
28 | protected LensMagnificationGraphMousePlugin magnificationPlugin; | |
29 | ||
30 | public ModalLensGraphMouse() { | |
31 | 0 | this(1.1f, 1/1.1f); |
32 | 0 | } |
33 | ||
34 | public ModalLensGraphMouse(float in, float out) { | |
35 | 0 | this(in, out, new LensMagnificationGraphMousePlugin()); |
36 | 0 | } |
37 | ||
38 | public ModalLensGraphMouse(LensMagnificationGraphMousePlugin magnificationPlugin) { | |
39 | 0 | this(1.1f, 1/1.1f, magnificationPlugin); |
40 | 0 | } |
41 | ||
42 | 0 | public ModalLensGraphMouse(float in, float out, LensMagnificationGraphMousePlugin magnificationPlugin) { |
43 | 0 | this.in = in; |
44 | 0 | this.out = out; |
45 | 0 | this.magnificationPlugin = magnificationPlugin; |
46 | 0 | loadPlugins(); |
47 | 0 | } |
48 | ||
49 | protected void loadPlugins() { | |
50 | 0 | pickingPlugin = new PickingGraphMousePlugin(); |
51 | 0 | animatedPickingPlugin = new AnimatedPickingGraphMousePlugin(); |
52 | 0 | translatingPlugin = new LensTranslatingGraphMousePlugin(InputEvent.BUTTON1_MASK); |
53 | 0 | scalingPlugin = new ScalingGraphMousePlugin(new LayoutScalingControl(), 0, in, out); |
54 | 0 | rotatingPlugin = new RotatingGraphMousePlugin(); |
55 | 0 | shearingPlugin = new ShearingGraphMousePlugin(); |
56 | ||
57 | 0 | add(magnificationPlugin); |
58 | 0 | add(scalingPlugin); |
59 | ||
60 | 0 | setMode(Mode.TRANSFORMING); |
61 | 0 | } |
62 | } |
this report was generated by version 1.0.5 of jcoverage. |
copyright © 2003, jcoverage ltd. all rights reserved. |