From: amwaterhouse Date: Fri, 26 Aug 2005 12:42:52 +0000 (+0000) Subject: resizeAgain flag set if user resizes whilst image is being prepared X-Git-Tag: Release_2_05~16 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=a8458ff4b33d8deb7e09a39b8ce5576880f6a862;p=jalview.git resizeAgain flag set if user resizes whilst image is being prepared --- diff --git a/src/jalview/gui/OverviewPanel.java b/src/jalview/gui/OverviewPanel.java index 62f8ca9..6c968a2 100755 --- a/src/jalview/gui/OverviewPanel.java +++ b/src/jalview/gui/OverviewPanel.java @@ -198,6 +198,7 @@ public class OverviewPanel extends JPanel implements Runnable { if (resizing) { + resizeAgain = true; return; } @@ -208,6 +209,10 @@ public class OverviewPanel extends JPanel implements Runnable repaint(); } + // This is set true if the user resizes whilst + // the overview is being calculated + boolean resizeAgain = false; + /** * DOCUMENT ME! */ @@ -265,6 +270,9 @@ public class OverviewPanel extends JPanel implements Runnable for (int sRes = 0, chunkx = 0; sRes < alwidth; sRes += maxSize, chunkx++) { + if(resizeAgain) + break; + eSeq = 0; eRes += maxSize; @@ -303,7 +311,7 @@ public class OverviewPanel extends JPanel implements Runnable mg.drawImage(block, blockx, blocky, blockx + blockw, blocky + blockh, 0, 0, block.getWidth(), - block.getHeight(), this); + block.getHeight(), null); block = null; } @@ -315,10 +323,18 @@ public class OverviewPanel extends JPanel implements Runnable "Out of memory when trying to calculate the overview window image!"); } + System.gc(); + av.setRenderGaps(oldRenderGaps); resizing = false; setBoxPosition(); + + if(resizeAgain) + { + resizeAgain = false; + updateOverviewImage(); + } } /**