From: <ha...@us...> - 2007-02-08 03:40:17
|
Revision: 6713 http://svn.sourceforge.net/jmol/?rev=6713&view=rev Author: hansonr Date: 2007-02-07 19:40:15 -0800 (Wed, 07 Feb 2007) Log Message: ----------- frame refinement Modified Paths: -------------- trunk/Jmol/src/org/jmol/viewer/Compiler.java trunk/Jmol/src/org/jmol/viewer/Eval.java trunk/Jmol/src/org/jmol/viewer/JmolConstants.java trunk/Jmol/src/org/jmol/viewer/MouseManager.java trunk/Jmol/src/org/jmol/viewer/Mps.java trunk/Jmol/src/org/jmol/viewer/StateManager.java Modified: trunk/Jmol/src/org/jmol/viewer/Compiler.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Compiler.java 2007-02-07 17:46:07 UTC (rev 6712) +++ trunk/Jmol/src/org/jmol/viewer/Compiler.java 2007-02-08 03:40:15 UTC (rev 6713) @@ -796,7 +796,7 @@ //compile expressions - isSetExpression = (tokCommand == Token.set && size > 3 && atokenCommand[2].tok == Token.leftbrace); + isSetExpression = false;//(tokCommand == Token.set && size > 3 && atokenCommand[2].tok == Token.leftbrace); isNumericExpression = (tokCommand == Token.ifcmd || isSetExpression); boolean checkExpression = (isNumericExpression || tokAttrOr(tokCommand, Token.expressionCommand, Token.embeddedExpression)); Modified: trunk/Jmol/src/org/jmol/viewer/Eval.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Eval.java 2007-02-07 17:46:07 UTC (rev 6712) +++ trunk/Jmol/src/org/jmol/viewer/Eval.java 2007-02-08 03:40:15 UTC (rev 6713) @@ -1046,6 +1046,8 @@ Token[] tempStatement; BitSet expression(int index) throws ScriptException { + if (!checkToken(index)) + badArgumentCount(); return expression(statement, index, true); } @@ -4609,25 +4611,21 @@ boolean isPlay = false; boolean isRange = false; boolean isAll = false; - int[] frameList = new int[2]; + int[] frameList = new int[] { -1, -1 }; int nFrames = 0; for (int i = offset; i < statementLength; i++) { switch (getToken(i).tok) { case Token.all: case Token.asterisk: - checkStatementLength(offset + 1); + checkStatementLength(offset + (isRange ? 2 : 1)); isAll = true; break; case Token.none: checkStatementLength(offset + 1); break; - case Token.opOr: - if (nFrames == 0 || (statement[i - 1].tok != Token.integer && statement[i -1].tok != Token.decimal)) - invalidArgument(); - break; case Token.decimal: useModelNumber = false; - //fall through + //fall through case Token.integer: if (nFrames == 2) invalidArgument(); @@ -4645,23 +4643,24 @@ return; } } - if ((isPlay || isRange) && nFrames > 2 || isRange && nFrames < 2) - invalidArgument(); boolean haveFileSet = (viewer.getModelNumber(0) > 1000); if ((isPlay || isRange) && haveFileSet && useModelNumber) invalidArgument(); if (isSyntaxCheck) return; if (isAll) { + viewer.setAnimationOn(false); viewer.setAnimationRange(-1, -1); - viewer.setCurrentModelIndex(-1); + if (!isRange) + viewer.setCurrentModelIndex(-1); return; } if (haveFileSet) useModelNumber = false; else for (int i = 0; i < nFrames; i++) - frameList[i] %= 1000; + if (frameList[i] >= 0) + frameList[i] %= 1000; int modelIndex = viewer.getModelNumberIndex(frameList[0], useModelNumber); int modelIndex2 = -1; if (!isPlay && !isRange || modelIndex >= 0) { @@ -4669,9 +4668,10 @@ } if (isPlay && nFrames == 2 || isRange) { modelIndex2 = viewer.getModelNumberIndex(frameList[1], useModelNumber); + viewer.setAnimationOn(false); viewer.setAnimationDirection(1); viewer.setAnimationRange(modelIndex, modelIndex2); - viewer.setCurrentModelIndex(modelIndex); + viewer.setCurrentModelIndex(modelIndex >= 0 ? modelIndex : 0); } if (isPlay) viewer.resumeAnimation(); @@ -4926,7 +4926,7 @@ setLabel(key.substring(5)); return; } - if (key.equalsIgnoreCase("toggleLabel")) { + if (key.equalsIgnoreCase("toggleLabel")) { //from PickingManager BitSet bs = expression(2); if (!isSyntaxCheck) viewer.togglePickingLabel(bs); Modified: trunk/Jmol/src/org/jmol/viewer/JmolConstants.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/JmolConstants.java 2007-02-07 17:46:07 UTC (rev 6712) +++ trunk/Jmol/src/org/jmol/viewer/JmolConstants.java 2007-02-08 03:40:15 UTC (rev 6713) @@ -34,7 +34,7 @@ // for now, just update this by hand // perhaps use ant filter later ... but mth doesn't like it :-( public final static String copyright = "(C) 2006 Jmol Development"; - public final static String version = "11.1.8"; //connect radius/color + public final static String version = "11.1.9"; //select 2.3 #file.model public final static String cvsDate = "$Date$"; public final static String date = cvsDate.substring(7, 23); Modified: trunk/Jmol/src/org/jmol/viewer/MouseManager.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/MouseManager.java 2007-02-07 17:46:07 UTC (rev 6712) +++ trunk/Jmol/src/org/jmol/viewer/MouseManager.java 2007-02-08 03:40:15 UTC (rev 6713) @@ -375,6 +375,9 @@ timeCurrent = time; xCurrent = previousDragX = x; yCurrent = previousDragY = y; wasDragged = true; + if (!viewer.getInMotion()) + viewer.getAwtComponent().setCursor( + Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR)); viewer.setInMotion(true); if (pressedCount == 1) mouseSinglePressDrag(deltaX, deltaY, modifiers); @@ -384,8 +387,6 @@ void mouseSinglePressDrag(int deltaX, int deltaY, int modifiers) { //viewer.setStatusUserAction("mouseSinglePressDrag: " + modifiers); - viewer.getAwtComponent().setCursor( - Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR)); switch (modifiers & BUTTON_MODIFIER_MASK) { case LEFT: viewer.rotateXYBy(deltaX, deltaY); Modified: trunk/Jmol/src/org/jmol/viewer/Mps.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Mps.java 2007-02-07 17:46:07 UTC (rev 6712) +++ trunk/Jmol/src/org/jmol/viewer/Mps.java 2007-02-08 03:40:15 UTC (rev 6713) @@ -446,9 +446,8 @@ for (int i = 0; i < monomerCount; i++) { int atomIndex1 = monomers[i].firstAtomIndex; int atomIndex2 = monomers[i].lastAtomIndex; - if (!bsSizeSet.get(i)) //shapes MUST have been set with a size - continue; - setStateInfo(temp, atomIndex1, atomIndex2, type + " " + if (bsSizeSet != null && bsSizeSet.get(i)) //shapes MUST have been set with a size + setStateInfo(temp, atomIndex1, atomIndex2, type + " " + (mads[i] / 2000f)); if (bsColixSet != null && bsColixSet.get(i)) setStateInfo(temp2, atomIndex1, atomIndex2, getColorCommand(type, Modified: trunk/Jmol/src/org/jmol/viewer/StateManager.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/StateManager.java 2007-02-07 17:46:07 UTC (rev 6712) +++ trunk/Jmol/src/org/jmol/viewer/StateManager.java 2007-02-08 03:40:15 UTC (rev 6713) @@ -581,7 +581,9 @@ + ";slabEnabled;zoomEnabled;axeswindow;axesunitcell;axesmolecular;windowcentered;" + ";vibrationscale;vibrationperiod;" + ";cameradepth;navigationmode;rotationradius;" - + ";zerobasedxyzrasmol;axesorientationrasmol;"; + + ";zerobasedxyzrasmol;axesorientationrasmol;" + + ";_modelnumber;" + + ""; void clearVolatileProperties() { Enumeration e; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |