From: <ha...@us...> - 2008-04-19 14:52:50
|
Revision: 9285 http://jmol.svn.sourceforge.net/jmol/?rev=9285&view=rev Author: hansonr Date: 2008-04-19 07:52:47 -0700 (Sat, 19 Apr 2008) Log Message: ----------- version=11.4.2_dev # bug fix: (forwared compatibility) invalid state setting (due to later version) now ignored. Modified Paths: -------------- branches/v11_4/Jmol/src/org/jmol/viewer/Eval.java branches/v11_4/Jmol/src/org/jmol/viewer/Jmol.properties branches/v11_4/Jmol/src/org/jmol/viewer/Viewer.java Modified: branches/v11_4/Jmol/src/org/jmol/viewer/Eval.java =================================================================== --- branches/v11_4/Jmol/src/org/jmol/viewer/Eval.java 2008-04-19 14:52:38 UTC (rev 9284) +++ branches/v11_4/Jmol/src/org/jmol/viewer/Eval.java 2008-04-19 14:52:47 UTC (rev 9285) @@ -77,7 +77,8 @@ int iToken; StringBuffer outputBuffer; Hashtable contextVariables; - + boolean isStateScript; + Context() { // } @@ -94,6 +95,7 @@ private String functionName; private String script; private Hashtable contextVariables; + private boolean isStateScript; String getScript() { return script; @@ -329,6 +331,7 @@ context.iToken = iToken; context.outputBuffer = outputBuffer; context.contextVariables = contextVariables; + context.isStateScript = isStateScript; stack[scriptLevel++] = context; if (isScriptCheck) Logger.info("-->>-------------".substring(0, scriptLevel + 5) + filename); @@ -355,6 +358,8 @@ iToken = context.iToken; outputBuffer = context.outputBuffer; contextVariables = context.contextVariables; + isStateScript = context.isStateScript; + } private boolean loadScript(String filename, String script, @@ -372,6 +377,7 @@ lineNumbers = compiler.getLineNumbers(); lineIndices = compiler.getLineIndices(); contextVariables = compiler.getContextVariables(); + isStateScript = (script.indexOf(Viewer.STATE_VERSION_STAMP) >= 0); return true; } @@ -6803,7 +6809,9 @@ boolean isJmolParameter = viewer.isJmolVariable(key); if (isJmolSet && !isJmolParameter) { iToken = 1; - unrecognizedParameter("SET", key); + if (!isStateScript) + unrecognizedParameter("SET", key); + unrecognizedParameterWarning("SET", key); } switch (statementLength) { case 2: @@ -10482,6 +10490,10 @@ evalError(GT._("unrecognized {0} parameter", kind) + ": " + param); } + void unrecognizedParameterWarning(String kind, String param) { + showString(GT._("unrecognized {0} parameter in Jmol state script (set anyway)", kind) + ": " + param); + } + private void unrecognizedShowParameter(String use) throws ScriptException { evalError(GT._("unrecognized SHOW parameter -- use {0}", use)); } Modified: branches/v11_4/Jmol/src/org/jmol/viewer/Jmol.properties =================================================================== --- branches/v11_4/Jmol/src/org/jmol/viewer/Jmol.properties 2008-04-19 14:52:38 UTC (rev 9284) +++ branches/v11_4/Jmol/src/org/jmol/viewer/Jmol.properties 2008-04-19 14:52:47 UTC (rev 9285) @@ -1,6 +1,7 @@ version=11.4.2_dev # bug fix: state for draw arrow in multimodel context delivers wrong coordinates +# bug fix: (forwared compatibility) invalid state setting (due to later version) now ignored. # ----------------------------------------------------------------------------- Modified: branches/v11_4/Jmol/src/org/jmol/viewer/Viewer.java =================================================================== --- branches/v11_4/Jmol/src/org/jmol/viewer/Viewer.java 2008-04-19 14:52:38 UTC (rev 9284) +++ branches/v11_4/Jmol/src/org/jmol/viewer/Viewer.java 2008-04-19 14:52:47 UTC (rev 9285) @@ -2315,13 +2315,14 @@ return getStateInfo(null); } + final static String STATE_VERSION_STAMP = "# Jmol state version "; public String getStateInfo(String type) { boolean isAll = (type == null || type.equalsIgnoreCase("all")); StringBuffer s = new StringBuffer(""); StringBuffer sfunc = (isAll ? new StringBuffer("function _setState();\n") : null); if (isAll) - s.append("# Jmol state version " + getJmolVersion() + ";\n"); + s.append(STATE_VERSION_STAMP + getJmolVersion() + ";\n"); if (isApplet && isAll) { StateManager.appendCmd(s, "# fullName = " + Escape.escape(fullName)); StateManager.appendCmd(s, "# documentBase = " This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |