/*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2)
- * Copyright (C) 2014 The Jalview Authors
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
*
* This file is part of Jalview.
*
*/
package jalview.viewmodel;
+import java.awt.Color;
+import java.util.ArrayDeque;
+import java.util.ArrayList;
+import java.util.BitSet;
+import java.util.Deque;
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import jalview.analysis.AnnotationSorter.SequenceAnnotationOrder;
import jalview.analysis.Conservation;
import jalview.api.AlignCalcManagerI;
import jalview.api.AlignViewportI;
import jalview.workers.ConsensusThread;
import jalview.workers.StrucConsensusThread;
-import java.awt.Color;
-import java.util.ArrayDeque;
-import java.util.ArrayList;
-import java.util.BitSet;
-import java.util.Deque;
-import java.util.HashMap;
-import java.util.Hashtable;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
/**
* base class holding visualization and analysis attributes and common logic for
* an active alignment view displayed in the GUI
private Map<SequenceI, Color> sequenceColours = new HashMap<SequenceI, Color>();
+ protected SequenceAnnotationOrder sortAnnotationsBy = null;
+
+ protected boolean showAutocalculatedAbove;
+
/**
* Property change listener for changes in alignment
*
new Annotation[1], 0f, 100f, AlignmentAnnotation.BAR_GRAPH);
initConsensus(consensus);
- if (!alignment.isNucleotide())
+ initComplementConsensus();
+ }
+ }
+
+ /**
+ * If this is a protein alignment and there are mappings to cDNA, add the cDNA
+ * consensus annotation.
+ */
+ protected void initComplementConsensus()
+ {
+ if (!alignment.isNucleotide())
+ {
+ final Set<AlignedCodonFrame> codonMappings = alignment
+ .getCodonFrames();
+ if (codonMappings != null && !codonMappings.isEmpty())
{
- final Set<AlignedCodonFrame> codonMappings = alignment
- .getCodonFrames();
- if (codonMappings != null && !codonMappings.isEmpty())
- {
- complementConsensus = new AlignmentAnnotation("cDNA Consensus",
- "PID for cDNA", new Annotation[1], 0f, 100f,
- AlignmentAnnotation.BAR_GRAPH);
- initConsensus(complementConsensus);
- }
+ complementConsensus = new AlignmentAnnotation("cDNA Consensus",
+ "PID for cDNA", new Annotation[1], 0f, 100f,
+ AlignmentAnnotation.BAR_GRAPH);
+ initConsensus(complementConsensus);
}
}
}
{
return this;
}
+
+ public SequenceAnnotationOrder getSortAnnotationsBy()
+ {
+ return sortAnnotationsBy;
+ }
+
+ public void setSortAnnotationsBy(SequenceAnnotationOrder sortAnnotationsBy)
+ {
+ this.sortAnnotationsBy = sortAnnotationsBy;
+ }
+
+ public boolean isShowAutocalculatedAbove()
+ {
+ return showAutocalculatedAbove;
+ }
+
+ public void setShowAutocalculatedAbove(boolean showAutocalculatedAbove)
+ {
+ this.showAutocalculatedAbove = showAutocalculatedAbove;
+ }
}