public void PCAMenuItem_actionPerformed()
{
// are the sequences aligned?
- if (!viewport.alignment.isAligned())
+ if (!viewport.alignment.isAligned(false))
{
SequenceI current;
int Width = viewport.getAlignment().getWidth();
void NewTreePanel(String type, String pwType, String title)
{
// are the sequences aligned?
- if (!viewport.alignment.isAligned())
+ if (!viewport.alignment.isAligned(false))
{
SequenceI current;
int Width = viewport.getAlignment().getWidth();
return gapCharacter;
}
- /**
- * DOCUMENT ME!
- *
- * @return DOCUMENT ME!
+ /* (non-Javadoc)
+ * @see jalview.datamodel.AlignmentI#isAligned()
*/
public boolean isAligned()
{
+ return isAligned(false);
+ }
+ /* (non-Javadoc)
+ * @see jalview.datamodel.AlignmentI#isAligned(boolean)
+ */
+ public boolean isAligned(boolean includeHidden) {
int width = getWidth();
-
+ if (hiddenSequences==null || hiddenSequences.getSize()==0) {
+ includeHidden = true; // no hidden sequences to check against.
+ }
for (int i = 0; i < sequences.size(); i++)
{
- if (getSequenceAt(i).getLength() != width)
+ if (includeHidden || !hiddenSequences.isHidden(getSequenceAt(i)))
{
- return false;
+ if (getSequenceAt(i).getLength() != width)
+ {
+ return false;
+ }
}
}
public int getWidth();
/**
- * Calculates if this set of sequences is all the same length
+ * Calculates if this set of sequences (visible and invisible) are all the same length
*
* @return true if all sequences in alignment are the same length
*/
public boolean isAligned();
-
+ /**
+ * Calculates if this set of sequences is all the same length
+ * @param includeHidden optionally exclude hidden sequences from test
+ * @return true if all (or just visible) sequences are the same length
+ */
+ public boolean isAligned(boolean includeHidden);
/**
* Gets sequences as a Vector
*
}
else
{
- // are the sequences aligned?
- if (!viewport.alignment.isAligned())
+ // are the visible sequences aligned?
+ if (!viewport.alignment.isAligned(false))
{
JOptionPane
.showMessageDialog(
// jobs
// TODO: viewport.alignment.isAligned is a global state - the local
// selection may well be aligned - we preserve 2.0.8 behaviour for moment.
- if (!viewport.alignment.isAligned())
+ if (!viewport.alignment.isAligned(false))
{
seqs.setSequences(new SeqCigar[]
{ seqs.getSequences()[0] });
/**
* very quick test to see if the viewport would be stored in the vamsas document.
- * Reasons for not storing include the unaligned flag being false.
+ * Reasons for not storing include the unaligned flag being false (for all sequences, including the hidden ones!)
* @param av
* @return true if alignment associated with this view will be stored in document.
*/