JAL-3390 new View menu option to hide hidden regions in structure
[jalview.git] / src / jalview / structures / models / AAStructureBindingModel.java
index 1fc59ed..ef4fed3 100644 (file)
@@ -104,6 +104,8 @@ public abstract class AAStructureBindingModel
   // TODO make private once showStructures() deals with this
   protected List<String> chainsToShow;
 
+  private boolean hideHiddenRegions;
+
   /**
    * Data bean class to simplify parameterisation in superposeStructures
    */
@@ -785,7 +787,7 @@ public abstract class AAStructureBindingModel
   public abstract void setBackgroundColour(Color col);
 
   protected abstract StructureMappingcommandSet[] getColourBySequenceCommands(
-          String[] files, SequenceRenderer sr, AlignmentViewPanel avp);
+          String[] files, AlignmentViewPanel avp);
 
   /**
    * returns the current sequenceRenderer that should be used to colour the
@@ -829,10 +831,8 @@ public abstract class AAStructureBindingModel
     }
     String[] files = getStructureFiles();
 
-    SequenceRenderer sr = getSequenceRenderer(alignmentv);
-
     StructureMappingcommandSet[] colourBySequenceCommands = getColourBySequenceCommands(
-            files, sr, alignmentv);
+            files, alignmentv);
     colourBySequence(colourBySequenceCommands);
   }
 
@@ -856,8 +856,8 @@ public abstract class AAStructureBindingModel
   }
 
   /**
-   * Answers true if only mapped visible residues in the alignment should be
-   * visible in the structure viewer, else false
+   * Answers true if only residues mapped to the alignment should be shown in the
+   * structure viewer, else false
    * 
    * @return
    */
@@ -867,6 +867,30 @@ public abstract class AAStructureBindingModel
   }
 
   /**
+   * Sets the flag for hiding regions of structure which are hidden in the
+   * alignment (only applies when the structure viewer is restricted to the
+   * alignment only)
+   * 
+   * @param b
+   */
+  public void setHideHiddenRegions(boolean b)
+  {
+    hideHiddenRegions = b;
+  }
+
+  /**
+   * Answers true if regions hidden in the alignment should also be hidden in the
+   * structure viewer, else false (only applies when the structure viewer is
+   * restricted to the alignment only)
+   * 
+   * @return
+   */
+  public boolean isHideHiddenRegions()
+  {
+    return hideHiddenRegions;
+  }
+
+  /**
    * Shows the structures in the viewer, without changing their colouring. This is
    * to support toggling of whether the whole structure is shown, or only residues
    * mapped to visible regions of the alignment.