Package org.jmol.script
Class ScriptEval
java.lang.Object
org.jmol.script.ScriptError
org.jmol.script.ScriptParam
org.jmol.script.ScriptExpr
org.jmol.script.ScriptEval
- All Implemented Interfaces:
JmolScriptEvaluator
-
Field Summary
FieldsModifier and TypeFieldDescriptionT[][]
private boolean
static int
static final String
static final String
private static int
private String
private Thread
private boolean
private static final long
private static final int
private static final int
private static final int
private boolean
private boolean
private boolean
private boolean
private JmolThread
private boolean
boolean
private static int
private boolean
private boolean
private boolean
private boolean
private boolean
private boolean
boolean
boolean
private int
private int[][]
private short[]
private boolean
private boolean
javajs.util.SB
private JmolParallelProcessor
int
private int
int
private static final String
private String
private JmolThread
private String
int
private static int
private long
private long
boolean
Fields inherited from class org.jmol.script.ScriptExpr
debugHigh, privateFuncs, tempStatement
Fields inherited from class org.jmol.script.ScriptParam
contextFunctions, contextVariables, coordinatesAreFractional, fractionalPoint, isBondSet, iToken, MODE_P_ALLOW_FRACTIONAL, MODE_P_CONVERT_TO_CARTESIAN, MODE_P_IMPLICIT_FRACTIONAL, MODE_P_INT_ONLY, MODE_P_NULL_ON_ERROR, MODE_P3, MODE_P34, MODE_P4, slen, st, theTok, theToken, thisContext
Fields inherited from class org.jmol.script.ScriptError
chk, error, ERROR_axisExpected, ERROR_backgroundModelError, ERROR_badArgumentCount, ERROR_badMillerIndices, ERROR_badRGBColor, ERROR_booleanExpected, ERROR_booleanOrNumberExpected, ERROR_booleanOrWhateverExpected, ERROR_cannotSet, ERROR_colorExpected, ERROR_colorOrPaletteRequired, ERROR_commandExpected, ERROR_coordinateOrNameOrExpressionRequired, ERROR_drawObjectNotDefined, ERROR_endOfStatementUnexpected, ERROR_expressionExpected, ERROR_expressionOrIntegerExpected, ERROR_filenameExpected, ERROR_fileNotFoundException, ERROR_incompatibleArguments, ERROR_insufficientArguments, ERROR_integerExpected, ERROR_integerOutOfRange, ERROR_invalidArgument, ERROR_invalidParameterOrder, ERROR_keywordExpected, ERROR_moCoefficients, ERROR_moIndex, ERROR_moModelError, ERROR_moOccupancy, ERROR_moOnlyOne, ERROR_multipleModelsDisplayedNotOK, ERROR_multipleModelsNotOK, ERROR_noData, ERROR_noPartialCharges, ERROR_noUnitCell, ERROR_numberExpected, ERROR_numberMustBe, ERROR_numberOutOfRange, ERROR_objectNameExpected, ERROR_planeExpected, ERROR_propertyNameExpected, ERROR_spaceGroupNotFound, ERROR_stringExpected, ERROR_stringOrIdentifierExpected, ERROR_tooManyPoints, ERROR_tooManyScriptLevels, ERROR_unrecognizedAtomProperty, ERROR_unrecognizedBondProperty, ERROR_unrecognizedCommand, ERROR_unrecognizedExpression, ERROR_unrecognizedObject, ERROR_unrecognizedParameter, ERROR_unrecognizedParameterWarning, ERROR_unrecognizedShowParameter, ERROR_what, ERROR_writeWhat, errorMessage, errorMessageUntranslated, errorType, iCommandError, ignoreError, vwr
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
private int
addLoadData
(javajs.util.SB loadScript, String key, Map<String, Object> htParams, int i) private void
addProcess
(javajs.util.Lst<T[]> vProcess, int pc, int pt) private void
appendBuffer
(String str, boolean mustDo) private void
breakAt
(int pt) private void
private boolean
checks to see if there is a pause condition, during which commands can still be issued, but with the ! first.private void
checkExtension
(int tok) checkFileExists
(String prefix, boolean isAsync, String filename, int i, boolean doClear) checkScriptSilent
(String script) a method for just checking a scriptboolean
checkSelect
(Map<String, SV> h, T[] where) Check a map for a WHERE phrasevoid
private void
clearState
(boolean tQuiet) private void
private void
cmdAxes
(int index) private void
cmdBackground
(int i) private void
cmdBind()
private void
private void
cmdBoundbox
(int index) private void
cmdCD()
private void
cmdCenter
(int i) private void
cmdColor()
private void
private void
cmdDelay()
private void
private void
cmdDisplay
(boolean isDisplay) private void
cmdDots
(int iShape) private void
cmdEcho
(int index) private void
cmdFile()
private void
cmdFixed()
private boolean
private int
cmdFlowSwitch
(ContextToken c, int tok) private void
cmdFont
(int shapeType, float fontsize) private boolean
cmdFor
(int tok, boolean isForCheck) private void
cmdFrank
(int i) private void
cmdFunc()
private void
private void
cmdGoto
(boolean isCmd) private void
cmdHbond()
private void
cmdHelp()
private void
cmdHistory
(int pt) private void
cmdHover()
private void
cmdLabel
(int index, javajs.util.BS bs) void
cmdLoad()
private void
cmdLog()
private void
cmdLoop()
private void
private void
cmdModel
(int offset) ONE difference between FRAME and MODEL: model 1 sets model NAMED one in the case of PDB frame 1 always sets the first modelprivate void
cmdMove()
private void
private boolean
cmdPause()
private void
cmdPrint()
private void
private void
cmdReset()
private void
private void
private void
void
cmdRotate
(boolean isSpin, boolean isSelected) private void
cmdSave()
private void
cmdScale
(int pt) void
private void
cmdSelect
(int i) private void
cmdSelectionHalos
(int pt) private void
cmdSet()
private void
cmdSetEcho
(int i) private boolean
cmdSetLabel
(String str) private void
private void
private void
cmdSlab
(boolean isDepth) private void
private void
private void
private void
cmdSync()
private void
cmdThrow()
private void
cmdTimeout
(int index) private void
cmdTranslate
(boolean isSelected) private void
void
cmdUndoRedo
(int tok) private void
cmdUnitcell
(int i) private void
private void
private void
private void
cmdZap
(boolean isZapCommand) private void
cmdZoom
(boolean isZoomTo) private void
colorShape
(int shapeType, int index, boolean isBackground) private void
commandLoop
(boolean allowJSInterrupt) boolean
compileScript
(String filename, String strScript, boolean debugCompiler) boolean
compileScriptFile
(String filename, boolean tQuiet) boolean
compileScriptString
(String script, boolean tQuiet) private void
defineAtomSet
(String script) private void
support for @xxx or define xxx commandsvoid
delayScript
(int millis) void
deleteAtomsInVariables
(javajs.util.BS bsDeleted) boolean
dispatchCommands
(boolean isSpt, boolean fromFunc, boolean isTry) private void
doDelay
(int millis) boolean
doReport()
encodeRadiusParameter
(int index, boolean isOnly, boolean allowAbsolute) float
evalFunctionFloat
(Object func, Object params, float[] values) boolean
evalParallel
(ScriptContext context, ShapeManager shapeManager) private Object
void
evaluateCompiledScript
(boolean isCmdLine_c_or_C_Option, boolean isCmdLine_C_Option, boolean historyDisabled, boolean listCommands, javajs.util.SB outputBuffer, boolean allowThreads) evaluateExpression
(Object expr, boolean asVariable, boolean compileOnly) a general-use method to evaluate a "SET" type expression.private int
executeCommands
(boolean isTry, boolean reportCompletion) expandFloatArray
(float[] a, int min, boolean asBS) Accepts a float array and expands [1 -3] to [1 2 3], for example.private void
finalizeLoad
(boolean isAppend, boolean appendNew, boolean isConcat, boolean doOrient, int nFiles, int ac0, int modelCount0, boolean isData) private String
fixScriptPath
(String strScript, String filename) private void
frameControl
(int i) boolean
javajs.util.BS
getAtomBitSet
(Object atomExpression) A general method to evaluate a string representing an atom set.getColorRange
(int i) private String
getCommand
(int pc, boolean allThisLine, boolean addSemi) used for recall of commands in the application console(package private) static javajs.util.SB
getContextTrace
(Viewer vwr, ScriptContext sc, javajs.util.SB sb, boolean isTop) getFullPathName
(boolean withType) int
private String
getLoadFilesList
(int i, javajs.util.SB loadScript, javajs.util.SB sOptions, Map<String, Object> htParams, javajs.util.Lst<String> fNames) private int
getLoadModelIndex
(int i, javajs.util.SB sOptions, Map<String, Object> htParams) when paused, indicates what statement will be nextprivate javajs.util.P3[]
protected javajs.util.P3
getObjectCenter
(String axisID, int index, int modelIndex) void
getPartialCharges
(javajs.util.BS bs) protected javajs.util.P4
getPlaneForObject
(String id, javajs.util.V3 vAB) javajs.util.Quat[]
getQuaternionArray
(Object quaternionOrSVData, int itype) getScriptContext
(String why) private String
getScriptFileInternal
(String filename, String localPath, String remotePath, String scriptPath) Retrieve the uncompiled script or null if failedint
getSetAxesTypeMad10
(int index) private float
getSettingFloat
(int pt) private int
getSettingInt
(int pt) private String
getSettingStr
(int pt, boolean isJmolSet) Accept an unquoted string if there is just one parameter regardless of its type.getShapeProperty
(int shapeType, String propertyName) boolean
getShapePropertyData
(int shapeType, String propertyName, Object[] data) private int
getShapeType
(int tok) float
getTranslucentLevel
(int i) getUserFunctionResult
(String name, javajs.util.Lst<SV> params, SV tokenAtom) private float
getZoom
(int ptCenter, int i, javajs.util.BS bs, float currentZoom) void
boolean
isAtomExpression
(int i) private boolean
isCommandDisplayable
(int i) provides support for the script editorboolean
private boolean
isLoadOption
(int tok) private boolean
boolean
isPaused()
boolean
boolean
boolean
private void
loadFileAsync
(String prefix, String filename, int i, boolean doClear) Allows asynchronous file loading from the LOAD or SCRIPT command.void
loadFileResourceAsync
(String fileName) load a static file asynchronouslyprivate void
private void
logDebugScript
(T[] st, int ifLevel) private void
logLoadInfo
(String msg, boolean isData) javajs.util.BS
lookupIdentifierValue
(String identifier) private javajs.util.BS
lookupValue
(String setName, boolean plurals) void
private void
notifyScriptEditor
(int pc) void
pauseExecution
(boolean withDelay) (package private) void
popContext
(boolean isFlowCommand, boolean statementOnly) private void
postProcessTry
(Map<String, SV> cv) private void
processCommand
(int tok) private void
processShapeCommand
(int tok) private void
pushContext
(ContextToken token, String why) private void
pushContext2
(ContextToken token, String why) void
pushContextDown
(String why) void
refresh
(boolean doDelay) Refresh the display NOWvoid
private void
private void
restoreFunction
(JmolScriptFunction f, javajs.util.Lst<SV> params, SV tokenAtom) note that functions requiring motion cannot be run in JavaScriptvoid
restoreScriptContext
(ScriptContext context, boolean isPopContext, boolean isFlowCommand, boolean statementOnly) void
restrictSelected
(boolean isBond, boolean doInvert) void
resumeEval
(Object sco) From dispatchCommands and JmolThread resumeEval.void
private void
resumeViewer
(String why) void
runBufferedSafely
(String script, javajs.util.SB outputBuffer) private SV
runFunctionAndRet
(JmolScriptFunction function, String name, javajs.util.Lst<SV> params, SV tokenAtom, boolean getReturn, boolean setContextPath, boolean allowThreads) void
void
runScriptBuffer
(String script, javajs.util.SB outputBuffer, boolean isFuncReturn) runs a script immediately and sends selected output to a provided SBstatic SV
runUserAction
(String functionName, Object[] params, Viewer vwr) private ScriptContext
saveContext
(String saveName) void
setAllowJSThreads
(boolean b) protected void
setAtomProp
(String prop, Object value, javajs.util.BS bs) void
void
private boolean
setElementColor
(String str, int argb) void
setException
(ScriptException sx, String msg, String untranslated) private void
setFrameSet
(int i) boolean
setMeshDisplayProperty
(int shape, int i, int tok) void
setModelCagePts
(int iModel, javajs.util.T3[] originABC, String name) private void
setObjectArgb
(String str, int argb) void
setObjectMad10
(int iShape, String name, int mad10) private String
setObjectProp
(String id, int tokCommand, int ptColor) setObjectPropSafe
(String id, int tokCommand) called by Viewer in setting up a PyMOL scene.private int
setShapeNameParameter
(int i) void
setShapeProperty
(int shapeType, String propertyName, Object propertyValue) void
setShapePropertyBs
(int iShape, String propertyName, Object propertyValue, javajs.util.BS bs) private void
setShapeSize
(int shapeType, RadiusData rd) void
setShapeSizeBs
(int shapeType, int size, javajs.util.BS bs) void
setShapeTranslucency
(int shapeType, String prefix, String translucency, float translucentLevel, javajs.util.BS bs) private void
setSize
(int shape, float scale) private void
setSizeBio
(int iShape) int
setStatic
(int tok, int ival) set a static variable, with checking for rangeprivate boolean
void
showString
(String str) void
showStringPrint
(String s, boolean mustDo) static String
statementAsString
(Viewer vwr, T[] statement, int iTok, boolean doLogMessages) void
void
toString()
boolean
Methods inherited from class org.jmol.script.ScriptExpr
addFunction, atomExpression, atomExpressionAt, compareFloat, compareFloatData, getAssocArray, getAtomBits, getBitsetProperty, getCmdExt, getFunction, getIsoExt, getMathExt, getSeqCode, getSmilesExt, isFunction, listBS, noCopy, parameterExpressionBoolean, parameterExpressionList, parameterExpressionSelect, parameterExpressionString, parameterExpressionToken, setStatement, setVariable
Methods inherited from class org.jmol.script.ScriptParam
atomCenterOrCoordinateParameter, centerParameter, centerParameterForModel, checkHKL, checkLast, checkLength, checkLength23, checkLength34, checkLengthErrorPt, checkToken, floatParameter, floatParameterRange, floatParameterSet, getArgbParam, getArgbParamLast, getArgbParamOrNone, getAtomsStartingAt, getContextVariableAsVariable, getFractionalPoint, getHklPlane, getMadParameter, getParameter, getPoint3f, getPoint4f, getPointArray, getPointOrCenterVector, getPointOrPlane, getPointVector, getQuaternionParameter, getToken, getVarParameter, hklParameter, intParameter, intParameterRange, isArrayParameter, isCenterParameter, isColorParam, isFloatParameter, isPoint3f, listParameter, listParameter4, modelNumberParameter, objectNameParameter, optParameterAsString, paramAsStr, planeParameter, planeValue, setBooleanProperty, setFloatProperty, setIntProperty, setStringProperty, stringParameter, stringParameterSet, tickParamAsStr, tokAt, xypParameter, xyzpParameter
Methods inherited from class org.jmol.script.ScriptError
bad, error, errorMore, errorStr, errorStr2, errorString, evalError, getErrorLineMessage, getErrorMessage, getErrorMessageUntranslated, integerOutOfRange, invArg, numberOutOfRange, setCursorWait, setErrorMessage, warning
-
Field Details
-
saveList
- See Also:
-
iProcess
private static int iProcess -
sm
-
isJS
public boolean isJS -
scriptDelayThread
-
fileLoadThread
-
allowJSThreads
private boolean allowJSThreads -
isFuncReturn
private boolean isFuncReturn -
historyDisabled
public boolean historyDisabled -
debugScript
private boolean debugScript -
isCmdLine_C_Option
private boolean isCmdLine_C_Option -
isCmdLine_c_or_C_Option
private boolean isCmdLine_c_or_C_Option -
listCommands
private boolean listCommands -
tQuiet
public boolean tQuiet -
executionStopped
private boolean executionStopped -
executionPaused
private boolean executionPaused -
executionStepping
private boolean executionStepping -
executing
private boolean executing -
isEditor
private boolean isEditor -
timeBeginExecution
private long timeBeginExecution -
timeEndExecution
private long timeEndExecution -
mustResumeEval
private boolean mustResumeEval -
currentThread
-
compiler
-
outputBuffer
public javajs.util.SB outputBuffer -
contextPath
-
scriptFileName
-
functionName
-
isStateScript
public boolean isStateScript -
scriptLevel
public int scriptLevel -
CONTEXT_HOLD_QUEUE
- See Also:
-
CONTEXT_DELAY
- See Also:
-
DELAY_INTERRUPT_MS
private static final long DELAY_INTERRUPT_MS- See Also:
-
EXEC_ASYNC
private static final int EXEC_ASYNC- See Also:
-
EXEC_ERR
private static final int EXEC_ERR- See Also:
-
EXEC_OK
private static final int EXEC_OK- See Also:
-
commandHistoryLevelMax
public static int commandHistoryLevelMax -
contextDepthMax
private static int contextDepthMax -
scriptReportingLevel
private static int scriptReportingLevel -
aatoken
-
lineNumbers
private short[] lineNumbers -
lineIndices
private int[][] lineIndices -
script
-
scriptExtensions
-
pc
public int pc -
thisCommand
-
fullCommand
-
lineEnd
private int lineEnd -
pcEnd
private int pcEnd -
forceNoAddHydrogens
private boolean forceNoAddHydrogens -
isEmbedded
private boolean isEmbedded -
isGUI
private boolean isGUI -
parallelProcessor
-
pcResume
public int pcResume
-
-
Constructor Details
-
ScriptEval
public ScriptEval()
-
-
Method Details
-
getAllowJSThreads
public boolean getAllowJSThreads() -
setAllowJSThreads
public void setAllowJSThreads(boolean b) -
doReport
public boolean doReport() -
isStateScript
public boolean isStateScript() -
setStatic
public int setStatic(int tok, int ival) set a static variable, with checking for range -
getScript
-
setViewer
-
setCompiler
public void setCompiler() -
compileScriptString
-
compileScriptFile
-
evaluateCompiledScript
public void evaluateCompiledScript(boolean isCmdLine_c_or_C_Option, boolean isCmdLine_C_Option, boolean historyDisabled, boolean listCommands, javajs.util.SB outputBuffer, boolean allowThreads) -
useThreads
public boolean useThreads() -
executeCommands
private int executeCommands(boolean isTry, boolean reportCompletion) -
resumeEval
From dispatchCommands and JmolThread resumeEval. After throwing a ScriptInterruption, all statements following the current one are lost. When a JavaScript timeout returns from a DELAY, MOVE, MOVETO, or other sleep-requiring command, it is the ScriptContext that contains all have to worry about this, because the current thread is just put to sleep, not stopped, but in JavaScript, where we only have one thread, we need to manage this more carefully. We re-enter the halted script here, using a saved script context. The program counter is incremented to skip the initiating statement, and all parent contexts up the line are set with mustResumeEval = true.- Parameters:
sco
-
-
resumeViewer
-
runScript
- Throws:
ScriptException
-
runScriptBuffer
public void runScriptBuffer(String script, javajs.util.SB outputBuffer, boolean isFuncReturn) throws ScriptException runs a script immediately and sends selected output to a provided SB- Parameters:
outputBuffer
-script
-- Throws:
ScriptException
-
checkScriptSilent
a method for just checking a script- Parameters:
script
-- Returns:
- a ScriptContext that indicates errors and provides a tokenized version of the script that has passed all syntax checking, both in the compiler and the evaluator
-
getContextTrace
static javajs.util.SB getContextTrace(Viewer vwr, ScriptContext sc, javajs.util.SB sb, boolean isTop) -
setDebugging
public void setDebugging() -
haltExecution
public void haltExecution() -
pauseExecution
public void pauseExecution(boolean withDelay) -
stepPausedExecution
public void stepPausedExecution() -
resumePausedExecution
public void resumePausedExecution() -
isExecuting
public boolean isExecuting() -
isPaused
public boolean isPaused() -
isStepping
public boolean isStepping() -
isStopped
public boolean isStopped() -
getNextStatement
when paused, indicates what statement will be next- Returns:
- a string indicating the statement
-
getCommand
used for recall of commands in the application console- Parameters:
pc
-allThisLine
-addSemi
-- Returns:
- a string representation of the command
-
logDebugScript
-
evaluateExpression
a general-use method to evaluate a "SET" type expression.- Parameters:
asVariable
-expr
-- Returns:
- an object of one of the following types: Boolean, Integer, Float, String, Point3f, BitSet
-
runBufferedSafely
-
runUserAction
-
evaluate
-
checkSelect
Check a map for a WHERE phrase -
getAtomBitSet
A general method to evaluate a string representing an atom set. Excepts one atom expression or one per line as "OR". Excepts "()" as "none".- Parameters:
atomExpression
-- Returns:
- is a bitset indicating the selected atoms
-
compileScript
-
fixScriptPath
-
setScriptExtensions
private int setScriptExtensions() -
getScriptFileInternal
private String getScriptFileInternal(String filename, String localPath, String remotePath, String scriptPath) Retrieve the uncompiled script or null if failed- Parameters:
filename
-localPath
-remotePath
-scriptPath
-- Returns:
- Jmol script or null
-
evalFunctionFloat
-
getUserFunctionResult
public SV getUserFunctionResult(String name, javajs.util.Lst<SV> params, SV tokenAtom) throws ScriptException - Throws:
ScriptException
-
runFunctionAndRet
private SV runFunctionAndRet(JmolScriptFunction function, String name, javajs.util.Lst<SV> params, SV tokenAtom, boolean getReturn, boolean setContextPath, boolean allowThreads) throws ScriptException - Throws:
ScriptException
-
postProcessTry
-
breakAt
private void breakAt(int pt) -
restoreFunction
private void restoreFunction(JmolScriptFunction f, javajs.util.Lst<SV> params, SV tokenAtom) throws ScriptException note that functions requiring motion cannot be run in JavaScript- Parameters:
f
-params
-tokenAtom
-- Throws:
ScriptException
-
clearDefinedVariableAtomSets
public void clearDefinedVariableAtomSets() -
defineSets
private void defineSets()support for @xxx or define xxx commands -
defineAtomSet
-
lookupIdentifierValue
- Throws:
ScriptException
-
lookupValue
- Throws:
ScriptException
-
deleteAtomsInVariables
public void deleteAtomsInVariables(javajs.util.BS bsDeleted) -
getThisContext
-
clearState
private void clearState(boolean tQuiet) -
pushContextDown
-
pushContext
- Throws:
ScriptException
-
pushContext2
-
getScriptContext
-
popContext
void popContext(boolean isFlowCommand, boolean statementOnly) -
restoreScriptContext
public void restoreScriptContext(ScriptContext context, boolean isPopContext, boolean isFlowCommand, boolean statementOnly) -
setException
-
statementAsString
-
setObjectPropSafe
called by Viewer in setting up a PyMOL scene. -
setAtomProp
-
restrictSelected
public void restrictSelected(boolean isBond, boolean doInvert) -
showString
-
showStringPrint
- Specified by:
showStringPrint
in classScriptError
-
report
-
appendBuffer
-
addProcess
-
checkContinue
checks to see if there is a pause condition, during which commands can still be issued, but with the ! first.- Returns:
- false if there was a problem
- Throws:
ScriptException
-
delayScript
public void delayScript(int millis) -
doDelay
- Parameters:
millis
- negative here bypasses max check- Throws:
ScriptException
-
evalParallel
-
isCommandDisplayable
private boolean isCommandDisplayable(int i) provides support for the script editor- Parameters:
i
-- Returns:
- true if displayable (not a } )
-
loadFileResourceAsync
load a static file asynchronously- Throws:
ScriptException
-
loadFileAsync
public String loadFileAsync(String prefix, String filename, int i, boolean doClear) throws ScriptException Allows asynchronous file loading from the LOAD or SCRIPT command. Saves the context, initiates a FileLoadThread instance. When the file loading completes, the file data (sans filename) is saved in the FileManager cache under cache://localLoad_xxxxx. Context is resumed at this command in the script, and the file is then retrieved from the cache. Only run from JSmol/HTML5 when vwr.isJS; Incompatibilities: LOAD and SCRIPT commands, load() function only; only one "?" per LOAD command- Parameters:
prefix
-filename
- or null if end of LOAD command and now just clearing out cachei
-doClear
- ensures only one file is in the cache for a given type- Returns:
- cached file name if it exists
- Throws:
ScriptException
-
cancelFileThread
private void cancelFileThread() -
logLoadInfo
-
notifyResumeStatus
public void notifyResumeStatus() -
refresh
Refresh the display NOW- Parameters:
doDelay
-- Throws:
ScriptException
-
stopScriptThreads
public void stopScriptThreads() -
getErrorLineMessage2
-
getLinenumber
-
dispatchCommands
public boolean dispatchCommands(boolean isSpt, boolean fromFunc, boolean isTry) throws ScriptException - Parameters:
isSpt
-fromFunc
-isTry
-- Returns:
- false only when still working through resumeEval
- Throws:
ScriptException
-
commandLoop
- Throws:
ScriptException
-
notifyScriptEditor
private void notifyScriptEditor(int pc) -
processCommand
- Throws:
ScriptException
-
checkExtension
- Throws:
ScriptException
-
processShapeCommand
- Throws:
ScriptException
-
cmdAnimation
- Throws:
ScriptException
-
setFrameSet
- Throws:
ScriptException
-
cmdAxes
- Throws:
ScriptException
-
cmdBackground
- Throws:
ScriptException
-
cmdBind
- Throws:
ScriptException
-
cmdBondorder
- Throws:
ScriptException
-
cmdBoundbox
- Throws:
ScriptException
-
cmdCD
- Throws:
ScriptException
-
cmdCenter
- Throws:
ScriptException
-
cmdColor
- Throws:
ScriptException
-
cmdDefine
- Throws:
ScriptException
-
cmdDelay
- Throws:
ScriptException
-
cmdDelete
- Throws:
ScriptException
-
cmdDisplay
- Throws:
ScriptException
-
cmdDots
- Throws:
ScriptException
-
cmdEcho
- Throws:
ScriptException
-
cmdFile
- Throws:
ScriptException
-
cmdFixed
- Throws:
ScriptException
-
cmdFor
- Throws:
ScriptException
-
cmdFlow
private boolean cmdFlow(int tok, boolean isForCheck, javajs.util.Lst<T[]> vProcess) throws ScriptException - Throws:
ScriptException
-
cmdFlowSwitch
- Throws:
ScriptException
-
cmdFont
- Throws:
ScriptException
-
cmdFrank
- Throws:
ScriptException
-
cmdFunc
- Throws:
ScriptException
-
cmdGetProperty
- Throws:
ScriptException
-
cmdGoto
- Throws:
ScriptException
-
cmdHbond
- Throws:
ScriptException
-
cmdHelp
- Throws:
ScriptException
-
cmdHistory
- Throws:
ScriptException
-
cmdHover
- Throws:
ScriptException
-
cmdLabel
- Throws:
ScriptException
-
cmdLoad
- Throws:
ScriptException
-
checkFileExists
public String checkFileExists(String prefix, boolean isAsync, String filename, int i, boolean doClear) throws ScriptException - Throws:
ScriptException
-
addFilterAttribute
-
addLoadData
private int addLoadData(javajs.util.SB loadScript, String key, Map<String, Object> htParams, int i) throws ScriptException- Throws:
ScriptException
-
loadPNGJVar
private void loadPNGJVar(String varName, Object o, Map<String, Object> htParams) throws ScriptException- Throws:
ScriptException
-
getLoadFilesList
private String getLoadFilesList(int i, javajs.util.SB loadScript, javajs.util.SB sOptions, Map<String, Object> htParams, javajs.util.Lst<String> fNames) throws ScriptException- Throws:
ScriptException
-
isLoadOption
private boolean isLoadOption(int tok) -
getLoadModelIndex
private int getLoadModelIndex(int i, javajs.util.SB sOptions, Map<String, Object> htParams) throws ScriptException- Throws:
ScriptException
-
finalizeLoad
private void finalizeLoad(boolean isAppend, boolean appendNew, boolean isConcat, boolean doOrient, int nFiles, int ac0, int modelCount0, boolean isData) throws ScriptException - Throws:
ScriptException
-
cmdLog
- Throws:
ScriptException
-
cmdLoop
- Throws:
ScriptException
-
cmdMessage
- Throws:
ScriptException
-
cmdModel
ONE difference between FRAME and MODEL: model 1 sets model NAMED one in the case of PDB frame 1 always sets the first model- Parameters:
offset
- will be 2 for "anim frame ..."- Throws:
ScriptException
-
loadDssr
- Throws:
ScriptException
-
cmdMove
- Throws:
ScriptException
-
cmdMoveto
- Throws:
ScriptException
-
isAtomExpression
public boolean isAtomExpression(int i) -
cmdPause
- Throws:
ScriptException
-
cmdPrint
- Throws:
ScriptException
-
cmdPrompt
- Throws:
ScriptException
-
cmdReset
- Throws:
ScriptException
-
resetError
private void resetError() -
cmdRestrict
- Throws:
ScriptException
-
cmdReturn
- Throws:
ScriptException
-
cmdRotate
- Throws:
ScriptException
-
cmdRestore
- Throws:
ScriptException
-
cmdSave
- Throws:
ScriptException
-
cmdScript
- Throws:
ScriptException
-
isMenu
-
cmdSelect
- Parameters:
i
- 2 from RESTRICT BONDS, otherwise 1- Throws:
ScriptException
-
cmdSelectionHalos
- Throws:
ScriptException
-
cmdSet
- Throws:
ScriptException
-
cmdScale
- Throws:
ScriptException
-
cmdSetEcho
- Throws:
ScriptException
-
cmdSetLabel
- Throws:
ScriptException
-
cmdSetPicking
- Throws:
ScriptException
-
cmdSetPickingStyle
- Throws:
ScriptException
-
cmdSlab
- Throws:
ScriptException
-
cmdSsbond
- Throws:
ScriptException
-
cmdStructure
- Throws:
ScriptException
-
cmdSubset
- Throws:
ScriptException
-
cmdSync
- Throws:
ScriptException
-
cmdThrow
- Throws:
ScriptException
-
saveContext
-
cmdTimeout
- Throws:
ScriptException
-
cmdTranslate
- Throws:
ScriptException
-
cmdUnbind
- Throws:
ScriptException
-
cmdUndoRedo
- Throws:
ScriptException
-
setModelCagePts
-
cmdUnitcell
- Throws:
ScriptException
-
cmdVector
- Throws:
ScriptException
-
cmdVibration
- Throws:
ScriptException
-
cmdWireframe
- Throws:
ScriptException
-
cmdZap
- Throws:
ScriptException
-
cmdZoom
- Throws:
ScriptException
-
colorShape
- Throws:
ScriptException
-
getPartialCharges
- Throws:
ScriptException
-
encodeRadiusParameter
public RadiusData encodeRadiusParameter(int index, boolean isOnly, boolean allowAbsolute) throws ScriptException - Throws:
ScriptException
-
expandFloatArray
Accepts a float array and expands [1 -3] to [1 2 3], for example.- Parameters:
a
-min
-asBS
-- Returns:
- float[] or BS
- Throws:
ScriptException
-
frameControl
- Throws:
ScriptException
-
getColorRange
- Throws:
ScriptException
-
getFullPathName
- Throws:
ScriptException
-
getObjectBoundingBox
-
getObjectCenter
-
getPlaneForObject
-
getQuaternionArray
-
getSetAxesTypeMad10
- Throws:
ScriptException
-
getSettingFloat
- Throws:
ScriptException
-
getSettingInt
- Throws:
ScriptException
-
getSettingStr
Accept an unquoted string if there is just one parameter regardless of its type. In other words, these commands cannot accept a variable name by itself.- Parameters:
pt
-isJmolSet
-- Returns:
- string parameter
- Throws:
ScriptException
-
getShapeProperty
-
getShapePropertyData
-
getShapeType
- Throws:
ScriptException
-
getTranslucentLevel
- Throws:
ScriptException
-
getZoom
private float getZoom(int ptCenter, int i, javajs.util.BS bs, float currentZoom) throws ScriptException - Throws:
ScriptException
-
setElementColor
-
setMeshDisplayProperty
- Parameters:
shape
-i
-tok
-- Returns:
- true if successful
- Throws:
ScriptException
-
setObjectArgb
-
setObjectMad10
-
setObjectProp
- Throws:
ScriptException
-
setObjectProperty
- Throws:
ScriptException
-
setShapeNameParameter
- Throws:
ScriptException
-
setShapeProperty
-
setShapePropertyBs
-
setShapeSize
-
setShapeSizeBs
public void setShapeSizeBs(int shapeType, int size, javajs.util.BS bs) -
setShapeTranslucency
-
setSize
- Throws:
ScriptException
-
setSizeBio
- Throws:
ScriptException
-
setUnits
- Throws:
ScriptException
-
toString
-