Minor updates
[jalview.git] / src / jalview / gui / AlignmentPanel.java
index 72a074d..443ae68 100644 (file)
@@ -1856,11 +1856,21 @@ public class AlignmentPanel extends GAlignmentPanel implements
 
   private boolean holdRepaint = false;
 
+  /**
+   * Checked by SeqCanvas when painting
+   * 
+   * @return
+   */
   public boolean getHoldRepaint()
   {
     return holdRepaint;
   }
 
+  /**
+   * Called specifically by Jalview2xml when loading a JPV file
+   * 
+   * @param b
+   */
   public void setHoldRepaint(boolean b)
   {
     if (holdRepaint == b)
@@ -1886,4 +1896,42 @@ public class AlignmentPanel extends GAlignmentPanel implements
     super.repaint();
   }
 
+  public void selectAllSequences()
+  {
+    selectSequences(av.getAlignment().getSequences());
+  }
+
+  public void deselectAllSequences()
+  {
+    if (av.cursorMode)
+    {
+      getSeqPanel().keyboardNo1 = null;
+      getSeqPanel().keyboardNo2 = null;
+    }
+    av.setSelectionGroup(null);
+    av.getColumnSelection().clear();
+    av.setSelectionGroup(null);
+    getIdPanel().getIdCanvas().searchResults = null;
+    av.sendSelection();
+    // JAL-2034 - should delegate to
+    // alignPanel to decide if overview needs
+    // updating.
+    paintAlignment(false, false);
+    PaintRefresher.Refresh(this, av.getSequenceSetId());
+  }
+
+  public void selectSequences(List<SequenceI> seqs)
+  {
+    SequenceGroup sg = new SequenceGroup(seqs);
+    sg.setEndRes(av.getAlignment().getWidth() - 1);
+    av.setSelectionGroup(sg);
+    av.isSelectionGroupChanged(true);
+    av.sendSelection();
+    // JAL-2034 - should delegate to
+    // alignPanel to decide if overview needs
+    // updating.
+    paintAlignment(false, false);
+    PaintRefresher.Refresh(this, av.getSequenceSetId());
+  }
+
 }