beginning of implementation of new properties for hide/show groups and sequence repre...
[jalview.git] / src / jalview / datamodel / SequenceGroup.java
index dd842ea..bb075aa 100755 (executable)
@@ -46,12 +46,18 @@ public class SequenceGroup
   boolean displayText = true;
 
   boolean colourText = false;
-
+  /**
+   * group members
+   */
   private Vector sequences = new Vector();
-
+  /**
+   * representative sequence for this group (if any)
+   */
+  private SequenceI seqrep = null;
   int width = -1;
 
-  /** DOCUMENT ME!! */
+  /**
+   * Colourscheme applied to group if any */
   public ColourSchemeI cs;
 
   int startRes = 0;
@@ -680,4 +686,71 @@ public class SequenceGroup
   {
     this.idColour = idColour;
   }
+
+  /**
+   * @return the representative sequence for this group
+   */
+  public SequenceI getSeqrep()
+  {
+    return seqrep;
+  }
+
+  /**
+   * set the representative sequence for this group.
+   * Note - this affects the interpretation of the Hidereps attribute.
+   * @param seqrep the seqrep to set (null means no sequence representative)
+   */
+  public void setSeqrep(SequenceI seqrep)
+  {
+    this.seqrep = seqrep;
+  }
+  /**
+   * 
+   * @return true if group has a sequence representative
+   */
+  public boolean hasSeqrep()
+  {
+    return seqrep != null;
+  }
+  /**
+   * visibility of rows or represented rows covered by group
+   */
+  private boolean hidereps=false;
+  /**
+   * set visibility of sequences covered by (if no sequence representative is defined) 
+   * or represented by this group.
+   * @param visibility
+   */
+  public void setHidereps(boolean visibility)
+  {
+    hidereps = visibility;
+  }
+  /**
+   * 
+   * @return true if sequences represented (or covered) by this group should be hidden
+   */
+  public boolean isHidereps()
+  {
+    return hidereps;
+  }
+  /**
+   * visibility of columns intersecting this group
+   */
+  private boolean hidecols=false;
+  /**
+   * set intended visibility of columns covered by this group
+   * @param visibility
+   */
+  public void setHideCols(boolean visibility)
+  {
+    hidecols = visibility;
+  }
+  /**
+   * 
+   * @return true if columns covered by group should be hidden
+   */
+  public boolean isHideCols()
+  {
+    return hidecols;
+  }
 }