Author: paperwing
Date: 2012-01-30 15:53:16 -0800 (Mon, 30 Jan 2012)
New Revision: 28160

Modified:
   
csplugins/trunk/toronto/yuedong/paperwing-impl/src/main/java/org/cytoscape/paperwing/internal/input/CameraInputHandler.java
   
csplugins/trunk/toronto/yuedong/paperwing-impl/src/main/java/org/cytoscape/paperwing/internal/tools/SimpleCamera.java
Log:
The mouse wheel now moves the camera along with its target point (center of 
rotation), instead of translating the camera towards or away from the target 
point. It should be investigated whether there is a good way to move the target 
point away from or towards the camera.

Modified: 
csplugins/trunk/toronto/yuedong/paperwing-impl/src/main/java/org/cytoscape/paperwing/internal/input/CameraInputHandler.java
===================================================================
--- 
csplugins/trunk/toronto/yuedong/paperwing-impl/src/main/java/org/cytoscape/paperwing/internal/input/CameraInputHandler.java
 2012-01-30 23:29:01 UTC (rev 28159)
+++ 
csplugins/trunk/toronto/yuedong/paperwing-impl/src/main/java/org/cytoscape/paperwing/internal/input/CameraInputHandler.java
 2012-01-30 23:53:16 UTC (rev 28160)
@@ -35,7 +35,8 @@
                
                // Varying distance between camera and camera's target point
                if (mouse.dWheel() != 0) {
-                       camera.zoomOut((double) mouse.dWheel());
+//                     camera.zoomOut((double) mouse.dWheel());
+                       camera.moveForwardQuickly(-mouse.dWheel());
                        
                        if (!selectedNodeIndices.isEmpty()) {
                                // TODO: Check if this is a suitable place to 
put this, as

Modified: 
csplugins/trunk/toronto/yuedong/paperwing-impl/src/main/java/org/cytoscape/paperwing/internal/tools/SimpleCamera.java
===================================================================
--- 
csplugins/trunk/toronto/yuedong/paperwing-impl/src/main/java/org/cytoscape/paperwing/internal/tools/SimpleCamera.java
       2012-01-30 23:29:01 UTC (rev 28159)
+++ 
csplugins/trunk/toronto/yuedong/paperwing-impl/src/main/java/org/cytoscape/paperwing/internal/tools/SimpleCamera.java
       2012-01-30 23:53:16 UTC (rev 28160)
@@ -247,6 +247,15 @@
                move(up, -moveSpeed);
        }
        
+       /** Translate the camera forwards quickly, using its zooming speed as 
the movement rate
+        * 
+        * @param multiplier The multiplier against the distance moved. A 
negative
+        * multiplier results in moving backwards.
+        */
+       public void moveForwardQuickly(double multiplier) {
+               move(direction, zoomSpeed * multiplier);
+       }
+       
        /** Translates the camera to a given position. The target position 
vector is
         * also shifted by the same amount as the camera's position vector
         * 

-- 
You received this message because you are subscribed to the Google Groups 
"cytoscape-cvs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/cytoscape-cvs?hl=en.

Reply via email to