Merge branch 'JAL-3878_ws-overhaul-3' into mmw/Release_2_12_ws_merge
[jalview.git] / src / jalview / viewmodel / AlignmentViewport.java
index c9165d0..0e3bb9e 100644 (file)
@@ -90,7 +90,6 @@ public abstract class AlignmentViewport
 {
   public static final String PROPERTY_ALIGNMENT = "alignment";
   public static final String PROPERTY_SEQUENCE = "sequence";
-
   protected ViewportRanges ranges;
 
   protected ViewStyleI viewStyle = new ViewStyle();
@@ -619,6 +618,7 @@ public abstract class AlignmentViewport
    * alignment
    */
   protected boolean isDataset = false;
+
   
   public void setDataset(boolean b)
   {
@@ -657,11 +657,10 @@ public abstract class AlignmentViewport
   {
     autoCalculateStrucConsensus = b;
   }
-
-
   protected boolean ignoreGapsInConsensusCalculation = false;
 
   protected ResidueShaderI residueShading = new ResidueShader();
+
   
   @Override
   public void setGlobalColourScheme(ColourSchemeI cs)
@@ -736,6 +735,7 @@ public abstract class AlignmentViewport
   {
     return residueShading;
   }
+
   
   protected AlignmentAnnotation consensus;
 
@@ -770,6 +770,7 @@ public abstract class AlignmentViewport
   protected Hashtable<String, Object>[] hStrucConsensus = null;
 
   protected Conservation hconservation = null;
+
   
   @Override
   public void setConservation(Conservation cons)
@@ -955,7 +956,6 @@ public abstract class AlignmentViewport
       calculator.registerWorker(new InformationThread(this, ap));
     }
   }
-
   // --------START Structure Conservation
   public void updateStrucConsensus(final AlignmentViewPanel ap)
   {
@@ -1048,6 +1048,7 @@ public abstract class AlignmentViewport
     ranges = null;
     currentTree = null;
     selectionGroup = null;
+    colSel = null;
     setAlignment(null);
   }
 
@@ -1158,7 +1159,6 @@ public abstract class AlignmentViewport
     }
     this.hmmShowSequenceLogo = showHMMSequenceLogo;
   }
-
   /**
    * @param showConsensusHistogram
    *          the showConsensusHistogram to set
@@ -1466,7 +1466,6 @@ public abstract class AlignmentViewport
   {
     return infoLetterHeight;
   }
-
   // property change stuff
   // JBPNote Prolly only need this in the applet version.
   private PropertyChangeSupport changeSupport = new PropertyChangeSupport(
@@ -1518,6 +1517,7 @@ public abstract class AlignmentViewport
     }
   }
 
+
   // common hide/show column stuff
 
   public void hideSelectedColumns()
@@ -1589,7 +1589,6 @@ public abstract class AlignmentViewport
     }
   }
 
-
   public void showSequence(int index)
   {
     int startSeq = ranges.getStartSeq();
@@ -1612,6 +1611,7 @@ public abstract class AlignmentViewport
       }
 
       ranges.setStartEndSeq(startSeq, endSeq + tmp.size());
+
       notifyAlignment();
       sendSelection();
     }
@@ -2097,7 +2097,6 @@ public abstract class AlignmentViewport
               MessageManager.getString("label.consensus_descr"),
               new Annotation[1], 0f, 100f, AlignmentAnnotation.BAR_GRAPH);
       initConsensus(consensus);
-
       initGapCounts();
 
       initComplementConsensus();
@@ -3143,7 +3142,6 @@ public abstract class AlignmentViewport
     }
     return false;
   }
-
   @Override
   public void setCurrentTree(TreeModel tree)
   {
@@ -3270,6 +3268,24 @@ public abstract class AlignmentViewport
       codingComplement.setUpdateStructures(needToUpdateStructureViews);
     }
   }
+
+  @Override
+  public Iterator<int[]> getViewAsVisibleContigs(boolean selectedRegionOnly)
+  {
+    int start = 0;
+    int end = 0;
+    if (selectedRegionOnly && selectionGroup != null)
+    {
+      start = selectionGroup.getStartRes();
+      end = selectionGroup.getEndRes() + 1;
+    }
+    else
+    {
+      end = alignment.getWidth();
+    }
+    return (alignment.getHiddenColumns().getVisContigsIterator(start, end,
+            false));
+  }
   /**
    * Filters out sequences with an eValue higher than the specified value. The
    * filtered sequences are hidden or deleted. Sequences with no eValues are also