-
-
- public boolean getIgnoreGapsConsensus()
- {
- return ignoreGapsInConsensusCalculation;
- }
- public void hideSelectedColumns()
- {
- if (colSel.size() < 1)
- return;
-
- colSel.hideSelectedColumns();
- setSelectionGroup(null);
-
- hasHiddenColumns = true;
- }
-
- public void invertColumnSelection()
- {
- int column;
- for (int i = 0; i < alignment.getWidth(); i++)
- {
- column = i;
-
- if (colSel.contains(column))
- colSel.removeElement(column);
- else
- colSel.addElement(column);
-
- }
- }
-
-
- public void hideColumns(int start, int end)
- {
- if(start==end)
- colSel.hideColumns(start);
- else
- colSel.hideColumns(start, end);
-
- hasHiddenColumns = true;
- }
-
- public void hideAllSelectedSeqs()
- {
- if (selectionGroup == null)
- return;
-
- SequenceI[] seqs = selectionGroup.getSequencesInOrder(alignment);
-
- hideSequence(seqs);
-
- setSelectionGroup(null);
- }
-
- public void hideSequence(SequenceI [] seq)
- {
- if(seq!=null)
- {
- for (int i = 0; i < seq.length; i++)
- alignment.getHiddenSequences().hideSequence(seq[i]);
-
- hasHiddenRows = true;
- firePropertyChange("alignment", null, alignment.getSequences());
- }
- }
-
- public void showColumn(int col)
- {
- colSel.revealHiddenColumns(col);
- if(colSel.getHiddenColumns()==null)
- hasHiddenColumns = false;
- }
-
- public void showAllHiddenColumns()
- {
- colSel.revealAllHiddenColumns();
- hasHiddenColumns = false;
- }
-
- public void showAllHiddenSeqs()
- {
- if(alignment.getHiddenSequences().getSize()>0)
+ /**
+ * synthesize a column selection if none exists so it covers the given
+ * selection group. if wholewidth is false, no column selection is made if the
+ * selection group covers the whole alignment width.
+ *
+ * @param sg
+ * @param wholewidth
+ */
+ public void expandColSelection(SequenceGroup sg, boolean wholewidth)
+ {
+ int sgs, sge;
+ if (sg != null
+ && (sgs = sg.getStartRes()) >= 0
+ && sg.getStartRes() <= (sge = sg.getEndRes())
+ && (colSel == null || colSel.getSelected() == null || colSel
+ .getSelected().size() == 0))