Revision: 20884
          http://sourceforge.net/p/jmol/code/20884
Author:   hansonr
Date:     2015-12-08 16:01:40 +0000 (Tue, 08 Dec 2015)
Log Message:
-----------
Jmol.___JmolVersion="14.4.0_2015.12.07"

bug fix: set selectAllModels not working appropriately
bug fix: set selectAllModels should not be saved in state

JmolVersion="14.4.0_2015.12.05"

bug fix: JmolData.jar does not update atom screen positions upon REFRESH or 
select {visible}
bug fix: JmolData.jar -p flag does not work properly
bug fix: model 0 issued when more than one PDB file is open does not execute 
model *

Modified Paths:
--------------
    branches/v14_4/Jmol/src/org/jmol/api/JmolScriptEvaluator.java
    branches/v14_4/Jmol/src/org/jmol/export/__RayTracerExporter.java
    branches/v14_4/Jmol/src/org/jmol/io/FileReader.java
    branches/v14_4/Jmol/src/org/jmol/io/FilesReader.java
    branches/v14_4/Jmol/src/org/jmol/modelset/AtomCollection.java
    branches/v14_4/Jmol/src/org/jmol/render/RepaintManager.java
    branches/v14_4/Jmol/src/org/jmol/script/SV.java
    branches/v14_4/Jmol/src/org/jmol/script/ScriptError.java
    branches/v14_4/Jmol/src/org/jmol/script/ScriptEval.java
    branches/v14_4/Jmol/src/org/jmol/script/ScriptExpr.java
    branches/v14_4/Jmol/src/org/jmol/script/ScriptManager.java
    branches/v14_4/Jmol/src/org/jmol/script/ScriptMathProcessor.java
    branches/v14_4/Jmol/src/org/jmol/scriptext/CmdExt.java
    branches/v14_4/Jmol/src/org/jmol/scriptext/MathExt.java
    branches/v14_4/Jmol/src/org/jmol/viewer/AnimationManager.java
    branches/v14_4/Jmol/src/org/jmol/viewer/ChimeMessenger.java
    branches/v14_4/Jmol/src/org/jmol/viewer/FileManager.java
    branches/v14_4/Jmol/src/org/jmol/viewer/GlobalSettings.java
    branches/v14_4/Jmol/src/org/jmol/viewer/JC.java
    branches/v14_4/Jmol/src/org/jmol/viewer/Jmol.properties
    branches/v14_4/Jmol/src/org/jmol/viewer/ShapeManager.java
    branches/v14_4/Jmol/src/org/jmol/viewer/Viewer.java
    branches/v14_4/Jmol/src/org/openscience/jmol/app/JmolData.java

Modified: branches/v14_4/Jmol/src/org/jmol/api/JmolScriptEvaluator.java
===================================================================
--- branches/v14_4/Jmol/src/org/jmol/api/JmolScriptEvaluator.java       
2015-12-03 21:31:41 UTC (rev 20883)
+++ branches/v14_4/Jmol/src/org/jmol/api/JmolScriptEvaluator.java       
2015-12-08 16:01:40 UTC (rev 20884)
@@ -73,7 +73,7 @@
 
   void runScript(String script) throws ScriptException;
 
-  void runScriptBuffer(String string, SB outputBuffer) throws ScriptException;
+  void runScriptBuffer(String string, SB outputBuffer, boolean isFuncReturn) 
throws ScriptException;
 
   float evalFunctionFloat(Object func, Object params, float[] values);
 

Modified: branches/v14_4/Jmol/src/org/jmol/export/__RayTracerExporter.java
===================================================================
--- branches/v14_4/Jmol/src/org/jmol/export/__RayTracerExporter.java    
2015-12-03 21:31:41 UTC (rev 20883)
+++ branches/v14_4/Jmol/src/org/jmol/export/__RayTracerExporter.java    
2015-12-08 16:01:40 UTC (rev 20884)
@@ -61,7 +61,7 @@
     if (super.initOutput(vwr, privateKey, g3d, params)) {
       vwr.tm.perspectiveDepth = false;
       if (wasPerspective)
-        vwr.shm.finalizeAtoms(null, null);
+        vwr.shm.finalizeAtoms(false, false);
       return true;
     }
     return false; 

Modified: branches/v14_4/Jmol/src/org/jmol/io/FileReader.java
===================================================================
--- branches/v14_4/Jmol/src/org/jmol/io/FileReader.java 2015-12-03 21:31:41 UTC 
(rev 20883)
+++ branches/v14_4/Jmol/src/org/jmol/io/FileReader.java 2015-12-08 16:01:40 UTC 
(rev 20884)
@@ -36,6 +36,7 @@
 import javajs.api.ZInputStream;
 import javajs.util.AU;
 import javajs.util.PT;
+import javajs.util.Rdr;
 
 import org.jmol.api.Interface;
 import org.jmol.util.Logger;
@@ -78,6 +79,8 @@
       vwr.zap(false, true, false);
     String errorMessage = null;
     Object t = null;
+    if (fullPathNameIn.contains("_CHANGEABLE_"))
+      reader = getChangeableReader(vwr, nameAsGivenIn, fullPathNameIn);
     if (reader == null) {
       t = fm.getUnzippedReaderOrStreamFromName(fullPathNameIn,
           bytes, true, false, false, true, htParams);
@@ -143,6 +146,12 @@
     fm.setFileInfo(new String[] { fullPathNameIn, fileNameIn, nameAsGivenIn });
   }
   
+  final static BufferedReader getChangeableReader(Viewer vwr, 
+                               String nameAsGivenIn, String fullPathNameIn) {
+    Logger.info("caching changeable file " + fullPathNameIn);
+    return Rdr.getBR((String) vwr.getLigandModel(nameAsGivenIn, 
fullPathNameIn, "_file", null));
+  }
+
   public Object getAtomSetCollection() {
     return atomSetCollection;
   }

Modified: branches/v14_4/Jmol/src/org/jmol/io/FilesReader.java
===================================================================
--- branches/v14_4/Jmol/src/org/jmol/io/FilesReader.java        2015-12-03 
21:31:41 UTC (rev 20883)
+++ branches/v14_4/Jmol/src/org/jmol/io/FilesReader.java        2015-12-08 
16:01:40 UTC (rev 20884)
@@ -95,6 +95,8 @@
       subFileList = PT.split(name, "|");
       name = subFileList[0];
     }
