From: <ha...@us...> - 2006-07-31 04:17:57
|
Revision: 5360 Author: hansonr Date: 2006-07-30 21:17:49 -0700 (Sun, 30 Jul 2006) ViewCVS: http://svn.sourceforge.net/jmol/?rev=5360&view=rev Log Message: ----------- bob200603 10.x.35 mo fix Modified Paths: -------------- branches/bob200603/Jmol/src/org/jmol/viewer/Eval.java branches/bob200603/Jmol/src/org/jmol/viewer/MolecularOrbital.java Modified: branches/bob200603/Jmol/src/org/jmol/viewer/Eval.java =================================================================== --- branches/bob200603/Jmol/src/org/jmol/viewer/Eval.java 2006-07-30 20:03:44 UTC (rev 5359) +++ branches/bob200603/Jmol/src/org/jmol/viewer/Eval.java 2006-07-31 04:17:49 UTC (rev 5360) @@ -4164,7 +4164,7 @@ } } - int lastMoIndex = 0; + int lastMoNumber = 0; void mo() throws ScriptException { viewer.loadShape(JmolConstants.SHAPE_MO); @@ -4172,13 +4172,13 @@ Integer index = null; try { index = (Integer) viewer.getShapeProperty(JmolConstants.SHAPE_MO, - "moIndex"); + "moNumber"); } catch (Exception e) { // could just be the string "no current mesh" } - int moIndex = (index == null ? Integer.MAX_VALUE : index.intValue()); - if (moIndex == Integer.MAX_VALUE) - lastMoIndex = 0; + int moNumber = (index == null ? Integer.MAX_VALUE : index.intValue()); + if (moNumber == Integer.MAX_VALUE) + lastMoNumber = 0; String str; if (statementLength == 1) endOfStatementUnexpected(); @@ -4188,13 +4188,13 @@ Object propertyValue = null; switch (tok) { case Token.integer: - moIndex = intParameter(1); + moNumber = intParameter(1); break; case Token.next: - moIndex = lastMoIndex + 1; + moNumber = lastMoNumber + 1; break; case Token.prev: - moIndex = lastMoIndex - 1; + moNumber = lastMoNumber - 1; break; case Token.color: //mo color color1 color2 @@ -4254,11 +4254,11 @@ if (propertyName != null) viewer.setShapeProperty(JmolConstants.SHAPE_MO, propertyName, propertyValue); - if (moIndex != Integer.MAX_VALUE) - setMoData(JmolConstants.SHAPE_MO, moIndex); + if (moNumber != Integer.MAX_VALUE) + setMoData(JmolConstants.SHAPE_MO, moNumber); } - void setMoData(int shape, int moIndex) throws ScriptException { + void setMoData(int shape, int moNumber) throws ScriptException { int modelIndex = viewer.getDisplayModelIndex(); if (modelIndex < 0) evalError("MO isosurfaces require that only one model be displayed"); @@ -4270,13 +4270,13 @@ int nOrb = (mos == null ? 0 : mos.size()); if (nOrb == 0) evalError("no MO coefficient data available"); - if (nOrb == 1 && moIndex > 1) + if (nOrb == 1 && moNumber > 1) evalError("Only one molecular orbital is available in this file"); - if (moIndex < 1 || moIndex > nOrb) + if (moNumber < 1 || moNumber > nOrb) evalError("An MO index from 1 to " + nOrb + " is required"); - lastMoIndex = moIndex; + lastMoNumber = moNumber; viewer.setShapeProperty(shape, "moData", moData); - viewer.setShapeProperty(shape, "molecularOrbital", new Integer(moIndex)); + viewer.setShapeProperty(shape, "molecularOrbital", new Integer(moNumber)); } void isosurface() throws ScriptException { @@ -4561,8 +4561,8 @@ //mo 1-based-index if (++i == statement.length) badArgumentCount(); - int moIndex = intParameter(i); - setMoData(JmolConstants.SHAPE_ISOSURFACE, moIndex); + int moNumber = intParameter(i); + setMoData(JmolConstants.SHAPE_ISOSURFACE, moNumber); surfaceObjectSeen = true; continue; case Token.sasurface: Modified: branches/bob200603/Jmol/src/org/jmol/viewer/MolecularOrbital.java =================================================================== --- branches/bob200603/Jmol/src/org/jmol/viewer/MolecularOrbital.java 2006-07-30 20:03:44 UTC (rev 5359) +++ branches/bob200603/Jmol/src/org/jmol/viewer/MolecularOrbital.java 2006-07-31 04:17:49 UTC (rev 5360) @@ -106,7 +106,7 @@ return; } - if ("moNumber" == propertyName) { + if ("molecularOrbital" == propertyName) { moNumber = (Integer) value; setOrbital(); return; @@ -145,6 +145,9 @@ } return "" + str; } + if (propertyName == "moNumber") { + return moNumber; + } return null; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |