}
/**
- * Hides columns containing (or not containing) a specified feature, provided
- * that would not leave all columns hidden
+ * Hides columns containing (or not containing) the specified feature(s),
+ * provided that would not leave all columns hidden
*
- * @param featureType
* @param columnsContaining
+ * @param featureTypes
+ *
* @return
*/
- public boolean hideFeatureColumns(String featureType,
- boolean columnsContaining)
+ public boolean hideFeatureColumns(boolean columnsContaining,
+ String... featureTypes)
{
boolean notForHiding = avc.markColumnsContainingFeatures(
- columnsContaining, false, false, featureType);
+ columnsContaining, false, false, featureTypes);
if (notForHiding)
{
if (avc.markColumnsContainingFeatures(!columnsContaining, false,
- false, featureType))
+ false, featureTypes))
{
getViewport().hideSelectedColumns();
return true;
AlignFrame.DEFAULT_WIDTH, AlignFrame.DEFAULT_HEIGHT);
if (Cache.getDefault("HIDE_INTRONS", true))
{
- newFrame.hideFeatureColumns(SequenceOntologyI.EXON, false);
+ newFrame.hideFeatureColumns(false, SequenceOntologyI.EXON);
}
String newtitle = String.format("%s %s %s",
dna ? MessageManager.getString("label.proteins")
@Override
public void actionPerformed(ActionEvent arg0)
{
+ String[] types = getTermsInScope(type);
fr.ap.alignFrame.avc.markColumnsContainingFeatures(false, false,
- false, type);
+ false, types);
}
});
JMenuItem clearCols = new JMenuItem(MessageManager
@Override
public void actionPerformed(ActionEvent arg0)
{
+ String[] types = getTermsInScope(type);
fr.ap.alignFrame.avc.markColumnsContainingFeatures(true, false,
- false, type);
+ false, types);
}
});
JMenuItem hideCols = new JMenuItem(
@Override
public void actionPerformed(ActionEvent arg0)
{
- fr.ap.alignFrame.hideFeatureColumns(type, true);
+ String[] types = getTermsInScope(type);
+ fr.ap.alignFrame.hideFeatureColumns(true, types);
}
});
JMenuItem hideOtherCols = new JMenuItem(
@Override
public void actionPerformed(ActionEvent arg0)
{
- fr.ap.alignFrame.hideFeatureColumns(type, false);
+ String[] types = getTermsInScope(type);
+ fr.ap.alignFrame.hideFeatureColumns(false, types);
}
});
men.add(selCols);
}
if (Cache.getDefault("HIDE_INTRONS", true))
{
- af.hideFeatureColumns(SequenceOntologyI.EXON, false);
+ af.hideFeatureColumns(false, SequenceOntologyI.EXON);
}
if (newAlframes != null)
{
/*
* hiding a feature not present does nothing
*/
- assertFalse(alignFrame.hideFeatureColumns("exon", true));
+ assertFalse(alignFrame.hideFeatureColumns(true, "exon"));
assertTrue(alignFrame.getViewport().getColumnSelection().isEmpty());
assertEquals(alignFrame.getViewport().getAlignment().getHiddenColumns()
.getNumberOfRegions(), 0);
- assertFalse(alignFrame.hideFeatureColumns("exon", false));
+ assertFalse(alignFrame.hideFeatureColumns(false, "exon"));
assertTrue(alignFrame.getViewport().getColumnSelection().isEmpty());
assertEquals(alignFrame.getViewport().getAlignment().getHiddenColumns()
/*
* hiding a feature in all columns does nothing
*/
- assertFalse(alignFrame.hideFeatureColumns("Metal", true));
+ assertFalse(alignFrame.hideFeatureColumns(true, "Metal"));
assertTrue(alignFrame.getViewport().getColumnSelection().isEmpty());
assertEquals(alignFrame.getViewport().getAlignment().getHiddenColumns()
fc.setAboveThreshold(true);
fc.setThreshold(5f);
alignFrame.getFeatureRenderer().setColour("Metal", fc);
- assertTrue(alignFrame.hideFeatureColumns("Metal", true));
+ assertTrue(alignFrame.hideFeatureColumns(true, "Metal"));
HiddenColumns hidden = alignFrame.getViewport().getAlignment().getHiddenColumns();
assertEquals(hidden.getNumberOfRegions(), 1);
Iterator<int[]> regions = hidden.iterator();
* [1-3], [6-8] base zero
*/
alignFrame.getViewport().showAllHiddenColumns();
- assertTrue(alignFrame.hideFeatureColumns("Turn", true));
+ assertTrue(alignFrame.hideFeatureColumns(true, "Turn"));
regions = alignFrame.getViewport().getAlignment()
.getHiddenColumns().iterator();
assertEquals(alignFrame.getViewport().getAlignment().getHiddenColumns()