+    if (name.contains("_CHANGEABLE_"))
+      return FileReader.getChangeableReader(vwr, namesAsGivenIn[i], name);
     Object t = fm.getUnzippedReaderOrStreamFromName(name, null,
         true, forceBinary, false, true, htParams);
     if (t instanceof ZipInputStream) {

Modified: branches/v14_4/Jmol/src/org/jmol/modelset/AtomCollection.java
===================================================================
--- branches/v14_4/Jmol/src/org/jmol/modelset/AtomCollection.java       
2015-12-03 21:31:41 UTC (rev 20883)
+++ branches/v14_4/Jmol/src/org/jmol/modelset/AtomCollection.java       
2015-12-08 16:01:40 UTC (rev 20884)
@@ -224,8 +224,9 @@
   
   public Lst<P3> getAtomPointVector(BS bs) {
     Lst<P3> v = new  Lst<P3>();
+    int n = ac;
     if (bs != null) {
-      for (int i = bs.nextSetBit(0); i >= 0; i = bs.nextSetBit(i+1)) {
+      for (int i = bs.nextSetBit(0); i >= 0 && i < n; i = bs.nextSetBit(i+1)) {
         v.addLast(at[i]);
       }
     }
@@ -2463,8 +2464,10 @@
   }
 
   public BS getVisibleSet(boolean forceNew) {
-    if (forceNew)
+    if (forceNew) {
       vwr.setModelVisibility();
+      vwr.shm.finalizeAtoms(false, true);
+    }
     else if (haveBSVisible)
       return bsVisible;
     bsVisible.clearAll();

Modified: branches/v14_4/Jmol/src/org/jmol/render/RepaintManager.java
===================================================================
--- branches/v14_4/Jmol/src/org/jmol/render/RepaintManager.java 2015-12-03 
21:31:41 UTC (rev 20883)
+++ branches/v14_4/Jmol/src/org/jmol/render/RepaintManager.java 2015-12-08 
16:01:40 UTC (rev 20884)
@@ -243,8 +243,7 @@
   public String renderExport(GData gdata, ModelSet modelSet,
                              Map<String, Object> params) {
     boolean isOK;
-    vwr.finalizeTransformParameters();
-    shapeManager.finalizeAtoms(null, null);
+    shapeManager.finalizeAtoms(false, true);
     JmolRendererInterface exporter3D = vwr.initializeExporter(params);
     isOK = (exporter3D != null);
     if (!isOK) {

Modified: branches/v14_4/Jmol/src/org/jmol/script/SV.java
===================================================================
--- branches/v14_4/Jmol/src/org/jmol/script/SV.java     2015-12-03 21:31:41 UTC 
(rev 20883)
+++ branches/v14_4/Jmol/src/org/jmol/script/SV.java     2015-12-08 16:01:40 UTC 
(rev 20884)
@@ -122,7 +122,7 @@
   static int sizeOf(T x) {
     switch (x == null ? nada : x.tok) {
     case bitset:
-      return BSUtil.cardinalityOf(bsSelectToken(x));
+      return bsSelectToken(x).cardinality();
     case on:
     case off:
       return -1;
@@ -549,7 +549,7 @@
 //    case matrix4f:
       return (int) fValue(x);
     case bitset:
-      return BSUtil.cardinalityOf(bsSelectToken(x));
+      return bsSelectToken(x).cardinality();
     case barray:
       return ((BArray) x.value).data.length;
     default:
@@ -816,17 +816,10 @@
     return getVariableList(vlist);
   }
 
-  static BS bsSelectToken(T x) {
-    x = selectItemTok(x, Integer.MIN_VALUE);
-    return (BS) x.value;
+  private static BS bsSelectToken(T x) {
+    return (BS) selectItemTok(x, Integer.MIN_VALUE).value;
   }
 
-  public static BS bsSelectVar(SV var) {
-    if (var.index == Integer.MAX_VALUE)
-      var = selectItemVar(var);
-    return (BS) var.value;
-  }
-
   static BS bsSelectRange(T x, int n) {
     x = selectItemTok(x, Integer.MIN_VALUE);
     x = selectItemTok(x, (n <= 0 ? n : 1));
@@ -835,12 +828,12 @@
   }
 
   static SV selectItemVar(SV var) {
-    // pass bitsets created by the select() or for() commands
+    // pass bitsets created by the select() or for() inline functions
     // and all arrays by reference
-    if (var.index != Integer.MAX_VALUE || 
-        (var.tok == varray || var.tok == barray) && var.intValue == 
Integer.MAX_VALUE)
-      return var;
-    return (SV) selectItemTok(var, Integer.MIN_VALUE);
+    return (var.index != Integer.MAX_VALUE
+        || (var.tok == varray || var.tok == barray)
+        && var.intValue == Integer.MAX_VALUE ? var : (SV) selectItemTok(var,
+        Integer.MIN_VALUE));
   }
 
   static T selectItemTok(T tokenIn, int i2) {
@@ -881,10 +874,10 @@
       if (tokenIn.value instanceof BondSet) {
         bs = BondSet.newBS((BS) tokenIn.value,
             ((BondSet) tokenIn.value).associatedAtoms);
-        len = BSUtil.cardinalityOf(bs);
+        len = bs.cardinality();
       } else {
         bs = BSUtil.copy((BS) tokenIn.value);
-        len = (isInputSelected ? 1 : BSUtil.cardinalityOf(bs));
+        len = (isInputSelected ? 1 : bs.cardinality());
       }
       break;
     case barray:
@@ -1307,7 +1300,10 @@
   public static BS getBitSet(SV x, boolean allowNull) {
     switch (x.tok) {
     case bitset:
-      return bsSelectVar(x);
+      // selectItemTok is important here because this may come from 
setVariable()
+      // in the case of     a[1].xyz = ptX1
+      return (BS) (x.index == Integer.MAX_VALUE ? (SV) selectItemTok(x,
+          Integer.MIN_VALUE) : x).value;
     case varray:
       return unEscapeBitSetArray(x.getList(), allowNull);
     default:

Modified: branches/v14_4/Jmol/src/org/jmol/script/ScriptError.java
===================================================================
--- branches/v14_4/Jmol/src/org/jmol/script/ScriptError.java    2015-12-03 
21:31:41 UTC (rev 20883)
+++ branches/v14_4/Jmol/src/org/jmol/script/ScriptError.java    2015-12-08 
16:01:40 UTC (rev 20884)
@@ -13,7 +13,7 @@
  */
 public abstract class ScriptError implements JmolScriptEvaluator {
 
-  abstract protected void showString(String msg);
+  abstract protected void showStringPrint(String msg, boolean mustDo);
   
   public Viewer vwr;
   public boolean chk;
@@ -83,7 +83,7 @@
         : errorString(iError, value, more, more2, false));
     if (!warningOnly)
       evalError(strError, strUntranslated);
-    showString(strError);
+    showStringPrint(strError, true);
   }
 
   public void evalError(String message, String strUntranslated)

Modified: branches/v14_4/Jmol/src/org/jmol/script/ScriptEval.java
===================================================================
--- branches/v14_4/Jmol/src/org/jmol/script/ScriptEval.java     2015-12-03 
21:31:41 UTC (rev 20883)
+++ branches/v14_4/Jmol/src/org/jmol/script/ScriptEval.java     2015-12-08 
16:01:40 UTC (rev 20884)
@@ -233,6 +233,7 @@
   private JmolThread scriptDelayThread, fileLoadThread;
 
   public boolean allowJSThreads = true;
+  private boolean isFuncReturn;
 
   @Override
   public boolean getAllowJSThreads() {
@@ -420,7 +421,7 @@
       vwr.handleError(er, false);
       setErrorMessage("" + er + " " + vwr.getShapeErrorState());
       errorMessageUntranslated = "" + er;
-      report(errorMessage);
+      report(errorMessage, true);
       haveError = true;
     } catch (ScriptException e) {
       if (e instanceof ScriptInterruption && (!isTry || !e.isError)) {
@@ -443,7 +444,7 @@
       }
       setErrorMessage(e.toString());
       errorMessageUntranslated = e.getErrorMessageUntranslated();
-      report(errorMessage);
+      report(errorMessage, true);
       vwr
           .notifyError(
               (errorMessage != null
@@ -567,27 +568,30 @@
   @Override
   public void runScript(String script) throws ScriptException {
     if (!vwr.isPreviewOnly)
-      runScriptBuffer(script, outputBuffer);
+      runScriptBuffer(script, outputBuffer, false);
   }
 
   /**
    * runs a script immediately and sends selected output to a provided SB
+   * @param outputBuffer
+   * @param script
    * 
-   * @param script
-   * @param outputBuffer
    * @throws ScriptException
    */
   @Override
-  public void runScriptBuffer(String script, SB outputBuffer)
+  public void runScriptBuffer(String script, SB outputBuffer, boolean 
isFuncReturn)
       throws ScriptException {
     pushContext(null, "runScriptBuffer");
     contextPath += " >> script() ";
     this.outputBuffer = outputBuffer;
     allowJSThreads = false;
+    boolean fret = this.isFuncReturn;
+    this.isFuncReturn |= isFuncReturn;    
     if (compileScript(null, script + JC.SCRIPT_EDITOR_IGNORE
         + JC.REPAINT_IGNORE, false))
       dispatchCommands(false, false, false);
     popContext(false, false);
+    this.isFuncReturn = fret;
   }
 
   /**
@@ -1777,31 +1781,35 @@
 
   //////////////////// showing strings /////////////////
 
-  @Override
   public void showString(String str) {
     // called by ScriptExt and ScriptError
     showStringPrint(str, false);
   }
 
-  public void showStringPrint(String str, boolean isPrint) {
-    if (chk || str == null)
+  @Override
+  public void showStringPrint(String s, boolean mustDo) {
+    if (chk || s == null)
       return;
-    if (outputBuffer != null && Logger.isActiveLevel(Logger.LEVEL_WARN))
-      outputBuffer.append(str).appendC('\n');
+    if (outputBuffer == null)
+      vwr.showString(s, mustDo);
     else
-      vwr.showString(str, isPrint);
+      appendBuffer(s, mustDo);
   }
 
-  public void report(String s) {
+  public void report(String s, boolean isError) {
     if (chk)
       return;
-    if (outputBuffer != null) {
-      outputBuffer.append(s).appendC('\n');
-      return;
-    }
+    if (outputBuffer == null)
     vwr.scriptStatus(s);
+    else 
+      appendBuffer(s, isError);
   }
 
+  private void appendBuffer(String str, boolean mustDo) {
+    if (mustDo || isFuncReturn || Logger.isActiveLevel(Logger.LEVEL_INFO))
+      outputBuffer.append(str).appendC('\n');
+  }
+
   /*
    * ****************************************************************
    * =============== command processing checks ===============================
@@ -1860,7 +1868,7 @@
           setErrorMessage("" + er);
         }
         if (error) {
-          report(errorMessage);
+          report(errorMessage, true);
           setErrorMessage(null);
         }
         restoreScriptContext(scSave, true, false, false);
@@ -2105,7 +2113,7 @@
       return true;
     String script = vwr.getInsertedCommand();
     if (!"".equals(script))
-      runScriptBuffer(script, null);
+      runScriptBuffer(script, null, false);
     else if (isSpt && debugScript && vwr.getBoolean(T.messagestylechime))
       vwr.getChimeMessenger().update(null);
     if (!mustResumeEval && !allowJSInterrupt || fromFunc)
@@ -3252,7 +3260,7 @@
       if (slen == 4 && optParameterAsString(2).equals("saved") && slen == 4) {
         vwr.stm.deleteSaved(optParameterAsString(3));
         if (doReport())
-          report(GT.o(GT._("show saved: {0}"), vwr.stm.listSavedStates()));
+          report(GT.o(GT._("show saved: {0}"), vwr.stm.listSavedStates()), 
false);
         return;
       }
       setObjectProperty();
@@ -3266,7 +3274,7 @@
       bs = vwr.getAllAtoms();
     int nDeleted = vwr.deleteAtoms(bs, false);
     if (doReport())
-      report(GT.i(GT._("{0} atoms deleted"), nDeleted));
+      report(GT.i(GT._("{0} atoms deleted"), nDeleted), false);
   }
 
   private void cmdDisplay(boolean isDisplay) throws ScriptException {
@@ -3484,8 +3492,8 @@
             SV vl = what.get(0);
             switch (inTok = vl.tok) {
             case T.bitset:
-              bsOrList = SV.getBitSet(vl, false);
-              isOK = (((BS) bsOrList).nextSetBit(0) >= 0);
+              bsOrList = vl.value;
+              isOK = !((BS) bsOrList).isEmpty();
               break;
             case T.varray:
               Lst<SV> v = vl.getList();
@@ -3984,7 +3992,7 @@
       if (chk)
         return;
       int n = vwr.autoHbond(null, null, false);
-      report(GT.i(GT._("{0} hydrogen bonds"), Math.abs(n)));
+      report(GT.i(GT._("{0} hydrogen bonds"), Math.abs(n)), false);
       return;
     }
     if (slen == 2 && getToken(1).tok == T.delete) {
@@ -4687,7 +4695,7 @@
 
     if (debugHigh)
       report("Successfully loaded:"
-          + (filenames == null ? htParams.get("fullPathName") : modelName));
+          + (filenames == null ? htParams.get("fullPathName") : modelName), 
false);
 
     finalizeLoad(isAppend, appendNew, isConcat, doOrient, nFiles, ac0,
         modelCount0);
@@ -4920,10 +4928,10 @@
     if (chk)
       return;
     String s = Txt.formatText(vwr, text);
-    if (outputBuffer == null)
-      vwr.warn(s);
+    if (outputBuffer == null && !vwr.isPrintOnly)
+      Logger.warn(s);
     if (!s.startsWith("_"))
-      report(s);
+      report(s, false);
   }
 
   /**
@@ -7650,7 +7658,7 @@
     if (pt == 2) {
       saveContext(info);
       if (doReport())
-        report(GT.o(GT._("to resume, enter: &{0}"), info));
+        report(GT.o(GT._("to resume, enter: &{0}"), info), false);
       throw new ScriptInterruption(this, info, Integer.MIN_VALUE);
     }
     evalError(info, null);
@@ -7943,7 +7951,7 @@
     int nDeleted = vwr.deleteAtoms(bs, true);
     boolean isQuiet = !doReport();
     if (!isQuiet)
-      report(GT.i(GT._("{0} atoms deleted"), nDeleted));
+      report(GT.i(GT._("{0} atoms deleted"), nDeleted), false);
     vwr.select(null, false, 0, isQuiet);
   }
 

Modified: branches/v14_4/Jmol/src/org/jmol/script/ScriptExpr.java
===================================================================
--- branches/v14_4/Jmol/src/org/jmol/script/ScriptExpr.java     2015-12-03 
21:31:41 UTC (rev 20883)
+++ branches/v14_4/Jmol/src/org/jmol/script/ScriptExpr.java     2015-12-08 
16:01:40 UTC (rev 20884)
@@ -2166,7 +2166,7 @@
         }
         break;
       case T.bitset:
-        bs = SV.getBitSet(t, true);
+        bs = SV.getBitSet(t, false);
         int nAtoms = vwr.ms.ac;
         int nbs = bs.cardinality();
         propertyName = sel.asString();

Modified: branches/v14_4/Jmol/src/org/jmol/script/ScriptManager.java
===================================================================
--- branches/v14_4/Jmol/src/org/jmol/script/ScriptManager.java  2015-12-03 
21:31:41 UTC (rev 20883)
+++ branches/v14_4/Jmol/src/org/jmol/script/ScriptManager.java  2015-12-08 
16:01:40 UTC (rev 20884)
@@ -677,7 +677,7 @@
           .append(" ").appendF(pts[i].z).append(" - - - - ").appendI(++atomno)
           .appendC('\n');
     vwr.openStringInlineParamsAppend(sb.toString(), null, true);
-    eval.runScriptBuffer(sbConnect.toString(), null);
+    eval.runScriptBuffer(sbConnect.toString(), null, false);
     BS bsB = vwr.getModelUndeletedAtomsBitSet(modelIndex);
     bsB.andNot(bsA);
     return bsB;

Modified: branches/v14_4/Jmol/src/org/jmol/script/ScriptMathProcessor.java
===================================================================
--- branches/v14_4/Jmol/src/org/jmol/script/ScriptMathProcessor.java    
2015-12-03 21:31:41 UTC (rev 20883)
+++ branches/v14_4/Jmol/src/org/jmol/script/ScriptMathProcessor.java    
2015-12-08 16:01:40 UTC (rev 20884)
@@ -941,7 +941,7 @@
         m4.transpose();
         return addXM4(m4);
       case T.bitset:
-        return addXBs(BSUtil.copyInvert(SV.bsSelectVar(x2),
+        return addXBs(BSUtil.copyInvert((BS) x2.value,
             (x2.value instanceof BondSet ? vwr.ms.bondCount : vwr.ms.ac)));
       }
       return addXFloat(-x2.asFloat());
@@ -958,7 +958,7 @@
       case T.matrix4f:
         return addXM4(M4.newM4((M4) x2.value).invert());
       case T.bitset:
-        return addXBs(BSUtil.copyInvert(SV.bsSelectVar(x2),
+        return addXBs(BSUtil.copyInvert((BS) x2.value,
             (x2.value instanceof BondSet ? vwr.ms.bondCount : vwr.ms.ac)));
       default:
         return addXBool(!x2.asBoolean());
@@ -1074,14 +1074,14 @@
     case T.opAnd:
       switch (x1.tok) {
       case T.bitset:
-        BS bs = SV.bsSelectVar(x1);
+        BS bs = (BS) x1.value;
         switch (x2.tok) {
         case T.integer:
           int x = x2.asInt();
           return (addXBool(x < 0 ? false : bs.get(x)));
         case T.bitset:
           bs = BSUtil.copy(bs);
-          bs.and(SV.bsSelectVar(x2));
+          bs.and((BS) x2.value);
           return addXBs(bs);
         }
         break;
@@ -1090,10 +1090,10 @@
     case T.opOr:
       switch (x1.tok) {
       case T.bitset:
-        BS bs = BSUtil.copy(SV.bsSelectVar(x1));
+        BS bs = BSUtil.copy((BS) x1.value);
         switch (x2.tok) {
         case T.bitset:
-          bs.or(SV.bsSelectVar(x2));
+          bs.or((BS) x2.value);
           return addXBs(bs);
         case T.integer:
           int x = x2.asInt();
@@ -1117,8 +1117,8 @@
       return addXBool(x1.asBoolean() || x2.asBoolean());
     case T.opXor:
       if (x1.tok == T.bitset && x2.tok == T.bitset) {
-        BS bs = BSUtil.copy(SV.bsSelectVar(x1));
-        bs.xor(SV.bsSelectVar(x2));
+        BS bs = BSUtil.copy((BS) x1.value);
+        bs.xor((BS) x2.value);
         return addXBs(bs);
       }
       boolean a = x1.asBoolean();
@@ -1127,8 +1127,8 @@
     case T.opToggle:
       if (x1.tok != T.bitset || x2.tok != T.bitset)
         return false;
-      return addXBs(BSUtil.toggleInPlace(BSUtil.copy(SV.bsSelectVar(x1)),
-          SV.bsSelectVar(x2)));
+      return addXBs(BSUtil.toggleInPlace(BSUtil.copy((BS) x1.value),
+          (BS) x2.value));
     case T.opLE:
       return addXBool(x1.asFloat() <= x2.asFloat());
     case T.opGE:
@@ -1543,8 +1543,8 @@
     case T.point3f:
       return (P3) x.value;
     case T.bitset:
-      BS bs = SV.bsSelectVar(x);
-      if (bs.nextSetBit(0) < 0)
+      BS bs = (BS) x.value;
+      if (bs.isEmpty())
         break;
       return (P3) eval.getBitsetProperty(bs, T.xyz, null, null,
           x.value, null, false, Integer.MAX_VALUE, false);
@@ -1603,7 +1603,7 @@
 
   private boolean getAllProperties(SV x2, String abbr)
       throws ScriptException {
-    BS bs = SV.bsSelectVar(x2);
+    BS bs = (BS) x2.value;
     Lst<T> tokens;
     int n = bs.cardinality();
     if (n == 0 || !abbr.endsWith("?")
@@ -1636,7 +1636,7 @@
   private boolean getBoundBox(SV x2) {
     if (x2.tok != T.bitset)
       return false;
-    BoxInfo b = vwr.ms.getBoxInfo(SV.bsSelectVar(x2), 1);
+    BoxInfo b = vwr.ms.getBoxInfo((BS) x2.value, 1);
     P3[] pts = b.getBoundBoxPoints(true);
     Lst<P3> list = new  Lst<P3>();
     for (int i = 0; i < 4; i++)
@@ -1739,7 +1739,7 @@
       boolean isAtoms = (op.intValue != T.bonds); 
       if (!isAtoms && x2.value instanceof BondSet)
         return addX(x2);
-      BS bs = SV.bsSelectVar(x2);
+      BS bs = (BS) x2.value;
       if (isAtoms && bs.cardinality() == 1 && (op.intValue & T.minmaxmask) == 
0)
         op.intValue |= T.min;
       Object val = eval.getBitsetProperty(bs, op.intValue, null, null,

Modified: branches/v14_4/Jmol/src/org/jmol/scriptext/CmdExt.java
===================================================================
--- branches/v14_4/Jmol/src/org/jmol/scriptext/CmdExt.java      2015-12-03 
21:31:41 UTC (rev 20883)
+++ branches/v14_4/Jmol/src/org/jmol/scriptext/CmdExt.java      2015-12-08 
16:01:40 UTC (rev 20884)
@@ -276,7 +276,7 @@
     LabelToken[] tokens = (asIdentity ? null : isAtoms ? labeler.compile(
         vwr, label, '\0', null) : labeler.compile(vwr, label, '\1',
         htValues));
-    int nmax = (haveIndex ? 1 : BSUtil.cardinalityOf(bs));
+    int nmax = (haveIndex ? 1 : bs.cardinality());
     String[] sout = new String[nmax];
     P3 ptTemp = new P3();
     for (int j = (haveIndex ? index : bs.nextSetBit(0)); j >= 0; j = bs
@@ -640,7 +640,7 @@
           return;
         n = vwr.autoHbond(bs1, bs2, false);
         if (n != Integer.MIN_VALUE)
-          eval.report(GT.i(GT._("{0} hydrogen bonds"), Math.abs(n)));
+          eval.report(GT.i(GT._("{0} hydrogen bonds"), Math.abs(n)), false);
         return;
       case T.hydrogen:
         boolean andBond = (tokAt(2) == T.on);
@@ -1869,7 +1869,7 @@
     boolean report = eval.doReport(); 
     if (isDelete) {
       if (report)
-        eval.report(GT.i(GT._("{0} connections deleted"), nModified));
+        eval.report(GT.i(GT._("{0} connections deleted"), nModified), false);
       return;
     }
     if (isColorOrRadius) {
@@ -1882,7 +1882,7 @@
     }
     if (report)
       eval.report(GT.o(GT._("{0} new bonds; {1} modified"),
-          new Object[] { Integer.valueOf(nNew), Integer.valueOf(nModified) }));
+          new Object[] { Integer.valueOf(nNew), Integer.valueOf(nModified) }), 
false);
   }
 
   private void console() throws ScriptException {
@@ -3775,9 +3775,10 @@
       if (timeMsg)
         showString(Logger.getTimerMsg("export", 0));
       if (msg != null) {
-        if (!msg.startsWith("OK"))
+        boolean isError = !msg.startsWith("OK"); 
+        if (isError)
           eval.evalError(msg, null);
-        eval.report(data);
+        eval.report(data, isError);
       }
       return "";
     }
@@ -3994,7 +3995,8 @@
   private String writeMsg(String msg) throws ScriptException {
     if (chk || msg == null)
       return "";
-    if (!msg.startsWith("OK")) {
+    boolean isError = !msg.startsWith("OK"); 
+    if (isError) {
       e.evalError(msg, null);
       /**
        * @j2sNative
@@ -4004,7 +4006,7 @@
       {
       }
     }
-    e.report(msg);
+    e.report(msg, isError);
     return msg;
   }
 
@@ -4738,7 +4740,7 @@
       switch (tokAt(++i)) {
       case T.bitset:
       case T.expressionBegin:
-        pt = P3.newP(vwr.ms.getAtomSetCenter(atomExpressionAt(i)));
+        pt = vwr.ms.getAtomSetCenter(atomExpressionAt(i));
         vwr.toFractional(pt, true);
         i = eval.iToken;
         break;

Modified: branches/v14_4/Jmol/src/org/jmol/scriptext/MathExt.java
===================================================================
--- branches/v14_4/Jmol/src/org/jmol/scriptext/MathExt.java     2015-12-03 
21:31:41 UTC (rev 20883)
+++ branches/v14_4/Jmol/src/org/jmol/scriptext/MathExt.java     2015-12-08 
16:01:40 UTC (rev 20884)
@@ -757,10 +757,10 @@
       return mp.addXBs(data[2] == null ? new BS() : (BS) data[2]);
     case T.bondcount:
       SV x1 = mp.getX();
-      if (x1.tok != T.bitset)
+      if (x1.tok != T.bitset || args.length != 1 || args[0].tok != T.bitset)
         return false;
-      atoms1 = SV.bsSelectVar(x1);
-      atoms2 = SV.bsSelectVar(args[0]);
+      atoms1 = (BS) x1.value;
+      atoms2 = (BS) args[0].value;
       Lst<Integer> list = new Lst<Integer>();
       Atom[] atoms = vwr.ms.at;
       for (int i = atoms1.nextSetBit(0); i >= 0; i = atoms1.nextSetBit(i + 1)) 
{
@@ -781,9 +781,9 @@
         if (isBonds && atoms1 != null)
           return false;
         if (atoms1 == null)
-          atoms1 = SV.bsSelectVar(var);
+          atoms1 = (BS) var.value;
         else if (atoms2 == null)
-          atoms2 = SV.bsSelectVar(var);
+          atoms2 = (BS) var.value;
         else
           return false;
         break;
@@ -858,8 +858,8 @@
     }
     if (i == args.length || !(args[i].value instanceof BS))
       return false;
-    BS bsA = BSUtil.copy(SV.bsSelectVar(args[i++]));
-    BS bsB = (i < args.length ? BSUtil.copy(SV.bsSelectVar(args[i])) : null);
+    BS bsA = BSUtil.copy((BS) args[i++].value);
+    BS bsB = (i < args.length ? BSUtil.copy((BS) args[i].value) : null);
     RadiusData rd = new RadiusData(null, (distance > 10 ? distance / 100
         : distance), (distance > 10 ? EnumType.FACTOR : EnumType.OFFSET),
         VDW.AUTO);
@@ -1021,12 +1021,12 @@
       boolean isAll = minMax == T.minmaxmask;
       switch (x1.tok) {
       case T.bitset:
-        BS bs = SV.bsSelectVar(x1);
+        BS bs = (BS) x1.value;
         BS bs2 = null;
         boolean returnAtom = (isMinMax && x3 != null && x3.asBoolean());
         switch (x2.tok) {
         case T.bitset:
-          bs2 = (x2.tok == T.bitset ? SV.bsSelectVar(x2) : null);
+          bs2 = (x2.tok == T.bitset ? (BS) x2.value : null);
           //$FALL-THROUGH$
         case T.point3f:
           Atom[] atoms = vwr.ms.at;
@@ -1200,8 +1200,7 @@
     boolean isON = !isList && (argLast.tok == T.on);
     try {
       if (isChemical) {
-        String data = (x1.tok == T.bitset ? vwr.getSmiles(SV.getBitSet(x1,
-            false)) : SV.sValue(x1));
+        String data = (x1.tok == T.bitset ? vwr.getSmiles((BS) x1.value) : 
SV.sValue(x1));
         data = data.length() == 0 ? "" : vwr.getChemicalInfo(data,
             args.length > 1 ? T.getTokenFromName(flags.toLowerCase()) : null);
         if (data.endsWith("\n"))
@@ -1483,11 +1482,11 @@
     } else if (args.length > pt) {
       switch (args[pt].tok) {
       case T.bitset:
-        propertyValue = SV.bsSelectVar(args[pt++]);
+        propertyValue = args[pt++].value;
         if (propertyName.equalsIgnoreCase("bondInfo") && args.length > pt
             && args[pt].tok == T.bitset)
           propertyValue = new BS[] { (BS) propertyValue,
-              SV.bsSelectVar(args[pt]) };
+              (BS) args[pt].value };
         break;
       case T.hash:
       case T.string:
@@ -1497,7 +1496,7 @@
       }
     }
     if (isAtomProperty) {
-      BS bs = SV.bsSelectVar(x);
+      BS bs = (BS) x.value;
       int iAtom = bs.nextSetBit(0);
       if (iAtom < 0)
         return mp.addXStr("");
@@ -1568,7 +1567,7 @@
       return mp.addXList(listOut);
     }
     
-    BS bs = SV.getBitSet(x1, true);
+    BS bs = (x1.tok == T.bitset ? (BS) x1.value : null);
     boolean asArray = T.tokAttr(intValue, T.minmaxmask); // "all"
     return mp.addXObj(format == null ? "" : bs == null ? 
SV.sprintf(PT.formatCheck(format), x1) : e
         .getCmdExt().getBitsetIdent(bs, format, x1.value, true, x1.index,
@@ -2082,7 +2081,8 @@
     }
     if (t456 == null && t < 1e6)
       t456 = P3.new3(t, t, t);
-    BS bs = SV.getBitSet(mp.getX(), false);
+    SV x = mp.getX();
+    BS bs = (x.tok == T.bitset ? (BS) x.value : new BS());
     return mp.addXList(vwr.ms.getModulationList(bs,
         (type + "D").toUpperCase().charAt(0), t456));
   }
@@ -2109,7 +2109,7 @@
     switch (args.length) {
     case 1:
       if (args[0].tok == T.bitset) {
-        BS bs = SV.getBitSet(args[0], false);
+        BS bs = (BS) args[0].value;
         if (bs.cardinality() == 3) {
           Lst<P3> pts = vwr.ms.getAtomPointVector(bs);
           return mp.addXPt4(Measure.getPlaneThroughPoints(pts.get(0), 
pts.get(1), pts.get(2),
@@ -2282,7 +2282,7 @@
           pt3 = P3.newP((T3) args[0].value);
           break;
         case T.bitset:
-          pt3 = vwr.ms.getAtomSetCenter(SV.bsSelectVar(args[0]));
+          pt3 = vwr.ms.getAtomSetCenter((BS) args[0].value);
           break;
         default:
           return false;
@@ -2649,6 +2649,7 @@
 
   private boolean evaluateScript(ScriptMathProcessor mp, SV[] args, int tok)
       throws ScriptException {
+    // eval(cmd)
     // javascript(cmd)
     // script(cmd)
     // script(cmd, syncTarget)
@@ -2668,10 +2669,10 @@
       if (!appID.equals("."))
         sb.append(vwr.jsEval(appID + "\1" + s));
       if (appID.equals(".") || appID.equals("*"))
-        e.runScriptBuffer(s, sb);
+        e.runScriptBuffer(s, sb, true);
       break;
     case T.show:
-      e.runScriptBuffer("show " + s, sb);
+      e.runScriptBuffer("show " + s, sb, true);
       break;
     case T.javascript:
       sb.append(vwr.jsEval(s));
@@ -2779,7 +2780,7 @@
     switch (tok) {
     case T.split:
       if (x.tok == T.bitset) {
-        BS bsSelected = SV.bsSelectVar(x);
+        BS bsSelected = (BS) x.value;
         int modelCount = vwr.ms.mc;
         Lst<SV> lst = new Lst<SV>();
         for (int i = 0; i < modelCount; i++) {
@@ -2818,9 +2819,8 @@
     String pattern = SV.sValue(args[0]);
     if (pattern.length() > 0)
       try {
-        BS bsSelected = (isSelector ? SV.bsSelectVar(mp.getX())
-            : args.length == 2 && args[1].tok == T.bitset ? SV
-                .bsSelectVar(args[1]) : null);
+        BS bsSelected = (isSelector ? (BS) mp.getX().value
+            : args.length == 2 && args[1].tok == T.bitset ?  (BS) 
args[1].value : null);
         bs = vwr.getSmilesMatcher().getSubstructureSet(pattern, vwr.ms.at,
             vwr.ms.ac, bsSelected,
             (tok == T.smiles ? JC.SMILES_TYPE_SMILES : JC.SMILES_TYPE_SMARTS));
@@ -2909,9 +2909,10 @@
     // {*}.tensor("isc")            // only within this atom set
     // {atomindex=1}.tensor("isc")  // all to this atom
     // {*}.tensor("efg","eigenvalues")
-    if (args.length > 2)
+    SV x = mp.getX();
+    if (args.length > 2 || x.tok != T.bitset)
       return false;
-    BS bs = SV.getBitSet(mp.getX(), false);
+    BS bs = (BS) x.value;
     String tensorType = (args.length == 0 ? null : SV.sValue(args[0])
         .toLowerCase());
     JmolNMRInterface calc = vwr.getNMRCalculation();
@@ -2949,7 +2950,7 @@
     }
     if (isSelector) {
       return mp
-          .addXObj(e.getBitsetProperty(SV.bsSelectVar(x1), tok, null, null,
+          .addXObj(e.getBitsetProperty((BS) x1.value, tok, null, null,
               x1.value, new Object[] { name, params }, false, x1.index, 
false));
     }
     SV var = e.getUserFunctionResult(name, params, null);
@@ -3134,9 +3135,10 @@
         plane = e.getHklPlane(pt);
       break;
     case T.varray:
-      if (last != 2)
+      pt = (last == 2 ? SV.ptValue(args[1]) : last == 1 ? P3.new3(Float.NaN, 0,
+          0) : null);
+      if (pt == null)
         return false;
-      pt = SV.ptValue(args[1]);
       break;
     }
     if (last > 0 && plane == null && pt == null
@@ -3146,7 +3148,7 @@
     if (plane != null)
       return mp.addXBs(ms.getAtomsNearPlane(distance, plane));
 
-    bs = (args[last].tok == T.bitset ? SV.bsSelectVar(args[last]) : null);
+    bs = (args[last].tok == T.bitset ? (BS) args[last].value : null);
     if (tok == T.unitcell) {
       boolean asMap = isWithinModelSet;
       return mp
@@ -3220,7 +3222,7 @@
 
   private BS getAtomsNearPts(float distance, T3[] points, BS bsInclude) {
     BS bsResult = new BS();
-    if (points.length == 0 || bsInclude != null && bsInclude.cardinality() == 
0)
+    if (points.length == 0 || bsInclude != null && bsInclude.isEmpty())
       return bsResult;
     if (bsInclude == null)
       bsInclude = BSUtil.setAll(points.length);

Modified: branches/v14_4/Jmol/src/org/jmol/viewer/AnimationManager.java
===================================================================
--- branches/v14_4/Jmol/src/org/jmol/viewer/AnimationManager.java       
2015-12-03 21:31:41 UTC (rev 20883)
+++ branches/v14_4/Jmol/src/org/jmol/viewer/AnimationManager.java       
2015-12-08 16:01:40 UTC (rev 20884)
@@ -173,7 +173,7 @@
   }
 
   void setDisplay(BS bs) {
-    bsDisplay = (bs == null || bs.cardinality() == 0? null : BSUtil.copy(bs));
+    bsDisplay = (bs == null || bs.isEmpty() ? null : BSUtil.copy(bs));
   }
 
   public void setMorphCount(int n) {
@@ -439,7 +439,7 @@
     setFrameRangeVisible();
     vwr.setStatusFrameChanged(false, false);
     if (vwr.ms != null && !vwr.g.selectAllModels)
-        vwr.slm.setSelectionSubset(vwr.getModelUndeletedAtomsBitSet(cmi));
+        
vwr.slm.setSelectionSubset(vwr.ms.getModelAtomBitSetIncludingDeleted(cmi, 
true));
   }
 
   private void setFrameRangeVisible() {

Modified: branches/v14_4/Jmol/src/org/jmol/viewer/ChimeMessenger.java
===================================================================
--- branches/v14_4/Jmol/src/org/jmol/viewer/ChimeMessenger.java 2015-12-03 
21:31:41 UTC (rev 20883)
+++ branches/v14_4/Jmol/src/org/jmol/viewer/ChimeMessenger.java 2015-12-08 
16:01:40 UTC (rev 20884)
@@ -33,6 +33,7 @@
 import org.jmol.modelset.Group;
 import org.jmol.modelset.Model;
 import org.jmol.modelset.ModelSet;
+import org.jmol.util.Logger;
 
 /**
  * 
@@ -86,7 +87,8 @@
     if (s == null)
       return;
     if (outputBuffer == null) {
-      vwr.warn(s);
+      if (!vwr.isPrintOnly)
+        Logger.warn(s);
       vwr.scriptStatus(s);
     } else {
       outputBuffer.append(s).appendC('\n');

Modified: branches/v14_4/Jmol/src/org/jmol/viewer/FileManager.java
===================================================================
--- branches/v14_4/Jmol/src/org/jmol/viewer/FileManager.java    2015-12-03 
21:31:41 UTC (rev 20883)
+++ branches/v14_4/Jmol/src/org/jmol/viewer/FileManager.java    2015-12-08 
16:01:40 UTC (rev 20884)
@@ -595,6 +595,7 @@
     }
     if (bytes == null && (bytes = getCachedPngjBytes(name)) != null && 
htParams != null)
         htParams.put("sourcePNGJ", Boolean.TRUE);
+    name = name.replace("_CHANGEABLE_", "");
     String fullName = name;
     String[] subFileList = null;
     if (name.indexOf("|") >= 0) {

Modified: branches/v14_4/Jmol/src/org/jmol/viewer/GlobalSettings.java
===================================================================
--- branches/v14_4/Jmol/src/org/jmol/viewer/GlobalSettings.java 2015-12-03 
21:31:41 UTC (rev 20883)
+++ branches/v14_4/Jmol/src/org/jmol/viewer/GlobalSettings.java 2015-12-08 
16:01:40 UTC (rev 20884)
@@ -75,8 +75,9 @@
         getDataBaseList(JC.databases);
         getDataBaseList(userDatabases);
       }
-      loadFormat = databases.get("pdb");
-      loadLigandFormat = databases.get("ligand");
+      loadFormat = pdbLoadFormat = databases.get("pdb");
+      pdbLoadFormat0 = databases.get("pdb0");
+      pdbLoadLigandFormat = databases.get("ligand");
       nmrUrlFormat = databases.get("nmr");
       nmrPredictFormat = databases.get("nmrdb");
       smilesUrlFormat = databases.get("nci") + "/file?format=sdf&get3d=True";
@@ -283,7 +284,7 @@
       setB("legacyJavaFloat", legacyJavaFloat);
       setF("loadAtomDataTolerance", loadAtomDataTolerance);
       setO("loadFormat", loadFormat);
-      setO("loadLigandFormat", loadLigandFormat);
+      setO("loadLigandFormat", pdbLoadLigandFormat);
       setB("logCommands", logCommands);
       setB("logGestures", logGestures);
       setB("measureAllModels", measureAllModels);
@@ -440,7 +441,7 @@
     boolean forceAutoBond = false;
     boolean fractionalRelative = true;// true: {1/2 1/2 1/2} relative to 
current (possibly offset) unit cell 
     char inlineNewlineChar = '|'; //pseudo static
-    String loadFormat, loadLigandFormat, nmrUrlFormat, nmrPredictFormat, 
smilesUrlFormat, nihResolverFormat, pubChemFormat;
+    String loadFormat, pdbLoadFormat, pdbLoadFormat0, pdbLoadLigandFormat, 
nmrUrlFormat, nmrPredictFormat, smilesUrlFormat, nihResolverFormat, 
pubChemFormat;
 
     String edsUrlFormat = 
"http://eds.bmc.uu.se/eds/dfs/%LC13/%LCFILE/%LCFILE.omap";;
     String edsUrlFormatDiff = 
"http://eds.bmc.uu.se/eds/dfs/%LC13/%LCFILE/%LCFILE_diff.omap";;
@@ -888,16 +889,30 @@
       return structureList;
     }
 
-  String resolveDataBase(String database, String id) {
-    String format = databases.get(database.toLowerCase());
-    if (format == null)
+  String resolveDataBase(String database, String id, String format) {
+    if (format == null) {
+      if ((format = databases.get(database.toLowerCase())) == null)
       return null;
-    if (id.indexOf("/") < 0) {
+      int pt = id.indexOf("/");
+      if (pt < 0) {
       if (database.equals("pubchem"))
         id = "name/" + id;
       else if (database.equals("nci"))
         id += "/file?format=sdf&get3d=True";
     }
+      if (format.startsWith("'")) {
+        // needs evaluation
+        // xxxx.n means "the nth item"
+        pt = id.indexOf(".");
+        int n = (pt > 0 ? PT.parseInt(id.substring(pt + 1)) : 0);
+        if (pt > 0)
+          id = id.substring(0, pt);
+        format = PT.rep(format, "%n", "" + n);
+      }
+    } else if (id.indexOf(".") >= 0 && format.indexOf("%FILE.") >= 0) {
+      // replace RCSB format extension when a file extension is made explicit 
+      format = format.substring(0, format.indexOf("%FILE"));
+    }
     try {
       while (format.indexOf("%c") >= 0)
         for (int i = 1; i < 10; i++) {
@@ -906,8 +921,9 @@
     } catch (Exception e) {
       // too bad.
     }
-    return (format.indexOf("%FILE") < 0 ? format + id : PT.formatStringS(
-        format, "FILE", id));
+    return (format.indexOf("%FILE") >= 0 ? PT.formatStringS(format, "FILE", id)
+        : format.indexOf("%file") >= 0 ? PT.formatStringS(format, "file",
+            id.toLowerCase()) : format + id);
   }
 
     static boolean doReportProperty(String name) {
@@ -1018,7 +1034,7 @@
       app(str, "set forceAutoBond " + forceAutoBond);
       app(str, "#set defaultDirectory " + PT.esc(defaultDirectory));
       app(str, "#set loadFormat " + PT.esc(loadFormat));
-      app(str, "#set loadLigandFormat " + PT.esc(loadLigandFormat));
+      app(str, "#set loadLigandFormat " + PT.esc(pdbLoadLigandFormat));
       app(str, "#set smilesUrlFormat " + PT.esc(smilesUrlFormat));
       app(str, "#set nihResolverFormat " + PT.esc(nihResolverFormat));
       app(str, "#set pubChemFormat " + PT.esc(pubChemFormat));

Modified: branches/v14_4/Jmol/src/org/jmol/viewer/JC.java
===================================================================
--- branches/v14_4/Jmol/src/org/jmol/viewer/JC.java     2015-12-03 21:31:41 UTC 
(rev 20883)
+++ branches/v14_4/Jmol/src/org/jmol/viewer/JC.java     2015-12-08 16:01:40 UTC 
(rev 20884)
@@ -66,7 +66,10 @@
     "pubchem", 
"http://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/%FILE/SDF?record_type=3d";,
     "map", 
"http://www.ebi.ac.uk/pdbe/api/%TYPE/%FILE?pretty=false&metadata=true";, 
     "rna3d", "http://rna.bgsu.edu/rna3dhub/%TYPE/download/%FILE";,
-    "aflow", 
"http://aflowlib.mems.duke.edu/users/jmolers/binary_new/%FILE.aflow_binary";
+    "aflow", 
"http://aflowlib.mems.duke.edu/users/jmolers/binary_new/%FILE.aflow_binary";,
+    // _CHANGEABLE_ flag indicates that the loaded file should be saved in any 
state in full
+    "ams", 
"http://rruff.geo.arizona.edu/AMS/viewJmol.php?_CHANGEABLE_&mineral=%file&action=showcif";,
+    "am", 
"'http://rruff.geo.arizona.edu/AMS/CIF_text_files/'+load('http://rruff.geo.arizona.edu/AMS/minerals/%FILE').split(\"viewJmol('\")[(%n
 == 0 ? 0 : %n + 1)].split(\"'\")[1]+'_cif.txt'"
   };
   
   public static String[] macros = {

Modified: branches/v14_4/Jmol/src/org/jmol/viewer/Jmol.properties
===================================================================
--- branches/v14_4/Jmol/src/org/jmol/viewer/Jmol.properties     2015-12-03 
21:31:41 UTC (rev 20883)
+++ branches/v14_4/Jmol/src/org/jmol/viewer/Jmol.properties     2015-12-08 
16:01:40 UTC (rev 20884)
@@ -8,10 +8,21 @@
 # see also http://chemapps.stolaf.edu/jmol/zip for daily updates
        
 
-Jmol.___JmolVersion="14.4.0_2015.12.03"
+Jmol.___JmolVersion="14.4.0_2015.12.07"
 
+bug fix: set selectAllModels not working appropriately
+bug fix: set selectAllModels should not be saved in state
+
+JmolVersion="14.4.0_2015.12.05"
+
+bug fix: JmolData.jar does not update atom screen positions upon REFRESH or 
select {visible}
+bug fix: JmolData.jar -p flag does not work properly
 bug fix: model 0 issued when more than one PDB file is open does not execute 
model *
 
+JmolVersion="14.4.0_2015.12.03"
+
+bug fix: model 0 issued when more than one PDB file is open does not execute 
model *
+
 JmolVersion="14.4.0_2015.12.02"
 
 bug fix: PDB reader broken for filter "biomolecule n"

Modified: branches/v14_4/Jmol/src/org/jmol/viewer/ShapeManager.java
===================================================================
--- branches/v14_4/Jmol/src/org/jmol/viewer/ShapeManager.java   2015-12-03 
21:31:41 UTC (rev 20883)
+++ branches/v14_4/Jmol/src/org/jmol/viewer/ShapeManager.java   2015-12-08 
16:01:40 UTC (rev 20884)
@@ -401,20 +401,24 @@
 
   private final int[] navMinMax = new int[4];
 
-  public int[] finalizeAtoms(BS bsAtoms, P3 ptOffset) {
+  public int[] finalizeAtoms(boolean checkAtoms, boolean finalizeParams) {
     Viewer vwr = this.vwr;
+    if (finalizeParams)
+      vwr.finalizeTransformParameters();
     TransformManager tm = vwr.tm;
     BS bs = bsRenderableAtoms;
+    BS bsAtoms = (checkAtoms ? tm.bsSelectedAtoms : null); 
     if (bsAtoms != null) {
       // translateSelected operation
       P3 ptCenter = ms.getAtomSetCenter(bsAtoms);
       P3 pt = new P3();
       tm.transformPt3f(ptCenter, pt);
-      pt.add(ptOffset);
+      pt.add(tm.ptOffset);
       tm.unTransformPoint(pt, pt);
       pt.sub(ptCenter);
       vwr.setAtomCoordsRelative(pt, bsAtoms);
-      ptOffset.set(0, 0, 0);
+      tm.ptOffset.set(0, 0, 0);
+      tm.bsSelectedAtoms = null;
     }
     ms.getAtomsInFrame(bs);
     Vibration[] vibrationVectors = ms.vibrations;

Modified: branches/v14_4/Jmol/src/org/jmol/viewer/Viewer.java
===================================================================
--- branches/v14_4/Jmol/src/org/jmol/viewer/Viewer.java 2015-12-03 21:31:41 UTC 
(rev 20883)
+++ branches/v14_4/Jmol/src/org/jmol/viewer/Viewer.java 2015-12-08 16:01:40 UTC 
(rev 20884)
@@ -265,7 +265,7 @@
   String logFilePath = "";
 
   private boolean allowScripting;
-  private boolean isPrintOnly = false;
+  public boolean isPrintOnly = false;
   public boolean isSignedApplet = false;
   private boolean isSignedAppletLocal = false;
   private boolean isSilent;
@@ -477,15 +477,15 @@
     apiPlatform = (GenericPlatform) o;
     display = info.get("display");
     isSingleThreaded = apiPlatform.isSingleThreaded();
-    noGraphicsAllowed = checkOption2("noGraphics", "-n");
-    System.out.println("nographics " + noGraphicsAllowed);
+    noGraphicsAllowed = checkOption2("noDisplay", "-n");
+    //System.out.println("nographics " + noGraphicsAllowed);
     headless = apiPlatform.isHeadless();
     haveDisplay = (isWebGL || display != null && !noGraphicsAllowed
         && !headless && !dataOnly);
     noGraphicsAllowed &= (display == null);
-    System.out.println("nographics " + noGraphicsAllowed);
+    //System.out.println("nographics " + noGraphicsAllowed);
     headless |= noGraphicsAllowed;
-    System.out.println("headless " + headless + commandOptions);
+    //System.out.println("headless " + headless + commandOptions);
     if (haveDisplay) {
       mustRender = true;
       multiTouch = checkOption2("multiTouch", "-multitouch");
@@ -777,8 +777,7 @@
   public void initialize(boolean clearUserVariables) {
     g = new GlobalSettings(this, g, clearUserVariables);
     setStartupBooleans();
-    g.setI("_width", dimScreen.width);
-    g.setI("_height", dimScreen.height);
+    setWidthHeightVar();
     if (haveDisplay) {
       g.setB("_is2D", isJS && !isWebGL);
       g.setB("_multiTouchClient", acm.isMTClient());
@@ -800,6 +799,11 @@
     tm.setDefaultPerspective();
   }
 
+  public void setWidthHeightVar() {
+    g.setI("_width", dimScreen.width);
+    g.setI("_height", dimScreen.height);
+  }
+
   void saveModelOrientation() {
     ms.saveModelOrientation(am.cmi, stm.getOrientation());
   }
@@ -1769,6 +1773,7 @@
       }
       return null;
     }
+    id = id.replace('\\', '/');
     boolean isLigand = prefix.equals("ligand_");
     id = (isLigand ? id.toUpperCase() : id.substring(id.lastIndexOf("/") + 1));
     if (ligandModelSet == null)
@@ -1863,7 +1868,7 @@
     boolean haveFileData = (htParams.containsKey("fileData"));
     if (fileName.indexOf('$') == 0)
       htParams.put("smilesString", fileName.substring(1));
-    boolean isString = (fileName.equalsIgnoreCase("string") || fileName
+    boolean isString = (fileName.equals("string") || fileName
         .equals(JC.MODELKIT_ZAP_TITLE));
     String strModel = null;
     if (haveFileData) {
@@ -3333,8 +3338,13 @@
     // called by AnimationThread run()
     // called by TransformationManager move and moveTo
     // called by TransformationManager11 navigate, navigateTo
-    if (!haveDisplay || rm == null)
+    if (rm == null)
       return;
+    if (!haveDisplay) {
+      setModelVisibility();
+      shm.finalizeAtoms(false, true);
+      return;
+    }
     rm.requestRepaintAndWait(why);
     setSync();
   }
@@ -3616,9 +3626,7 @@
         || rm == null)
       return;
     boolean antialias2 = antialiased && g.antialiasTranslucent;
-    finalizeTransformParameters();
-    int[] navMinMax = shm.finalizeAtoms(tm.bsSelectedAtoms, tm.ptOffset);
-    tm.bsSelectedAtoms = null;
+    int[] navMinMax = shm.finalizeAtoms(true, true);
     if (isWebGL) {
       rm.renderExport(gdata, ms, jsParams);
       notifyViewerRepaintDone();
@@ -3893,7 +3901,7 @@
    * @return String or String[]
    */
   public Object setLoadFormat(String name, char type, boolean withPrefix) {
-    String format;
+    String format = null;
     String f = name.substring(1);
     switch (type) {
     case '=':
@@ -3905,18 +3913,26 @@
         try {
           int pt = f.indexOf("/");
           String database = f.substring(0, pt);
-          f = g.resolveDataBase(database, f.substring(pt + 1));
-          return (f == null ? name : f);
+          f = g.resolveDataBase(database, f.substring(pt + 1), null);
+          if (f != null && f.startsWith("'"))
+            f = evaluateExpression(f).toString();
+          return (f == null || f.length() == 0 ? name : f);
         } catch (Exception e) {
           return name;
         }
+      } else {
+        format = ( 
+            // following is temporary, until issues are resolved for AJAX asych
+            isJS && g.loadFormat.equals(g.pdbLoadFormat) ? g.pdbLoadFormat0 
+                : g.loadFormat);
       }
       //$FALL-THROUGH$
     case '#': // ligand
-      String s = (type == '=' ? g.loadFormat : g.loadLigandFormat);
-      if (f.indexOf(".") > 0 && s.indexOf("%FILE.") >= 0)
-        s = s.substring(0, s.indexOf("%FILE") + 5);
-      return PT.formatStringS(s, "FILE", f);
+      if (format == null)
+        format = g.pdbLoadLigandFormat;
+      if (f.indexOf(".") >= 0 && format.equals(g.pdbLoadFormat))
+          format = g.pdbLoadFormat0; // older version for =1crn.cif or  
=1crn.pdb
+      return g.resolveDataBase(null, f, format);
     case '*':
       // European Bioinformatics Institute
       int pt = name.lastIndexOf("/");
@@ -3924,23 +3940,23 @@
         //  *dom/.../.../.../xxxx
         f = name.substring(pt + 1);
         format = (pt > 4 ? name.substring(5) : "mappings");
-        return PT.rep(g.resolveDataBase("map", f), "%TYPE", format);
+        return PT.rep(g.resolveDataBase("map", f, null), "%TYPE", format);
       } else if (name.startsWith("*val/")) {
         //  *val/.../.../.../xxxx
         f = name.substring(pt + 1);
         format = (pt > 4 ? name.substring(5) : "validation/outliers/all");
-        return PT.rep(g.resolveDataBase("map", f), "%TYPE", format);
+        return PT.rep(g.resolveDataBase("map", f, null), "%TYPE", format);
       } else if (name.startsWith("*rna3d/")) {
         //  *rna3d/.../.../.../xxxx
         f = name.substring(pt + 1);
         format = (pt > 6 ? name.substring(6) : "loops");
-        return PT.rep(g.resolveDataBase("rna3d", f), "%TYPE", format);
+        return PT.rep(g.resolveDataBase("rna3d", f, null), "%TYPE", format);
       } else if (name.startsWith("*dssr/")) {
         f = name.substring(pt + 1);
-        return g.resolveDataBase("dssr", f);
+        return g.resolveDataBase("dssr", f, null);
       } else if (name.startsWith("*dssr1/")) {
         f = name.substring(pt + 1);
-        return g.resolveDataBase("dssr1", f);
+        return g.resolveDataBase("dssr1", f, null);
       }
       // these are processed in SmarterJmolAdapter
       String pdbe = "pdbe";
@@ -3948,7 +3964,7 @@
         pdbe = "pdbe2";
         f = f.substring(0, 4);
       }
-      return g.resolveDataBase(pdbe, f);
+      return g.resolveDataBase(pdbe, f, null);
     case ':': // PubChem
       format = g.pubChemFormat;
       if (f.equals("")) {
@@ -5365,7 +5381,7 @@
       return;
     case T.loadligandformat:
       // /12.1.51//
-      g.loadLigandFormat = value;
+      g.pdbLoadLigandFormat = value;
       break;
     // 12.1.50
     case T.defaultlabelpdb:
@@ -6195,6 +6211,10 @@
     case T.selectallmodels:
       // 11.5.52
       g.selectAllModels = value;
+      if (value)
+        slm.setSelectionSubset(null);
+      else
+        slm.setSelectionSubset(ms.getModelAtomBitSetIncludingDeleted(am.cmi, 
true));
       break;
     case T.messagestylechime:
       // 11.5.39
@@ -7375,7 +7395,7 @@
   }
 
   public void setAtomCoords(BS bs, int tokType, Object xyzValues) {
-    if (bs.cardinality() == 0)
+    if (bs.isEmpty())
       return;
     ms.setAtomCoords(bs, tokType, xyzValues);
     checkMinimization();
@@ -7386,7 +7406,7 @@
     // Eval
     if (bs == null)
       bs = bsA();
-    if (bs.cardinality() == 0)
+    if (bs.isEmpty())
       return;
     ms.setAtomCoordsRelative(offset, bs);
     checkMinimization();
@@ -7409,7 +7429,7 @@
   public void invertSelected(P3 pt, P4 plane, int iAtom, BS invAtoms) {
     // Eval
     BS bs = bsA();
-    if (bs.cardinality() == 0)
+    if (bs.isEmpty())
       return;
     ms.invertSelected(pt, plane, iAtom, invAtoms, bs);
     checkMinimization();
@@ -7419,7 +7439,7 @@
   public void moveAtoms(M4 m4, M3 mNew, M3 rotation, V3 translation, P3 center,
                         boolean isInternal, BS bsAtoms, boolean 
translationOnly) {
     // from TransformManager exclusively
-    if (bsAtoms.cardinality() == 0)
+    if (bsAtoms.isEmpty())
       return;
     ms.moveAtoms(m4, mNew, rotation, translation, bsAtoms, center, isInternal,
         translationOnly);
@@ -7464,7 +7484,7 @@
       actionRotateBond(deltaX, deltaY, x, y);
     } else {
       bsSelected = setMovableBitSet(bsSelected, !asAtoms);
-      if (bsSelected.cardinality() != 0) {
+      if (!bsSelected.isEmpty()) {
         if (isTranslation) {
           P3 ptCenter = ms.getAtomSetCenter(bsSelected);
           tm.finalizeTransformParameters();
@@ -8260,11 +8280,6 @@
     return getStateCreator().getFunctionCalls(selectedFunction);
   }
 
-  public void warn(String s) {
-    if (!isPrintOnly)
-      Logger.warn(s);
-  }
-
   /**
    * Simple method to ensure that the image creator (which writes files) was in
    * fact opened by this vwr and not by some manipulation of the applet. When
@@ -8815,7 +8830,7 @@
     try {
       if (getScriptManager() == null)
         return null;
-      eval.runScriptBuffer(script, outputBuffer);
+      eval.runScriptBuffer(script, outputBuffer, false);
     } catch (Exception e) {
       return eval.getErrorMessage();
     }
@@ -8866,7 +8881,7 @@
   }
 
   public void calculatePartialCharges(BS bsSelected) throws JmolAsyncException 
{
-    if (bsSelected == null || bsSelected.cardinality() == 0)
+    if (bsSelected == null || bsSelected.isEmpty())
       bsSelected = getModelUndeletedAtomsBitSetBs(getVisibleFramesBitSet());
     int pt = bsSelected.nextSetBit(0);
     if (pt < 0)
@@ -9003,7 +9018,7 @@
     if (bsAtoms == null)
       bsAtoms = getModelUndeletedAtomsBitSet(getVisibleFramesBitSet().length() 
- 1);
     BS bsB = new BS();
-    if (bsAtoms.cardinality() == 0)
+    if (bsAtoms.isEmpty())
       return bsB;
     int modelIndex = ms.at[bsAtoms.nextSetBit(0)].mi;
     if (modelIndex != ms.mc - 1)
@@ -9318,7 +9333,7 @@
 
   void dragMinimizeAtom(int iAtom) {
     stopMinimization();
-    BS bs = (getMotionFixedAtoms().cardinality() == 0 ? ms.getAtoms(
+    BS bs = (getMotionFixedAtoms().isEmpty() ? ms.getAtoms(
         (ms.isAtomPDB(iAtom) ? T.group : T.molecule),
         BSUtil.newAndSetBit(iAtom)) : BSUtil.setAll(ms.ac));
     try {

Modified: branches/v14_4/Jmol/src/org/openscience/jmol/app/JmolData.java
===================================================================
--- branches/v14_4/Jmol/src/org/openscience/jmol/app/JmolData.java      
2015-12-03 21:31:41 UTC (rev 20883)
+++ branches/v14_4/Jmol/src/org/openscience/jmol/app/JmolData.java      
2015-12-08 16:01:40 UTC (rev 20884)
@@ -25,7 +25,6 @@
 
 import javajs.util.PT;
 
-import org.jmol.api.JmolViewer;
 import org.jmol.util.Escape;
 import org.jmol.viewer.Viewer;
 
@@ -42,7 +41,7 @@
    */
 
   public JmolApp jmolApp;
-  public JmolViewer vwr;
+  public Viewer vwr;
   
   public static JmolData getJmol(int width, int height, String commandOptions) 
{
     JmolApp jmolApp = new JmolApp();
@@ -82,6 +81,7 @@
     this.jmolApp = jmolApp;
     vwr = new Viewer(jmolApp.info);
     vwr.setScreenDimension(jmolApp.startupWidth, jmolApp.startupHeight);
+    vwr.setWidthHeightVar();
     jmolApp.startViewer(vwr, null, true);
   }
   

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


------------------------------------------------------------------------------
Go from Idea to Many App Stores Faster with Intel(R) XDK
Give your users amazing mobile app experiences with Intel(R) XDK.
Use one codebase in this all-in-one HTML5 development environment.
Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
http://pubads.g.doubleclick.net/gampad/clk?id=254741911&iu=/4140
_______________________________________________
Jmol-commits mailing list
Jmol-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-commits

Reply via email to