Revision: 20704
          http://sourceforge.net/p/jmol/code/20704
Author:   hansonr
Date:     2015-08-18 03:19:52 +0000 (Tue, 18 Aug 2015)
Log Message:
-----------
Jmol.___JmolVersion="14.3.16_2015.08.17"

bug fix: PDB reader cuts off long titles.
bug fix: slab setting by wheel can be unintentional
bug fix: wheeling slab could run range unintentionally way too high or low

new feature: slab/depth setting.

  -- these enable wheel actions
  
    bindAction(SINGLE|CTRL|WHEEL, ActionManager.ACTION_wheelZoom);
    bindAction(SINGLE|SHIFT|WHEEL, ActionManager.ACTION_wheelZoom);
    bindAction(SINGLE|CTRL|SHIFT|WHEEL, ActionManager.ACTION_wheelZoom);
    
  -- these enable slab-wheel actions
  
    bindAction(SINGLE|CTRL|WHEEL, ActionManager.ACTION_slab);
    bindAction(SINGLE|SHIFT|WHEEL, ActionManager.ACTION_depth); 
    bindAction(SINGLE|CTRL|SHIFT|WHEEL, ActionManager.ACTION_slabAndDepth);

Modified Paths:
--------------
    trunk/Jmol/src/org/jmol/viewer/ActionManager.java
    trunk/Jmol/src/org/jmol/viewer/Jmol.properties
    trunk/Jmol/src/org/jmol/viewer/TransformManager.java
    trunk/Jmol/src/org/jmol/viewer/binding/JmolBinding.java

Modified: trunk/Jmol/src/org/jmol/viewer/ActionManager.java
===================================================================
--- trunk/Jmol/src/org/jmol/viewer/ActionManager.java   2015-08-17 13:28:09 UTC 
(rev 20703)
+++ trunk/Jmol/src/org/jmol/viewer/ActionManager.java   2015-08-18 03:19:52 UTC 
(rev 20704)
@@ -1162,7 +1162,7 @@
       return;
     }
     if (checkMotionRotateZoom(dragWheelAction, x, deltaX, deltaY, true)) {
-      if (vwr.tm.slabEnabled && checkSlideZoom(dragWheelAction))
+      if (vwr.tm.slabEnabled && bnd(dragWheelAction,ACTION_slabAndDepth))
         vwr.slabDepthByPixels(deltaY);
       else
         vwr.zoomBy(deltaY);
@@ -1187,14 +1187,7 @@
             Integer.MAX_VALUE);
       }
       return;
-    } else if (bnd(dragWheelAction, ACTION_wheelZoom)) {
-      zoomByFactor(deltaY, Integer.MAX_VALUE, Integer.MAX_VALUE);
-      return;
-    } else if (bnd(dragWheelAction, ACTION_rotateZ)) {
-      setMotion(GenericPlatform.CURSOR_MOVE, true);
-      vwr.rotateZBy(-deltaX, Integer.MAX_VALUE, Integer.MAX_VALUE);
-      return;
-    }
+    } 
     if (vwr.tm.slabEnabled) {
       if (bnd(dragWheelAction, ACTION_depth)) {
         vwr.depthByPixels(deltaY);
@@ -1209,6 +1202,15 @@
         return;
       }
     }
+    if (bnd(dragWheelAction, ACTION_wheelZoom)) {
+      zoomByFactor(deltaY, Integer.MAX_VALUE, Integer.MAX_VALUE);
+      return;
+    } 
+    if (bnd(dragWheelAction, ACTION_rotateZ)) {
+      setMotion(GenericPlatform.CURSOR_MOVE, true);
+      vwr.rotateZBy(-deltaX, Integer.MAX_VALUE, Integer.MAX_VALUE);
+      return;
+    }
   }
 
   /**
@@ -1498,7 +1500,7 @@
    */
   private boolean checkMotionRotateZoom(int mouseAction, int x, int deltaX,
                                         int deltaY, boolean isDrag) {
-    boolean isSlideZoom = checkSlideZoom(mouseAction);
+    boolean isSlideZoom = bnd(mouseAction, ACTION_slideZoom) && 
isZoomArea(pressed.x);
     boolean isRotateXY = bnd(mouseAction, ACTION_rotate);
     boolean isRotateZorZoom = bnd(mouseAction, ACTION_rotateZorZoom);
     if (!isSlideZoom && !isRotateXY && !isRotateZorZoom)
@@ -1566,10 +1568,6 @@
         : vwr.getScreenHeight()) * 180 * mouseDragFactor;
   }
 
