Revision: 20371
          http://sourceforge.net/p/jmol/code/20371
Author:   hansonr
Date:     2015-03-09 02:05:50 +0000 (Mon, 09 Mar 2015)
Log Message:
-----------
refactoring CmdExt and IsoExt; adding ScriptExt

Modified Paths:
--------------
    trunk/Jmol/src/org/jmol/script/ScriptExpr.java
    trunk/Jmol/src/org/jmol/scriptext/CmdExt.java
    trunk/Jmol/src/org/jmol/scriptext/IsoExt.java
    trunk/Jmol/src/org/jmol/scriptext/MathExt.java
    trunk/Jmol/src/org/jmol/scriptext/SmilesExt.java

Added Paths:
-----------
    trunk/Jmol/src/org/jmol/scriptext/ScriptExt.java

Modified: trunk/Jmol/src/org/jmol/script/ScriptExpr.java
===================================================================
--- trunk/Jmol/src/org/jmol/script/ScriptExpr.java      2015-03-09 01:38:45 UTC 
(rev 20370)
+++ trunk/Jmol/src/org/jmol/script/ScriptExpr.java      2015-03-09 02:05:50 UTC 
(rev 20371)
@@ -24,7 +24,9 @@
 import org.jmol.modelset.Group;
 import org.jmol.modelset.ModelSet;
 import org.jmol.scriptext.CmdExt;
+import org.jmol.scriptext.IsoExt;
 import org.jmol.scriptext.MathExt;
+import org.jmol.scriptext.ScriptExt;
 import org.jmol.scriptext.SmilesExt;
 import org.jmol.util.BSUtil;
 import org.jmol.util.Elements;
@@ -54,12 +56,12 @@
 
   private CmdExt cmdExt;
   public CmdExt getCmdExt() {
-    return (cmdExt == null ? (cmdExt = (CmdExt) getExt("Cmd")).init(this) : 
cmdExt);
+    return (cmdExt == null ? cmdExt = (CmdExt) ((ScriptExt) 
getExt("Cmd")).init(this) : cmdExt);
   }
 
-  private CmdExt isoExt;
-  public CmdExt getIsoExt() {
-    return (isoExt == null ? (isoExt = (CmdExt) getExt("Iso")).init(this) : 
isoExt);
+  private IsoExt isoExt;
+  public IsoExt getIsoExt() {
+    return (isoExt == null ? isoExt = (IsoExt) ((ScriptExt) 
getExt("Iso")).init(this) : isoExt);
   }
 
   private MathExt mathExt;
@@ -72,7 +74,7 @@
     return (smilesExt == null ? (smilesExt = (SmilesExt) 
getExt("Smiles")).init(this) : smilesExt);
   }
 
