JAL-2034 flag for triggering redraw of overview window for a view
authorJim Procter <jprocter@issues.jalview.org>
Fri, 25 Mar 2016 14:48:02 +0000 (14:48 +0000)
committerJim Procter <jprocter@issues.jalview.org>
Fri, 25 Mar 2016 14:48:02 +0000 (14:48 +0000)
src/jalview/appletgui/SeqPanel.java
src/jalview/gui/SeqPanel.java

index 479b746..d88add1 100644 (file)
@@ -919,6 +919,14 @@ public class SeqPanel extends Panel implements MouseMotionListener,
 
   Tooltip tooltip;
 
+  /**
+   * set when the current UI interaction has resulted in a change that requires
+   * overview shading to be recalculated. this could be changed to something
+   * more expressive that indicates what actually has changed, so selective
+   * redraws can be applied
+   */
+  private boolean needOverviewUpdate; // TODO: refactor to avcontroller
+
   @Override
   public void mouseDragged(MouseEvent evt)
   {
@@ -1540,11 +1548,11 @@ public class SeqPanel extends Panel implements MouseMotionListener,
                 stretchGroup.getName());
       }
     }
+    PaintRefresher.Refresh(ap, av.getSequenceSetId());
+    ap.paintAlignment(needOverviewUpdate);
     changeEndRes = false;
     changeStartRes = false;
     stretchGroup = null;
-    PaintRefresher.Refresh(ap, av.getSequenceSetId());
-    ap.paintAlignment(true);
     av.sendSelection();
   }
 
index cce2ee0..362e7f9 100644 (file)
@@ -822,6 +822,14 @@ public class SeqPanel extends JPanel implements MouseListener,
   String lastTooltip;
 
   /**
+   * set when the current UI interaction has resulted in a change that requires
+   * overview shading to be recalculated. this could be changed to something
+   * more expressive that indicates what actually has changed, so selective
+   * redraws can be applied
+   */
+  private boolean needOverviewUpdate = false; // TODO: refactor to avcontroller
+
+  /**
    * Set status message in alignment panel
    * 
    * @param sequence
@@ -1700,7 +1708,7 @@ public class SeqPanel extends JPanel implements MouseListener,
       }
     }
     PaintRefresher.Refresh(this, av.getSequenceSetId());
-    ap.paintAlignment(true);
+    ap.paintAlignment(needOverviewUpdate);
 
     changeEndRes = false;
     changeStartRes = false;