-  private boolean checkSlideZoom(int action) {
-    return bnd(action, ACTION_slideZoom) && isZoomArea(pressed.x);
-  }
-
   private boolean isZoomArea(int x) {
     return x > vwr.getScreenWidth() * (vwr.tm.stereoDoubleFull || 
vwr.tm.stereoDoubleDTI ? 2 : 1)
         * SLIDE_ZOOM_X_PERCENT / 100f;

Modified: trunk/Jmol/src/org/jmol/viewer/Jmol.properties
===================================================================
--- trunk/Jmol/src/org/jmol/viewer/Jmol.properties      2015-08-17 13:28:09 UTC 
(rev 20703)
+++ trunk/Jmol/src/org/jmol/viewer/Jmol.properties      2015-08-18 03:19:52 UTC 
(rev 20704)
@@ -60,7 +60,24 @@
 Jmol.___JmolVersion="14.3.16_2015.08.17"
 
 bug fix: PDB reader cuts off long titles.
+bug fix: slab setting by wheel can be unintentional
+bug fix: wheeling slab could run range unintentionally way too high or low
 
+new feature: slab/depth setting.
+
+  -- these enable wheel actions
+  
+    bindAction(SINGLE|CTRL|WHEEL, ActionManager.ACTION_wheelZoom);
+    bindAction(SINGLE|SHIFT|WHEEL, ActionManager.ACTION_wheelZoom);
+    bindAction(SINGLE|CTRL|SHIFT|WHEEL, ActionManager.ACTION_wheelZoom);
+    
+  -- these enable slab-wheel actions
+  
+    bindAction(SINGLE|CTRL|WHEEL, ActionManager.ACTION_slab);
+    bindAction(SINGLE|SHIFT|WHEEL, ActionManager.ACTION_depth); 
+    bindAction(SINGLE|CTRL|SHIFT|WHEEL, ActionManager.ACTION_slabAndDepth);
+
+
 JmolVersion="14.3.16_2015.08.16"
 
 run up to full documentation

Modified: trunk/Jmol/src/org/jmol/viewer/TransformManager.java
===================================================================
--- trunk/Jmol/src/org/jmol/viewer/TransformManager.java        2015-08-17 
13:28:09 UTC (rev 20703)
+++ trunk/Jmol/src/org/jmol/viewer/TransformManager.java        2015-08-18 
03:19:52 UTC (rev 20704)
@@ -882,22 +882,28 @@
     return slabPercentSetting;
   }
 
+  private void slabDepthChanged() {
+    vwr.g.setI("slab", slabPercentSetting);
+    vwr.g.setI("depth", depthPercentSetting);
+    finalizeTransformParameters(); // also sets _slabPlane and _depthPlane
+  }
+
   void slabByPercentagePoints(int percentage) {
     slabPlane = null;
+    if (percentage < 0 ? slabPercentSetting <= Math.max(0, 
depthPercentSetting) 
+        : slabPercentSetting >= 100)
+      return;
     slabPercentSetting += percentage;
     slabDepthChanged();
     if (depthPercentSetting >= slabPercentSetting)
       depthPercentSetting = slabPercentSetting - 1;
   }
 
-  private void slabDepthChanged() {
-    vwr.g.setI("slab", slabPercentSetting);
-    vwr.g.setI("depth", depthPercentSetting);
-    finalizeTransformParameters(); // also sets _slabPlane and _depthPlane
-  }
-
   void depthByPercentagePoints(int percentage) {
     depthPlane = null;
+    if (percentage < 0 ? depthPercentSetting <= 0 
+        : depthPercentSetting >= Math.min(100, slabPercentSetting))
+      return;
     depthPercentSetting += percentage;
     if (slabPercentSetting <= depthPercentSetting)
       slabPercentSetting = depthPercentSetting + 1;
@@ -907,6 +913,9 @@
   void slabDepthByPercentagePoints(int percentage) {
     slabPlane = null;
     depthPlane = null;
+    if (percentage < 0 ? slabPercentSetting <= Math.max(0, 
depthPercentSetting) 
+        : depthPercentSetting >= Math.min(100, slabPercentSetting))
+      return;
     slabPercentSetting += percentage;
     depthPercentSetting += percentage;
     slabDepthChanged();

Modified: trunk/Jmol/src/org/jmol/viewer/binding/JmolBinding.java
===================================================================
--- trunk/Jmol/src/org/jmol/viewer/binding/JmolBinding.java     2015-08-17 
13:28:09 UTC (rev 20703)
+++ trunk/Jmol/src/org/jmol/viewer/binding/JmolBinding.java     2015-08-18 
03:19:52 UTC (rev 20704)
@@ -45,7 +45,15 @@
     bindAction(SINGLE|CTRL|SHIFT|LEFT|DRAG, ActionManager.ACTION_slab);
     bindAction(DOUBLE|CTRL|SHIFT|LEFT|DRAG, ActionManager.ACTION_depth); 
     bindAction(SINGLE|CTRL|ALT|SHIFT|LEFT|DRAG, 
ActionManager.ACTION_slabAndDepth);
+
+    bindAction(SINGLE|CTRL|WHEEL, ActionManager.ACTION_wheelZoom);
+    bindAction(SINGLE|SHIFT|WHEEL, ActionManager.ACTION_wheelZoom);
+    bindAction(SINGLE|CTRL|SHIFT|WHEEL, ActionManager.ACTION_wheelZoom);
     
+    bindAction(SINGLE|CTRL|WHEEL, ActionManager.ACTION_slab);
+    bindAction(SINGLE|SHIFT|WHEEL, ActionManager.ACTION_depth); 
+    bindAction(SINGLE|CTRL|SHIFT|WHEEL, ActionManager.ACTION_slabAndDepth);
+    
     bindAction(SINGLE|LEFT|DRAG, ActionManager.ACTION_swipe);
     bindAction(SINGLE|LEFT|DRAG, ActionManager.ACTION_spinDrawObjectCCW);
     bindAction(SINGLE|SHIFT|LEFT|DRAG, ActionManager.ACTION_spinDrawObjectCW);

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
_______________________________________________
Jmol-commits mailing list
Jmol-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-commits

Reply via email to