private AlignViewControllerGuiI avcg;
public AlignViewController(AlignViewControllerGuiI alignFrame,
- AlignViewportI viewport, AlignmentViewPanel alignPanel)
+ AlignViewportI vp, AlignmentViewPanel ap)
{
this.avcg = alignFrame;
- this.viewport = viewport;
- this.alignPanel = alignPanel;
+ this.viewport = vp;
+ this.alignPanel = ap;
}
@Override
- public void setViewportAndAlignmentPanel(AlignViewportI viewport,
- AlignmentViewPanel alignPanel)
+ public void setViewportAndAlignmentPanel(AlignViewportI vp,
+ AlignmentViewPanel ap)
{
- this.alignPanel = alignPanel;
- this.viewport = viewport;
-
+ this.alignPanel = ap;
+ this.viewport = vp;
}
@Override
/**
* Sets a bit in the BitSet for each column (base 0) in the sequence
- * collection which includes the specified feature type. Returns the number of
- * sequences which have the feature in the selected range.
+ * collection which includes a visible feature of the specified feature type.
+ * Returns the number of sequences which have the feature visible in the
+ * selected range.
*
* @param featureType
* @param sqcol
* @param bs
* @return
*/
- static int findColumnsWithFeature(String featureType,
+ int findColumnsWithFeature(String featureType,
SequenceCollectionI sqcol, BitSet bs)
{
+ FeatureRenderer fr = alignPanel == null ? null : alignPanel
+ .getFeatureRenderer();
+
final int startColumn = sqcol.getStartRes() + 1; // converted to base 1
final int endColumn = sqcol.getEndRes() + 1;
List<SequenceI> seqs = sqcol.getSequences();
List<SequenceFeature> sfs = sq.findFeatures(startColumn,
endColumn, featureType);
- if (!sfs.isEmpty())
- {
- nseq++;
- }
-
+ boolean found = false;
for (SequenceFeature sf : sfs)
{
+ if (fr.getColour(sf) == null)
+ {
+ continue;
+ }
+ if (!found)
+ {
+ nseq++;
+ }
+ found = true;
+
int sfStartCol = sq.findIndex(sf.getBegin());
int sfEndCol = sq.findIndex(sf.getEnd());