public class ScriptExt extends Object implements JmolScriptExtension
Modifier and Type | Field and Description |
---|---|
private boolean |
chk |
private Object[] |
data |
(package private) static int |
ERROR_invalidArgument |
private ScriptEvaluator |
eval |
private String |
fullCommand |
private JmolPatternMatcher |
pm |
private int |
slen |
private ShapeManager |
sm |
private T[] |
st |
private String |
thisCommand |
private Viewer |
viewer |
Constructor and Description |
---|
ScriptExt() |
Modifier and Type | Method and Description |
---|---|
private void |
addShapeProperty(javajs.util.List<Object[]> propertyList,
String key,
Object value) |
private BS |
atomExpressionAt(int i) |
private void |
calculate() |
private void |
capture() |
private javajs.util.P3 |
centerParameter(int i) |
private boolean |
cgo() |
private void |
checkLength(int i) |
private void |
compare() |
private void |
configuration() |
private boolean |
contact() |
private Object[] |
createFunction(String fname,
String xyz,
String ret)
for the ISOSURFACE command
|
void |
data() |
private boolean |
dipole() |
boolean |
dispatch(int iTok,
boolean b,
T[] st) |
private boolean |
draw() |
private void |
error(int err) |
boolean |
evaluate(ScriptMathProcessor mp,
T op,
SV[] args,
int tok) |
private boolean |
evaluateArray(ScriptMathProcessor mp,
SV[] args,
boolean allowMatrix) |
private boolean |
evaluateBin(ScriptMathProcessor mp,
SV[] args) |
private boolean |
evaluateCache(ScriptMathProcessor mp,
SV[] args) |
private boolean |
evaluateColor(ScriptMathProcessor mp,
SV[] args) |
private boolean |
evaluateCompare(ScriptMathProcessor mp,
SV[] args) |
private boolean |
evaluateConnected(ScriptMathProcessor mp,
SV[] args) |
private boolean |
evaluateContact(ScriptMathProcessor mp,
SV[] args) |
private boolean |
evaluateCross(ScriptMathProcessor mp,
SV[] args) |
private boolean |
evaluateData(ScriptMathProcessor mp,
SV[] args) |
private boolean |
evaluateDot(ScriptMathProcessor mp,
SV[] args,
int tok,
int intValue) |
private boolean |
evaluateFind(ScriptMathProcessor mp,
SV[] args) |
private boolean |
evaluateGetProperty(ScriptMathProcessor mp,
SV[] args,
boolean isAtomProperty) |
private boolean |
evaluateHelix(ScriptMathProcessor mp,
SV[] args) |
private boolean |
evaluateLabel(ScriptMathProcessor mp,
int intValue,
SV[] args) |
private boolean |
evaluateList(ScriptMathProcessor mp,
int tok,
SV[] args)
array.add(x)
array.add(sep, x)
array.sub(x)
array.mul(x)
array.mul3(x)
array.div(x)
array.push()
array.pop()
|
private boolean |
evaluateLoad(ScriptMathProcessor mp,
SV[] args,
int tok) |
private boolean |
evaluateMath(ScriptMathProcessor mp,
SV[] args,
int tok) |
private boolean |
evaluateMeasure(ScriptMathProcessor mp,
SV[] args,
int tok) |
private boolean |
evaluateModulation(ScriptMathProcessor mp,
SV[] args) |
boolean |
evaluateParallel(ScriptContext context,
ShapeManager shapeManager)
used for TRY command
|
private boolean |
evaluatePlane(ScriptMathProcessor mp,
SV[] args,
int tok) |
private boolean |
evaluatePoint(ScriptMathProcessor mp,
SV[] args) |
private boolean |
evaluatePrompt(ScriptMathProcessor mp,
SV[] args) |
private boolean |
evaluateQuaternion(ScriptMathProcessor mp,
SV[] args,
int tok) |
private boolean |
evaluateRandom(ScriptMathProcessor mp,
SV[] args) |
private boolean |
evaluateReplace(ScriptMathProcessor mp,
SV[] args) |
private boolean |
evaluateRowCol(ScriptMathProcessor mp,
SV[] args,
int tok) |
private boolean |
evaluateScript(ScriptMathProcessor mp,
SV[] args,
int tok) |
private boolean |
evaluateSort(ScriptMathProcessor mp,
SV[] args,
int tok) |
private boolean |
evaluateString(ScriptMathProcessor mp,
int tok,
SV[] args) |
private boolean |
evaluateSubstructure(ScriptMathProcessor mp,
SV[] args,
int tok) |
private boolean |
evaluateSymop(ScriptMathProcessor mp,
SV[] args,
boolean haveBitSet) |
private boolean |
evaluateTensor(ScriptMathProcessor mp,
SV[] args) |
private boolean |
evaluateUserFunction(ScriptMathProcessor mp,
String name,
SV[] args,
int tok,
boolean isSelector) |
private boolean |
evaluateWithin(ScriptMathProcessor mp,
SV[] args) |
private boolean |
evaluateWrite(ScriptMathProcessor mp,
SV[] args) |
private float[][] |
floatArraySet(int i,
int nX,
int nY) |
private float[][][] |
floatArraySetXYZ(int i,
int nX,
int nY,
int nZ) |
private float |
floatParameter(int i) |
private float[] |
getAtomicPotentials(BS bsSelected,
BS bsIgnore,
String fileName) |
private BS |
getAtomsNearSurface(float distance,
String surfaceId) |
Object |
getBitsetIdent(BS bs,
String label,
Object tokenValue,
boolean useAtomMap,
int index,
boolean isExplicitlyAll) |
private Object |
getCapSlabObject(int i,
boolean isLcaoCartoon) |
private String |
getContext(boolean withVariables) |
private float |
getDistance(ScriptMathProcessor mp,
SV x1,
SV x2,
int tok) |
private float[] |
getFlexFitList(BS bs1,
BS bs2,
String smiles1,
boolean isSmarts) |
private String |
getIsosurfaceJvxl(boolean asMesh,
int iShape) |
Object |
getMinMax(Object floatOrSVArray,
int tok) |
private Object |
getMinMaxPoint(Object pointOrSVArray,
int tok)
calculates the statistical value for x, y, and z independently
|
private Object |
getMinMaxQuaternion(javajs.util.List<SV> svData,
int tok) |
private String |
getMoJvxl(int ptMO) |
private String |
getParameterEscaped(String var) |
private JmolPatternMatcher |
getPatternMatcher() |
private float |
getPlotMinMax(float[] data,
boolean isMax,
int tok) |
private javajs.util.P3 |
getPoint3f(int i,
boolean allowFractional) |
private javajs.util.P4 |
getPoint4f(int i) |
private Quaternion[] |
getQuaternionArray(Object quaternionOrSVData,
int itype) |
private String |
getScriptID(ScriptContext context) |
private Object |
getShapeProperty(int shapeType,
String propertyName) |
private Object |
getShapePropertyIndex(int shapeType,
String propertyName,
int index) |
private float |
getSmilesCorrelation(BS bsA,
BS bsB,
String smiles,
javajs.util.List<javajs.util.P3> ptsA,
javajs.util.List<javajs.util.P3> ptsB,
javajs.util.M4 m4,
javajs.util.List<BS> vReturn,
boolean isSmarts,
boolean asMap,
int[][] mapSet,
javajs.util.P3 center) |
Object |
getSmilesMatches(String pattern,
String smiles,
BS bsSelected,
BS bsMatch3D,
boolean isSmarts,
boolean asOneBitset) |
private T |
getToken(int i) |
private static void |
getTorsions(Atom[] atoms,
int[][] bondMap,
float[][] diff,
int pt) |
private void |
getWithinDistanceVector(javajs.util.List<Object[]> propertyList,
float distance,
javajs.util.P3 ptc,
BS bs,
boolean isShow) |
JmolScriptExtension |
init(Object se) |
private String |
initIsosurface(int iShape) |
private int |
intParameter(int index) |
private void |
invArg() |
private void |
invPO() |
private boolean |
isFloatParameter(int index) |
private boolean |
isosurface(int iShape) |
private boolean |
lcaoCartoon() |
private boolean |
listIsosurface(int iShape) |
private void |
mapProperty() |
private void |
measure() |
private void |
minimize() |
private boolean |
mo(boolean isInitOnly) |
private float[] |
moCombo(javajs.util.List<Object[]> propertyList) |
private void |
modulation()
Allows for setting one or more specific t-values
as well as full unit-cell shifts (multiples of q).
|
private int |
moOffset(int index) |
void |
navigate() |
private MeasurementData |
newMeasurementData(String id,
javajs.util.List<Object> points) |
private T |
opTokenFor(int tok) |
private String |
parameterAsString(int i) |
String |
plot(T[] args) |
private void |
pointGroup() |
private boolean |
polyhedra() |
private String |
setColorOptions(javajs.util.SB sb,
int index,
int iShape,
int nAllowed) |
private BS |
setContactBitSets(BS bsA,
BS bsB,
boolean localOnly,
float distance,
RadiusData rd,
boolean warnMultiModel) |
private void |
setMoData(javajs.util.List<Object[]> propertyList,
int moNumber,
float[] lc,
int offset,
boolean isNegOffset,
int modelIndex,
String title) |
private String |
setShapeId(int iShape,
int i,
boolean idSeen) |
private void |
setShapeProperty(int shapeType,
String propertyName,
Object propertyValue) |
private void |
show() |
private void |
showString(String s) |
private String |
stringParameter(int index) |
private boolean |
struts() |
private int |
tokAt(int i) |
private static int |
tokAtArray(int i,
T[] args) |
private T |
tokenAt(int i,
T[] args) |
String |
write(T[] args) |
private Viewer viewer
private ScriptEvaluator eval
private ShapeManager sm
private boolean chk
private String fullCommand
private String thisCommand
private T[] st
private int slen
static final int ERROR_invalidArgument
private Object[] data
private JmolPatternMatcher pm
public JmolScriptExtension init(Object se)
init
in interface JmolScriptExtension
public boolean dispatch(int iTok, boolean b, T[] st) throws ScriptException
dispatch
in interface JmolScriptExtension
ScriptException
private BS atomExpressionAt(int i) throws ScriptException
ScriptException
private void error(int err) throws ScriptException
ScriptException
private void invArg() throws ScriptException
ScriptException
private void invPO() throws ScriptException
ScriptException
private String parameterAsString(int i) throws ScriptException
ScriptException
private javajs.util.P3 centerParameter(int i) throws ScriptException
ScriptException
private float floatParameter(int i) throws ScriptException
ScriptException
private javajs.util.P3 getPoint3f(int i, boolean allowFractional) throws ScriptException
ScriptException
private javajs.util.P4 getPoint4f(int i) throws ScriptException
ScriptException
private int intParameter(int index) throws ScriptException
ScriptException
private boolean isFloatParameter(int index)
private String setShapeId(int iShape, int i, boolean idSeen) throws ScriptException
ScriptException
private void setShapeProperty(int shapeType, String propertyName, Object propertyValue)
private String stringParameter(int index) throws ScriptException
ScriptException
private T getToken(int i) throws ScriptException
ScriptException
private int tokAt(int i)
private boolean cgo() throws ScriptException
ScriptException
private boolean contact() throws ScriptException
ScriptException
private boolean dipole() throws ScriptException
ScriptException
private boolean draw() throws ScriptException
ScriptException
private boolean isosurface(int iShape) throws ScriptException
ScriptException
private float[] getAtomicPotentials(BS bsSelected, BS bsIgnore, String fileName)
bsSelected
- bsIgnore
- fileName
- private boolean lcaoCartoon() throws ScriptException
ScriptException
private Object getCapSlabObject(int i, boolean isLcaoCartoon) throws ScriptException
ScriptException
private boolean mo(boolean isInitOnly) throws ScriptException
ScriptException
private float[] moCombo(javajs.util.List<Object[]> propertyList)
private int moOffset(int index) throws ScriptException
ScriptException
private void setMoData(javajs.util.List<Object[]> propertyList, int moNumber, float[] lc, int offset, boolean isNegOffset, int modelIndex, String title) throws ScriptException
ScriptException
public String plot(T[] args) throws ScriptException
plot
in interface JmolScriptExtension
ScriptException
private float getPlotMinMax(float[] data, boolean isMax, int tok)
private boolean polyhedra() throws ScriptException
ScriptException
private boolean struts() throws ScriptException
ScriptException
private String initIsosurface(int iShape) throws ScriptException
ScriptException
private void getWithinDistanceVector(javajs.util.List<Object[]> propertyList, float distance, javajs.util.P3 ptc, BS bs, boolean isShow)
private String setColorOptions(javajs.util.SB sb, int index, int iShape, int nAllowed) throws ScriptException
ScriptException
private void addShapeProperty(javajs.util.List<Object[]> propertyList, String key, Object value)
private Object[] createFunction(String fname, String xyz, String ret)
fname
- xyz
- ret
- private float[][] floatArraySet(int i, int nX, int nY) throws ScriptException
ScriptException
private float[][][] floatArraySetXYZ(int i, int nX, int nY, int nZ) throws ScriptException
ScriptException
private boolean listIsosurface(int iShape) throws ScriptException
ScriptException
public Object getBitsetIdent(BS bs, String label, Object tokenValue, boolean useAtomMap, int index, boolean isExplicitlyAll)
getBitsetIdent
in interface JmolScriptExtension
public void data() throws ScriptException
ScriptException
public void navigate() throws ScriptException
ScriptException
public boolean evaluateParallel(ScriptContext context, ShapeManager shapeManager)
evaluateParallel
in interface JmolScriptExtension
context
- shapeManager
- public String write(T[] args) throws ScriptException
write
in interface JmolScriptExtension
ScriptException
private void show() throws ScriptException
ScriptException
private void showString(String s)
private void checkLength(int i) throws ScriptException
ScriptException
private String getIsosurfaceJvxl(boolean asMesh, int iShape)
private String getMoJvxl(int ptMO) throws ScriptException
ScriptException
private String getContext(boolean withVariables)
private String getScriptID(ScriptContext context)
private Object getShapePropertyIndex(int shapeType, String propertyName, int index)
private static int tokAtArray(int i, T[] args)
private void calculate() throws ScriptException
ScriptException
private void pointGroup() throws ScriptException
ScriptException
private void mapProperty() throws ScriptException
ScriptException
private void minimize() throws ScriptException
ScriptException
private void modulation() throws ScriptException
ScriptException
private BS setContactBitSets(BS bsA, BS bsB, boolean localOnly, float distance, RadiusData rd, boolean warnMultiModel)
private void compare() throws ScriptException
ScriptException
private void configuration() throws ScriptException
ScriptException
private void measure() throws ScriptException
ScriptException
private float[] getFlexFitList(BS bs1, BS bs2, String smiles1, boolean isSmarts) throws ScriptException
ScriptException
private static void getTorsions(Atom[] atoms, int[][] bondMap, float[][] diff, int pt)
private float getSmilesCorrelation(BS bsA, BS bsB, String smiles, javajs.util.List<javajs.util.P3> ptsA, javajs.util.List<javajs.util.P3> ptsB, javajs.util.M4 m4, javajs.util.List<BS> vReturn, boolean isSmarts, boolean asMap, int[][] mapSet, javajs.util.P3 center) throws ScriptException
ScriptException
public Object getSmilesMatches(String pattern, String smiles, BS bsSelected, BS bsMatch3D, boolean isSmarts, boolean asOneBitset) throws ScriptException
getSmilesMatches
in interface JmolScriptExtension
ScriptException
public boolean evaluate(ScriptMathProcessor mp, T op, SV[] args, int tok) throws ScriptException
evaluate
in interface JmolScriptExtension
ScriptException
private boolean evaluateModulation(ScriptMathProcessor mp, SV[] args) throws ScriptException
ScriptException
private boolean evaluateTensor(ScriptMathProcessor mp, SV[] args) throws ScriptException
ScriptException
private boolean evaluateCache(ScriptMathProcessor mp, SV[] args)
private boolean evaluateCompare(ScriptMathProcessor mp, SV[] args) throws ScriptException
ScriptException
private boolean evaluateContact(ScriptMathProcessor mp, SV[] args)
private boolean evaluateSort(ScriptMathProcessor mp, SV[] args, int tok) throws ScriptException
ScriptException
private boolean evaluateSymop(ScriptMathProcessor mp, SV[] args, boolean haveBitSet) throws ScriptException
ScriptException
private boolean evaluateBin(ScriptMathProcessor mp, SV[] args) throws ScriptException
ScriptException
private boolean evaluateHelix(ScriptMathProcessor mp, SV[] args) throws ScriptException
ScriptException
private boolean evaluateDot(ScriptMathProcessor mp, SV[] args, int tok, int intValue) throws ScriptException
ScriptException
private float getDistance(ScriptMathProcessor mp, SV x1, SV x2, int tok) throws ScriptException
ScriptException
private boolean evaluateMeasure(ScriptMathProcessor mp, SV[] args, int tok) throws ScriptException
ScriptException
private MeasurementData newMeasurementData(String id, javajs.util.List<Object> points)
private boolean evaluateUserFunction(ScriptMathProcessor mp, String name, SV[] args, int tok, boolean isSelector) throws ScriptException
ScriptException
private boolean evaluateFind(ScriptMathProcessor mp, SV[] args) throws ScriptException
ScriptException
private JmolPatternMatcher getPatternMatcher()
private boolean evaluateGetProperty(ScriptMathProcessor mp, SV[] args, boolean isAtomProperty) throws ScriptException
ScriptException
private boolean evaluatePlane(ScriptMathProcessor mp, SV[] args, int tok) throws ScriptException
ScriptException
private boolean evaluatePoint(ScriptMathProcessor mp, SV[] args)
private boolean evaluatePrompt(ScriptMathProcessor mp, SV[] args)
private boolean evaluateReplace(ScriptMathProcessor mp, SV[] args) throws ScriptException
ScriptException
private boolean evaluateString(ScriptMathProcessor mp, int tok, SV[] args) throws ScriptException
ScriptException
private boolean evaluateList(ScriptMathProcessor mp, int tok, SV[] args) throws ScriptException
mp
- tok
- args
- ScriptException
private T opTokenFor(int tok)
private boolean evaluateRowCol(ScriptMathProcessor mp, SV[] args, int tok) throws ScriptException
ScriptException
private boolean evaluateArray(ScriptMathProcessor mp, SV[] args, boolean allowMatrix)
private boolean evaluateMath(ScriptMathProcessor mp, SV[] args, int tok)
private boolean evaluateQuaternion(ScriptMathProcessor mp, SV[] args, int tok) throws ScriptException
ScriptException
private boolean evaluateRandom(ScriptMathProcessor mp, SV[] args)
private boolean evaluateCross(ScriptMathProcessor mp, SV[] args)
private boolean evaluateLoad(ScriptMathProcessor mp, SV[] args, int tok) throws ScriptException
ScriptException
private boolean evaluateWrite(ScriptMathProcessor mp, SV[] args) throws ScriptException
ScriptException
private boolean evaluateScript(ScriptMathProcessor mp, SV[] args, int tok) throws ScriptException
ScriptException
private boolean evaluateData(ScriptMathProcessor mp, SV[] args)
private boolean evaluateLabel(ScriptMathProcessor mp, int intValue, SV[] args) throws ScriptException
ScriptException
private boolean evaluateWithin(ScriptMathProcessor mp, SV[] args) throws ScriptException
ScriptException
private boolean evaluateColor(ScriptMathProcessor mp, SV[] args)
private boolean evaluateConnected(ScriptMathProcessor mp, SV[] args)
private boolean evaluateSubstructure(ScriptMathProcessor mp, SV[] args, int tok) throws ScriptException
ScriptException
private Object getMinMaxPoint(Object pointOrSVArray, int tok)
pointOrSVArray
- tok
- private Quaternion[] getQuaternionArray(Object quaternionOrSVData, int itype)
public Object getMinMax(Object floatOrSVArray, int tok)
getMinMax
in interface JmolScriptExtension
private void capture() throws ScriptException
ScriptException