From: <ha...@us...> - 2010-02-07 16:45:35
|
Revision: 12324 http://jmol.svn.sourceforge.net/jmol/?rev=12324&view=rev Author: hansonr Date: 2010-02-07 16:45:29 +0000 (Sun, 07 Feb 2010) Log Message: ----------- version=11.8.19_dev # bug fix: refresh after echo @{...} causes Jmol to hang. Modified Paths: -------------- branches/v11_8/Jmol/src/org/jmol/viewer/Jmol.properties branches/v11_8/Jmol/src/org/jmol/viewer/RepaintManager.java branches/v11_8/Jmol/src/org/jmol/viewer/Viewer.java Modified: branches/v11_8/Jmol/src/org/jmol/viewer/Jmol.properties =================================================================== --- branches/v11_8/Jmol/src/org/jmol/viewer/Jmol.properties 2010-02-07 16:44:15 UTC (rev 12323) +++ branches/v11_8/Jmol/src/org/jmol/viewer/Jmol.properties 2010-02-07 16:45:29 UTC (rev 12324) @@ -4,6 +4,8 @@ version=11.8.19_dev +# bug fix: refresh after echo @{...} causes Jmol to hang. + # ----------------------------------------------------------------------------- #version=11.8.18 Modified: branches/v11_8/Jmol/src/org/jmol/viewer/RepaintManager.java =================================================================== --- branches/v11_8/Jmol/src/org/jmol/viewer/RepaintManager.java 2010-02-07 16:44:15 UTC (rev 12323) +++ branches/v11_8/Jmol/src/org/jmol/viewer/RepaintManager.java 2010-02-07 16:45:29 UTC (rev 12324) @@ -30,7 +30,6 @@ import org.jmol.shape.ShapeRenderer; import org.jmol.util.Logger; -import java.awt.Component; import java.awt.Rectangle; class RepaintManager { @@ -69,7 +68,11 @@ synchronized void requestRepaintAndWait() { repaintDisplay(); try { - wait(); + wait(1000); + if (repaintPending) { + System.out.println("repaintManager-11.8 requestRepaintAndWait Thread " + Thread.currentThread().getName()); + repaintDone(); + } } catch (InterruptedException e) { } } @@ -78,25 +81,9 @@ holdRepaint = 0; repaintPending = true; repaintInterrupted = false; - Component display = viewer.getDisplay(); - if (display == null) - return; - display.repaint(); + viewer.repaint(); } - synchronized void cancelRendering() { - if (!repaintPending || repaintInterrupted || holdRepaint > 0) - return; - repaintInterrupted = true; - try { - //System.out.println("repaintManager waiting for rendering to complete"); - wait(); - } catch (InterruptedException e) { - } - repaintInterrupted = false; - //System.out.println("repaintManager continuing"); - } - synchronized void repaintDone() { repaintPending = false; notify(); // to cancel any wait in requestRepaintAndWait() Modified: branches/v11_8/Jmol/src/org/jmol/viewer/Viewer.java =================================================================== --- branches/v11_8/Jmol/src/org/jmol/viewer/Viewer.java 2010-02-07 16:44:15 UTC (rev 12323) +++ branches/v11_8/Jmol/src/org/jmol/viewer/Viewer.java 2010-02-07 16:45:29 UTC (rev 12324) @@ -6959,7 +6959,7 @@ return (String) evaluateExpression(exp); } - public synchronized Object evaluateExpression(Object stringOrTokens) { + public Object evaluateExpression(Object stringOrTokens) { return ScriptEvaluator.evaluateExpression(this, stringOrTokens); } @@ -7762,4 +7762,10 @@ return repaintManager.repaintPending; } + void repaint() { + if (display == null) + return; + display.repaint(); + } + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |