JAL-2388 Initial removal of hidden cols/seqs out of overview
[jalview.git] / src / jalview / gui / OverviewPanel.java
index d87285c..e553657 100755 (executable)
@@ -181,15 +181,11 @@ public class OverviewPanel extends JPanel implements Runnable
     mg.setColor(Color.orange);
     mg.fillRect(0, 0, od.getWidth(), miniMe.getHeight());
 
-    // calculate scale based on current alignment width and height
-    od.updateScales();
-
     // calculate sampleCol and sampleRow
     // alignment width is max number of residues/bases
     // alignment height is number of sequences
     int alwidth = av.getAlignment().getWidth();
-    int alheight = av.getAlignment().getHeight()
-            + av.getAlignment().getHiddenSequences().getSize();
+    int alheight = av.getAlignment().getAbsoluteHeight();
 
     // sampleCol or sampleRow is the width/height allocated to each residue
     // in particular, sometimes we may need more than one row/col of the
@@ -239,7 +235,7 @@ public class OverviewPanel extends JPanel implements Runnable
     int color = Color.white.getRGB();
 
     jalview.datamodel.SequenceI seq = null;
-    final boolean hasHiddenRows = av.hasHiddenRows();
+
     final boolean hasHiddenCols = av.hasHiddenColumns();
     boolean hiddenRow = false;
     // get hidden row and hidden column map once at beginning.
@@ -255,29 +251,10 @@ public class OverviewPanel extends JPanel implements Runnable
 
         lastrow = currentrow;
 
-        hiddenRow = false;
-        // should be method(s) in Alignment
-        if (hasHiddenRows)
-        {
-          seq = av.getAlignment().getHiddenSequences()
-                  .getHiddenSequence(lastrow);
-          if (seq == null)
-          {
-            int index = av.getAlignment().getHiddenSequences()
-                    .findIndexWithoutHiddenSeqs(lastrow);
-
-            seq = av.getAlignment().getSequenceAt(index);
-          }
-          else
-          {
-            hiddenRow = true;
-          }
-        }
-        else
-        {
-          seq = av.getAlignment().getSequenceAt(lastrow);
-        }
-        // end of Alignment method(s)
+        // get the sequence which would be at alignment index 'lastrow' if no
+        // columns were hidden, and determine whether it is hidden or not
+        hiddenRow = av.getAlignment().isHidden(lastrow);
+        seq = av.getAlignment().getSequenceAtAbsoluteIndex(lastrow);
       }
 
       if (seq == null)