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:
4bae495
)
JAL-2349 JAL-3855 bizarre resizing exception when resizing protein alignment for...
author
Jim Procter
<j.procter@dundee.ac.uk>
Sun, 30 Oct 2022 23:22:32 +0000
(23:22 +0000)
committer
Jim Procter
<j.procter@dundee.ac.uk>
Sun, 30 Oct 2022 23:22:32 +0000
(23:22 +0000)
src/jalview/gui/AnnotationPanel.java
patch
|
blob
|
history
diff --git
a/src/jalview/gui/AnnotationPanel.java
b/src/jalview/gui/AnnotationPanel.java
index
c3b44ce
..
786696c
100755
(executable)
--- a/
src/jalview/gui/AnnotationPanel.java
+++ b/
src/jalview/gui/AnnotationPanel.java
@@
-1284,24
+1284,37
@@
public class AnnotationPanel extends JPanel implements AwtRenderPanelI,
if (image == null || imgWidth != image.getWidth(this)
|| image.getHeight(this) != getHeight())
{
if (image == null || imgWidth != image.getWidth(this)
|| image.getHeight(this) != getHeight())
{
- try
- {
- image = new BufferedImage(imgWidth,
- ap.getAnnotationPanel().getHeight(),
- BufferedImage.TYPE_INT_RGB);
- } catch (OutOfMemoryError oom)
+ boolean tried = false;
+ image = null;
+ while (image == null && !tried)
{
try
{
{
try
{
- System.gc();
- } catch (Exception x)
+ image = new BufferedImage(imgWidth,
+ ap.getAnnotationPanel().getHeight(),
+ BufferedImage.TYPE_INT_RGB);
+ tried = true;
+ } catch (IllegalArgumentException exc)
{
{
+ System.err.println(
+ "Serious issue with viewport geometry imgWidth requested was "
+ + imgWidth);
+ return;
+ } catch (OutOfMemoryError oom)
+ {
+ try
+ {
+ System.gc();
+ } catch (Exception x)
+ {
+ }
+ ;
+ new OOMWarning(
+ "Couldn't allocate memory to redraw screen. Please restart Jalview",
+ oom);
+ return;
}
}
- ;
- new OOMWarning(
- "Couldn't allocate memory to redraw screen. Please restart Jalview",
- oom);
- return;
+
}
gg = (Graphics2D) image.getGraphics();
}
gg = (Graphics2D) image.getGraphics();