git://source.jalview.org
/
jalview.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
751db10
)
JAL-4217 don’t try and export an image when Jmol is also trying to repaint
author
James Procter
<j.procter@dundee.ac.uk>
Tue, 12 Dec 2023 17:17:17 +0000
(17:17 +0000)
committer
James Procter
<j.procter@dundee.ac.uk>
Tue, 12 Dec 2023 17:17:17 +0000
(17:17 +0000)
src/jalview/gui/AppJmol.java
patch
|
blob
|
history
diff --git
a/src/jalview/gui/AppJmol.java
b/src/jalview/gui/AppJmol.java
index
0aa4878
..
4d0de1b
100644
(file)
--- a/
src/jalview/gui/AppJmol.java
+++ b/
src/jalview/gui/AppJmol.java
@@
-421,6
+421,14
@@
public class AppJmol extends StructureViewerBase
}
}
+ public boolean isRepainting()
+ {
+ if (renderPanel!=null && renderPanel.isVisible())
+ {
+ return renderPanel.repainting;
+ }
+ return false;
+ }
/**
* Outputs the Jmol viewer image as an image file, after prompting the user to
* choose a file and (for EPS) choice of Text or Lineart character rendering
/**
* Outputs the Jmol viewer image as an image file, after prompting the user to
* choose a file and (for EPS) choice of Text or Lineart character rendering
@@
-431,6
+439,13
@@
public class AppJmol extends StructureViewerBase
@Override
public void makePDBImage(ImageMaker.TYPE type)
{
@Override
public void makePDBImage(ImageMaker.TYPE type)
{
+ while (!isRepainting())
+ {
+ try {
+ Thread.sleep(2);
+ } catch (Exception q)
+ {}
+ }
try
{
makePDBImage(null, type, null,
try
{
makePDBImage(null, type, null,
@@
-627,10
+642,17
@@
public class AppJmol extends StructureViewerBase
}
else
{
}
else
{
- jmb.jmolViewer.renderScreenImage(g, currentSize.width,
- currentSize.height);
+ repainting=true;
+ synchronized (jmb)
+ {
+ jmb.jmolViewer.renderScreenImage(g, currentSize.width,
+ currentSize.height);
+
+ }
+ repainting=false;
}
}
}
}
+ volatile boolean repainting=false;
}
@Override
}
@Override