return "";
int modelCount = viewer.getModelCount();
viewer.setJmolDataFrame(stateScript, modelIndex, modelCount - 1);
if (plotType != JmolConstants.JMOL_DATA_OTHER)
stateScript += ";\n" + preSelected;
StateScript ss = viewer.addStateScript(stateScript, true, false);
// get post-processing script
String script;
switch (plotType) {
case -1:
viewer.setFrameTitle(modelCount - 1, type + " plot for model "
+ viewer.getModelNumberDotted(modelIndex));
float f = 3;
script = "frame 0.0; frame last; reset;" + "select visible; spacefill "
+ f + "; wireframe 0;" + "draw plotAxisX" + modelCount
+ " {100 -100 -100} {-100 -100 -100} \"" + Token.nameOf(propertyX)
+ "\";" + "draw plotAxisY" + modelCount
+ " {-100 100 -100} {-100 -100 -100} \"" + Token.nameOf(propertyY)
+ "\";";
if (propertyZ != 0)
script += "draw plotAxisZ" + modelCount
+ " {-100 -100 100} {-100 -100 -100} \"" + Token.nameOf(propertyZ)
+ "\";";
break;
case JmolConstants.JMOL_DATA_RAMACHANDRAN:
default:
viewer.setFrameTitle(modelCount - 1, "ramachandran plot for model "
+ viewer.getModelNumberDotted(modelIndex));
script = "frame 0.0; frame last; reset;"
+ "select visible; color structure; spacefill 3.0; wireframe 0;"
+ "draw ramaAxisX" + modelCount + " {100 0 0} {-100 0 0} \"phi\";"
+ "draw ramaAxisY" + modelCount + " {0 100 0} {0 -100 0} \"psi\";";
break;
case JmolConstants.JMOL_DATA_QUATERNION:
viewer.setFrameTitle(modelCount - 1, type.replace('w', ' ') + qFrame
+ " for model " + viewer.getModelNumberDotted(modelIndex));
String color = (Graphics3D
.getHexCode(viewer.getColixBackgroundContrast()));
script = "frame 0.0; frame last; reset;"
+ "select visible; wireframe 0; spacefill 3.0; "
+ "isosurface quatSphere" + modelCount + " color " + color
+ " sphere 100.0 mesh nofill frontonly translucent 0.8;"
+ "draw quatAxis" + modelCount
+ "X {100 0 0} {-100 0 0} color red \"x\";" + "draw quatAxis"
+ modelCount + "Y {0 100 0} {0 -100 0} color green \"y\";"
+ "draw quatAxis" + modelCount
+ "Z {0 0 100} {0 0 -100} color blue \"z\";" + "color structure;"
+ "draw quatCenter" + modelCount + "{0 0 0} scale 0.02;";
break;
}
// run the post-processing script and set rotation radius and display frame title
runScript(script + preSelected);
ss.setModelIndex(viewer.getCurrentModelIndex());
viewer.setRotationRadius(150f, true);
loadShape(JmolConstants.SHAPE_ECHO);
showString("frame " + viewer.getModelNumberDotted(modelCount - 1)
+ " created: " + type + (isQuaternion ? qFrame : ""));
return "";