-  public Object getExt(String type) {
+  private Object getExt(String type) {
     return Interface.getInterface("org.jmol.scriptext." + type + "Ext", vwr, 
"script");
   }
 

Modified: trunk/Jmol/src/org/jmol/scriptext/CmdExt.java
===================================================================
--- trunk/Jmol/src/org/jmol/scriptext/CmdExt.java       2015-03-09 01:38:45 UTC 
(rev 20370)
+++ trunk/Jmol/src/org/jmol/scriptext/CmdExt.java       2015-03-09 02:05:50 UTC 
(rev 20371)
@@ -45,7 +45,6 @@
 import org.jmol.modelset.StateScript;
 import org.jmol.modelset.Text;
 import org.jmol.modelset.TickInfo;
-import org.jmol.script.JmolCmdExtension;
 import org.jmol.script.SV;
 import org.jmol.script.ScriptCompiler;
 import org.jmol.script.ScriptContext;
@@ -87,15 +86,9 @@
 import org.jmol.viewer.ShapeManager;
 import org.jmol.viewer.StateManager;
 import org.jmol.viewer.TransformManager;
-import org.jmol.viewer.Viewer;
 import org.jmol.viewer.Viewer.ACCESS;
 
-public class CmdExt implements JmolCmdExtension {
-  protected Viewer vwr;
-  protected ScriptEval e;
-  protected boolean chk;
-  protected T[] st;
-  protected int slen;
+public class CmdExt extends ScriptExt {
 
   final static int ERROR_invalidArgument = 22;
 
@@ -104,13 +97,6 @@
   }
 
   @Override
-  public JmolCmdExtension init(Object se) {
-    e = (ScriptEval) se;
-    vwr = e.vwr;
-    return this;
-  }
-
-  @Override
   public String dispatch(int iTok, boolean b, T[] st) throws ScriptException {
     chk = e.chk;
     slen = e.slen;
@@ -196,80 +182,98 @@
     return null;
   }
 
-  protected BS atomExpressionAt(int i) throws ScriptException {
-    return e.atomExpressionAt(i);
-  }
 
-  protected void checkLength(int i) throws ScriptException {
-    e.checkLength(i);
+  /**
+   * used for TRY command
+   * 
+   * @param context
+   * @param shapeManager
+   * @return true if successful; false if not
+   */
+  public boolean evalParallel(ScriptContext context,
+                                  ShapeManager shapeManager) {
+    ScriptEval se = new ScriptEval().setViewer(vwr);
+    se.historyDisabled = true;
+    se.compiler = new ScriptCompiler(vwr);
+    se.sm = shapeManager;
+    try {
+      se.restoreScriptContext(context, true, false, false);
+      // TODO: This will disallow some motion commands
+      //       within a TRY/CATCH block in JavaScript, and
+      //       the code will block. 
+      se.allowJSThreads = false;
+      se.dispatchCommands(false, false, false);
+    } catch (Exception ex) {
+      e.vwr.setStringProperty("_errormessage", "" + ex);
+      if (se.thisContext == null) {
+        Logger.error("Error evaluating context " + ex);
+        if (!vwr.isJS)
+          ex.printStackTrace();
+      }
+      return false;
+    }
+    return true;
   }
-  
-  protected void error(int err) throws ScriptException {
-    e.error(err);
-  }
 
-  protected void invArg() throws ScriptException {
-    e.invArg();
-  }
-
-  protected void invPO() throws ScriptException {
-    error(ScriptError.ERROR_invalidParameterOrder);
-  }
-
-  protected Object getShapeProperty(int shapeType, String propertyName) {
-    return e.getShapeProperty(shapeType, propertyName);
-  }
-
-  protected String paramAsStr(int i) throws ScriptException {
-    return e.paramAsStr(i);
-  }
-
-  protected P3 centerParameter(int i) throws ScriptException {
-    return e.centerParameter(i);
-  }
-
-  protected float floatParameter(int i) throws ScriptException {
-    return e.floatParameter(i);
-  }
-
-  protected P3 getPoint3f(int i, boolean allowFractional) throws 
ScriptException {
-    return e.getPoint3f(i, allowFractional);
-  }
-
-  protected int intParameter(int index) throws ScriptException {
-    return e.intParameter(index);
-  }
-
-  protected boolean isFloatParameter(int index) {
-    switch (e.tokAt(index)) {
-    case T.integer:
-    case T.decimal:
-      return true;
+  @SuppressWarnings("static-access")
+  public Object getBitsetIdent(BS bs, String label, Object tokenValue,
+                               boolean useAtomMap, int index,
+                               boolean isExplicitlyAll) {
+    boolean isAtoms = !(tokenValue instanceof BondSet);
+    if (isAtoms) {
+      if (label == null)
+        label = vwr.getStandardLabelFormat(0);
+      else if (label.length() == 0)
+        label = "%[label]";
     }
-    return false;
+    int pt = (label == null ? -1 : label.indexOf("%"));
+    boolean haveIndex = (index != Integer.MAX_VALUE);
+    if (bs == null || chk || isAtoms && pt < 0) {
+      if (label == null)
+        label = "";
+      return isExplicitlyAll ? new String[] { label } : (Object) label;
+    }
+    ModelSet modelSet = vwr.ms;
+    int n = 0;
+    LabelToken labeler = modelSet.getLabeler();
+    int[] indices = (isAtoms || !useAtomMap ? null : ((BondSet) tokenValue)
+        .associatedAtoms);
+    if (indices == null && label != null && label.indexOf("%D") > 0)
+      indices = vwr.ms.getAtomIndices(bs);
+    boolean asIdentity = (label == null || label.length() == 0);
+    Map<String, Object> htValues = (isAtoms || asIdentity ? null : LabelToken
+        .getBondLabelValues());
+    LabelToken[] tokens = (asIdentity ? null : isAtoms ? labeler.compile(
+        vwr, label, '\0', null) : labeler.compile(vwr, label, '\1',
+        htValues));
+    int nmax = (haveIndex ? 1 : BSUtil.cardinalityOf(bs));
+    String[] sout = new String[nmax];
+    P3 ptTemp = new P3();
+    for (int j = (haveIndex ? index : bs.nextSetBit(0)); j >= 0; j = bs
+        .nextSetBit(j + 1)) {
+      String str;
+      if (isAtoms) {
+        if (asIdentity)
+          str = modelSet.at[j].getInfo();
+        else
+          str = labeler.formatLabelAtomArray(vwr, modelSet.at[j], tokens,
+              '\0', indices, ptTemp);
+      } else {
+        Bond bond = modelSet.bo[j];
+        if (asIdentity)
+          str = bond.getIdentity();
+        else
+          str = labeler
+              .formatLabelBond(vwr, bond, tokens, htValues, indices, ptTemp);
+      }
+      str = PT.formatStringI(str, "#", (n + 1));
+      sout[n++] = str;
+      if (haveIndex)
+        break;
+    }
+    return nmax == 1 && !isExplicitlyAll ? sout[0] : (Object) sout;
   }
 
-  protected void setShapeProperty(int shapeType, String propertyName,
-                                Object propertyValue) {
-    e.setShapeProperty(shapeType, propertyName, propertyValue);
-  }
-
-  protected void showString(String s) {
-    e.showString(s);
-  }
-
-  protected String stringParameter(int index) throws ScriptException {
-    return e.stringParameter(index);
-  }
-
-  protected T getToken(int i) throws ScriptException {
-    return e.getToken(i);
-  }
-
-  protected int tokAt(int i) {
-    return e.tokAt(i);
-  }
-
   ///////////////// Jmol script commands ////////////
   
   private void cache() throws ScriptException {
@@ -3007,40 +3011,7 @@
   }
 
   /**
-   * used for TRY command
    * 
-   * @param context
-   * @param shapeManager
-   * @return true if successful; false if not
-   */
-  @Override
-  public boolean evalParallel(ScriptContext context,
-                                  ShapeManager shapeManager) {
-    ScriptEval se = new ScriptEval().setViewer(vwr);
-    se.historyDisabled = true;
-    se.compiler = new ScriptCompiler(vwr);
-    se.sm = shapeManager;
-    try {
-      se.restoreScriptContext(context, true, false, false);
-      // TODO: This will disallow some motion commands
-      //       within a TRY/CATCH block in JavaScript, and
-      //       the code will block. 
-      se.allowJSThreads = false;
-      se.dispatchCommands(false, false, false);
-    } catch (Exception ex) {
-      e.vwr.setStringProperty("_errormessage", "" + ex);
-      if (se.thisContext == null) {
-        Logger.error("Error evaluating context " + ex);
-        if (!vwr.isJS)
-          ex.printStackTrace();
-      }
-      return false;
-    }
-    return true;
-  }
-
-  /**
-   * 
    * @param args
    * @return string for write() function
    * @throws ScriptException
@@ -4434,45 +4405,6 @@
     return sb.toString();
   }
 
-  /**
-   * Checks color, translucent, opaque parameters.
-   * @param eval 
-   * @param i
-   * @param allowNone
-   * @param ret returned int argb color
-   * @return translucentLevel and sets iToken and ret[0]
-   * 
-   * @throws ScriptException
-   */
-  protected float getColorTrans(ScriptEval eval, int i, boolean allowNone, int 
ret[]) throws ScriptException {
-    float translucentLevel = Float.MAX_VALUE;
-    if (eval.theTok != T.color)
-      --i;
-    switch (tokAt(i + 1)) {
-    case T.translucent:
-      i++;
-      translucentLevel = (isFloatParameter(i + 1) ? 
eval.getTranslucentLevel(++i)
-          : vwr.getFloat(T.defaulttranslucent));
-      break;
-    case T.opaque:
-      i++;
-      translucentLevel = 0;
-      break;
-    }
-    if (eval.isColorParam(i + 1)) {
-      ret[0] = eval.getArgbParam(++i);
-    } else if (tokAt(i + 1) == T.none) {
-      ret[0] = 0;
-      eval.iToken = i + 1;
-    } else if (translucentLevel == Float.MAX_VALUE) {
-      invArg();
-    } else {
-      ret[0] = Integer.MIN_VALUE;
-    }
-    i = eval.iToken;
-    return translucentLevel;
-  }
-
   private String getIsosurfaceJvxl(boolean asMesh, int iShape) {
     return (chk ? "" : (String) getShapeProperty(iShape, asMesh ? "jvxlMeshX"
         : "jvxlDataXml"));
@@ -4520,27 +4452,6 @@
     return (i < args.length && args[i] != null ? args[i].tok : T.nada);
   }
 
-  protected void finalizeObject(int shapeID, int colorArgb,
-                              float translucentLevel, int intScale,
-                              boolean doSet, Object data,
-                              int iptDisplayProperty, BS bs)
-       throws ScriptException {
-     if (doSet) {
-       setShapeProperty(shapeID, "set", data);
-     }
-     if (colorArgb != Integer.MIN_VALUE)
-       e.setShapePropertyBs(shapeID, "color", Integer.valueOf(colorArgb), bs);
-     if (translucentLevel != Float.MAX_VALUE)
-       e.setShapeTranslucency(shapeID, "", "translucent", translucentLevel, 
bs);
-     if (intScale != 0) {
-       setShapeProperty(shapeID, "scale", Integer.valueOf(intScale));
-     }
-     if (iptDisplayProperty > 0) {
-       if (!e.setMeshDisplayProperty(shapeID, iptDisplayProperty, 0))
-         invArg();
-     }
-   }
-
   private float getPlotMinMax(float[] data, boolean isMax, int tok) {
     if (data == null)
       return 0;
@@ -4566,75 +4477,6 @@
     return fmax;
   }
 
-  @Override
-  @SuppressWarnings("static-access")
-  public Object getBitsetIdent(BS bs, String label, Object tokenValue,
-                               boolean useAtomMap, int index,
-                               boolean isExplicitlyAll) {
-    boolean isAtoms = !(tokenValue instanceof BondSet);
-    if (isAtoms) {
-      if (label == null)
-        label = vwr.getStandardLabelFormat(0);
-      else if (label.length() == 0)
-        label = "%[label]";
-    }
-    int pt = (label == null ? -1 : label.indexOf("%"));
-    boolean haveIndex = (index != Integer.MAX_VALUE);
-    if (bs == null || chk || isAtoms && pt < 0) {
-      if (label == null)
-        label = "";
-      return isExplicitlyAll ? new String[] { label } : (Object) label;
-    }
-    ModelSet modelSet = vwr.ms;
-    int n = 0;
-    LabelToken labeler = modelSet.getLabeler();
-    int[] indices = (isAtoms || !useAtomMap ? null : ((BondSet) tokenValue)
-        .associatedAtoms);
-    if (indices == null && label != null && label.indexOf("%D") > 0)
-      indices = vwr.ms.getAtomIndices(bs);
-    boolean asIdentity = (label == null || label.length() == 0);
-    Map<String, Object> htValues = (isAtoms || asIdentity ? null : LabelToken
-        .getBondLabelValues());
-    LabelToken[] tokens = (asIdentity ? null : isAtoms ? labeler.compile(
-        vwr, label, '\0', null) : labeler.compile(vwr, label, '\1',
-        htValues));
-    int nmax = (haveIndex ? 1 : BSUtil.cardinalityOf(bs));
-    String[] sout = new String[nmax];
-    P3 ptTemp = new P3();
-    for (int j = (haveIndex ? index : bs.nextSetBit(0)); j >= 0; j = bs
-        .nextSetBit(j + 1)) {
-      String str;
-      if (isAtoms) {
-        if (asIdentity)
-          str = modelSet.at[j].getInfo();
-        else
-          str = labeler.formatLabelAtomArray(vwr, modelSet.at[j], tokens,
-              '\0', indices, ptTemp);
-      } else {
-        Bond bond = modelSet.bo[j];
-        if (asIdentity)
-          str = bond.getIdentity();
-        else
-          str = labeler
-              .formatLabelBond(vwr, bond, tokens, htValues, indices, ptTemp);
-      }
-      str = PT.formatStringI(str, "#", (n + 1));
-      sout[n++] = str;
-      if (haveIndex)
-        break;
-    }
-    return nmax == 1 && !isExplicitlyAll ? sout[0] : (Object) sout;
-  }
-
-  protected String setShapeId(int iShape, int i, boolean idSeen)
-      throws ScriptException {
-      if (idSeen)
-        invArg();
-      String name = e.setShapeNameParameter(i).toLowerCase();
-      setShapeProperty(iShape, "thisID", name);
-      return name;
-  }
-
   private Object parseDataArray(String str, boolean is3D) {
     str = Parser.fixDataString(str);
     int[] lines = Parser.markLines(str, '\n');

Modified: trunk/Jmol/src/org/jmol/scriptext/IsoExt.java
===================================================================
--- trunk/Jmol/src/org/jmol/scriptext/IsoExt.java       2015-03-09 01:38:45 UTC 
(rev 20370)
+++ trunk/Jmol/src/org/jmol/scriptext/IsoExt.java       2015-03-09 02:05:50 UTC 
(rev 20371)
@@ -36,7 +36,6 @@
 import org.jmol.java.BS;
 import org.jmol.modelset.Atom;
 import org.jmol.quantum.QS;
-import org.jmol.script.JmolCmdExtension;
 import org.jmol.script.SV;
 import org.jmol.script.ScriptError;
 import org.jmol.script.ScriptEval;
@@ -69,17 +68,12 @@
 import org.jmol.viewer.JC;
 
 @J2SIgnoreImport(org.jmol.quantum.QS.class)
-public class IsoExt extends CmdExt {
+public class IsoExt extends ScriptExt {
 
-  public IsoExt() {}
+  public IsoExt() {
+    // used by Reflection
+  }
   
-  @Override 
-  public JmolCmdExtension init(Object eval) {
-    e = (ScriptEval) eval;
-    vwr = e.vwr;
-    return this;
-  }
-
   @Override
   public String dispatch(int iTok, boolean b, T[] st) throws ScriptException {
     chk = e.chk;
@@ -274,7 +268,7 @@
     case T.helix:
     case T.quaternion:
     case T.ramachandran:
-      plot(st);
+      e.getCmdExt().plot(st);
       return false;
     }
     boolean havePoints = false;

Modified: trunk/Jmol/src/org/jmol/scriptext/MathExt.java
===================================================================
--- trunk/Jmol/src/org/jmol/scriptext/MathExt.java      2015-03-09 01:38:45 UTC 
(rev 20370)
+++ trunk/Jmol/src/org/jmol/scriptext/MathExt.java      2015-03-09 02:05:50 UTC 
(rev 20371)
@@ -41,7 +41,6 @@
 import org.jmol.modelset.Atom;
 import org.jmol.modelset.BondSet;
 import org.jmol.modelset.ModelSet;
-import org.jmol.script.JmolMathExtension;
 import org.jmol.script.SV;
 import org.jmol.script.ScriptEval;
 import org.jmol.script.ScriptException;
@@ -76,7 +75,7 @@
 import org.jmol.viewer.JC;
 import org.jmol.viewer.Viewer;
 
-public class MathExt implements JmolMathExtension {
+public class MathExt {
   
   private Viewer vwr;
   private ScriptEval e;
@@ -85,8 +84,7 @@
     // used by Reflection
   }
 
-  @Override
-  public JmolMathExtension init(Object se) {
+  public MathExt init(Object se) {
     e = (ScriptEval) se;
     vwr = e.vwr;
     return this;
@@ -95,7 +93,6 @@
   ///////////// ScriptMathProcessor extensions ///////////
 
   
-  @Override
   public boolean evaluate(ScriptMathProcessor mp, T op, SV[] args, int tok)
       throws ScriptException {
     switch (tok) {
@@ -2064,7 +2061,7 @@
       return false;
     if (rand == null)
       rand = new Random();
-    float lower = 0, upper = 1, seed = Float.NaN;
+    float lower = 0, upper = 1;
     switch (args.length) {
     case 3:
       rand.setSeed((int) SV.fValue(args[2]));
@@ -2705,7 +2702,6 @@
   }
 
 
-  @Override
   @SuppressWarnings("unchecked")
   public Object getMinMax(Object floatOrSVArray, int tok) {
     float[] data = null;
@@ -2915,7 +2911,6 @@
     return null;
   }
 
-  @Override
   public BS setContactBitSets(BS bsA, BS bsB, boolean localOnly,
                                float distance, RadiusData rd,
                                boolean warnMultiModel) {

Added: trunk/Jmol/src/org/jmol/scriptext/ScriptExt.java
===================================================================
--- trunk/Jmol/src/org/jmol/scriptext/ScriptExt.java                            
(rev 0)
+++ trunk/Jmol/src/org/jmol/scriptext/ScriptExt.java    2015-03-09 02:05:50 UTC 
(rev 20371)
@@ -0,0 +1,172 @@
+package org.jmol.scriptext;
+
+import javajs.util.P3;
+
+import org.jmol.java.BS;
+import org.jmol.script.ScriptError;
+import org.jmol.script.ScriptEval;
+import org.jmol.script.ScriptException;
+import org.jmol.script.T;
+import org.jmol.viewer.Viewer;
+
+public abstract class ScriptExt {
+
+  protected Viewer vwr;
+  protected ScriptEval e;
+  protected boolean chk;
+  protected T[] st;
+  protected int slen;
+  
+  public ScriptExt init(Object eval) {
+    e = (ScriptEval) eval;
+    vwr = e.vwr;
+    return this;
+  }
+
+  public abstract String dispatch(int iTok, boolean b, T[] st) throws 
ScriptException;
+  
+  protected BS atomExpressionAt(int i) throws ScriptException {
+    return e.atomExpressionAt(i);
+  }
+
+  protected void checkLength(int i) throws ScriptException {
+    e.checkLength(i);
+  }
+  
+  protected void error(int err) throws ScriptException {
+    e.error(err);
+  }
+
+  protected void invArg() throws ScriptException {
+    e.invArg();
+  }
+
+  protected void invPO() throws ScriptException {
+    error(ScriptError.ERROR_invalidParameterOrder);
+  }
+
+  protected Object getShapeProperty(int shapeType, String propertyName) {
+    return e.getShapeProperty(shapeType, propertyName);
+  }
+
+  protected String paramAsStr(int i) throws ScriptException {
+    return e.paramAsStr(i);
+  }
+
+  protected P3 centerParameter(int i) throws ScriptException {
+    return e.centerParameter(i);
+  }
+
+  protected float floatParameter(int i) throws ScriptException {
+    return e.floatParameter(i);
+  }
+
+  protected P3 getPoint3f(int i, boolean allowFractional) throws 
ScriptException {
+    return e.getPoint3f(i, allowFractional);
+  }
+
+  protected int intParameter(int index) throws ScriptException {
+    return e.intParameter(index);
+  }
+
+  protected boolean isFloatParameter(int index) {
+    switch (e.tokAt(index)) {
+    case T.integer:
+    case T.decimal:
+      return true;
+    }
+    return false;
+  }
+
+  protected void setShapeProperty(int shapeType, String propertyName,
+                                Object propertyValue) {
+    e.setShapeProperty(shapeType, propertyName, propertyValue);
+  }
+
+  protected void showString(String s) {
+    e.showString(s);
+  }
+
+  protected String stringParameter(int index) throws ScriptException {
+    return e.stringParameter(index);
+  }
+
+  protected T getToken(int i) throws ScriptException {
+    return e.getToken(i);
+  }
+
+  protected int tokAt(int i) {
+    return e.tokAt(i);
+  }
+
+  protected String setShapeId(int iShape, int i, boolean idSeen)
+      throws ScriptException {
+      if (idSeen)
+        invArg();
+      String name = e.setShapeNameParameter(i).toLowerCase();
+      setShapeProperty(iShape, "thisID", name);
+      return name;
+  }
+
+  /**
+   * Checks color, translucent, opaque parameters.
+   * @param eval 
+   * @param i
+   * @param allowNone
+   * @param ret returned int argb color
+   * @return translucentLevel and sets iToken and ret[0]
+   * 
+   * @throws ScriptException
+   */
+  protected float getColorTrans(ScriptEval eval, int i, boolean allowNone, int 
ret[]) throws ScriptException {
+    float translucentLevel = Float.MAX_VALUE;
+    if (eval.theTok != T.color)
+      --i;
+    switch (tokAt(i + 1)) {
+    case T.translucent:
+      i++;
+      translucentLevel = (isFloatParameter(i + 1) ? 
eval.getTranslucentLevel(++i)
+          : vwr.getFloat(T.defaulttranslucent));
+      break;
+    case T.opaque:
+      i++;
+      translucentLevel = 0;
+      break;
+    }
+    if (eval.isColorParam(i + 1)) {
+      ret[0] = eval.getArgbParam(++i);
+    } else if (tokAt(i + 1) == T.none) {
+      ret[0] = 0;
+      eval.iToken = i + 1;
+    } else if (translucentLevel == Float.MAX_VALUE) {
+      invArg();
+    } else {
+      ret[0] = Integer.MIN_VALUE;
+    }
+    i = eval.iToken;
+    return translucentLevel;
+  }
+
+  protected void finalizeObject(int shapeID, int colorArgb,
+                                float translucentLevel, int intScale,
+                                boolean doSet, Object data,
+                                int iptDisplayProperty, BS bs)
+         throws ScriptException {
+       if (doSet) {
+         setShapeProperty(shapeID, "set", data);
+       }
+       if (colorArgb != Integer.MIN_VALUE)
+         e.setShapePropertyBs(shapeID, "color", Integer.valueOf(colorArgb), 
bs);
+       if (translucentLevel != Float.MAX_VALUE)
+         e.setShapeTranslucency(shapeID, "", "translucent", translucentLevel, 
bs);
+       if (intScale != 0) {
+         setShapeProperty(shapeID, "scale", Integer.valueOf(intScale));
+       }
+       if (iptDisplayProperty > 0) {
+         if (!e.setMeshDisplayProperty(shapeID, iptDisplayProperty, 0))
+           invArg();
+       }
+     }
+
+
+}


Property changes on: trunk/Jmol/src/org/jmol/scriptext/ScriptExt.java
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Modified: trunk/Jmol/src/org/jmol/scriptext/SmilesExt.java
===================================================================
--- trunk/Jmol/src/org/jmol/scriptext/SmilesExt.java    2015-03-09 01:38:45 UTC 
(rev 20370)
+++ trunk/Jmol/src/org/jmol/scriptext/SmilesExt.java    2015-03-09 02:05:50 UTC 
(rev 20371)
@@ -29,7 +29,6 @@
 import org.jmol.java.BS;
 import org.jmol.modelset.Atom;
 import org.jmol.modelset.BondSet;
-import org.jmol.script.JmolSmilesExtension;
 import org.jmol.script.ScriptEval;
 import org.jmol.script.ScriptException;
 import org.jmol.util.BSUtil;
@@ -43,7 +42,7 @@
 import javajs.util.M4;
 import javajs.util.P3;
 
-public class SmilesExt implements JmolSmilesExtension {
+public class SmilesExt {
   
   private ScriptEval e;
   private SmilesMatcherInterface sm;
@@ -52,8 +51,7 @@
     // used by Reflection
   }
 
-  @Override
-  public JmolSmilesExtension init(Object se) {
+  public SmilesExt init(Object se) {
     e = (ScriptEval) se;
     sm = e.vwr.getSmilesMatcher();
     return this;
@@ -81,7 +79,6 @@
    * @return standard deviation
    * @throws ScriptException
    */
-  @Override
   public float getSmilesCorrelation(BS bsA, BS bsB, String smiles,
                                      Lst<P3> ptsA, Lst<P3> ptsB, M4 m4,
                                      Lst<BS> vReturn, boolean isSmarts,
@@ -161,7 +158,6 @@
     return 0;
   }
 
-  @Override
   public Object getSmilesMatches(String pattern, String smiles, BS bsSelected,
                                  BS bsMatch3D, boolean isSmarts,
                                  boolean asOneBitset) throws ScriptException {
@@ -238,7 +234,6 @@
     return list;
   }
 
-  @Override
   public float[] getFlexFitList(BS bs1, BS bs2, String smiles1,
                                  boolean isSmarts) throws ScriptException {
     int[][] mapSet = AU.newInt2(2);

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


------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Jmol-commits mailing list
Jmol-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-commits

Reply via email to