From: <ha...@us...> - 2011-03-15 14:55:05
|
Revision: 15285 http://jmol.svn.sourceforge.net/jmol/?rev=15285&view=rev Author: hansonr Date: 2011-03-15 14:54:56 +0000 (Tue, 15 Mar 2011) Log Message: ----------- version=12.1.40_dev # new feature: frame title @someArray # -- for example: # x = getproperty("modelinfo.models.energy") # y = x.sub(x.min).mul(2625.5) # relative energies, in kJ # frame *;frame title @y # write butane.xyzvib # write simple multimodel xyz file Modified Paths: -------------- trunk/Jmol/src/org/jmol/modelset/ModelCollection.java trunk/Jmol/src/org/jmol/script/ScriptEvaluator.java trunk/Jmol/src/org/jmol/viewer/Jmol.properties trunk/Jmol/src/org/jmol/viewer/Viewer.java Modified: trunk/Jmol/src/org/jmol/modelset/ModelCollection.java =================================================================== --- trunk/Jmol/src/org/jmol/modelset/ModelCollection.java 2011-03-14 23:31:17 UTC (rev 15284) +++ trunk/Jmol/src/org/jmol/modelset/ModelCollection.java 2011-03-15 14:54:56 UTC (rev 15285) @@ -208,9 +208,16 @@ return (String) getModelAuxiliaryInfo(modelIndex, "fileName"); } - public void setFrameTitle(BitSet bsFrames, String title) { - for (int i = bsFrames.nextSetBit(0); i >= 0; i = bsFrames.nextSetBit(i + 1)) - frameTitles[i] = title; + public void setFrameTitle(BitSet bsFrames, Object title) { + if (title instanceof String[]) { + String[] list = (String[]) title; + for (int i = bsFrames.nextSetBit(0), n = 0; i >= 0; i = bsFrames.nextSetBit(i + 1)) + if (n < list.length) + frameTitles[i] = list[n++]; + } else { + for (int i = bsFrames.nextSetBit(0); i >= 0; i = bsFrames.nextSetBit(i + 1)) + frameTitles[i] = (String) title; + } } public String getFrameTitle(int modelIndex) { Modified: trunk/Jmol/src/org/jmol/script/ScriptEvaluator.java =================================================================== --- trunk/Jmol/src/org/jmol/script/ScriptEvaluator.java 2011-03-14 23:31:17 UTC (rev 15284) +++ trunk/Jmol/src/org/jmol/script/ScriptEvaluator.java 2011-03-15 14:54:56 UTC (rev 15285) @@ -11479,7 +11479,7 @@ if (checkLength23() > 0) if (!isSyntaxCheck) viewer.setFrameTitle(statementLength == 2 ? "@{_modelName}" - : parameterAsString(2)); + : (tokAt(2) == Token.varray ? ScriptVariable.listValue(statement[2]) : parameterAsString(2))); return; case Token.align: BitSet bs = (statementLength == 2 || tokAt(2) == Token.none ? null Modified: trunk/Jmol/src/org/jmol/viewer/Jmol.properties =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Jmol.properties 2011-03-14 23:31:17 UTC (rev 15284) +++ trunk/Jmol/src/org/jmol/viewer/Jmol.properties 2011-03-15 14:54:56 UTC (rev 15285) @@ -3,6 +3,13 @@ version=12.1.40_dev +# new feature: frame title @someArray +# -- for example: +# x = getproperty("modelinfo.models.energy") +# y = x.sub(x.min).mul(2625.5) # relative energies, in kJ +# frame *;frame title @y +# write butane.xyzvib # write simple multimodel xyz file + # bug fix: not reading MOPAC 6, 7, or 2009 files # -------------------------------------------------------------- Modified: trunk/Jmol/src/org/jmol/viewer/Viewer.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Viewer.java 2011-03-14 23:31:17 UTC (rev 15284) +++ trunk/Jmol/src/org/jmol/viewer/Viewer.java 2011-03-15 14:54:56 UTC (rev 15285) @@ -7767,7 +7767,7 @@ modelSet.setFrameTitle(BitSetUtil.setBit(modelIndex), title); } - public void setFrameTitle(String title) { + public void setFrameTitle(Object title) { loadShape(JmolConstants.SHAPE_ECHO); modelSet.setFrameTitle(getVisibleFramesBitSet(), title); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |