1 
2 /* $RCSfile$
3  * $Author: hansonr $
4 efe * $Date: 2021-11-28 10:58:48 -0600 (Sun, 28 Nov 2021) $
5  * $Revision: 22265 $
6  *
7  * Copyright (C) 2003-2005  The Jmol Development Team
8  *
9  * Contact: jmol-developers@lists.sf.net
10  *
11  *  This library is free software; you can redistribute it and/or
12  *  modify it under the terms of the GNU Lesser General Public
13  *  License as published by the Free Software Foundation; either
14  *  version 2.1 of the License, or (at your option) any later version.
15  *
16  *  This library is distributed in the hope that it will be useful,
17  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
18  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19  *  Lesser General Public License for more details.
20  *
21  *  You should have received a copy of the GNU Lesser General Public
22  *  License along with this library; if not, write to the Free Software
23  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
24  */
25 
26 package org.jmol.script;
27 
28 import java.util.Arrays;
29 import java.util.Hashtable;
30 import java.util.Map;
31 import java.util.Map.Entry;
32 
33 import javajs.util.AU;
34 import javajs.util.Lst;
35 
36 import org.jmol.util.Logger;
37 
38 /**
39  *
40  * Script token class.
41  *
42  */
43 public class T {
44   public int tok;
45   public Object value;
46   public int intValue = Integer.MAX_VALUE;
47 
t(int tok)48   public final static T t(int tok) {
49     T token = new T();
50     token.tok = tok;
51     return token;
52   }
53 
tv(int tok, int intValue, Object value)54   public final static T tv(int tok, int intValue, Object value) {
55     T token = t(tok);
56     token.intValue = intValue;
57     token.value = value;
58     return token;
59   }
60 
o(int tok, Object value)61   public final static T o(int tok, Object value) {
62     T token = t(tok);
63     token.value = value;
64     return token;
65   }
66 
n(int tok, int intValue)67   public final static T n(int tok, int intValue) {
68     T token = t(tok);
69     token.intValue = intValue;
70     return token;
71   }
72 
i(int intValue)73   public final static T i(int intValue) {
74     T token = t(integer);
75     token.intValue = intValue;
76     return token;
77   }
78 
79   public final static String[] astrType;
80 
81   static {
82     astrType = "nada identifier integer decimal string inscode hash array point point4 bitset matrix3f matrix4f array hash bytearray keyword".split(" ");
83   }
84 
85   public final static int nada       =  0;
86   public final static int integer    =  2;
87   public final static int decimal    =  3;
88   public final static int string     =  4;
89 
90   public final static int inscode    =  5;
91   public final static int hash       =  6;  // associative array; Hashtable
92   public final static int varray     =  7;  // List<ScriptVariable>
93   public final static int point3f    =  8;
94   public final static int point4f    =  9;
95   public final static int bitset     =  10;
96 
97   public final static int matrix3f   = 11;
98   public final static int matrix4f   = 12;
99   // listf "list-float" is specifically for xxx.all.bin,
100   // but it could be developed further
101   public final static int listf      = 13;
102   public final static int context    = 14;
103   public final static int barray     = 15; // byte array
104   final private static int keyword   = 16;
105 
106 
tokAttr(int a, int b)107   public static boolean tokAttr(int a, int b) {
108     return (a & b) == (b & b);
109   }
110 
tokAttrOr(int a, int b1, int b2)111   public static boolean tokAttrOr(int a, int b1, int b2) {
112     return (a & b1) == (b1 & b1) || (a & b2) == (b2 & b2);
113   }
114 
115 
116 
117   // TOKEN BIT FIELDS
118 
119   // first 9 bits are generally identifier bits
120   // or bits specific to a type
121 
122   /* bit flags:
123    *
124    * parameter bit flags:
125    *
126    * 3         2         1         0
127    * 0987654321098765432109876543210
128    *    |   |   |   |   |   |   |
129    *  x                  xxxxxxxxxxx setparam  "set THIS ...."
130    *  x     x                        strparam
131    *  x    x                         intparam
132    *  x   x                          floatparam
133    *  x  x                           booleanparam
134    * xx                              deprecatedparam
135    * x                   xxxxxxxxxxx misc
136    *
137    * 3         2         1         0
138    * 0987654321098765432109876543210
139    *                   x             sciptCommand
140    *                  xx             atomExpressionCommand
141    *                 x x           o implicitStringCommand (parsing of @{x})
142    *                 x x           x implicitStringCommand (no initial parsing of @{x})
143    *                x  x             mathExpressionCommand
144    *               xx  x             flowCommand
145    *              x    x             shapeCommand
146    *             x                   noArgs
147    *            x                    defaultON
148    *                     xxxxxxxxxxx uniqueID (may include math flags)
149    *
150    *
151    * math bit flags:
152    *
153    * 3         2         1         0
154    * 0987654321098765432109876543210
155    *    FFFF    FFFF    FFFF    FFFF
156    *          x                      predefined set
157    * x       x                       atomproperty
158    * x      xx                       strproperty
159    * x     x x                       intproperty
160    * x    x  x                       floatproperty
161    * x   x                           mathproperty
162    *    x                            mathfunc
163    *
164    *
165    *                           xxxxx unique id 1 to 0x1F (31)
166    *                          x      min
167    *                         x       max
168    *                         xx      average
169    *                        x        sum
170    *                        x x      sum2
171    *                        xx       stddev
172    *                        xxx      selectedfloat  (including just the atoms selected)
173    *                       x         allfloat (including all atoms, not just selected)
174    *                       x???      [available]
175    *                       xxxx      minmaxmask (all)
176    *                     xx          maximum number of parameters for function
177    *                    x            settable
178    *
179    * 3         2         1         0
180    * 0987654321098765432109876543210
181    *   x       x                     mathop
182    *   x       x           x         comparator
183    *                            xxxx unique id (0 to 15)
184    *                        xxxx     precedence
185    *
186    *
187    *
188    */
189 
190   //
191   // parameter bit flags
192   //
193 
194   public final static int setparam          = 1 << 29; // parameter to set command
195   public final static int misc              = 1 << 30; // misc parameter
196   public final static int deprecatedparam   = setparam | misc;
197 
198   public final static int identifier =  misc;
199 
200   public final static int scriptCommand            = 1 << 12;
201 
202   // the command assumes an atom expression as the first parameter
203   // -- center, define, delete, display, hide, restrict, select, subset, zap
204   public final static int atomExpressionCommand  = (1 << 13) | scriptCommand;
205 
206   // this implicitString flag indicates that then entire command is an implied quoted string
207   // -- ODD echo, hover, label, message, pause  -- do NOT parse variables the same way
208   // -- EVEN help, javascript, cd, gotocmd -- allow for single starting variable
209   public final static int implicitStringCommand     = (1 << 14) | scriptCommand;
210 
211   // this mathExpression flag indicates that
212   // the command evaluates a math expression.
213   // -- elseif, forcmd, ifcmd, print, returncmd, set, var, whilecmd
214   public final static int mathExpressionCommand = (1 << 15) | scriptCommand;
215 
216   // program flow commands include:
217   // -- breakcmd, continuecmd, elsecmd, elseif, end, endifcmd, switch, case,
218   //    forcmd, function, ifcmd, whilecmd
219   public final static int flowCommand    = (1 << 16) | mathExpressionCommand;
220 
221   // these commands will be handled specially
222   public final static int shapeCommand   = (1 << 17) | scriptCommand;
223 
224   // Command argument compile flags
225 
226   public final static int noArgs         = 1 << 18;
227   public final static int defaultON      = 1 << 19;
228 
229   public final static int predefinedset = (1 << 21);
230 
231   public final static int atomproperty  = (1 << 22) | misc;
232   // all atom properties are either a member of one of the next three groups,
233   // or they are a point/vector, in which case they are just atomproperty
234   public final static int strproperty   = (1 << 23) | atomproperty; // string property
235   public final static int intproperty   = (1 << 24) | atomproperty; // int parameter
236   public final static int floatproperty = (1 << 25) | atomproperty; // float parameter
237 
238   public final static int PROPERTYFLAGS = strproperty | intproperty | floatproperty; // includes point-type
239 
240   // parameters that can be set using the SET command
241   public final static int strparam   = (1 << 23) | setparam; // string parameter
242   public final static int intparam   = (1 << 24) | setparam; // int parameter
243   public final static int floatparam = (1 << 25) | setparam; // float parameter
244   public final static int booleanparam = (1 << 26) | setparam; // boolean parameter
245   public final static int paramTypes = strparam | intparam | floatparam | booleanparam;
246 
247   // note: the booleanparam and the mathproperty bits are the same, but there is no
248   //       conflict because mathproperty is only checked in ScriptEvaluator.getBitsetProperty
249   //       meaning it is coming after a "." as in {*}.min
250 
251   public final static int mathproperty         = (1 << 26) | misc; // {xxx}.nnnn
252   public final static int mathfunc             = (1 << 27);
253   public final static int mathop               = (1 << 28);
254   public final static int comparator           = mathop | (1 << 8);
255 
256   public final static int center       = 1 | atomExpressionCommand;
257   public final static int define       = 2 | atomExpressionCommand;
258   public final static int delete       = 3 | atomExpressionCommand;
259   public final static int display      = 4 | atomExpressionCommand | deprecatedparam;
260   public final static int fixed        = 5 | atomExpressionCommand; // Jmol 12.0.RC15
261   public final static int hide         = 6 | atomExpressionCommand;
262   public final static int restrict     = 7 | atomExpressionCommand;
263 //public final static int select       see mathfunc
264   public final static int subset       = 8 | atomExpressionCommand | predefinedset;
265   public final static int zap          = 9 | atomExpressionCommand;
266 
267   public final static int print        = 1 | mathExpressionCommand;
268   public final static int returncmd    = 2 | mathExpressionCommand;
269   public final static int set          = 3 | mathExpressionCommand;
270   public final static int var          = 4 | mathExpressionCommand;
271   public final static int log          = 5 | mathExpressionCommand;
272   public final static int throwcmd     = 6 | mathExpressionCommand;
273   //public final static int prompt     see mathfunc
274 
275   public final static int echo         = 1 /* must be odd */ | implicitStringCommand | shapeCommand | setparam;
276   public final static int help         = 2 /* must be even */ | implicitStringCommand;
277   public final static int hover        = 3 /* must be odd */ | implicitStringCommand | defaultON;
278 //public final static int javascript   see mathfunc
279 //public final static int label        see mathfunc
280   public final static int message      = 5 /* must be odd */ | implicitStringCommand;
281   public final static int pause        = 7 /* must be odd */ | implicitStringCommand;
282 
283   //these commands control flow
284   //sorry about GOTO!
285 //public final static int function     see mathfunc
286 //public final static int ifcmd        see mathfunc
287   public final static int elseif       = 2 | flowCommand;
288   public final static int elsecmd      = 3 | flowCommand | noArgs;
289   public final static int endifcmd     = 4 | flowCommand | noArgs;
290 //public final static int forcmd       see mathfunc
291   public final static int whilecmd     = 6 | flowCommand;
292   public final static int breakcmd     = 7 | flowCommand;
293   public final static int continuecmd  = 8 | flowCommand;
294   public final static int end          = 9 | flowCommand;
295   public final static int switchcmd    = 10 | flowCommand;
296   public final static int casecmd      = 11 | flowCommand;
297   public final static int catchcmd     = 12 | flowCommand;
298   public final static int defaultcmd   = 13 | flowCommand;
299   public final static int trycmd       = 14 | flowCommand | noArgs;
300 
301   public final static int animation    = scriptCommand | 1;
302   public final static int assign       = scriptCommand | 2;
303   public final static int background   = scriptCommand | 3 | deprecatedparam;
304   public final static int bind         = scriptCommand | 4;
305   public final static int bondorder    = scriptCommand | 5;
306   public final static int calculate    = scriptCommand | 6;
307 //public final static int cache  see mathfunc
308   public final static int capture      = scriptCommand | 7;
309   public final static int cd           = scriptCommand | 8 /* must be even */| implicitStringCommand; // must be even
310   public final static int centerat     = scriptCommand | 9;
311 //public final static int color  see intproperty
312 //public final static int configuration see intproperty
313   public final static int connect      = scriptCommand | 10;
314   public final static int console      = scriptCommand | 11 | defaultON;
315 //public final static int data  see mathfunc
316   public final static int delay        = scriptCommand | 13 | defaultON;
317   public final static int depth        = scriptCommand | 14 | intparam | defaultON;
318   public final static int exit         = scriptCommand | 15 | noArgs;
319   public final static int exitjmol     = scriptCommand | 16 | noArgs;
320 //public final static int file  see intproperty
321   public final static int font         = scriptCommand | 18;
322   public final static int frame        = scriptCommand | 19;
323 //public final static int getproperty  see mathfunc
324   public final static int gotocmd      = scriptCommand | 20 /*must be even*/| implicitStringCommand;
325   public final static int hbond        = scriptCommand | 22 | deprecatedparam | predefinedset | defaultON;
326   public final static int history      = scriptCommand | 23 | deprecatedparam;
327   public final static int image        = scriptCommand | 24;
328   public final static int initialize   = scriptCommand | 25;
329   public final static int invertSelected = scriptCommand | 26;
330 //public final static int load   see mathfunc
331   public final static int loop         = scriptCommand | 27 | defaultON;
332   public final static int macro        = scriptCommand | 28;
333   public final static int mapproperty  = scriptCommand | 29;
334   public final static int minimize     = scriptCommand | 30;
335   public final static int modelkitmode = scriptCommand | booleanparam | 31;  // 12.0.RC15
336 
337 //public final static int model  see mathfunc
338 //public final static int measure   see mathfunc
339   public final static int move         = scriptCommand | 32;
340   public final static int moveto       = scriptCommand | 33;
341   public final static int mutate       = scriptCommand | 34;
342   public final static int navigate     = scriptCommand | 35;
343 //public final static int quaternion   see mathfunc
344   public final static int parallel     = flowCommand   | 36;
345   public final static int plot         = scriptCommand | 37;
346   public final static int privat       = scriptCommand | 38;
347   public final static int process      = flowCommand   | 39;
348 //  public final static int prompt  see mathfunc
349 //  public final static int push  see mathfunc //internal only
350   public final static int quit         = scriptCommand | 41 | noArgs;
351   public final static int ramachandran = scriptCommand | 42;
352   public final static int redomove = scriptCommand | 43;
353   public final static int refresh      = scriptCommand | 44 | noArgs;
354   public final static int reset        = scriptCommand | 45;
355   public final static int restore      = scriptCommand | 46;
356   public final static int resume       = scriptCommand | 47;
357   public final static int rotate       = scriptCommand | 48 | defaultON;
358   public final static int rotateSelected = scriptCommand | 49;
359   public final static int save  = scriptCommand | 50;
360 //public final static int script   see mathfunc
361   public final static int selectionhalos = scriptCommand | 51 | deprecatedparam | defaultON;
362 // public final static int show     see mathfunc
363   public final static int slab  = scriptCommand | 53 | intparam | defaultON;
364   public final static int spin         = scriptCommand | 55 | deprecatedparam | defaultON;
365   public final static int ssbond = scriptCommand | 56 | deprecatedparam | defaultON;
366   public final static int step         = scriptCommand | 58 | noArgs;
367   public final static int stereo       = scriptCommand | 59 | defaultON;
368 //public final static int structure    see intproperty
369   public final static int sync         = scriptCommand | 60;
370   public final static int timeout      = scriptCommand | 62 | setparam;
371   public final static int translate    = scriptCommand | 64;
372   public final static int translateSelected   = scriptCommand | 66;
373   public final static int unbind              = scriptCommand | 68;
374   public final static int undomove     = scriptCommand | 69;
375   public final static int vibration    = scriptCommand | 70;
376   //public final static int write   see mathfunc
377   public final static int zoom                = scriptCommand | 72;
378   public final static int zoomTo              = scriptCommand | 74;
379 
380   // shapes:
381 
382   public final static int axes         = shapeCommand | 2 | deprecatedparam | defaultON;
383 //public final static int boundbox     see mathproperty
384 //public final static int contact      see mathfunc
385   public final static int cgo          = shapeCommand | 6; // PyMOL Compiled Graphical Object
386   public final static int dipole       = shapeCommand | 7;
387   public final static int draw         = shapeCommand | 8;
388   public final static int frank        = shapeCommand | 10 | deprecatedparam | defaultON;
389   public final static int isosurface   = shapeCommand | 12;
390   public final static int lcaocartoon  = shapeCommand | 14;
391   public final static int measurements = shapeCommand | 16 | setparam;
392   public final static int mo           = shapeCommand | 18 | misc;
393   public final static int nbo          = shapeCommand | 19 | misc;
394   public final static int pmesh        = shapeCommand | 20;
395   public final static int plot3d       = shapeCommand | 22;
396   // public final static int polyhedra see mathfunc
397   // public final static int spacefill see floatproperty
398   public final static int struts       = shapeCommand | 26 | defaultON;
399   // public final static int unitcell see mathfunc
400   public final static int vector       = shapeCommand | 30;
401   public final static int wireframe    = shapeCommand | 32 | defaultON;
402 
403 
404 
405 
406 
407   public final static int amino                = predefinedset | 2;
408   public final static int bonded               = predefinedset | 3;
409   public final static int dna           = predefinedset | 4;
410   public final static int hetero        = predefinedset | 6 | deprecatedparam;
411   public final static int helixalpha           = predefinedset | 7;   // Jmol 12.1.14
412   public final static int helix310             = predefinedset | 8;   // Jmol 12.1.14
413   public final static int helixpi              = predefinedset | 10;
414   public final static int hydrogen      = predefinedset | 12 | deprecatedparam;
415   public final static int leadatom      = predefinedset | 13;
416   public final static int nucleic       = predefinedset | 14;
417   public final static int protein       = predefinedset | 16;
418   public final static int purine        = predefinedset | 18;
419   public final static int pyrimidine    = predefinedset | 20;
420   public final static int rna           = predefinedset | 22;
421   public final static int solvent       = predefinedset | 24 | deprecatedparam;
422   public final static int sidechain     = predefinedset | 26;
423   public final static int surface              = predefinedset | 28;
424   public final static int thismodel            = predefinedset | 30;
425   public final static int sheet         = predefinedset | 32;
426   public final static int spine         = predefinedset | 34;  // 11.9.34
427   // these next are predefined in the sense that they are known quantities
428   public final static int carbohydrate    = predefinedset | 36;
429   public final static int clickable              = predefinedset | 38;
430   public final static int displayed              = predefinedset | 40;
431   public final static int hidden                 = predefinedset | 42;
432   public final static int specialposition = predefinedset | 44;
433   public final static int visible                = predefinedset | 46;
434   public final static int basemodel              = predefinedset | 48; // specific to JCAMP-MOL files
435 
436 
getPrecedence(int tokOperator)437   static int getPrecedence(int tokOperator) {
438     return ((tokOperator >> 4) & 0xF);
439   }
440 
441 
442   public final static int leftparen    = 0 | mathop | 1 << 4;
443   public final static int rightparen   = 1 | mathop | 1 << 4;
444 
445   public final static int opIf         = 1 | mathop | 2 << 4 | setparam;   // set ?
446   public final static int colon        = 2 | mathop | 2 << 4;
447 
448   public final static int comma        = 0 | mathop | 3 << 4;
449 
450   public final static int leftsquare   = 0 | mathop | 4 << 4;
451   public final static int rightsquare  = 1 | mathop | 4 << 4;
452 
453   public final static int opOr         = 0 | mathop | 5 << 4;
454   public final static int opXor        = 1 | mathop | 5 << 4;
455   public final static int opToggle = 2 | mathop | 5 << 4;
456 
457   public final static int opAnd        = 0 | mathop | 6 << 4;
458 
459   public final static int opNot        = 0 | mathop | 7 << 4;
460 
461   public final static int opAND        = 0 | mathop | 8 << 4;
462 
463   public final static int opGT         = 0 | comparator | 9 << 4;
464   public final static int opGE         = 1 | comparator | 9 << 4;
465   public final static int opLE         = 2 | comparator | 9 << 4;
466   public final static int opLT         = 3 | comparator | 9 << 4;
467   public final static int opEQ         = 4 | comparator | 9 << 4;
468   public final static int opNE         = 5 | comparator | 9 << 4;
469   public final static int opLIKE       = 6 | comparator | 9 << 4;
470 
471   public final static int minus        = 0 | mathop | 10 << 4;
472   public final static int plus         = 1 | mathop | 10 << 4;
473 
474   public final static int divide         = 0 | mathop | 11 << 4;
475   public final static int times          = 1 | mathop | 11 << 4;
476   public final static int percent = 2 | mathop | 11 << 4;
477   public final static int leftdivide     = 3 | mathop | 11 << 4;  //   quaternion1 \ quaternion2
478 
479   public final static int unaryMinus   = 0 | mathop | 12 << 4;
480   public final static int minusMinus   = 1 | mathop | 12 << 4;
481   public final static int plusPlus     = 2 | mathop | 12 << 4;
482   public final static int timestimes   = 3 | mathop | 12 << 4;
483 
484 
485   public final static int propselector = 1 | mathop | 13 << 4;
486 
487   public final static int andequals    = 2 | mathop | 13 << 4;
488 
489   // these atom and math properties are invoked after a ".":
490   // x.atoms
491   // myset.bonds
492 
493   // .min and .max, .average, .sum, .sum2, .stddev, and .all
494   // are bitfields added to a preceding property selector
495   // for example, x.atoms.max, x.atoms.all
496   // .all gets incorporated as minmaxmask
497   // .selectedfloat is a special flag used by mapPropety() and plot()
498   // to pass temporary float arrays to the .bin() function
499   // .allfloat is a special flag for colorShape() to get a full
500   // atom float array
501 
502   public final static int minmaxmask /*all*/ = 0xF << 5;
503   public final static int min           = 1 << 5;
504   public final static int max           = 2 << 5;
505   public final static int average       = 3 << 5;
506   public final static int sum           = 4 << 5;
507   public final static int sum2          = 5 << 5;
508   public final static int stddev        = 6 << 5;
509   public final static int selectedfloat = 7 << 5; //not user-selectable
510   public final static int allfloat      = 8 << 5; //not user-selectable
511 
512   public final static int settable           = 1 << 11;
513 
514   // bits 0 - 4 are for an identifier -- DO NOT GO OVER 31!
515   // but, note that we can have more than 1 provided other parameters differ
516 
517   // ___.xxx math properties and all atom properties
518 
519   public final static int atoms     = 1 | mathproperty;
520   public final static int bonds     = 2 | mathproperty | deprecatedparam;
521   public final static int length           = 3 | mathproperty;
522   public final static int lines            = 4 | mathproperty;
523   public final static int reverse   = 5 | mathproperty;
524   public final static int size             = 6 | mathproperty;
525   public final static int type      = 8 | mathproperty;
526   public final static int boundbox  = 9 | mathproperty | deprecatedparam | shapeCommand | defaultON;
527   public final static int xyz       =10 | mathproperty | atomproperty | settable;
528   public final static int fracxyz   =11 | mathproperty | atomproperty | settable;
529   public final static int screenxyz =12 | mathproperty | atomproperty | settable;
530   public final static int fuxyz     =13 | mathproperty | atomproperty | settable;
531   public final static int unitxyz   =14 | mathproperty | atomproperty;
532   public final static int vibxyz    =15 | mathproperty | atomproperty | settable;
533   public final static int modxyz    =16 | mathproperty | atomproperty;
534   public final static int w         =17 | mathproperty;
535   public final static int keys      =18 | mathproperty;
536 
537   // occupancy, radius, and structure are odd, because they takes different meanings when compared
538 
539   public final static int occupancy     = intproperty | floatproperty | 1 | settable;
540   public final static int radius        = intproperty | floatproperty | 2 | deprecatedparam | settable;
541   public final static int structure     = intproperty | strproperty   | 3 | setparam | scriptCommand;
542 
543   // any new int, float, or string property should be added also to LabelToken.labelTokenIds
544   // and the appropriate Atom.atomPropertyXXXX() method
545 
546   public final static int atomtype      = strproperty | 1 | settable;
547   public final static int atomname      = strproperty | 2 | settable;
548   public final static int altloc        = strproperty | 3;
549   public final static int chain         = strproperty | 4 | settable;
550   public final static int element       = strproperty | 5 | settable;
551   public final static int group         = strproperty | 6;
552   public final static int group1        = strproperty | 7;
553   public final static int sequence      = strproperty | 8;
554   public final static int identify      = strproperty | 9;
555   public final static int insertion     = strproperty |10;
556   public final static int seqcode       = strproperty |11;
557   public final static int shape         = strproperty |12;
558   public final static int strucid       = strproperty |13;
559   public final static int symbol        = strproperty |14 | settable;
560   public final static int symmetry      = strproperty |15 | predefinedset;
561   public final static int chirality     = strproperty |16;
562   public final static int ciprule = strproperty |17;
563 
564   public final static int atomno        = intproperty | 1 | settable;
565   public final static int atomid        = intproperty | 2;
566   public final static int atomindex     = intproperty | 3;
567   // bondcount -- see xxx(a)
568   public final static int cell          = intproperty | 5;
569   public final static int centroid      = intproperty | 6;
570   public final static int chainno       = intproperty | 7;
571   public final static int configuration = intproperty | 8 | scriptCommand;
572   //color: see xxx(a, b, c, d)
573   public final static int elemisono     = intproperty | 9;
574   public final static int elemno        = intproperty | 10 | settable;
575   //file: see xxx(a)
576   public final static int formalcharge  = intproperty | 11 | setparam | settable;
577   public final static int groupid       = intproperty | 12;
578   public final static int groupindex    = intproperty | 13;
579   public final static int model         = intproperty | 14 | scriptCommand;
580   public final static int modelindex    = intproperty | 15;
581   public final static int molecule      = intproperty | 16;
582   public final static int monomer       = intproperty | 17;
583   public final static int polymer       = intproperty | 18;
584   public final static int polymerlength = intproperty | 19;
585   public final static int resno         = intproperty | 20 | settable;
586   public final static int seqid         = intproperty | 21;
587   public final static int site          = intproperty | 22;
588   public final static int strucno       = intproperty | 23;
589   public final static int subsystem     = intproperty | 24;
590   public final static int valence       = intproperty | 25 | settable;
591 
592   // float values must be multiplied by 100 prior to comparing to integer values
593 
594   // max 31 here
595 
596   public final static int adpmax          = floatproperty | 1;
597   public final static int adpmin          = floatproperty | 2;
598   public final static int chemicalshift   = floatproperty | 3; // Jmol 13.1.19
599   public final static int covalentradius        = floatproperty | 4;
600   public final static int eta             = floatproperty | 5; // Jmol 12.0.RC23
601   public final static int magneticshielding = floatproperty | 6;  // Jmol 13.1.19
602   public final static int mass            = floatproperty | 7;
603   public final static int omega           = floatproperty | 8;
604   public final static int phi             = floatproperty | 9;
605   public final static int psi             = floatproperty | 10;
606   public final static int screenx         = floatproperty | 11;
607   public final static int screeny         = floatproperty | 12;
608   public final static int screenz         = floatproperty | 13;
609   public final static int straightness    = floatproperty | 14;
610   public final static int surfacedistance = floatproperty | 15;
611   public final static int theta           = floatproperty | 16; // Jmol 12.0.RC23
612   public final static int unitx           = floatproperty | 17;
613   public final static int unity           = floatproperty | 18;
614   public final static int unitz           = floatproperty | 19;
615   public final static int modt1           = floatproperty | 20;
616   public final static int modt2           = floatproperty | 21;
617   public final static int modt3           = floatproperty | 22;
618   public final static int modx            = floatproperty | 23;
619   public final static int mody            = floatproperty | 24;
620   public final static int modz            = floatproperty | 25;
621   public final static int modo            = floatproperty | 26;
622   public final static int dssr            = floatproperty | 27;
623   public final static int vectorscale     = floatproperty | 1 | floatparam;
624   public final static int atomx           = floatproperty | 1 | settable;
625   public final static int atomy           = floatproperty | 2 | settable;
626   public final static int atomz           = floatproperty | 3 | settable;
627   public final static int fracx           = floatproperty | 4 | settable;
628   public final static int fracy           = floatproperty | 5 | settable;
629   public final static int fracz           = floatproperty | 6 | settable;
630   public final static int fux             = floatproperty | 7 | settable;
631   public final static int fuy             = floatproperty | 8 | settable;
632   public final static int fuz             = floatproperty | 9 | settable;
633   public final static int bondingradius   = floatproperty | 10 | settable;
634   public final static int partialcharge   = floatproperty | 11 | settable;
635   public final static int temperature     = floatproperty | 12 | settable;
636   public final static int vibx            = floatproperty | 18 | settable;
637   public final static int viby            = floatproperty | 19 | settable;
638   public final static int vibz            = floatproperty | 20 | settable;
639   public final static int x               = floatproperty | 21 | settable;
640   public final static int y               = floatproperty | 22 | settable;
641   public final static int z               = floatproperty | 23 | settable;
642   public final static int vanderwaals     = floatproperty | 24 | settable | setparam;
643   public final static int property        = floatproperty | 25 | settable | setparam | mathproperty;
644   public final static int hydrophobicity  = floatproperty | 26 | settable | predefinedset;
645   public final static int selected        = floatproperty | 27 | settable | predefinedset;
646 
647   public final static int backbone     = floatproperty | shapeCommand | 1 | predefinedset | defaultON | settable;
648   public final static int cartoon      = floatproperty | shapeCommand | 2 | defaultON | settable;
649   public final static int dots         = floatproperty | shapeCommand | 3 | defaultON;
650   public final static int ellipsoid    = floatproperty | shapeCommand | 4 | defaultON;
651   public final static int geosurface   = floatproperty | shapeCommand | 5 | defaultON;
652   public final static int halo         = floatproperty | shapeCommand | 6 | defaultON | settable;
653   public final static int meshRibbon   = floatproperty | shapeCommand | 7 | defaultON | settable;
654   public final static int ribbon       = floatproperty | shapeCommand | 9 | defaultON | settable;
655   public final static int rocket       = floatproperty | shapeCommand | 10 | defaultON | settable;
656   public final static int spacefill    = floatproperty | shapeCommand | 11 | defaultON | settable;
657   public final static int star         = floatproperty | shapeCommand | 12 | defaultON | settable;
658   public final static int strands      = floatproperty | shapeCommand | 13 | deprecatedparam | defaultON | settable;
659   public final static int trace        = floatproperty | shapeCommand | 14 | defaultON | settable;
660 
661   // mathfunc               means x = somefunc(a,b,c)
662   // mathfunc|mathproperty  means x = y.somefunc(a,b,c)
663   //
664   // maximum number of parameters is set by the << 9 shift
665   // the min/max mask requires that the first number here must not exceed 63
666   // the only other requirement is that these numbers be unique, so the initial
667   // number can be duplicated if necessary, as long as other flags are different
668 
669 
getMaxMathParams(int tokCommand)670   static int getMaxMathParams(int tokCommand) {
671     return  ((tokCommand >> 9) & 0x3);
672   }
673 
674   // 0 << 9 indicates that ScriptMathProcessor
675   // will check length in second stage of compilation
676 
677   // xxx(a,b,c,d,e,...)
678 
679   public final static int angle            = 1 | 0 << 9 | mathfunc;
680   public final static int array            = 2 | 0 << 9 | mathfunc | mathproperty;
681   public final static int axisangle        = 3 | 0 << 9 | mathfunc;
682   public final static int bin              = 4 | 0 << 9 | mathfunc | mathproperty;
683   public final static int cache            = 5 | 0 << 9 | mathfunc | scriptCommand; // new in Jmol 13.1.2
684   public final static int color            = 6 | 0 << 9 | mathfunc | intproperty | scriptCommand | deprecatedparam | settable;
685   public final static int compare          = 7 | 0 << 9 | mathfunc | scriptCommand;
686   public final static int connected        = 8 | 0 << 9 | mathfunc;
687   public final static int count            = 9 | 0 << 9 | mathfunc | mathproperty;
688   public final static int data             = 10 | 0 << 9 | mathfunc | scriptCommand;
689   public final static int find             = 11 | 0 << 9 | mathfunc | mathproperty;
690   public final static int format           = 12 | 0 << 9 | mathfunc | mathproperty | strproperty | settable;
691   public final static int function         = 13 | 0 << 9 | mathfunc | flowCommand;
692   public final static int getproperty      = 14 | 0 << 9 | mathfunc | mathproperty | scriptCommand;
693   public final static int helix            = 15 | 0 << 9 | mathfunc | predefinedset;
694   public final static int in               = 16 | 0 << 9 | mathfunc | mathproperty;
695   public final static int inchi            = 17 | 0 << 9 | mathfunc | mathproperty;
696   public final static int label            = 18 /* must NOT be odd */| 0 << 9 | mathfunc | mathproperty | strproperty | settable | implicitStringCommand | shapeCommand | defaultON | deprecatedparam;
697   public final static int measure          = 19 | 0 << 9| mathfunc | shapeCommand | deprecatedparam | defaultON;
698   public final static int modulation       = 20 | 0 << 9 | mathfunc | mathproperty | scriptCommand;
699   public final static int pivot            = 21 | 0 << 9 | mathfunc | mathproperty;
700   public final static int plane            = 22 | 0 << 9 | mathfunc;
701   public final static int point            = 23 | 0 << 9 | mathfunc;
702   public final static int polyhedra        = 24 | 0 << 9 | mathfunc | mathproperty | shapeCommand;
703   public final static int pop              = 25 | 0 << 9 | mathfunc | mathproperty | scriptCommand | noArgs; //internal only;
704   public final static int quaternion       = 26 | 0 << 9 | mathfunc | scriptCommand;
705   public final static int replace          = 27 | 0 << 9 | mathfunc | mathproperty;
706   public final static int sort             = 28 | 0 << 9 | mathfunc | mathproperty;
707   public final static int tensor           = 29 | 0 << 9 | mathfunc | mathproperty;
708   public final static int unitcell         = 30 | 0 << 9 | mathfunc | mathproperty | shapeCommand | deprecatedparam | predefinedset | defaultON;
709   public final static int within           = 31 | 0 << 9 | mathfunc;
710   public final static int write            = 32 | 0 << 9 | mathfunc | scriptCommand;
711   public final static int __               = 33 | 0 << 9 | mathfunc | mathproperty; // same as getProperty
712   public final static int pointgroup       = 34 | 0 << 9 | mathfunc;
713   public final static int intersection     = 35 | 0 << 9 | mathfunc;
714   public final static int spacegroup       = 36 | 0 << 9 | mathfunc;
715 
716 
717     // xxx(a)
718 
719   public final static int acos         = 2 | 1 << 9 | mathfunc;
720   public final static int bondcount    = 3 | 1 << 9 | mathfunc | intproperty;
721   public final static int sin          = 4 | 1 << 9 | mathfunc;
722   public final static int cos          = 5 | 1 << 9 | mathfunc;
723   public final static int sqrt         = 6 | 1 << 9 | mathfunc;
724   public final static int file         = 7 | 1 << 9 | mathfunc | intproperty | scriptCommand;
725   public final static int forcmd       = 8 | 1 << 9 | mathfunc | flowCommand;
726   public final static int ifcmd        = 9 | 1 << 9 | mathfunc | flowCommand;
727   public final static int abs          = 10 | 1 << 9 | mathfunc;
728   public final static int javascript   = 12 /* must be even */| 1 << 9 | mathfunc | implicitStringCommand;
729   public final static int show         = 14 | 1 << 9 | mathfunc | scriptCommand;
730 
731 
732   // ___.xxx(a)
733 
734   // a.distance(b) is in a different set -- distance(b,c) -- because it CAN take
735   // two parameters and it CAN be a dot-function (but not both together)
736 
737   public final static int div          = 0 | 1 << 9 | mathfunc | mathproperty;
738   public final static int mul          = 1 | 1 << 9 | mathfunc | mathproperty;
739   public final static int mul3         = 2 | 1 << 9 | mathfunc | mathproperty;
740   public final static int sub          = 3 | 1 << 9 | mathfunc | mathproperty;
741   public final static int trim         = 4 | 1 << 9 | mathfunc | mathproperty;
742   public final static int volume       = 5 | 1 << 9 | mathfunc | mathproperty | floatproperty;
743   public final static int col          = 6 | 1 << 9 | mathfunc | mathproperty;
744   public final static int row          = 7 | 1 << 9 | mathfunc | mathproperty;
745 
746   // xxx(a,b)
747 
748   public final static int load         = 1 | 2 << 9 | mathfunc | scriptCommand;
749   public final static int script       = 2 | 2 << 9 | mathfunc | scriptCommand;
750   public final static int substructure = 3 | 2 << 9 | mathfunc | intproperty | strproperty;
751   public final static int search       = 4 | 2 << 9 | mathfunc;
752   public final static int smiles       = 5 | 2 << 9 | mathfunc;
753   public final static int contact      = 6 | 2 << 9 | mathfunc | shapeCommand;
754   public final static int eval         = 7 | 2 << 9 | mathfunc;
755   public final static int now          = 8 | 2 << 9 | mathfunc;
756 
757 
758   // ___.xxx(a,b)
759 
760   // note that distance is here because it can take two forms:
761   //     a.distance(b)
762   // and
763   //     distance(a,b)
764   //so it can be a math property and it can have up to two parameters
765 
766   public final static int add          = 1 | 2 << 9 | mathfunc | mathproperty;
767   public final static int cross        = 2 | 2 << 9 | mathfunc | mathproperty;
768   public final static int distance     = 3 | 2 << 9 | mathfunc | mathproperty;
769   public final static int dot          = 4 | 2 << 9 | mathfunc | mathproperty;
770   public final static int push         = 5 | 2 << 9 | mathfunc | mathproperty | scriptCommand | noArgs; //internal only;
771   public final static int join         = 6 | 2 << 9 | mathfunc | mathproperty;
772   public final static int split        = 7 | 2 << 9 | mathfunc | mathproperty;
773 
774   // xxx(a,b,c)
775 
776   public final static int hkl          = 1 | 3 << 9 | mathfunc;
777   public final static int prompt       = 3 | 3 << 9 | mathfunc | mathExpressionCommand;
778   public final static int random       = 4 | 3 << 9 | mathfunc;
779   public final static int select       = 5 | 3 << 9 | mathfunc | mathproperty | atomExpressionCommand;
780 
781   // ___.xxx(a,b,c)
782 
783   public final static int symop        = 2 | 4 << 9 | mathfunc | mathproperty | intproperty;
784 
785   // set parameters
786 
787   // deprecated or handled specially in ScriptEvaluator
788 
789   public final static int bondmode           = deprecatedparam | 1;
790   public final static int fontsize           = deprecatedparam | 2;
791   public final static int measurementnumbers = deprecatedparam | 3;
792   public final static int scale3d            = deprecatedparam | 4;
793   public final static int togglelabel        = deprecatedparam | 5;
794 
795   // handled specially in ScriptEvaluator
796 
797   public final static int backgroundmodel  = setparam | 2;
798   public final static int debug            = setparam | 4;
799   public final static int debughigh        = setparam | 5;
800   public final static int defaultlattice   = setparam | 6;
801   public final static int highlight        = setparam | 8;// 12.0.RC14
802   public final static int showscript       = setparam | 10;
803   public final static int specular         = setparam | 12;
804   public final static int trajectory       = setparam | 14;
805   public final static int undo             = setparam | 16;
806   public final static int usercolorscheme  = setparam | 18;
807   public final static int window           = setparam  | 20;
808 
809   // full set of all Jmol "set" parameters
810 
811   public final static int animationmode                  = strparam | 1;
812   public final static int appletproxy                    = strparam | 2;
813   public final static int atomtypes                      = strparam | 4;
814   public final static int axescolor                      = strparam | 6;
815   public final static int axis1color                     = strparam | 8;
816   public final static int axis2color                     = strparam | 10;
817   public final static int axis3color                     = strparam | 12;
818   public final static int backgroundcolor                = strparam | 14;
819   public final static int boundboxcolor                  = strparam | 16;
820   public final static int currentlocalpath               = strparam | 18;
821   public final static int dataseparator                  = strparam | 20;
822   public final static int defaultanglelabel              = strparam | 22;
823   public final static int defaultlabelpdb                = strparam | 23;
824   public final static int defaultlabelxyz                = strparam | 24;
825   public final static int defaultcolorscheme             = strparam | 25;
826   public final static int defaultdirectory               = strparam | 26;
827   public final static int defaultdistancelabel           = strparam | 27;
828   public final static int defaultdropscript              = strparam | 28;
829   public final static int defaultloadfilter              = strparam | 29;
830   public final static int defaultloadscript              = strparam | 30;
831   public final static int defaults                       = strparam | 32;
832   public final static int defaulttorsionlabel            = strparam | 34;
833   public final static int defaultvdw                     = strparam | 35;
834   public final static int eds                            = strparam | 36;
835   public final static int edsdiff                        = strparam | 37;
836 //  public final static int edsurlcutoff                   = strparam | 36;
837 //  public final static int edsurlformat                   = strparam | 37;
838 //  public final static int edsurlformatdiff               = strparam | 38;
839   public final static int energyunits                    = strparam | 38;
840   public final static int filecachedirectory             = strparam | 39;
841   public final static int forcefield                     = strparam | 40;
842   public final static int helppath                       = strparam | 41;
843   public final static int hoverlabel                     = strparam | 42;
844   public final static int language                       = strparam | 43;
845   public final static int loadformat                     = strparam | 44;
846   public final static int loadligandformat               = strparam | 45;
847   public final static int logfile                        = strparam | 46;
848   public final static int macrodirectory                 = strparam | 47;
849   public final static int measurementunits               = strparam | 48;
850   public final static int nmrpredictformat               = strparam | 49;
851   public final static int nihresolverformat              = strparam | 50;
852   public final static int nmrurlformat                   = strparam | 51;
853   public final static int pathforallfiles                = strparam | 52;
854   public final static int picking                        = strparam | 53;
855   public final static int pickingstyle                   = strparam | 54;
856   public final static int picklabel                      = strparam | 56;
857   public final static int propertycolorscheme            = strparam | 58;
858   public final static int quaternionframe                = strparam | 60;
859   public final static int smilesurlformat                = strparam | 62;
860   public final static int smiles2dimageformat            = strparam | 64;
861   public final static int unitcellcolor                  = strparam | 66;
862 
863   public final static int axesoffset                     = floatparam | 1;
864   public final static int axesscale                      = floatparam | 2;
865   public final static int cartoonblockheight             = floatparam | 3;
866   public final static int bondtolerance                  = floatparam | 4;
867   public final static int cameradepth                    = floatparam | 6;
868   public final static int defaultdrawarrowscale          = floatparam | 8;
869   public final static int defaulttranslucent             = floatparam | 9;
870   public final static int dipolescale                    = floatparam | 10;
871   public final static int drawfontsize                   = floatparam | 11;
872   public final static int ellipsoidaxisdiameter          = floatparam | 12;
873   public final static int exportscale                    = floatparam | 13;
874   public final static int gestureswipefactor             = floatparam | 14;
875   public final static int hbondsangleminimum             = floatparam | 15;
876   public final static int hbondnodistancemaximum          = floatparam | 16;
877   public final static int hbondhxdistancemaximum         = floatparam | 17;
878   public final static int hoverdelay                     = floatparam | 18;
879   public final static int loadatomdatatolerance          = floatparam | 19;
880   public final static int minbonddistance                = floatparam | 20;
881   public final static int minimizationcriterion          = floatparam | 21;
882   public final static int modulationscale                = floatparam | 22;
883   public final static int mousedragfactor                = floatparam | 23;
884   public final static int mousewheelfactor               = floatparam | 24;
885   public final static int multiplebondradiusfactor       = floatparam | 25;
886   public final static int multiplebondspacing            = floatparam | 26;
887   public final static int navfps                         = floatparam | 27;
888   public final static int navigationdepth                = floatparam | 28;
889   public final static int navigationslab                 = floatparam | 29;
890   public final static int navigationspeed                = floatparam | 30;
891   public final static int navx                           = floatparam | 32;
892   public final static int navy                           = floatparam | 34;
893   public final static int navz                           = floatparam | 36;
894   public final static int particleradius                 = floatparam | 37;
895   public final static int pointgroupdistancetolerance    = floatparam | 38;
896   public final static int pointgrouplineartolerance      = floatparam | 40;
897   public final static int rotationradius                 = floatparam | 44;
898   public final static int scaleangstromsperinch          = floatparam | 46;
899   public final static int sheetsmoothing                 = floatparam | 48;
900   public final static int slabrange                      = floatparam | 49;
901   public final static int solventproberadius             = floatparam | 50;
902   public final static int spinfps                        = floatparam | 52;
903   public final static int spinx                          = floatparam | 54;
904   public final static int spiny                          = floatparam | 56;
905   public final static int spinz                          = floatparam | 58;
906   public final static int starwidth                     = floatparam | 59; // Jmol 13.1.15
907   public final static int stereodegrees                  = floatparam | 60;
908   public final static int strutdefaultradius             = floatparam | 62;
909   public final static int strutlengthmaximum             = floatparam | 64;
910   public final static int vibrationperiod                = floatparam | 68;
911   public final static int vibrationscale                 = floatparam | 70;
912   public final static int visualrange                    = floatparam | 72;
913 
914   public final static int ambientocclusion               = intparam | 1;
915   public final static int ambientpercent                 = intparam | 2;
916   public final static int animationfps                   = intparam | 4;
917   public final static int axesmode                       = intparam | 6;
918   public final static int bondradiusmilliangstroms       = intparam | 8;
919   public final static int celshadingpower                = intparam | 9;
920   public final static int bondingversion             = intparam | 10;
921   public final static int delaymaximumms                 = intparam | 11;
922   public final static int diffusepercent                 = intparam | 12;
923   public final static int dotdensity                     = intparam | 13;
924   public final static int dotscale                       = intparam | 14;
925   public final static int ellipsoiddotcount              = intparam | 15;
926   public final static int helixstep                      = intparam | 16;
927   public final static int hermitelevel                   = intparam | 17;
928   public final static int historylevel                   = intparam | 18;
929   public final static int infofontsize                   = intparam | 19;
930   public final static int isosurfacepropertysmoothingpower=intparam | 20;
931   public final static int loglevel                       = intparam | 21;
932   public final static int meshscale                      = intparam | 22;
933   public final static int minimizationsteps              = intparam | 23;
934   public final static int minimizationmaxatoms           = intparam | 24;
935   public final static int minpixelselradius              = intparam | 25;
936   public final static int percentvdwatom                 = intparam | 26;
937   public final static int perspectivemodel               = intparam | 27;
938   public final static int phongexponent                  = intparam | 28;
939   public final static int pickingspinrate                = intparam | 29;
940   public final static int platformspeed                  = intparam | 30;
941   public final static int propertyatomnumberfield        = intparam | 31;
942   public final static int propertyatomnumbercolumncount  = intparam | 32;
943   public final static int propertydatacolumncount        = intparam | 34;
944   public final static int propertydatafield              = intparam | 36;
945   public final static int repaintwaitms                  = intparam | 37;
946   public final static int ribbonaspectratio              = intparam | 38;
947   public final static int contextdepthmax                = intparam | 39;
948   public final static int scriptreportinglevel           = intparam | 40;
949   public final static int smallmoleculemaxatoms          = intparam | 42;
950   public final static int specularexponent               = intparam | 44;
951   public final static int specularpercent                = intparam | 46;
952   public final static int specularpower                  = intparam | 48;
953   public final static int strandcount                    = intparam | 50;
954   public final static int strandcountformeshribbon       = intparam | 52;
955   public final static int strandcountforstrands          = intparam | 54;
956   public final static int strutspacing                   = intparam | 56;
957   public final static int vectortrail                    = intparam | 57;
958   public final static int zdepth                         = intparam | 58;
959   public final static int zslab                          = intparam | 60;
960   public final static int zshadepower                    = intparam | 62;
961 
962   public final static int allowembeddedscripts           = booleanparam | 2;
963   public final static int allowgestures                  = booleanparam | 4;
964   public final static int allowkeystrokes                = booleanparam | 5;
965   public static final int allowmodelkit                  = booleanparam | 6; // Jmol 12.RC15
966   public final static int allowmoveatoms                 = booleanparam | 7; // Jmol 12.1.21
967   public static final int allowmultitouch                = booleanparam | 8; // Jmol 11.9.24
968   public final static int allowrotateselected            = booleanparam | 9;
969   public final static int antialiasdisplay               = booleanparam | 10;
970   public final static int antialiasimages                = booleanparam | 12;
971   public final static int antialiastranslucent           = booleanparam | 14;
972   public final static int appendnew                      = booleanparam | 16;
973   public final static int applysymmetrytobonds           = booleanparam | 18;
974   public final static int atompicking                    = booleanparam | 20;
975   public final static int allowaudio                     = booleanparam | 21;
976   public final static int autobond                       = booleanparam | 22;
977   public final static int autofps                        = booleanparam | 24;
978   public final static int autoplaymovie                  = booleanparam | 26;
979 //  public final static int autoloadorientation            = booleanparam | 26;
980   public final static int axesmolecular                  = booleanparam | 28;
981   public final static int axesorientationrasmol          = booleanparam | 30;
982   public final static int axesunitcell                   = booleanparam | 32;
983   public final static int axeswindow                     = booleanparam | 33;
984   public final static int cartoonblocks                  = booleanparam | 34;
985   public final static int cartoonsteps                   = booleanparam | 35;
986   public final static int bondmodeor                     = booleanparam | 36;
987   public final static int bondpicking                    = booleanparam | 38;
988 // set mathproperty  public final static int bonds                          = booleanparam | 40;
989   public final static int cartoonbaseedges               = booleanparam | 39;
990   public final static int cartoonsfancy                  = booleanparam | 40;
991   public final static int cartoonladders                 = booleanparam | 41;
992   public final static int cartoonribose                  = booleanparam | 42;
993   public final static int cartoonrockets                 = booleanparam | 43;
994   public final static int celshading                     = booleanparam | 44;
995   public final static int checkcir                       = booleanparam | 45;
996   public final static int chaincasesensitive             = booleanparam | 46;
997   public final static int ciprule6full                   = booleanparam | 47;
998   public final static int colorrasmol                    = booleanparam | 48;
999   public final static int debugscript                    = booleanparam | 49;
1000   public final static int defaultstructuredssp           = booleanparam | 50;
1001   public final static int disablepopupmenu               = booleanparam | 51;
1002   public final static int displaycellparameters          = booleanparam | 52;
1003   public final static int dotsselectedonly               = booleanparam | 53;
1004   public final static int dotsurface                     = booleanparam | 54;
1005   public final static int dragselected                   = booleanparam | 55;
1006   public final static int drawhover                      = booleanparam | 56;
1007   public final static int drawpicking                    = booleanparam | 57;
1008   public final static int dsspcalchydrogen               = booleanparam | 58;
1009   public final static int dynamicmeasurements            = booleanparam | 59; //DEPRECATED; not implemented; leave here to avoid SET error
1010   public final static int ellipsoidarcs                  = booleanparam | 60;
1011   public final static int ellipsoidarrows                = booleanparam | 61;
1012   public final static int ellipsoidaxes                  = booleanparam | 62;
1013   public final static int ellipsoidball                  = booleanparam | 63;
1014   public final static int ellipsoiddots                  = booleanparam | 64;
1015   public final static int ellipsoidfill                  = booleanparam | 65;
1016   public final static int filecaching                    = booleanparam | 66;
1017   public final static int fontcaching                    = booleanparam | 68;
1018   public final static int fontscaling                    = booleanparam | 69;
1019   public final static int forceautobond                  = booleanparam | 70;
1020   public final static int fractionalrelative             = booleanparam | 72;
1021 // see shapecommand public final static int frank                          = booleanparam | 72;
1022   public final static int greyscalerendering             = booleanparam | 74;
1023   public final static int hbondsbackbone                 = booleanparam | 76;
1024   public final static int hbondsrasmol                   = booleanparam | 77;
1025   public final static int hbondssolid                    = booleanparam | 78;
1026 // see predefinedset  public final static int hetero                         = booleanparam | 80;
1027   public final static int hiddenlinesdashed              = booleanparam | 80;
1028   public final static int hidenameinpopup                = booleanparam | 82;
1029   public final static int hidenavigationpoint            = booleanparam | 84;
1030   public final static int hidenotselected                = booleanparam | 86;
1031   public final static int highresolution                 = booleanparam | 88;
1032 // see predefinedset  public final static int hydrogen                       = booleanparam | 90;
1033   public final static int imagestate                     = booleanparam | 89;
1034   public static final int iskiosk                        = booleanparam | 90; // 11.9.29
1035   public final static int isosurfacekey                  = booleanparam | 91;
1036   public final static int isosurfacepropertysmoothing    = booleanparam | 92;
1037   public final static int jmolinjspecview                = booleanparam | 93; // 14.13.1
1038   public final static int justifymeasurements            = booleanparam | 94;
1039   public final static int languagetranslation            = booleanparam | 95;
1040   public final static int legacyautobonding              = booleanparam | 96;
1041   public final static int legacyhaddition                = booleanparam | 97;
1042   public final static int legacyjavafloat                = booleanparam | 98;
1043   public final static int logcommands                    = booleanparam | 99;
1044   public final static int loggestures                    = booleanparam | 100;
1045   public final static int measureallmodels               = booleanparam | 101;
1046   public final static int measurementlabels              = booleanparam | 102;
1047   public final static int messagestylechime              = booleanparam | 103;
1048   public final static int minimizationrefresh            = booleanparam | 104;
1049   public final static int minimizationsilent             = booleanparam | 105;
1050   public final static int modulateoccupancy              = booleanparam | 108;  // 14.3.13
1051   public final static int monitorenergy                  = booleanparam | 109;
1052   public final static int multiplebondbananas            = booleanparam | 110;
1053   public final static int multiprocessor                 = booleanparam | 111;
1054   public final static int navigatesurface                = booleanparam | 112;
1055   public final static int navigationmode                 = booleanparam | 113;
1056   public final static int navigationperiodic             = booleanparam | 114;
1057   public final static int nbocharges                     = booleanparam | 115;
1058   public final static int nodelay                        = booleanparam | 116;
1059   public final static int partialdots                    = booleanparam | 117; // 12.1.46
1060   public final static int pdbaddhydrogens                = booleanparam | 118;
1061   public final static int pdbgetheader                   = booleanparam | 119;
1062   public final static int pdbsequential                  = booleanparam | 120;
1063   public final static int perspectivedepth               = booleanparam | 121;
1064   public final static int preservestate                  = booleanparam | 122;
1065   public final static int rangeselected                  = booleanparam | 123;
1066   public final static int refreshing                     = booleanparam | 124;
1067   public final static int ribbonborder                   = booleanparam | 125;
1068   public final static int rocketbarrels                  = booleanparam | 126;
1069   public final static int saveproteinstructurestate      = booleanparam | 127;
1070   public final static int scriptqueue                    = booleanparam | 128;
1071   public final static int selectallmodels                = booleanparam | 130;
1072   public final static int selecthetero                   = booleanparam | 132;
1073   public final static int selecthydrogen                 = booleanparam | 134;
1074   // see commands public final static int selectionhalo                  = booleanparam | 136;
1075   public final static int showaxes                       = booleanparam | 138;
1076   public final static int showboundbox                   = booleanparam | 140;
1077   public final static int showfrank                      = booleanparam | 142;
1078   public final static int showhiddenselectionhalos       = booleanparam | 144;
1079   public final static int showhydrogens                  = booleanparam | 146;
1080   public final static int showkeystrokes                 = booleanparam | 148;
1081   public final static int showmeasurements               = booleanparam | 150;
1082   public final static int showmodvecs                    = booleanparam | 151;
1083   public final static int showmultiplebonds              = booleanparam | 152;
1084   public final static int shownavigationpointalways      = booleanparam | 154;
1085 // see intparam  public final static int showscript                     = booleanparam | 156;
1086   public final static int showtiming                     = booleanparam | 158;
1087   public final static int showunitcell                   = booleanparam | 160;
1088   public final static int showunitcelldetails            = booleanparam | 161;
1089   public final static int slabbyatom                     = booleanparam | 163;
1090   public final static int slabbymolecule                 = booleanparam | 164;
1091   public final static int slabenabled                    = booleanparam | 166;
1092   public final static int smartaromatic                  = booleanparam | 168;
1093 // see predefinedset  public final static int solvent                        = booleanparam | 170;
1094   public final static int solventprobe                   = booleanparam | 172;
1095 // see intparam  public final static int specular                       = booleanparam | 174;
1096   public final static int ssbondsbackbone                = booleanparam | 176;
1097   public final static int statusreporting                = booleanparam | 178;
1098   public final static int strutsmultiple                 = booleanparam | 179;
1099   public final static int syncmouse                      = booleanparam | 180;
1100   public final static int syncscript                     = booleanparam | 182;
1101   public final static int testflag1                      = booleanparam | 184;
1102   public final static int testflag2                      = booleanparam | 186;
1103   public final static int testflag3                      = booleanparam | 188;
1104   public final static int testflag4                      = booleanparam | 189;
1105   public final static int tracealpha                     = booleanparam | 190;
1106   public final static int translucent                    = booleanparam | 191;
1107   public final static int twistedsheets                  = booleanparam | 192;
1108   //public final static int usearcball                     = booleanparam | 193;
1109   public final static int useminimizationthread          = booleanparam | 194;
1110   public final static int usenumberlocalization          = booleanparam | 195;
1111   public final static int vectorscentered                = booleanparam | 196;
1112   public final static int vectorsymmetry                 = booleanparam | 197;
1113   public final static int waitformoveto                  = booleanparam | 199;
1114   public final static int windowcentered                 = booleanparam | 200;
1115   public final static int wireframerotation              = booleanparam | 201;
1116   public final static int zerobasedxyzrasmol             = booleanparam | 202;
1117   public final static int zoomenabled                    = booleanparam | 204;
1118   public final static int zoomheight                     = booleanparam | 206;
1119   public final static int zoomlarge                      = booleanparam | 207;
1120   public final static int zshade                         = booleanparam | 208;
1121 
1122 
1123   // misc
1124 
1125   public final static int absolute      = misc  | 2;
1126   public final static int addhydrogens  = misc  | 4;
1127   public final static int adjust        = misc  | 6;
1128   public final static int align         = misc  | 8;
1129   public final static int allconnected  = misc  | 10;
1130   public final static int angstroms     = misc  | 12;
1131   public final static int anisotropy    = misc  | 13;
1132   public final static int append        = misc  | 15;
1133   public final static int arc           = misc  | 16;
1134   public final static int area          = misc  | 18;
1135   public final static int aromatic      = misc  | 20 | predefinedset;
1136   public final static int arrow         = misc  | 22;
1137   public final static int as            = misc  | 24; // for LOAD and ISOSURFACE only
1138   public final static int async         = misc  | 25;
1139   public final static int atomicorbital = misc  | 26;
1140   public final static int audio         = misc  | 27;
1141 
1142   public final static int auto          = misc  | 28;
1143   public final static int axis          = misc  | 30;
1144   public final static int babel         = misc  | 32;
1145   public final static int babel21       = misc  | 33;
1146   public final static int back          = misc  | 34;
1147   public final static int balls         = misc  | 35;
1148   public final static int barb          = misc  | 36;
1149   public final static int backlit       = misc  | 37;
1150   public final static int backshell     = misc  | 38;
1151   public final static int basepair      = misc  | 39;
1152   public final static int best          = misc  | 40;
1153   public final static int beta          = misc  | 41;
1154   public final static int binary        = misc  | 42;
1155   public final static int blockdata     = misc  | 44;
1156   public final static int bondset       = misc  | 46; // never used
1157   public final static int bottom        = misc  | 47;
1158   public final static int brillouin     = misc  | 48;
1159   public final static int cancel        = misc  | 50;
1160   public final static int cap           = misc  | 51;
1161   public final static int cavity        = misc  | 52;
1162   public final static int check         = misc  | 53;
1163   public final static int chemical      = misc  | 55;
1164   public final static int circle        = misc  | 56;
1165   public final static int clash         = misc  | 57;
1166   public final static int clear         = misc  | 58;
1167   public final static int clipboard     = misc  | 60;
1168   public final static int collapsed     = misc  | 62;
1169   public final static int colorscheme   = misc  | 64;
1170   public final static int command       = misc  | 66;
1171   public final static int commands      = misc  | 68;
1172   public final static int constraint    = misc  | 70;
1173   public final static int contour       = misc  | 72;
1174   public final static int contourlines  = misc  | 74;
1175   public final static int contours      = misc  | 76;
1176   public final static int corners       = misc  | 78;
1177   public final static int create = misc  | 80;
1178   public final static int criterion     = misc  | 81;
1179   public final static int crossed       = misc  | 82;
1180   public final static int curve         = misc  | 84;
1181   public final static int cutoff        = misc  | 86;
1182   public final static int cylinder      = misc  | 88;
1183   public final static int density        = misc  | 90;
1184   public final static int dssp           = misc  | 91;
1185   public final static int diameter       = misc  | 93;
1186   public final static int direction      = misc  | 94;
1187   public final static int discrete       = misc  | 96;
1188   public final static int displacement   = misc  | 98;
1189   public final static int distancefactor = misc  | 100;
1190   public final static int domains        = misc  | 101;
1191   public final static int dotted         = misc  | 102;
1192   public final static int downsample     = misc  | 104;
1193   public final static int drawing        = misc  | 105;
1194   public final static int eccentricity   = misc  | 107;
1195   public final static int ed             = misc  | 108;
1196   public final static int edges          = misc  | 109;
1197   public final static int edgesonly      = misc  | 110;
1198   public final static int energy         = misc  | 111;
1199   public final static int error          = misc  | 112;
1200   public final static int facecenteroffset = misc  | 113;
1201   public final static int fill    = misc  | 114;
1202   public final static int filter         = misc  | 116;
1203   public final static int first   = misc  | 118;
1204   public final static int fixedtemp      = misc  | 122;
1205   public final static int flat           = misc  | 124;
1206   public final static int fps            = misc  | 126;
1207   public final static int from           = misc  | 128;
1208   public final static int front   = misc  | 130;
1209   public final static int frontedges     = misc  | 132;
1210   public final static int frontlit = misc  | 134;
1211   public final static int frontonly = misc  | 136;
1212   public final static int full            = misc  | 137;
1213   public final static int fullplane       = misc  | 138;
1214   public final static int fullylit        = misc  | 140;
1215   public final static int functionxy     = misc  | 142;
1216   public final static int functionxyz    = misc  | 144;
1217   public final static int gridpoints     = misc  | 146;
1218   public final static int homo           = misc  | 149;
1219   public final static int id             = misc  | 150;
1220   public final static int ignore         = misc  | 152;
1221   public final static int inchikey       = misc  | 154;
1222   public final static int increment      = misc  | 157;
1223   public final static int info           = misc  | 158;
1224   public final static int inline         = misc  | 160;
1225   public final static int insideout      = misc  | 161;
1226   public final static int interior       = misc  | 162;
1227   public final static int internal       = misc  | 164;
1228   public final static int intramolecular = misc  | 165;
1229   public final static int intermolecular = misc  | 166;
1230   public final static int jmol           = misc  | 167;
1231   public final static int json           = misc  | 168;
1232   public final static int last    = misc  | 169;
1233   public final static int lattice        = misc  | 170;
1234   public final static int lighting       = misc  | 171;
1235   public final static int left    = misc  | 172;
1236   public final static int line           = misc  | 174;
1237   public final static int link           = misc  | 175;
1238   public final static int linedata       = misc  | 176;
1239   public final static int list    = misc  | 177; // just "list"
1240   public final static int lobe           = misc  | 178;
1241   public final static int lonepair       = misc  | 180;
1242   public final static int lp             = misc  | 182;
1243   public final static int lumo           = misc  | 184;
1244   public final static int manifest       = misc  | 186;
1245   public final static int maxset         = misc  | 190;
1246   public final static int menu           = misc  | 191;
1247   public final static int mep            = misc  | 192;
1248   public final static int mesh    = misc  | 194;
1249   public final static int middle         = misc  | 195;
1250   public final static int minset         = misc  | 196;
1251   public final static int mlp            = misc  | 198;
1252   public final static int mode           = misc  | 200;
1253   public final static int modify         = misc  | 201;
1254   public final static int modifyorcreate = misc  | 202;
1255   public final static int modelbased     = misc  | 203;
1256   public final static int molecular      = misc  | 204;
1257   public final static int morph          = misc  | 205;
1258   public final static int mouse          = misc  | 206;
1259   public final static int movie          = misc  | 207;
1260   public final static int mrc            = misc  | 208;
1261   public final static int msms           = misc  | 209;
1262   public final static int name           = misc  | 210;
1263   public final static int nci            = misc  | 212;
1264   public final static int next           = misc  | 213;
1265   public final static int nmr            = misc  | 214;
1266   public final static int nocontourlines  = misc  | 215;
1267   public final static int nocross        = misc  | 216;
1268   public final static int nodebug        = misc  | 217;
1269   public final static int nodots         = misc  | 218;
1270   public final static int noedges        = misc  | 220;
1271   public final static int nofill         = misc  | 222;
1272   public final static int nohead         = misc  | 224;
1273   public final static int noload         = misc  | 226;
1274   public final static int nomesh         = misc  | 228;
1275   public final static int noplane        = misc  | 230;
1276   public final static int normal         = misc  | 232;
1277   public final static int nobackshell    = misc  | 233;
1278   public final static int notfrontonly   = misc  | 234;
1279   public final static int notriangles    = misc  | 236;
1280   public final static int obj            = misc  | 238;
1281   public final static int object         = misc  | 240;
1282   public final static int offset         = misc  | 242;
1283   public final static int offsetside     = misc  | 244;
1284   public final static int once           = misc  | 246;
1285   public final static int only           = misc  | 248;
1286   public final static int opaque         = misc  | 250;
1287   public final static int options        = misc  | 251;
1288   public final static int orbital        = misc  | 252;
1289   public final static int orientation    = misc  | 253;
1290   public final static int origin         = misc  | 254; // 12.1.51
1291   public final static int out            = misc  | 255;
1292   public final static int packed         = misc  | 256;
1293   public final static int palindrome     = misc  | 258;
1294   public final static int parameters     = misc  | 259;
1295   public final static int path           = misc  | 260;
1296   public final static int pdb            = misc  | 262;
1297   public final static int pdbheader      = misc  | 264;
1298   public final static int period         = misc  | 266;
1299   public final static int perpendicular  = misc  | 268;
1300   public final static int phase          = misc  | 270;
1301   public final static int play           = misc  | 272;
1302   public final static int playrev        = misc  | 274;
1303   public final static int planarparam    = misc  | 275;
1304   public final static int pocket         = misc  | 276;
1305   public final static int pointsperangstrom = misc  | 280;
1306   public final static int polygon        = misc  | 282;
1307   public final static int prev           = misc  | 284;
1308   public final static int probe          = misc  | 285;
1309   public final static int pymol          = misc  | 286;
1310   public final static int rad            = misc  | 287;
1311   public final static int radical        = misc  | 288;
1312   public final static int range          = misc  | 290;
1313   public final static int rasmol         = misc  | 292;
1314   public final static int reference      = misc  | 294;
1315   public final static int remove         = misc  | 295;
1316   public final static int residue        = misc  | 296;
1317   public final static int resolution     = misc  | 298;
1318   public final static int reversecolor   = misc  | 300;
1319   public final static int rewind         = misc  | 301;
1320   public final static int right          = misc  | 302;
1321   public final static int rmsd           = misc  | 303;
1322   public final static int rna3d          = misc  | 304;
1323   public final static int rock           = misc  | 305;
1324   public final static int rotate45       = misc  | 306;
1325   public final static int rotation       = misc  | 308;
1326   public final static int rubberband     = misc  | 310;
1327   public final static int sasurface      = misc  | 311;
1328   public final static int saved          = misc  | 312;
1329   public final static int scale          = misc  | 314;
1330   public final static int scene          = misc  | 315; // Jmol 12.3.32
1331   public final static int selection      = misc  | 316;
1332   public final static int shapely        = misc  | 320;
1333   public final static int sigma          = misc  | 322;
1334   public final static int sign           = misc  | 323;
1335   public final static int silent         = misc  | 324;
1336   public final static int solid          = misc  | 326;
1337   public final static int sphere         = misc  | 330;
1338   public final static int squared        = misc  | 332;
1339   public final static int state          = misc  | 334;
1340   public final static int stdinchi       = misc  | 335;
1341   public final static int stdinchikey    = misc  | 336;
1342   public final static int stop           = misc  | 338;
1343   public final static int supercell      = misc  | 339;//
1344   public final static int ticks          = misc  | 340;
1345   public final static int title          = misc  | 342;
1346   public final static int titleformat    = misc  | 344;
1347   public final static int to             = misc  | 346;
1348   public final static int top            = misc  | 348;
1349   public final static int torsion        = misc  | 350;
1350   public final static int transform      = misc  | 352;
1351   public final static int translation    = misc  | 354;
1352   public final static int triangles      = misc  | 358;
1353   public final static int url            = misc  | 360;
1354   public final static int user           = misc  | 362;
1355   public final static int val            = misc  | 364;
1356   public final static int validation     = misc  | 365;
1357   public final static int variable       = misc  | 366;
1358   public final static int variables      = misc  | 368;
1359   public final static int vertices       = misc  | 370;
1360   public final static int spacebeforesquare = misc  | 371;
1361   public final static int width          = misc  | 372;
1362   public final static int wigner         = misc  | 373;
1363 
1364   // used to be "expression":
1365 
1366   public final static int expressionBegin     = misc | 501;
1367   public final static int expressionEnd       = misc | 502;
1368   public final static int all                 = misc | 503;
1369   public final static int branch              = misc | 504;
1370   public final static int coord               = misc | 505;
1371   public final static int dollarsign          = misc | 506;
1372   public final static int isaromatic          = misc | 507;
1373   public final static int leftbrace           = misc | 508;
1374   public final static int none                = misc | 509;
1375   public final static int off                 = misc | 510;
1376   public final static int on                  = misc | 511;
1377   public final static int per                 = misc | 512;
1378   public final static int perper              = misc | 513;
1379   public final static int rightbrace          = misc | 514;
1380   public final static int semicolon           = misc | 515;
1381   public final static int spec_alternate      = misc | 531;
1382   public final static int spec_atom           = misc | 532;
1383   public final static int spec_chain          = misc | 533;
1384   public final static int spec_model          = misc | 534;  // /3, /4
1385   public final static int spec_model2         = misc | 535;  // 1.2, 1.3
1386   public final static int spec_name_pattern   = misc | 536;
1387   public final static int spec_resid          = misc | 537;
1388   public final static int spec_seqcode        = misc | 538;
1389   public final static int spec_seqcode_range  = misc | 539;
1390 
1391 
1392   // NOTE: It is important that width is the last token.
1393   //       build_13_tojs.xml needs to see that to clear out
1394   //       the unnecessary static defs.
1395 
1396 
1397 
1398   // predefined Tokens:
1399 
1400   public final static T tokenSpaceBeforeSquare = o(spacebeforesquare, " ");
1401   public final static T tokenOn  = tv(on, 1, "on");
1402   public final static T tokenOff = tv(off, 0, "off");
1403   public final static T tokenAll = o(all, "all");
1404   public final static T tokenIf = o(ifcmd, "if");
1405   public final static T tokenAnd = o(opAnd, "and");
1406   public final static T tokenAndSpec = o(opAND, "");
1407   public final static T tokenOr  = o(opOr, "or");
1408   public final static T tokenAndFALSE = o(opAnd, "and");
1409   public final static T tokenOrTRUE = o(opOr, "or");
1410   public final static T tokenOpIf  = o(opIf, "?");
1411   public final static T tokenComma = o(comma, ",");
1412   public final static T tokenDefineString = tv(define, string, "@");
1413   public final static T tokenPlus = o(plus, "+");
1414   public final static T tokenMinus = o(minus, "-");
1415   public final static T tokenMul3 = o(mul3, "mul3"); // used only in internal calc.
1416   public final static T tokenTimes = o(times, "*");
1417   public final static T tokenDivide = o(divide, "/");
1418 
1419   public final static T tokenLeftParen = o(leftparen, "(");
1420   public final static T tokenRightParen = o(rightparen, ")");
1421   public final static T tokenArraySquare = o(array, "[");        // special operator stack flag
1422   public final static T tokenArrayOpen = o(leftsquare, "[");     // used also as special operand stack flag
1423   public final static T tokenArrayClose = o(rightsquare, "]");
1424   public final static T tokenLeftBrace = o(leftbrace, "{");
1425 
1426   public final static T tokenExpressionBegin = o(expressionBegin, "expressionBegin");
1427   public final static T tokenExpressionEnd   = o(expressionEnd, "expressionEnd");
1428   public final static T tokenConnected       = o(connected, "connected");
1429   public final static T tokenCoordinateBegin = o(leftbrace, "{");
1430   public final static T tokenRightBrace = o(rightbrace, "}");
1431   public final static T tokenCoordinateEnd = tokenRightBrace;
1432   public final static T tokenColon           = o(colon, ":");
1433   public final static T tokenSetCmd          = o(set, "set");
1434   public final static T tokenSet             = tv(set, '=', "");
1435   public final static T tokenSetArray        = tv(set, '[', "");
1436   public final static T tokenSetProperty     = tv(set, '.', "");
1437   public final static T tokenSetVar          = tv(var, '=', "var");
1438   public final static T tokenEquals          = o(opEQ, "=");
1439   public final static T tokenScript          = o(script, "script");
1440   public final static T tokenSwitch          = o(switchcmd, "switch");
1441 
1442   private static Map<String, T> tokenMap = new Hashtable<String, T>();
1443 
addToken(String ident, T token)1444   public static void addToken(String ident, T token) {
1445     tokenMap.put(ident, token);
1446   }
1447 
getTokenFromName(String name)1448   public static T getTokenFromName(String name) {
1449     // this one needs to NOT be lower case for ScriptCompiler
1450     return tokenMap.get(name);
1451   }
1452 
getTokFromName(String name)1453   public static int getTokFromName(String name) {
1454     T token = getTokenFromName(name.toLowerCase());
1455     return (token == null ? nada : token.tok);
1456   }
1457 
1458 
1459 
1460   /**
1461    * note: nameOf is a very inefficient mechanism for getting
1462    * the name of a token. But it is only used for error messages
1463    * and listings of variables and such.
1464    *
1465    * @param tok
1466    * @return     the name of the token or 0xAAAAAA
1467    */
nameOf(int tok)1468   public static String nameOf(int tok) {
1469     for (T token : tokenMap.values()) {
1470       if (token.tok == tok)
1471         return "" + token.value;
1472     }
1473     return "0x"+Integer.toHexString(tok);
1474    }
1475 
1476   @Override
toString()1477   public String toString() {
1478     return toString2();
1479   }
1480 
1481   ////////command sets ///////
1482 
toString2()1483   protected String toString2() {
1484     return "Token["
1485     + astrType[tok < keyword ? tok : keyword]
1486     + "("+(tok%(1<<9))+"/0x" + Integer.toHexString(tok) + ")"
1487     + ((intValue == Integer.MAX_VALUE) ? "" : " intValue=" + intValue
1488         + "(0x" + Integer.toHexString(intValue) + ")")
1489     + ((value == null) ? "" : value instanceof String ? " value=\"" + value
1490         + "\"" : " value=" + value) + "]";
1491   }
1492 
1493   /**
1494    * retrieves an unsorted list of viable commands that could be
1495    * completed by this initial set of characters. If fewer than
1496    * two characters are given, then only the "preferred" command
1497    * is given (measure, not monitor, for example), and in all cases
1498    * if both a singular and a plural might be returned, only the
1499    * singular is returned.
1500    *
1501    * @param strBegin initial characters of the command, or null
1502    * @return UNSORTED semicolon-separated string of viable commands
1503    */
getCommandSet(String strBegin)1504   public static String getCommandSet(String strBegin) {
1505     String cmds = "";
1506     Map<String, Boolean> htSet = new Hashtable<String, Boolean>();
1507     int nCmds = 0;
1508     String s = (strBegin == null || strBegin.length() == 0 ? null : strBegin
1509         .toLowerCase());
1510     boolean isMultiCharacter = (s != null && s.length() > 1);
1511     for (Map.Entry<String, T> entry : tokenMap.entrySet()) {
1512       String name = entry.getKey();
1513       T token = entry.getValue();
1514       if ((token.tok & scriptCommand) != 0
1515           && (s == null || name.indexOf(s) == 0)
1516           && (isMultiCharacter || ((String) token.value).equals(name)))
1517         htSet.put(name, Boolean.TRUE);
1518     }
1519     for (Map.Entry<String, Boolean> entry : htSet.entrySet()) {
1520       String name = entry.getKey();
1521       if (name.charAt(name.length() - 1) != 's'
1522           || !htSet.containsKey(name.substring(0, name.length() - 1)))
1523         cmds += (nCmds++ == 0 ? "" : ";") + name;
1524     }
1525     return cmds;
1526   }
1527 
getAtomPropertiesLike(String type)1528   public static Lst<T> getAtomPropertiesLike(String type) {
1529     type = type.toLowerCase();
1530     Lst<T> v = new  Lst<T>();
1531     boolean isAll = (type.length() == 0);
1532     for (Map.Entry<String, T> entry : tokenMap.entrySet()) {
1533       String name = entry.getKey();
1534       if (name.charAt(0) == '_')
1535         continue;
1536       T token = entry.getValue();
1537       if (tokAttr(token.tok, atomproperty) && (isAll || name.toLowerCase().startsWith(type))) {
1538         if (isAll || !((String) token.value).toLowerCase().startsWith(type))
1539           token = o(token.tok, name);
1540         v.addLast(token);
1541       }
1542     }
1543     return (v.size() == 0 ? null : v);
1544   }
1545 
getTokensLike(String type)1546   public static String[] getTokensLike(String type) {
1547     int attr = (type.equals("setparam") ? setparam
1548         : type.equals("misc") ? misc
1549         : type.equals("mathfunc") ? mathfunc : scriptCommand);
1550     int notattr = (attr == setparam ? deprecatedparam : nada);
1551     Lst<String> v = new  Lst<String>();
1552     for (Map.Entry<String, T> entry : tokenMap.entrySet()) {
1553       String name = entry.getKey();
1554       T token = entry.getValue();
1555       if (tokAttr(token.tok, attr) && (notattr == nada || !tokAttr(token.tok, notattr)))
1556         v.addLast(name);
1557     }
1558     String[] a = v.toArray(new String[v.size()]);
1559     Arrays.sort(a);
1560     return a;
1561   }
1562 
getSettableTokFromString(String s)1563   public static int getSettableTokFromString(String s) {
1564     int tok = getTokFromName(s);
1565     return (tok != nada && tokAttr(tok, settable)
1566           && !tokAttr(tok, mathproperty) ? tok : nada);
1567   }
1568 
completeCommand(Map<String, ?> map, boolean isSet, boolean asCommand, String str, int n)1569   public static String completeCommand(Map<String, ?> map, boolean isSet,
1570                                        boolean asCommand,
1571                                        String str, int n) {
1572     if (map == null)
1573       map = tokenMap;
1574     else
1575       asCommand = false;
1576     Lst<String> v = new  Lst<String>();
1577     str = str.toLowerCase();
1578     for (String name : map.keySet()) {
1579       if (!name.startsWith(str))
1580         continue;
1581       int tok = getTokFromName(name);
1582       if (asCommand ? tokAttr(tok, scriptCommand)
1583           : isSet ? tokAttr(tok, setparam) && !tokAttr(tok, deprecatedparam)
1584           : true)
1585         v.addLast(name);
1586     }
1587     return AU.sortedItem(v, n);
1588   }
1589 
1590   static {
1591 
1592     // OK for J2S compiler even though T is not final because
1593     // tokenMap is private
1594 
1595     Object[] arrayPairs  = {
1596 
1597     // atom expressions
1598 
1599       "(",            tokenLeftParen,
1600       ")",            tokenRightParen,
1601       "and",          tokenAnd,
1602       "&",            null,
1603       "&&",           null,
1604       "or",           tokenOr,
1605       "|",            null,
1606       "||",           null,
1607       "?",            tokenOpIf,
1608       ",",            tokenComma,
1609       "=",            tokenEquals,
1610       "==",           null,
1611       ":",            tokenColon,
1612       "+",            tokenPlus,
1613       "-",            tokenMinus,
1614       "*",            tokenTimes,
1615       "/",            tokenDivide,
1616 
1617     // commands
1618 
1619       "script",       tokenScript,
1620       "source",       null,
1621       "set",          tokenSetCmd,
1622       "switch",       tokenSwitch,
1623 
1624       // misc
1625 
1626       "all",          tokenAll,
1627       "off",          tokenOff,
1628       "false",        null,
1629       "on",           tokenOn,
1630       "true",         null,
1631     };
1632 
1633     T tokenThis, tokenLast = null;
1634     String sTok, lcase;
1635     int n = arrayPairs.length - 1;
1636     for (int i = 0; i < n; i += 2) {
1637       sTok = (String) arrayPairs[i];
1638       lcase = sTok.toLowerCase();
1639       tokenThis = (T) arrayPairs[i + 1];
1640       if (tokenThis == null)
1641         tokenThis = tokenLast;
1642       else if (tokenThis.value == null)
1643         tokenThis.value = sTok;
tokenMap.put(lcase, tokenThis)1644       tokenMap.put(lcase, tokenThis);
1645       tokenLast = tokenThis;
1646     }
1647 
1648     arrayPairs = null;
1649 
1650     // This two-array system is risky, but I think worth the risk in
1651     // terms of how much it saves ( KB).
1652 
1653     String[] sTokens = {
1654         "+=",
1655         "-=",
1656         "*=",
1657         "/=",
1658         "\\=",
1659         "&=",
1660         "|=",
1661         "not",
1662         "!",
1663         "xor",
1664         //no-- don't do this; it interferes with define
1665         // "~"
1666         "tog",
1667         "<",
1668         "<=",
1669         ">=",
1670         ">",
1671         "!=",
1672         "<>",
1673         "LIKE",
1674         "within",
1675         ".",
1676         "..",
1677         "[",
1678         "]",
1679         "{",
1680         "}",
1681         "$",
1682         "%",
1683         ";",
1684         "++",
1685         "--",
1686         "**",
1687         "\\",
1688 
1689         // commands
1690 
1691         "animation",
1692         "anim",
1693         "assign",
1694         "axes",
1695         "backbone",
1696         "background",
1697         "bind",
1698         "bondorder",
1699         "boundbox",
1700         "boundingBox",
1701         "break",
1702         "calculate",
1703         "capture",
1704         "cartoon",
1705         "cartoons",
1706         "case",
1707         "catch",
1708         "cd",
1709         "center",
1710         "centre",
1711         "centerat",
1712         "cgo",
1713         "color",
1714         "colour",
1715         "compare",
1716         "configuration",
1717         "conformation",
1718         "config",
1719         "connect",
1720         "console",
1721         "contact",
1722         "contacts",
1723         "continue",
1724         "data",
1725         "default",
1726         "define",
1727         "@",
1728         "delay",
1729         "delete",
1730         "density",
1731         "depth",
1732         "dipole",
1733         "dipoles",
1734         "display",
1735         "dot",
1736         "dots",
1737         "draw",
1738         "echo",
1739         "ellipsoid",
1740         "ellipsoids",
1741         "else",
1742         "elseif",
1743         "end",
1744         "endif",
1745         "exit",
1746         "eval",
1747         "file",
1748         "files",
1749         "font",
1750         "for",
1751         "format",
1752         "frame",
1753         "frames",
1754         "frank",
1755         "function",
1756         "functions",
1757         "geosurface",
1758         "getProperty",
1759         "goto",
1760         "halo",
1761         "halos",
1762         "helix",
1763         "helixalpha",
1764         "helix310",
1765         "helixpi",
1766         "hbond",
1767         "hbonds",
1768         "help",
1769         "hide",
1770         "history",
1771         "hover",
1772         "if",
1773         "in",
1774         "initialize",
1775         "invertSelected",
1776         "isosurface",
1777         "javascript",
1778         "label",
1779         "labels",
1780         "lcaoCartoon",
1781         "lcaoCartoons",
1782         "load",
1783         "log",
1784         "loop",
1785         "measure",
1786         "measures",
1787         "monitor",
1788         "monitors",
1789         "meshribbon",
1790         "meshribbons",
1791         "message",
1792         "minimize",
1793         "minimization",
1794         "mo",
1795         "model",
1796         "models",
1797         "modulation",
1798         "move",
1799         "moveTo",
1800         "mutate",
1801         "navigate",
1802         "navigation",
1803         "nbo",
1804         "origin",
1805         "out",
1806         "parallel",
1807         "pause",
1808         "wait",
1809         "plot",
1810         "private",
1811         "plot3d",
1812         "pmesh",
1813         "polygon",
1814         "polyhedra",
1815         "polyhedron",
1816         "print",
1817         "process",
1818         "prompt",
1819         "quaternion",
1820         "quaternions",
1821         "quit",
1822         "ramachandran",
1823         "rama",
1824         "refresh",
1825         "reset",
1826         "unset",
1827         "restore",
1828         "restrict",
1829         "return",
1830         "ribbon",
1831         "ribbons",
1832         "rocket",
1833         "rockets",
1834         "rotate",
1835         "rotateSelected",
1836         "save",
1837         "select",
1838         "selectionHalos",
1839         "selectionHalo",
1840         "showSelections",
1841         "sheet",
1842         "show",
1843         "slab",
1844         "spacefill",
1845         "cpk",
1846         "spin",
1847         "ssbond",
1848         "ssbonds",
1849         "star",
1850         "stars",
1851         "step",
1852         "steps",
1853         "stereo",
1854         "strand",
1855         "strands",
1856         "structure",
1857         "_structure",
1858         "strucNo",
1859         "struts",
1860         "strut",
1861         "subset",
1862         "subsystem",
1863         "synchronize",
1864         "sync",
1865         "trace",
1866         "translate",
1867         "translateSelected",
1868         "try",
1869         "unbind",
1870         "unitcell",
1871         "var",
1872         "vector",
1873         "vectors",
1874         "vibration",
1875         "while",
1876         "wireframe",
1877         "write",
1878         "zap",
1879         "zoom",
1880         "zoomTo",
1881 
1882         // show parameters
1883 
1884         "atom",
1885         "atoms",
1886         "axisangle",
1887         "basepair",
1888         "basepairs",
1889         "orientation",
1890         "orientations",
1891         "pdbheader",
1892         "polymer",
1893         "polymers",
1894         "residue",
1895         "residues",
1896         "rotation",
1897         "row",
1898         "sequence",
1899         "seqcode",
1900         "shape",
1901         "state",
1902         "symbol",
1903         "symmetry",
1904         "spaceGroup",
1905         "transform",
1906         "translation",
1907         "url",
1908 
1909         // misc
1910 
1911         "_",
1912         "abs",
1913         "absolute",
1914         "acos",
1915         "add",
1916         "adpmax",
1917         "adpmin",
1918         "align",
1919         "altloc",
1920         "altlocs",
1921         "ambientOcclusion",
1922         "amino",
1923         "angle",
1924         "array",
1925         "as",
1926         "atomID",
1927         "_atomID",
1928         "_a",
1929         "atomIndex",
1930         "atomName",
1931         "atomno",
1932         "atomType",
1933         "atomX",
1934         "atomY",
1935         "atomZ",
1936         "average",
1937         "babel",
1938         "babel21",
1939         "back",
1940         "backlit",
1941         "backshell",
1942         "balls",
1943         "baseModel",
1944         "best",
1945         "beta",
1946         "bin",
1947         "bondCount",
1948         "bonded",
1949         "bottom",
1950         "branch",
1951         "brillouin",
1952         "bzone",
1953         "wignerSeitz",
1954         "cache",
1955         "carbohydrate",
1956         "cell",
1957         "chain",
1958         "chains",
1959         "chainNo",
1960         "chemicalShift",
1961         "cs",
1962         "clash",
1963         "clear",
1964         "clickable",
1965         "clipboard",
1966         "connected",
1967         "context",
1968         "constraint",
1969         "contourLines",
1970         "coord",
1971         "coordinates",
1972         "coords",
1973         "cos",
1974         "cross",
1975         "covalentRadius",
1976         "covalent",
1977         "direction",
1978         "displacement",
1979         "displayed",
1980         "distance",
1981         "div",
1982         "DNA",
1983         "domains",
1984         "dotted",
1985         "DSSP",
1986         "DSSR",
1987         "element",
1988         "elemno",
1989         "_e",
1990         "error",
1991         "exportScale",
1992         "fill",
1993         "find",
1994         "fixedTemperature",
1995         "forcefield",
1996         "formalCharge",
1997         "charge",
1998         "eta",
1999         "front",
2000         "frontlit",
2001         "frontOnly",
2002         "fullylit",
2003         "fx",
2004         "fy",
2005         "fz",
2006         "fxyz",
2007         "fux",
2008         "fuy",
2009         "fuz",
2010         "fuxyz",
2011         "group",
2012         "groups",
2013         "group1",
2014         "groupID",
2015         "_groupID",
2016         "_g",
2017         "groupIndex",
2018         "hidden",
2019         "highlight",
2020         "hkl",
2021         "hydrophobicity",
2022         "hydrophobic",
2023         "hydro",
2024         "id",
2025         "identify",
2026         "ident",
2027         "image",
2028         "info",
2029         "infoFontSize",
2030         "inline",
2031         "insertion",
2032         "insertions",
2033         "intramolecular",
2034         "intra",
2035         "intermolecular",
2036         "inter",
2037         "bondingRadius",
2038         "ionicRadius",
2039         "ionic",
2040         "isAromatic",
2041         "Jmol",
2042         "JSON",
2043         "join",
2044         "keys",
2045         "last",
2046         "left",
2047         "length",
2048         "lines",
2049         "list",
2050         "magneticShielding",
2051         "ms",
2052         "mass",
2053         "max",
2054         "mep",
2055         "mesh",
2056         "middle",
2057         "min",
2058         "mlp",
2059         "mode",
2060         "modify",
2061         "modifyOrCreate",
2062         "modt",
2063         "modt1",
2064         "modt2",
2065         "modt3",
2066         "modx",
2067         "mody",
2068         "modz",
2069         "modo",
2070         "modxyz",
2071         "molecule",
2072         "molecules",
2073         "modelIndex",
2074         "monomer",
2075         "morph",
2076         "movie",
2077         "mouse",
2078         "mul",
2079         "mul3",
2080         "nboCharges",
2081         "nci",
2082         "next",
2083         "noDelay",
2084         "noDots",
2085         "noFill",
2086         "noMesh",
2087         "none",
2088         "null",
2089         "inherit",
2090         "normal",
2091         "noBackshell",
2092         "noContourLines",
2093         "notFrontOnly",
2094         "noTriangles",
2095         "now",
2096         "nucleic",
2097         "occupancy",
2098         "omega",
2099         "only",
2100         "opaque",
2101         "options",
2102         "partialCharge",
2103         "phi",
2104         "pivot",
2105         "plane",
2106         "planar",
2107         "play",
2108         "playRev",
2109         "point",
2110         "points",
2111         "pointGroup",
2112         "polymerLength",
2113         "pop",
2114         "previous",
2115         "prev",
2116         "probe",
2117         "property",
2118         "properties",
2119         "protein",
2120         "psi",
2121         "purine",
2122         "push",
2123         "PyMOL",
2124         "pyrimidine",
2125         "random",
2126         "range",
2127         "rasmol",
2128         "replace",
2129         "resno",
2130         "resume",
2131         "rewind",
2132         "reverse",
2133         "right",
2134         "rmsd",
2135         "RNA",
2136         "rna3d",
2137         "rock",
2138         "rubberband",
2139         "saSurface",
2140         "saved",
2141         "scale",
2142         "scene",
2143         "search",
2144         "smarts",
2145         "selected",
2146         "seqid",
2147         "shapely",
2148         "sidechain",
2149         "sin",
2150         "site",
2151         "size",
2152         "smiles",
2153         "substructure",
2154         "solid",
2155         "sort",
2156         "specialPosition",
2157         "sqrt",
2158         "split",
2159         "starWidth",
2160         "starScale",
2161         "stddev",
2162         "straightness",
2163         "structureId",
2164         "supercell",
2165         "sub",
2166         "sum",
2167         "sum2",
2168         "surface",
2169         "surfaceDistance",
2170         "symop",
2171         "sx",
2172         "sy",
2173         "sz",
2174         "sxyz",
2175         "temperature",
2176         "relativeTemperature",
2177         "tensor",
2178         "theta",
2179         "thisModel",
2180         "ticks",
2181         "top",
2182         "torsion",
2183         "trajectory",
2184         "trajectories",
2185         "translucent",
2186         "transparent",
2187         "triangles",
2188         "trim",
2189         "type",
2190         "ux",
2191         "uy",
2192         "uz",
2193         "uxyz",
2194         "user",
2195         "valence",
2196         "vanderWaals",
2197         "vdw",
2198         "vdwRadius",
2199         "visible",
2200         "volume",
2201         "vx",
2202         "vy",
2203         "vz",
2204         "vxyz",
2205         "xyz",
2206         "w",
2207         "x",
2208         "y",
2209         "z",
2210 
2211        // more misc parameters
2212        "addHydrogens",
2213        "allConnected",
2214        "angstroms",
2215        "anisotropy",
2216        "append",
2217        "arc",
2218        "area",
2219        "aromatic",
2220        "arrow",
2221        "async",
2222        "audio",
2223        "auto",
2224        "axis",
2225        "barb",
2226        "binary",
2227        "blockData",
2228        "cancel",
2229        "cap",
2230        "cavity",
2231        "centroid",
2232        "check",
2233        "checkCIR",
2234        "chemical",
2235        "circle",
2236        "collapsed",
2237        "col",
2238        "colorScheme",
2239        "command",
2240        "commands",
2241        "contour",
2242        "contours",
2243        "corners",
2244        "count",
2245        "criterion",
2246        "create",
2247        "crossed",
2248        "curve",
2249        "cutoff",
2250        "cylinder",
2251        "diameter",
2252        "discrete",
2253        "distanceFactor",
2254        "downsample",
2255        "drawing",
2256        "dynamicMeasurements",
2257        "eccentricity",
2258        "ed",
2259        "edges",
2260        "edgesOnly",
2261        "energy",
2262        "exitJmol",
2263        "faceCenterOffset",
2264        "filter",
2265        "first",
2266        "fixed",
2267        "fix",
2268        "flat",
2269        "fps",
2270        "from",
2271        "frontEdges",
2272        "full",
2273        "fullPlane",
2274        "functionXY",
2275        "functionXYZ",
2276        "gridPoints",
2277        "hiddenLinesDashed",
2278        "homo",
2279        "ignore",
2280        "InChI",
2281        "InChIKey",
2282        "increment",
2283        "insideout",
2284        "interior",
2285        "intersection",
2286        "intersect",
2287        "internal",
2288        "lattice",
2289        "line",
2290        "lineData",
2291        "link",
2292        "lobe",
2293        "lonePair",
2294        "lp",
2295        "lumo",
2296        "macro",
2297        "manifest",
2298        "mapProperty",
2299        "maxSet",
2300        "menu",
2301        "minSet",
2302        "modelBased",
2303        "molecular",
2304        "mrc",
2305        "msms",
2306        "name",
2307        "nmr",
2308        "noCross",
2309        "noDebug",
2310        "noEdges",
2311        "noHead",
2312        "noLoad",
2313        "noPlane",
2314        "object",
2315        "obj",
2316        "offset",
2317        "offsetSide",
2318        "once",
2319        "orbital",
2320        "atomicOrbital",
2321        "packed",
2322        "palindrome",
2323        "parameters",
2324        "path",
2325        "pdb",
2326        "period",
2327        "periodic",
2328        "perpendicular",
2329        "perp",
2330        "phase",
2331        "planarParam",
2332        "pocket",
2333        "pointsPerAngstrom",
2334        "radical",
2335        "rad",
2336        "reference",
2337        "remove",
2338        "resolution",
2339        "reverseColor",
2340        "rotate45",
2341        "selection",
2342        "sigma",
2343        "sign",
2344        "silent",
2345        "sphere",
2346        "squared",
2347        "stdInChI",
2348        "stdInChIKey",
2349        "stop",
2350        "title",
2351        "titleFormat",
2352        "to",
2353        "validation",
2354        "value",
2355        "variable",
2356        "variables",
2357        "vertices",
2358        "width",
2359        "wigner",
2360 
2361        // set params
2362 
2363        "backgroundModel",
2364        "celShading",
2365        "celShadingPower",
2366        "debug",
2367        "debugHigh",
2368        "defaultLattice",
2369        "measurements",
2370        "measurement",
2371        "scale3D",
2372        "toggleLabel",
2373        "userColorScheme",
2374        "throw",
2375        "timeout",
2376        "timeouts",
2377        "window",
2378 
2379        // string
2380 
2381        "animationMode",
2382        "appletProxy",
2383        "atomTypes",
2384        "axesColor",
2385        "axis1Color",
2386        "axis2Color",
2387        "axis3Color",
2388        "backgroundColor",
2389        "bondmode",
2390        "boundBoxColor",
2391        "boundingBoxColor",
2392        "chirality",
2393        "cipRule",
2394        "currentLocalPath",
2395        "dataSeparator",
2396        "defaultAngleLabel",
2397        "defaultColorScheme",
2398        "defaultColors",
2399        "defaultDirectory",
2400        "defaultDistanceLabel",
2401        "defaultDropScript",
2402        "defaultLabelPDB",
2403        "defaultLabelXYZ",
2404        "defaultLoadFilter",
2405        "defaultLoadScript",
2406        "defaults",
2407        "defaultTorsionLabel",
2408        "defaultVDW",
2409        "drawFontSize",
2410        "eds",
2411        "edsDiff",
2412 //       "edsUrlCutoff",
2413 //       "edsUrlFormat",
2414 //       "edsUrlFormatDiff",
2415        "energyUnits",
2416        "fileCacheDirectory",
2417        "fontsize",
2418        "helpPath",
2419        "hoverLabel",
2420        "language",
2421        "loadFormat",
2422        "loadLigandFormat",
2423        "logFile",
2424        "measurementUnits",
2425        "nihResolverFormat",
2426        "nmrPredictFormat",
2427        "nmrUrlFormat",
2428        "pathForAllFiles",
2429        "picking",
2430        "pickingStyle",
2431        "pickLabel",
2432        "platformSpeed",
2433        "propertyColorScheme",
2434        "quaternionFrame",
2435        "smilesUrlFormat",
2436        "smiles2dImageFormat",
2437        "unitCellColor",
2438 
2439        // float
2440 
2441        "axesOffset",
2442        "axisOffset",
2443        "axesScale",
2444        "axisScale",
2445        "bondTolerance",
2446        "cameraDepth",
2447        "defaultDrawArrowScale",
2448        "defaultTranslucent",
2449        "dipoleScale",
2450        "ellipsoidAxisDiameter",
2451        "gestureSwipeFactor",
2452        "hbondsAngleMinimum",
2453        "hbondHXDistanceMaximum",
2454        "hbondsDistanceMaximum",
2455        "hbondNODistanceMaximum",
2456        "hoverDelay",
2457        "loadAtomDataTolerance",
2458        "minBondDistance",
2459        "minimizationCriterion",
2460        "minimizationMaxAtoms",
2461        "modulationScale",
2462        "mouseDragFactor",
2463        "mouseWheelFactor",
2464        "navFPS",
2465        "navigationDepth",
2466        "navigationSlab",
2467        "navigationSpeed",
2468        "navX",
2469        "navY",
2470        "navZ",
2471        "particleRadius",
2472        "pointGroupDistanceTolerance",
2473        "pointGroupLinearTolerance",
2474        "radius",
2475        "rotationRadius",
2476        "scaleAngstromsPerInch",
2477        "sheetSmoothing",
2478        "slabRange",
2479        "solventProbeRadius",
2480        "spinFPS",
2481        "spinX",
2482        "spinY",
2483        "spinZ",
2484        "stereoDegrees",
2485        "strutDefaultRadius",
2486        "strutLengthMaximum",
2487        "vectorScale",
2488        "vectorsCentered",
2489        "vectorSymmetry",
2490        "vectorTrail",
2491        "vibrationPeriod",
2492        "vibrationScale",
2493        "visualRange",
2494 
2495        // int
2496 
2497        "ambientPercent",
2498        "ambient",
2499        "animationFps",
2500        "axesMode",
2501        "bondRadiusMilliAngstroms",
2502        "bondingVersion",
2503        "delayMaximumMs",
2504        "diffusePercent",
2505        "diffuse",
2506        "dotDensity",
2507        "dotScale",
2508        "ellipsoidDotCount",
2509        "helixStep",
2510        "hermiteLevel",
2511        "historyLevel",
2512        "lighting",
2513        "logLevel",
2514        "meshScale",
2515        "minimizationSteps",
2516        "minPixelSelRadius",
2517        "percentVdwAtom",
2518        "perspectiveModel",
2519        "phongExponent",
2520        "pickingSpinRate",
2521        "propertyAtomNumberField",
2522        "propertyAtomNumberColumnCount",
2523        "propertyDataColumnCount",
2524        "propertyDataField",
2525        "repaintWaitMs",
2526        "ribbonAspectRatio",
2527        "contextDepthMax",
2528        "scriptReportingLevel",
2529        "showScript",
2530        "smallMoleculeMaxAtoms",
2531        "specular",
2532        "specularExponent",
2533        "specularPercent",
2534        "specPercent",
2535        "specularPower",
2536        "specpower",
2537        "strandCount",
2538        "strandCountForMeshRibbon",
2539        "strandCountForStrands",
2540        "strutSpacing",
2541        "zDepth",
2542        "zSlab",
2543        "zshadePower",
2544 
2545        // boolean
2546 
2547        "allowEmbeddedScripts",
2548        "allowGestures",
2549        "allowKeyStrokes",
2550        "allowModelKit",
2551        "allowMoveAtoms",
2552        "allowMultiTouch",
2553        "allowRotateSelected",
2554        "antialiasDisplay",
2555        "antialiasImages",
2556        "antialiasTranslucent",
2557        "appendNew",
2558        "applySymmetryToBonds",
2559        "atomPicking",
2560        "allowAudio",
2561        "autobond",
2562        "autoFPS",
2563        "autoplayMovie",
2564   //               "autoLoadOrientation",
2565        "axesMolecular",
2566        "axesOrientationRasmol",
2567        "axesUnitCell",
2568        "axesWindow",
2569        "bondModeOr",
2570        "bondPicking",
2571        "bonds",
2572        "bond",
2573        "cartoonBaseEdges",
2574        "cartoonBlocks",
2575        "cartoonBlockHeight",
2576        "cartoonsFancy",
2577        "cartoonFancy",
2578        "cartoonLadders",
2579        "cartoonRibose",
2580        "cartoonRockets",
2581        "cartoonSteps",
2582        "chainCaseSensitive",
2583        "cipRule6Full",
2584        "colorRasmol",
2585        "debugScript",
2586        "defaultStructureDssp",
2587        "disablePopupMenu",
2588        "displayCellParameters",
2589        "showUnitcellInfo", // oops
2590        "dotsSelectedOnly",
2591        "dotSurface",
2592        "dragSelected",
2593        "drawHover",
2594        "drawPicking",
2595        "dsspCalculateHydrogenAlways",
2596        "ellipsoidArcs",
2597        "ellipsoidArrows",
2598        "ellipsoidAxes",
2599        "ellipsoidBall",
2600        "ellipsoidDots",
2601        "ellipsoidFill",
2602        "fileCaching",
2603        "fontCaching",
2604        "fontScaling",
2605        "forceAutoBond",
2606        "fractionalRelative",
2607    // see commands     "frank",
2608        "greyscaleRendering",
2609        "hbondsBackbone",
2610        "hbondsRasmol",
2611        "hbondsSolid",
2612        "hetero",
2613        "hideNameInPopup",
2614        "hideNavigationPoint",
2615        "hideNotSelected",
2616        "highResolution",
2617        "hydrogen",
2618        "hydrogens",
2619        "imageState",
2620        "isKiosk",
2621        "isosurfaceKey",
2622        "isosurfacePropertySmoothing",
2623        "isosurfacePropertySmoothingPower",
2624        "jmolInJSpecView",
2625        "justifyMeasurements",
2626        "languageTranslation",
2627        "leadAtom",
2628        "leadAtoms",
2629        "legacyAutoBonding",
2630        "legacyHAddition",
2631        "legacyJavaFloat",
2632        "logCommands",
2633        "logGestures",
2634        "macroDirectory",
2635        "measureAllModels",
2636        "measurementLabels",
2637        "measurementNumbers",
2638        "messageStyleChime",
2639        "minimizationRefresh",
2640        "minimizationSilent",
2641        "modelkitMode",
2642        "modelkit",
2643        "modulateOccupancy",
2644        "monitorEnergy",
2645        "multiplebondbananas",
2646        "multipleBondRadiusFactor",
2647        "multipleBondSpacing",
2648        "multiProcessor",
2649        "navigateSurface",
2650        "navigationMode",
2651        "navigationPeriodic",
2652        "partialDots",
2653        "pdbAddHydrogens",
2654        "pdbGetHeader",
2655        "pdbSequential",
2656        "perspectiveDepth",
2657        "preserveState",
2658        "rangeSelected",
2659        "redoMove",
2660        "refreshing",
2661        "ribbonBorder",
2662        "rocketBarrels",
2663        "saveProteinStructureState",
2664        "scriptQueue",
2665        "selectAllModels",
2666        "selectHetero",
2667        "selectHydrogen",
2668    // see commands     "selectionHalos",
2669        "showAxes",
2670        "showBoundBox",
2671        "showBoundingBox",
2672        "showFrank",
2673        "showHiddenSelectionHalos",
2674        "showHydrogens",
2675        "showKeyStrokes",
2676        "showMeasurements",
2677        "showModulationVectors",
2678        "showMultipleBonds",
2679        "showNavigationPointAlways",
2680    // see intparam      "showScript",
2681        "showTiming",
2682        "showUnitcell",
2683        "showUnitcellDetails",
2684        "slabByAtom",
2685        "slabByMolecule",
2686        "slabEnabled",
2687        "smartAromatic",
2688        "solvent",
2689        "solventProbe",
2690    // see intparam     "specular",
2691        "ssBondsBackbone",
2692        "statusReporting",
2693        "strutsMultiple",
2694        "syncMouse",
2695        "syncScript",
2696        "testFlag1",
2697        "testFlag2",
2698        "testFlag3",
2699        "testFlag4",
2700        "traceAlpha",
2701        "twistedSheets",
2702        "undo",
2703        "undoMove",
2704 //       "useArcBall",
2705        "useMinimizationThread",
2706        "useNumberLocalization",
2707        "waitForMoveTo",
2708        "windowCentered",
2709        "wireframeRotation",
2710        "zeroBasedXyzRasmol",
2711        "zoomEnabled",
2712        "zoomHeight",
2713        "zoomLarge",
2714        "zShade",
2715 
2716     };
2717 
2718     int[] iTokens = {
2719         andequals,                          // "+="
2720         -1,                                 // "-="
2721         -1,                                 // "*="
2722         -1,                                 // "/="
2723         -1,                                 // "\\="
2724         -1,                                 // "&="
2725         -1,                                 // "|="
2726         opNot,                              // "not"
2727         -1,                                 // "!"
2728         opXor,                              // "xor"
2729          //no-- don't do this; it interferes with define
2730          // "~"
2731         opToggle,                           // "tog"
2732         opLT,                               // "<"
2733         opLE,                               // "<="
2734         opGE,                               // ">="
2735         opGT,                               // ">"
2736         opNE,                               // "!="
2737         -1,                                 // "<>"
2738         opLIKE,                             // "like"
2739         within,                             // "within"
2740         per,                                // "."
2741         perper,                             // ".."
2742         leftsquare,                         // "["
2743         rightsquare,                        // "]"
2744         leftbrace,                          // "{"
2745         rightbrace,                         // "}"
2746         dollarsign,                         // "$"
2747         percent,                            // "%"
2748         semicolon,                          // ";"
2749         plusPlus,                           // "++"
2750         minusMinus,                         // "--"
2751         timestimes,                         // "**"
2752         leftdivide,                         // "\\"
2753 
2754          // commands
2755 
2756         animation,                          // "animation"
2757         -1,                                 // "anim"
2758         assign,                             // "assign"
2759         axes,                               // "axes"
2760         backbone,                           // "backbone"
2761         background,                         // "background"
2762         bind,                               // "bind"
2763         bondorder,                          // "bondorder"
2764         boundbox,                           // "boundbox"
2765         -1,                                 // "boundingBox"
2766         breakcmd,                           // "break"
2767         calculate,                          // "calculate"
2768         capture,                            // "capture"
2769         cartoon,                            // "cartoon"
2770         -1,                                 // "cartoons"
2771         casecmd,                            // "case"
2772         catchcmd,                           // "catch"
2773         cd,                                 // "cd"
2774         center,                             // "center"
2775         -1,                                 // "centre"
2776         centerat,                           // "centerat"
2777         cgo,                                // "cgo"
2778         color,                              // "color"
2779         -1,                                 // "colour"
2780         compare,                            // "compare"
2781         configuration,                      // "configuration"
2782         -1,                                 // "conformation"
2783         -1,                                 // "config"
2784         connect,                            // "connect"
2785         console,                            // "console"
2786         contact,                            // "contact"
2787         -1,                                 // "contacts"
2788         continuecmd,                        // "continue"
2789         data,                               // "data"
2790         defaultcmd,                         // "default"
2791         define,                             // "define"
2792         -1,                                 // "@"
2793         delay,                              // "delay"
2794         delete,                             // "delete"
2795         density,                            // "density"
2796         depth,                              // "depth"
2797         dipole,                             // "dipole"
2798         -1,                                 // "dipoles"
2799         display,                            // "display"
2800         dot,                                // "dot"
2801         dots,                               // "dots"
2802         draw,                               // "draw"
2803         echo,                               // "echo"
2804         ellipsoid,                          // "ellipsoid"
2805         -1,                                 // "ellipsoids"
2806         elsecmd,                            // "else"
2807         elseif,                             // "elseif"
2808         end,                                // "end"
2809         endifcmd,                           // "endif"
2810         exit,                               // "exit"
2811         eval,                               // "eval"
2812         file,                               // "file"
2813         -1,                                 // "files"
2814         font,                               // "font"
2815         forcmd,                             // "for"
2816         format,                             // "format"
2817         frame,                              // "frame"
2818         -1,                                 // "frames"
2819         frank,                              // "frank"
2820         function,                           // "function"
2821         -1,                                 // "functions"
2822         geosurface,                         // "geosurface"
2823         getproperty,                        // "getProperty"
2824         gotocmd,                            // "goto"
2825         halo,                               // "halo"
2826         -1,                                 // "halos"
2827         helix,                              // "helix"
2828         helixalpha,                         // "helixalpha"
2829         helix310,                           // "helix310"
2830         helixpi,                            // "helixpi"
2831         hbond,                              // "hbond"
2832         -1,                                 // "hbonds"
2833         help,                               // "help"
2834         hide,                               // "hide"
2835         history,                            // "history"
2836         hover,                              // "hover"
2837         ifcmd,                              // "if"
2838         in,                                 // "in"
2839         initialize,                         // "initialize"
2840         invertSelected,                     // "invertSelected"
2841         isosurface,                         // "isosurface"
2842         javascript,                         // "javascript"
2843         label,                              // "label"
2844         -1,                                 // "labels"
2845         lcaocartoon,                        // "lcaoCartoon"
2846         -1,                                 // "lcaoCartoons"
2847         load,                               // "load"
2848         log,                                // "log"
2849         loop,                               // "loop"
2850         measure,                            // "measure"
2851         -1,                                 // "measures"
2852         -1,                                 // "monitor"
2853         -1,                                 // "monitors"
2854         meshRibbon,                         // "meshribbon"
2855         -1,                                 // "meshribbons"
2856         message,                            // "message"
2857         minimize,                           // "minimize"
2858         -1,                                 // "minimization"
2859         mo,                                 // "mo"
2860         model,                              // "model"
2861         -1,                                 // "models"
2862         modulation,                         // "modulation"
2863         move,                               // "move"
2864         moveto,                             // "moveTo"
2865         mutate,                             // "mutate"
2866         navigate,                           // "navigate"
2867         -1,                                 // "navigation"
2868         nbo,                                // "nbo"
2869         origin,                             // "origin"
2870         out,                                // "out"
2871         parallel,                           // "parallel"
2872         pause,                              // "pause"
2873         -1,                                 // "wait"
2874         plot,                               // "plot"
2875         privat,                            // "private"
2876         plot3d,                             // "plot3d"
2877         pmesh,                              // "pmesh"
2878         polygon,                            // "polygon"
2879         polyhedra,                          // "polyhedra"
2880         -1,                                 // "polyhedron"
2881         print,                              // "print"
2882         process,                            // "process"
2883         prompt,                             // "prompt"
2884         quaternion,                         // "quaternion"
2885         -1,                                 // "quaternions"
2886         quit,                               // "quit"
2887         ramachandran,                       // "ramachandran"
2888         -1,                                 // "rama"
2889         refresh,                            // "refresh"
2890         reset,                              // "reset"
2891         -1,                                 // "unset"
2892         restore,                            // "restore"
2893         restrict,                           // "restrict"
2894         returncmd,                          // "return"
2895         ribbon,                             // "ribbon"
2896         -1,                                 // "ribbons"
2897         rocket,                             // "rocket"
2898         -1,                                 // "rockets"
2899         rotate,                             // "rotate"
2900         rotateSelected,                     // "rotateSelected"
2901         save,                               // "save"
2902         select,                             // "select"
2903         selectionhalos,                     // "selectionHalos"
2904         -1,                                 // "selectionHalo"
2905         -1,                                 // "showSelections"
2906         sheet,                              // "sheet"
2907         show,                               // "show"
2908         slab,                               // "slab"
2909         spacefill,                          // "spacefill"
2910         -1,                                 // "cpk"
2911         spin,                               // "spin"
2912         ssbond,                             // "ssbond"
2913         -1,                                 // "ssbonds"
2914         star,                               // "star"
2915         -1,                                 // "stars"
2916         step,                               // "step"
2917         -1,                                 // "steps"
2918         stereo,                             // "stereo"
2919         strands,                            // "strand"
2920         -1,                                 // "strands"
2921         structure,                          // "structure"
2922         -1,                                 // "_structure"
2923         strucno,                            // "strucNo"
2924         struts,                             // "struts"
2925         -1,                                 // "strut"
2926         subset,                             // "subset"
2927         subsystem,                          // "subsystem"
2928         sync,                               // "synchronize"
2929         -1,                                 // "sync"
2930         trace,                              // "trace"
2931         translate,                          // "translate"
2932         translateSelected,                  // "translateSelected"
2933         trycmd,                             // "try"
2934         unbind,                             // "unbind"
2935         unitcell,                           // "unitcell"
2936         var,                                // "var"
2937         vector,                             // "vector"
2938         -1,                                 // "vectors"
2939         vibration,                          // "vibration"
2940         whilecmd,                           // "while"
2941         wireframe,                          // "wireframe"
2942         write,                              // "write"
2943         zap,                                // "zap"
2944         zoom,                               // "zoom"
2945         zoomTo,                             // "zoomTo"
2946 
2947          // show parameters
2948 
2949         atoms,                              // "atom"
2950         -1,                                 // "atoms"
2951         axisangle,                          // "axisangle"
2952         basepair,                           // "basepair"
2953         -1,                                 // "basepairs"
2954         orientation,                        // "orientation"
2955         -1,                                 // "orientations"
2956         pdbheader,                          // "pdbheader"
2957         polymer,                            // "polymer"
2958         -1,                                 // "polymers"
2959         residue,                            // "residue"
2960         -1,                                 // "residues"
2961         rotation,                           // "rotation"
2962         row,                                // "row"
2963         sequence,                           // "sequence"
2964         seqcode,                            // "seqcode"
2965         shape,                              // "shape"
2966         state,                              // "state"
2967         symbol,                             // "symbol"
2968         symmetry,                           // "symmetry"
2969         spacegroup,                         // "spaceGroup"
2970         transform,                          // "transform"
2971         translation,                        // "translation"
2972         url,                                // "url"
2973 
2974          // misc
2975 
2976         __,                                  // "_" (getProperty function)
2977         abs,                                // "abs"
2978         absolute,                           // "absolute"
2979         acos,                               // "acos"
2980         add,                                // "add"
2981         adpmax,                             // "adpmax"
2982         adpmin,                             // "adpmin"
2983         align,                              // "align"
2984         altloc,                             // "altloc"
2985         -1,                                 // "altlocs"
2986         ambientocclusion,                   // "ambientOcclusion"
2987         amino,                              // "amino"
2988         angle,                              // "angle"
2989         array,                              // "array"
2990         as,                                 // "as"
2991         atomid,                             // "atomID"
2992         -1,                                 // "_atomID"
2993         -1,                                 // "_a"
2994         atomindex,                          // "atomIndex"
2995         atomname,                           // "atomName"
2996         atomno,                             // "atomno"
2997         atomtype,                           // "atomType"
2998         atomx,                              // "atomX"
2999         atomy,                              // "atomY"
3000         atomz,                              // "atomZ"
3001         average,                            // "average"
3002         babel,                              // "babel"
3003         babel21,                            // "babel21"
3004         back,                               // "back"
3005         backlit,                            // "backlit"
3006         backshell,                          // "backshell"
3007         balls,                              // "balls"
3008         basemodel,                          // "baseModel"
3009         best,                               // "best"
3010         beta,
3011         bin,                                // "bin"
3012         bondcount,                          // "bondCount"
3013         bonded,                             // "bonded"
3014         bottom,                             // "bottom"
3015         branch,                             // "branch"
3016         brillouin,                          // "brillouin"
3017         -1,                                 // "bzone"
3018         -1,                                 // "wignerSeitz"
3019         cache,                              // "cache"
3020         carbohydrate,                       // "carbohydrate"
3021         cell,                               // "cell"
3022         chain,                              // "chain"
3023         -1,                                 // "chains"
3024         chainno,                            // "chainNo"
3025         chemicalshift,                      // "chemicalShift"
3026         -1,                                 // "cs"
3027         clash,                              // "clash"
3028         clear,                              // "clear"
3029         clickable,                          // "clickable"
3030         clipboard,                          // "clipboard"
3031         connected,                          // "connected"
3032         context,                            // "context"
3033         constraint,                         // "constraint"
3034         contourlines,                       // "contourLines"
3035         coord,                              // "coord"
3036         -1,                                 // "coordinates"
3037         -1,                                 // "coords"
3038         cos,                                // "cos"
3039         cross,                              // "cross"
3040         covalentradius,                     // "covalentRadius"
3041         -1,                                 // "covalent"
3042         direction,                          // "direction"
3043         displacement,                       // "displacement"
3044         displayed,                          // "displayed"
3045         distance,                           // "distance"
3046         div,                                // "div"
3047         dna,                                // "DNA"
3048         domains,                            // "domains"
3049         dotted,                             // "dotted"
3050         dssp,                               // "DSSP"
3051         dssr,                               // "DSSR"
3052         element,                            // "element"
3053         elemno,                             // "elemno"
3054         elemisono,                          // "_e"
3055         error,                              // "error"
3056         exportscale,                        // "exportScale"
3057         fill,                               // "fill"
3058         find,                               // "find"
3059         fixedtemp,                          // "fixedTemperature"
3060         forcefield,                         // "forcefield"
3061         formalcharge,                       // "formalCharge"
3062         -1,                                 // "charge"
3063         eta,                                // "eta"
3064         front,                              // "front"
3065         frontlit,                           // "frontlit"
3066         frontonly,                          // "frontOnly"
3067         fullylit,                           // "fullylit"
3068         fracx,                              // "fx"
3069         fracy,                              // "fy"
3070         fracz,                              // "fz"
3071         fracxyz,                            // "fxyz"
3072         fux,                                // "fux"
3073         fuy,                                // "fuy"
3074         fuz,                                // "fuz"
3075         fuxyz,                              // "fuxyz"
3076         group,                              // "group"
3077         -1,                                 // "groups"
3078         group1,                             // "group1"
3079         groupid,                            // "groupID"
3080         -1,                                 // "_groupID"
3081         -1,                                 // "_g"
3082         groupindex,                         // "groupIndex"
3083         hidden,                             // "hidden"
3084         highlight,                          // "highlight"
3085         hkl,                                // "hkl"
3086         hydrophobicity,                     // "hydrophobicity"
3087         -1,                                 // "hydrophobic"
3088         -1,                                 // "hydro"
3089         id,                                 // "id"
3090         identify,                           // "identify"
3091         -1,                                 // "ident"
3092         image,                              // "image"
3093         info,                               // "info"
3094         infofontsize,                       // "infofontsize"
3095         inline,                             // "inline"
3096         insertion,                          // "insertion"
3097         -1,                                 // "insertions"
3098         intramolecular,                     // "intramolecular"
3099         -1,                                 // "intra"
3100         intermolecular,                     // "intermolecular"
3101         -1,                                 // "inter"
3102         bondingradius,                      // "bondingRadius"
3103         -1,                                 // "ionicRadius"
3104         -1,                                 // "ionic"
3105         isaromatic,                         // "isAromatic"
3106         jmol,                               // "Jmol"
3107         json,                               // "JSON"
3108         join,                               // "join"
3109         keys,                               // "keys"
3110         last,                               // "last"
3111         left,                               // "left"
3112         length,                             // "length"
3113         lines,                              // "lines"
3114         list,                               // "list"
3115         magneticshielding,                  // "magneticShielding"
3116         -1,                                 // "ms"
3117         mass,                               // "mass"
3118         max,                                // "max"
3119         mep,                                // "mep"
3120         mesh,                               // "mesh"
3121         middle,                             // "middle"
3122         min,                                // "min"
3123         mlp,                                // "mlp"
3124         mode,                               // "mode"
3125         modify,                             // "modify"
3126         modifyorcreate,                     // "modifyOrCreate"
3127         modt1,                              // "modt"
3128         -1,                                 // "modt1"
3129         modt2,
3130         modt3,
3131         modx,                               // "modx"
3132         mody,                               // "mody"
3133         modz,                               // "modz"
3134         modo,                               // "modo"
3135         modxyz,                             // "vxyz"
3136         molecule,                           // "molecule"
3137         -1,                                 // "molecules"
3138         modelindex,                         // "modelIndex"
3139         monomer,                            // "monomer"
3140         morph,                              // "morph"
3141         movie,                              // "movie"
3142         mouse,                              // "mouse"
3143         mul,                                // "mul"
3144         mul3,                               // "mul3"
3145         nbocharges,                         // "nbocharges"
3146         nci,                                // "nci"
3147         next,                               // "next"
3148         nodelay,
3149         nodots,                             // "noDots"
3150         nofill,                             // "noFill"
3151         nomesh,                             // "noMesh"
3152         none,                               // "none"
3153         -1,                                 // "null"
3154         -1,                                 // "inherit"
3155         normal,                             // "normal"
3156         nobackshell,                        // "nobackshell"
3157         nocontourlines,                     // "noContourLines"
3158         notfrontonly,                       // "notFrontOnly"
3159         notriangles,                        // "noTriangles"
3160         now,                                // "now"
3161         nucleic,                            // "nucleic"
3162         occupancy,                          // "occupancy"
3163         omega,                              // "omega"
3164         only,                               // "only"
3165         opaque,                             // "opaque"
3166         options,                            // "options"
3167         partialcharge,                      // "partialCharge"
3168         phi,                                // "phi"
3169         pivot,                              // "pivot"
3170         plane,                              // "plane"
3171         -1,                                 // "planar"
3172         play,                               // "play"
3173         playrev,                            // "playRev"
3174         point,                              // "point"
3175         -1,                                 // "points"
3176         pointgroup,                         // "pointGroup"
3177         polymerlength,                      // "polymerLength"
3178         pop,                                // "pop"
3179         prev,                               // "previous"
3180         -1,                                 // "prev"
3181         probe,                              // "probe"
3182         property,                           // "property"
3183         -1,                                 // "properties"
3184         protein,                            // "protein"
3185         psi,                                // "psi"
3186         purine,                             // "purine"
3187         push,                               // "push"
3188         pymol,                              // "PyMOL"
3189         pyrimidine,                         // "pyrimidine"
3190         random,                             // "random"
3191         range,                              // "range"
3192         rasmol,                             // "rasmol"
3193         replace,                            // "replace"
3194         resno,                              // "resno"
3195         resume,                             // "resume"
3196         rewind,                             // "rewind"
3197         reverse,                            // "reverse"
3198         right,                              // "right"
3199         rmsd,                               // "rmsd"
3200         rna,                                // "RNA"
3201         rna3d,                              // "rna3d"
3202         rock,                               // "rock"
3203         rubberband,                         // "rubberband"
3204         sasurface,                          // "saSurface"
3205         saved,                              // "saved"
3206         scale,                              // "scale"
3207         scene,                              // "scene"
3208         search,                             // "search"
3209         -1,                                 // "smarts"
3210         selected,                           // "selected"
3211         seqid,                              // "seqid"
3212         shapely,                            // "shapely"
3213         sidechain,                          // "sidechain"
3214         sin,                                // "sin"
3215         site,                               // "site"
3216         size,                               // "size"
3217         smiles,                             // "smiles"
3218         substructure,                       // "substructure"
3219         solid,                              // "solid"
3220         sort,                               // "sort"
3221         specialposition,                    // "specialPosition"
3222         sqrt,                               // "sqrt"
3223         split,                              // "split"
3224         starwidth,                         // "starWidth"
3225         -1,                                 // "starScale" // too confusing
3226         stddev,                             // "stddev"
3227         straightness,                       // "straightness"
3228         strucid,                            // "structureId"
3229         supercell,                          // "supercell"
3230         sub,                                // "sub"
3231         sum,                                // "sum"
3232         sum2,                               // "sum2"
3233         surface,                            // "surface"
3234         surfacedistance,                    // "surfaceDistance"
3235         symop,                              // "symop"
3236         screenx,                            // "sx"
3237         screeny,                            // "sy"
3238         screenz,                            // "sz"
3239         screenxyz,                          // "sxyz"
3240         temperature,                        // "temperature"
3241         -1,                                 // "relativeTemperature"
3242         tensor,                             // "tensor"
3243         theta,                              // "theta"
3244         thismodel,                          // "thisModel"
3245         ticks,                              // "ticks"
3246         top,                                // "top"
3247         torsion,                            // "torsion"
3248         trajectory,                         // "trajectory"
3249         -1,                                 // "trajectories"
3250         translucent,                        // "translucent"
3251         -1,                                 // "transparent"
3252         triangles,                          // "triangles"
3253         trim,                               // "trim"
3254         type,                               // "type"
3255         unitx,                              // "ux"
3256         unity,                              // "uy"
3257         unitz,                              // "uz"
3258         unitxyz,                            // "uxyz"
3259         user,                               // "user"
3260         valence,                            // "valence"
3261         vanderwaals,                        // "vanderWaals"
3262         -1,                                 // "vdw"
3263         -1,                                 // "vdwRadius"
3264         visible,                            // "visible"
3265         volume,                             // "volume"
3266         vibx,                               // "vx"
3267         viby,                               // "vy"
3268         vibz,                               // "vz"
3269         vibxyz,                             // "vxyz"
3270         xyz,                                // "xyz"
3271         w,                                  // "w"
3272         x,                                  // "x"
3273         y,                                  // "y"
3274         z,                                  // "z"
3275 
3276                 // more misc parameters
3277         addhydrogens,                       //        "addHydrogens"
3278         allconnected,                       //        "allConnected"
3279         angstroms,                          //        "angstroms"
3280         anisotropy,                         //        "anisotropy"
3281         append,                             //        "append"
3282         arc,                                //        "arc"
3283         area,                               //        "area"
3284         aromatic,                           //        "aromatic"
3285         arrow,                              //        "arrow"
3286         async,                              //        "async"
3287         audio,                              //        "audio"
3288         auto,                               //        "auto"
3289         axis,                               //        "axis"
3290         barb,                               //        "barb"
3291         binary,                             //        "binary"
3292         blockdata,                          //        "blockData"
3293         cancel,                             //        "cancel"
3294         cap,                                //        "cap"
3295         cavity,                             //        "cavity"
3296         centroid,                           //        "centroid"
3297         check,                              //        "check"
3298         checkcir,
3299         chemical,                           //        "chemical"
3300         circle,                             //        "circle"
3301         collapsed,                          //        "collapsed"
3302         col,                                //        "col"
3303         colorscheme,                        //        "colorScheme"
3304         command,                            //        "command"
3305         commands,                           //        "commands"
3306         contour,                            //        "contour"
3307         contours,                           //        "contours"
3308         corners,                            //        "corners"
3309         count,                              //        "count"
3310         criterion,                          //        "criterion"
3311         create,                             //        "create"
3312         crossed,                            //        "crossed"
3313         curve,                              //        "curve"
3314         cutoff,                             //        "cutoff"
3315         cylinder,                           //        "cylinder"
3316         diameter,                           //        "diameter"
3317         discrete,                           //        "discrete"
3318         distancefactor,                     //        "distanceFactor"
3319         downsample,                         //        "downsample"
3320         drawing,                            //        "drawing"
3321         dynamicmeasurements,                //        "dynamicMeasurements"
3322         eccentricity,                       //        "eccentricity"
3323         ed,                                 //        "ed"
3324         edges,                              //        "edges"
3325         edgesonly,                          //        "edgesonly" - Polyhedra
3326         energy,                             //        "energy"
3327         exitjmol,                           //        "exitJmol"
3328         facecenteroffset,                   //        "faceCenterOffset"
3329         filter,                             //        "filter"
3330         first,                              //        "first"
3331         fixed,                              //        "fixed"
3332         -1,                                 //        "fix"
3333         flat,                               //        "flat"
3334         fps,                                //        "fps"
3335         from,                               //        "from"
3336         frontedges,                         //        "frontEdges"
3337         full,                               //        "full"
3338         fullplane,                          //        "fullPlane"
3339         functionxy,                         //        "functionXY"
3340         functionxyz,                        //        "functionXYZ"
3341         gridpoints,                         //        "gridPoints"
3342         hiddenlinesdashed,                  //        "hiddenLinesDashed"
3343         homo,                               //        "homo"
3344         ignore,                             //        "ignore"
3345         inchi,                              //        "InChI"
3346         inchikey,                           //        "InChIKey"
3347         increment,                          //        "increment"
3348         insideout,                          //        "insideout"
3349         interior,                           //        "interior"
3350         intersection,                       //        "intersection"
3351         -1,                                 //        "intersect"
3352         internal,                           //        "internal"
3353         lattice,                            //        "lattice"
3354         line,                               //        "line"
3355         linedata,                           //        "lineData"
3356         link,                               //        "link"
3357         lobe,                               //        "lobe"
3358         lonepair,                           //        "lonePair"
3359         lp,                                 //        "lp"
3360         lumo,                               //        "lumo"
3361         macro,                              //        "macro"  // added in Jmol 14.3.15
3362         manifest,                           //        "manifest"
3363         mapproperty,                        //        "mapProperty"
3364         maxset,                             //        "maxSet"
3365         menu,                               //        "menu"
3366         minset,                             //        "minSet"
3367         modelbased,                         //        "modelBased"
3368         molecular,                          //        "molecular"
3369         mrc,                                //        "mrc"
3370         msms,                               //        "msms"
3371         name,                               //        "name"
3372         nmr,                                //        "nmr"
3373         nocross,                            //        "noCross"
3374         nodebug,                            //        "noDebug"
3375         noedges,                            //        "noEdges"
3376         nohead,                             //        "noHead"
3377         noload,                             //        "noLoad"
3378         noplane,                            //        "noPlane"
3379         object,                             //        "object"
3380         obj,                                //        "obj"
3381         offset,                             //        "offset"
3382         offsetside,                         //        "offsetSide"
3383         once,                               //        "once"
3384         orbital,                            //        "orbital"
3385         atomicorbital,                      //        "atomicOrbital"
3386         packed,                             //        "packed"
3387         palindrome,                         //        "palindrome"
3388         parameters,                         //        "parameters"
3389         path,                               //        "path"
3390         pdb,                                //        "pdb"
3391         period,                             //        "period"
3392         -1,                                 //        "periodic"
3393         perpendicular,                      //        "perpendicular"
3394         -1,                                 //        "perp"
3395         phase,                              //        "phase"
3396         planarparam,                        //        "planarparam"
3397         pocket,                             //        "pocket"
3398         pointsperangstrom,                  //        "pointsPerAngstrom"
3399         radical,                            //        "radical"
3400         rad,                                //        "rad"
3401         reference,                          //        "reference"
3402         remove,                             //        "remove"
3403         resolution,                         //        "resolution"
3404         reversecolor,                       //        "reverseColor"
3405         rotate45,                           //        "rotate45"
3406         selection,                          //        "selection"
3407         sigma,                              //        "sigma"
3408         sign,                               //        "sign"
3409         silent,                             //        "silent"
3410         sphere,                             //        "sphere"
3411         squared,                            //        "squared"
3412         stdinchi,                           //        "stdInChI"
3413         stdinchikey,                        //        "stdInChIKey"
3414         stop,                               //        "stop"
3415         title,                              //        "title"
3416         titleformat,                        //        "titleFormat"
3417         to,                                 //        "to"
3418         validation,                         //        "validation"
3419         val,                                //        "value"
3420         variable,                           //        "variable"
3421         variables,                          //        "variables"
3422         vertices,                           //        "vertices"
3423         width,                              //        "width"
3424         wigner,                             //        "wigner"
3425 
3426                 // set params
3427 
3428         backgroundmodel,                    //        "backgroundModel"
3429         celshading,                         //        "celShading"
3430         celshadingpower,                    //        "celShadingPower"
3431         debug,                              //        "debug"
3432         debughigh,                          //        "debugHigh"
3433         defaultlattice,                     //        "defaultLattice"
3434         measurements,                       //        "measurements"
3435         -1,                                 //        "measurement"
3436         scale3d,                            //        "scale3D"
3437         togglelabel,                        //        "toggleLabel"
3438         usercolorscheme,                    //        "userColorScheme"
3439         throwcmd,                           //        "throw"
3440         timeout,                            //        "timeout"
3441         -1,                                 //        "timeouts"
3442         window,                             //        "window"
3443 
3444                 // string
3445 
3446         animationmode,                      //        "animationMode"
3447         appletproxy,                        //        "appletProxy"
3448         atomtypes,                          //        "atomTypes"
3449         axescolor,                          //        "axesColor"
3450         axis1color,                         //        "axis1Color"
3451         axis2color,                         //        "axis2Color"
3452         axis3color,                         //        "axis3Color"
3453         backgroundcolor,                    //        "backgroundColor"
3454         bondmode,                           //        "bondmode"
3455         boundboxcolor,                      //        "boundBoxColor"
3456         -1,                                 //        "boundingBoxColor"
3457         chirality,
3458         ciprule,
3459         currentlocalpath,                   //        "currentLocalPath"
3460         dataseparator,                      //        "dataSeparator"
3461         defaultanglelabel,                  //        "defaultAngleLabel"
3462         defaultcolorscheme,                 //        "defaultColorScheme"
3463         -1,                                 //        "defaultColors"
3464         defaultdirectory,                   //        "defaultDirectory"
3465         defaultdistancelabel,               //        "defaultDistanceLabel"
3466         defaultdropscript,                  //        "defaultDropScript"
3467         defaultlabelpdb,                    //        "defaultLabelPDB"
3468         defaultlabelxyz,                    //        "defaultLabelXYZ"
3469         defaultloadfilter,                  //        "defaultLoadFilter"
3470         defaultloadscript,                  //        "defaultLoadScript"
3471         defaults,                           //        "defaults"
3472         defaulttorsionlabel,                //        "defaultTorsionLabel"
3473         defaultvdw,                         //        "defaultVDW"
3474         drawfontsize,                       //        "drawFontSize"
3475         eds,                                //        "eds"
3476         edsdiff,                            //        "edsDiff"
3477 //        edsurlcutoff,                       //        "edsUrlCutoff"
3478 //        edsurlformat,                       //        "edsUrlFormat"
3479 //        edsurlformatdiff,                   //        "edsUrlFormatDiff"
3480         energyunits,                        //        "energyUnits"
3481         filecachedirectory,                 //        "fileCacheDirectory"
3482         fontsize,                           //        "fontsize"
3483         helppath,                           //        "helpPath"
3484         hoverlabel,                         //        "hoverLabel"
3485         language,                           //        "language"
3486         loadformat,                         //        "loadFormat"
3487         loadligandformat,                   //        "loadLigandFormat"
3488         logfile,                            //        "logFile"
3489         measurementunits,                   //        "measurementUnits"
3490         nihresolverformat,                  //        "nihResolverFormat"
3491         nmrpredictformat,                   //        "nmrPredictFormat"
3492         nmrurlformat,                       //        "nmrUrlFormat"
3493         pathforallfiles,                    //        "pathForAllFiles"
3494         picking,                            //        "picking"
3495         pickingstyle,                       //        "pickingStyle"
3496         picklabel,                          //        "pickLabel"
3497         platformspeed,                      //        "platformSpeed"
3498         propertycolorscheme,                //        "propertyColorScheme"
3499         quaternionframe,                    //        "quaternionFrame"
3500         smilesurlformat,                    //        "smilesUrlFormat"
3501         smiles2dimageformat,                //        "smiles2dImageFormat"
3502         unitcellcolor,                      //        "unitCellColor"
3503 
3504                 // float
3505 
3506         axesoffset,                          //       "axesOffset"
3507         -1,                                 //        "axisOffset"
3508         axesscale,                          //        "axesScale"
3509         -1,                                 //        "axisScale"
3510         bondtolerance,                      //        "bondTolerance"
3511         cameradepth,                        //        "cameraDepth"
3512         defaultdrawarrowscale,              //        "defaultDrawArrowScale"
3513         defaulttranslucent,                 //        "defaultTranslucent"
3514         dipolescale,                        //        "dipoleScale"
3515         ellipsoidaxisdiameter,              //        "ellipsoidAxisDiameter"
3516         gestureswipefactor,                 //        "gestureSwipeFactor"
3517         hbondsangleminimum,                 //        "hbondsAngleMinimum"
3518         hbondhxdistancemaximum,             //        "hbondHDistanceMaximum"
3519         hbondnodistancemaximum,              //        "hbondsDistanceMaximum"
3520         -1,
3521         hoverdelay,                         //        "hoverDelay"
3522         loadatomdatatolerance,              //        "loadAtomDataTolerance"
3523         minbonddistance,                    //        "minBondDistance"
3524         minimizationcriterion,              //        "minimizationCriterion"
3525         minimizationmaxatoms,               //        "minimizationMaxAtom"
3526         modulationscale,                    //        "modulationScale"
3527         mousedragfactor,                    //        "mouseDragFactor"
3528         mousewheelfactor,                   //        "mouseWheelFactor"
3529         navfps,                             //        "navFPS"
3530         navigationdepth,                    //        "navigationDepth"
3531         navigationslab,                     //        "navigationSlab"
3532         navigationspeed,                    //        "navigationSpeed"
3533         navx,                               //        "navX"
3534         navy,                               //        "navY"
3535         navz,                               //        "navZ"
3536         particleradius,                     //        "particleRadius"
3537         pointgroupdistancetolerance,        //        "pointGroupDistanceTolerance"
3538         pointgrouplineartolerance,          //        "pointGroupLinearTolerance"
3539         radius,                             //        "radius"
3540         rotationradius,                     //        "rotationRadius"
3541         scaleangstromsperinch,              //        "scaleAngstromsPerInch"
3542         sheetsmoothing,                     //        "sheetSmoothing"
3543         slabrange,                          //        "slabRange"
3544         solventproberadius,                 //        "solventProbeRadius"
3545         spinfps,                            //        "spinFPS"
3546         spinx,                              //        "spinX"
3547         spiny,                              //        "spinY"
3548         spinz,                              //        "spinZ"
3549         stereodegrees,                      //        "stereoDegrees"
3550         strutdefaultradius,                 //        "strutDefaultRadius"
3551         strutlengthmaximum,                 //        "strutLengthMaximum"
3552         vectorscale,                        //        "vectorScale"
3553         vectorscentered,                    //        "vectorsCenered"
3554         vectorsymmetry,                     //        "vectorSymmetry"
3555         vectortrail,                        //        "vectorTrail"
3556         vibrationperiod,                    //        "vibrationPeriod"
3557         vibrationscale,                     //        "vibrationScale"
3558         visualrange,                        //        "visualRange"
3559 
3560                 // int
3561 
3562         ambientpercent,                     //        "ambientPercent"
3563         -1,                                 //        "ambient"
3564         animationfps,                       //        "animationFps"
3565         axesmode,                           //        "axesMode"
3566         bondradiusmilliangstroms,           //        "bondRadiusMilliAngstroms"
3567         bondingversion,                     //        "bondingVersion"
3568         delaymaximumms,                     //        "delayMaximumMs"
3569         diffusepercent,                     //        "diffusePercent"
3570         -1,                                 //        "diffuse"
3571         dotdensity,                         //        "dotDensity"
3572         dotscale,                           //        "dotScale"
3573         ellipsoiddotcount,                  //        "ellipsoidDotCount"
3574         helixstep,                          //        "helixStep"
3575         hermitelevel,                       //        "hermiteLevel"
3576         historylevel,                       //        "historyLevel"
3577         lighting,                           //        "lighting"
3578         loglevel,                           //        "logLevel"
3579         meshscale,                          //        "meshScale"
3580         minimizationsteps,                  //        "minimizationSteps"
3581         minpixelselradius,                  //        "minPixelSelRadius"
3582         percentvdwatom,                     //        "percentVdwAtom"
3583         perspectivemodel,                   //        "perspectiveModel"
3584         phongexponent,                      //        "phongExponent"
3585         pickingspinrate,                    //        "pickingSpinRate"
3586         propertyatomnumberfield,            //        "propertyAtomNumberField"
3587         propertyatomnumbercolumncount,      //        "propertyAtomNumberColumnCount"
3588         propertydatacolumncount,            //        "propertyDataColumnCount"
3589         propertydatafield,                  //        "propertyDataField"
3590         repaintwaitms,                      //        "repaintWaitMs"
3591         ribbonaspectratio,                  //        "ribbonAspectRatio"
3592         contextdepthmax,                     //        "scriptLevelMax"
3593         scriptreportinglevel,               //        "scriptReportingLevel"
3594         showscript,                         //        "showScript"
3595         smallmoleculemaxatoms,              //        "smallMoleculeMaxAtoms"
3596         specular,                           //        "specular"
3597         specularexponent,                   //        "specularExponent"
3598         specularpercent,                    //        "specularPercent"
3599         -1,                                 //        "specPercent"
3600         specularpower,                      //        "specularPower"
3601         -1,                                 //        "specpower"
3602         strandcount,                        //        "strandCount"
3603         strandcountformeshribbon,           //        "strandCountForMeshRibbon"
3604         strandcountforstrands,              //        "strandCountForStrands"
3605         strutspacing,                       //        "strutSpacing"
3606         zdepth,                             //        "zDepth"
3607         zslab,                              //        "zSlab"
3608         zshadepower,                        //        "zshadePower"
3609 
3610                 // boolean
3611 
3612         allowembeddedscripts,               //        "allowEmbeddedScripts"
3613         allowgestures,                      //        "allowGestures"
3614         allowkeystrokes,                    //        "allowKeyStrokes"
3615         allowmodelkit,                      //        "allowModelKit"
3616         allowmoveatoms,                     //        "allowMoveAtoms"
3617         allowmultitouch,                    //        "allowMultiTouch"
3618         allowrotateselected,                //        "allowRotateSelected"
3619         antialiasdisplay,                   //        "antialiasDisplay"
3620         antialiasimages,                    //        "antialiasImages"
3621         antialiastranslucent,               //        "antialiasTranslucent"
3622         appendnew,                          //        "appendNew"
3623         applysymmetrytobonds,               //        "applySymmetryToBonds"
3624         atompicking,                        //        "atomPicking"
3625         allowaudio,                         //        "allowAudio"
3626         autobond,                           //        "autobond"
3627         autofps,                            //        "autoFPS"
3628         autoplaymovie,                      //        "autoplayMovie"
3629 //                "autoLoadOrientation"
3630         axesmolecular,                      //        "axesMolecular"
3631         axesorientationrasmol,              //        "axesOrientationRasmol"
3632         axesunitcell,                       //        "axesUnitCell"
3633         axeswindow,                         //        "axesWindow"
3634         bondmodeor,                         //        "bondModeOr"
3635         bondpicking,                        //        "bondPicking"
3636         bonds,                              //        "bonds"
3637         -1,                                 //        "bond"
3638         cartoonbaseedges,                   //        "cartoonBaseEdges"
3639         cartoonblocks,
3640         cartoonblockheight,
3641         cartoonsfancy,                      //        "cartoonsFancy"
3642         -1,                                 //        "cartoonFancy"
3643         cartoonladders,                     //        "cartoonLadders"
3644         cartoonribose,                      //        "cartoonRibose"
3645         cartoonrockets,                     //        "cartoonRockets"
3646         cartoonsteps,                       //
3647         chaincasesensitive,                 //        "chainCaseSensitive"
3648         ciprule6full,
3649         colorrasmol,                        //        "colorRasmol"
3650         debugscript,                        //        "debugScript"
3651         defaultstructuredssp,               //        "defaultStructureDssp"
3652         disablepopupmenu,                   //        "disablePopupMenu"
3653         displaycellparameters,              //        "displayCellParameters"
3654         -1,                                 //        "showUnitCellInfo"
3655         dotsselectedonly,                   //        "dotsSelectedOnly"
3656         dotsurface,                         //        "dotSurface"
3657         dragselected,                       //        "dragSelected"
3658         drawhover,                          //        "drawHover"
3659         drawpicking,                        //        "drawPicking"
3660         dsspcalchydrogen,                   //        "dsspCalculateHydrogenAlways"
3661         ellipsoidarcs,                      //        "ellipsoidArcs"
3662         ellipsoidarrows,                    //        "ellipsoidArrows"
3663         ellipsoidaxes,                      //        "ellipsoidAxes"
3664         ellipsoidball,                      //        "ellipsoidBall"
3665         ellipsoiddots,                      //        "ellipsoidDots"
3666         ellipsoidfill,                      //        "ellipsoidFill"
3667         filecaching,                        //        "fileCaching"
3668         fontcaching,                        //        "fontCaching"
3669         fontscaling,                        //        "fontScaling"
3670         forceautobond,                      //        "forceAutoBond"
3671         fractionalrelative,                 //        "fractionalRelative"
3672           // see commands     "frank"
3673         greyscalerendering,                 //        "greyscaleRendering"
3674         hbondsbackbone,                     //        "hbondsBackbone"
3675         hbondsrasmol,                       //        "hbondsRasmol"
3676         hbondssolid,                        //        "hbondsSolid"
3677         hetero,                             //        "hetero"
3678         hidenameinpopup,                    //        "hideNameInPopup"
3679         hidenavigationpoint,                //        "hideNavigationPoint"
3680         hidenotselected,                    //        "hideNotSelected"
3681         highresolution,                     //        "highResolution"
3682         hydrogen,                           //        "hydrogen"
3683         -1,                                 //        "hydrogens"
3684         imagestate,                         //        "imageState"
3685         iskiosk,                            //        "isKiosk"
3686         isosurfacekey,                      //        "isosurfaceKey"
3687         isosurfacepropertysmoothing,        //        "isosurfacePropertySmoothing"
3688         isosurfacepropertysmoothingpower,   //        "isosurfacePropertySmoothingPower"
3689         jmolinjspecview,
3690         justifymeasurements,                //        "justifyMeasurements"
3691         languagetranslation,                //        "languageTranslation"
3692         leadatom,                           //        "leadAtom"
3693         -1,                                 //        "leadAtoms"
3694         legacyautobonding,                  //        "legacyAutoBonding"
3695         legacyhaddition,                    //        "legacyHAddition"
3696         legacyjavafloat,                   //        "legacyRangeCheck"
3697         logcommands,                        //        "logCommands"
3698         loggestures,                        //        "logGestures"
3699         macrodirectory,
3700         measureallmodels,                   //        "measureAllModels"
3701         measurementlabels,                  //        "measurementLabels"
3702         measurementnumbers,                 //        "measurementNumbers"
3703         messagestylechime,                  //        "messageStyleChime"
3704         minimizationrefresh,                //        "minimizationRefresh"
3705         minimizationsilent,                 //        "minimizationSilent"
3706         modelkitmode,                       //        "modelkitMode"
3707         -1,
3708         modulateoccupancy,
3709         monitorenergy,                      //        "monitorEnergy"
3710         multiplebondbananas,
3711         multiplebondradiusfactor,           //        "multipleBondRadiusFactor"
3712         multiplebondspacing,                //        "multipleBondSpacing"
3713         multiprocessor,                     //        "multiProcessor"
3714         navigatesurface,                    //        "navigateSurface"
3715         navigationmode,                     //        "navigationMode"
3716         navigationperiodic,                 //        "navigationPeriodic"
3717         partialdots,                        //        "partialDots"
3718         pdbaddhydrogens,                    //        "pdbAddHydrogens"
3719         pdbgetheader,                       //        "pdbGetHeader"
3720         pdbsequential,                      //        "pdbSequential"
3721         perspectivedepth,                   //        "perspectiveDepth"
3722         preservestate,                      //        "preserveState"
3723         rangeselected,                      //        "rangeSelected"
3724         redomove,                           //        "redoMove"
3725         refreshing,                         //        "refreshing"
3726         ribbonborder,                       //        "ribbonBorder"
3727         rocketbarrels,                      //        "rocketBarrels"
3728         saveproteinstructurestate,          //        "saveProteinStructureState"
3729         scriptqueue,                        //        "scriptQueue"
3730         selectallmodels,                    //        "selectAllModels"
3731         selecthetero,                       //        "selectHetero"
3732         selecthydrogen,                     //        "selectHydrogen"
3733           // see commands     "selectionHalos"
3734         showaxes,                           //        "showAxes"
3735         showboundbox,                       //        "showBoundBox"
3736         -1,                                 //        "showBoundingBox"
3737         showfrank,                          //        "showFrank"
3738         showhiddenselectionhalos,           //        "showHiddenSelectionHalos"
3739         showhydrogens,                      //        "showHydrogens"
3740         showkeystrokes,                     //        "showKeyStrokes"
3741         showmeasurements,                   //        "showMeasurements"
3742         showmodvecs,                        //        "showModulationVectors"
3743         showmultiplebonds,                  //        "showMultipleBonds"
3744         shownavigationpointalways,          //        "showNavigationPointAlways"
3745           // see intparam      "showScript"
3746         showtiming,                         //        "showTiming"
3747         showunitcell,                       //        "showUnitcell"
3748         showunitcelldetails,                //        "showUnitcellDetails"
3749         slabbyatom,                         //        "slabByAtom"
3750         slabbymolecule,                     //        "slabByMolecule"
3751         slabenabled,                        //        "slabEnabled"
3752         smartaromatic,                      //        "smartAromatic"
3753         solvent,                            //        "solvent"
3754         solventprobe,                       //        "solventProbe"
3755           // see intparam     "specular"
3756         ssbondsbackbone,                    //        "ssBondsBackbone"
3757         statusreporting,                    //        "statusReporting"
3758         strutsmultiple,                     //        "strutsMultiple"
3759         syncmouse,                          //        "syncMouse"
3760         syncscript,                         //        "syncScript"
3761         testflag1,                          //        "testFlag1"
3762         testflag2,                          //        "testFlag2"
3763         testflag3,                          //        "testFlag3"
3764         testflag4,                          //        "testFlag4"
3765         tracealpha,                         //        "traceAlpha"
3766         twistedsheets,                      //        "twistedSheets"
3767         undo,                               //        "undo"
3768         undomove,                           //        "undoMove"
3769 //        usearcball,                         //        "useArcBall"
3770         useminimizationthread,              //        "useMinimizationThread"
3771         usenumberlocalization,              //        "useNumberLocalization"
3772         waitformoveto,                      //        "waitForMoveTo"
3773         windowcentered,                     //        "windowCentered"
3774         wireframerotation,                  //        "wireframeRotation"
3775         zerobasedxyzrasmol,                 //        "zeroBasedXyzRasmol"
3776         zoomenabled,                        //        "zoomEnabled"
3777         zoomheight,                         //        "zoomHeight"
3778         zoomlarge,                          //        "zoomLarge"
3779         zshade,                             //        "zShade"
3780 
3781     };
3782 
3783 
3784     if (sTokens.length != iTokens.length) {
3785       Logger.error("sTokens.length ("+sTokens.length+") != iTokens.length! ("+iTokens.length+")");
3786       System.exit(1);
3787     }
3788 
3789     n = sTokens.length;
3790     for (int i = 0; i < n; i++) {
3791       sTok = sTokens[i];
3792       lcase = sTok.toLowerCase();
3793       int t = iTokens[i];
3794       tokenThis = tokenLast = (t == -1 ? tokenLast : o(t, sTok));
3795       if (tokenMap.get(lcase) != null)
3796         Logger.error("duplicate token definition:" + lcase);
tokenMap.put(lcase, tokenThis)3797       tokenMap.put(lcase, tokenThis);
3798     }
3799 
3800     sTokens = null;
3801     iTokens = null;
3802   }
3803 
getParamType(int tok)3804   public static int getParamType(int tok) {
3805     if (!tokAttr(tok, setparam))
3806       return nada;
3807     return tok & paramTypes;
3808   }
3809 
getTokensType(Map<String, Object> map, int attr)3810   public static void getTokensType(Map<String, Object> map, int attr) {
3811     for (Entry<String, T> e: tokenMap.entrySet()) {
3812       T t = e.getValue();
3813       if (tokAttr(t.tok, attr))
3814         map.put(e.getKey(), e.getValue());
3815     }
3816   }
3817 
3818   /**
3819    * commands that allow implicit ID as first parameter
3820    *
3821    * @param cmdtok
3822    * @return true or false
3823    */
isIDcmd(int cmdtok)3824   public static boolean isIDcmd(int cmdtok) {
3825     switch (cmdtok) {
3826     case isosurface:
3827     case draw:
3828     case cgo:
3829     case pmesh:
3830     case contact:
3831       return true;
3832     default:
3833       return false;
3834     }
3835   }
3836 
3837   @Override
equals(Object o)3838   public boolean equals(Object o) {
3839     // only used for arrays.
3840     if (!(o instanceof T))
3841       return false;
3842     T t = (T) o;
3843     if (tok == t.tok)
3844       return (t.intValue == intValue && (tok == integer || tok == on || tok == off || t.value
3845           .equals(value)));
3846     switch (tok) {
3847     case integer:
3848       return (t.tok == decimal && ((Float) t.value).floatValue() == intValue);
3849     case decimal:
3850       return (t.tok == integer && ((Float) value).floatValue() == t.intValue);
3851     default:
3852       return false;
3853     }
3854   }
3855 
3856   @Override
hashCode()3857   public int hashCode() {
3858     return super.hashCode();
3859   }
3860 
3861 }
3862