import jalview.analysis.AnnotationSorter.SequenceAnnotationOrder;
import jalview.analysis.Conservation;
+import jalview.analysis.TreeModel;
import jalview.api.AlignCalcManagerI;
import jalview.api.AlignViewportI;
import jalview.api.AlignmentViewPanel;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.AlignmentView;
import jalview.datamodel.Annotation;
-import jalview.datamodel.CigarArray;
import jalview.datamodel.ColumnSelection;
import jalview.datamodel.HiddenColumns;
import jalview.datamodel.HiddenSequences;
public abstract class AlignmentViewport
implements AlignViewportI, CommandListener, VamsasSource
{
- final protected ViewportRanges ranges;
+ protected ViewportRanges ranges;
protected ViewStyleI viewStyle = new ViewStyle();
protected boolean ignoreBelowBackGroundFrequencyCalculation = false;
+ protected boolean infoLetterHeight = false;
+
protected ResidueShaderI residueShading = new ResidueShader();
@Override
groupConsensus = null;
groupConservation = null;
hconsensus = null;
+ hconservation = null;
hcomplementConsensus = null;
- // colour scheme may hold reference to consensus
- residueShading = null;
- // TODO remove listeners from changeSupport?
+ gapcounts = null;
+ calculator = null;
+ residueShading = null; // may hold a reference to Consensus
changeSupport = null;
+ ranges = null;
+ currentTree = null;
+ selectionGroup = null;
setAlignment(null);
}
}
+ public void setInfoLetterHeight(boolean b, AlignmentViewPanel ap)
+ {
+ infoLetterHeight = b;
+ if (ap != null)
+ {
+ updateInformation(ap);
+ }
+
+ }
+
private long sgrouphash = -1, colselhash = -1;
/**
return ignoreBelowBackGroundFrequencyCalculation;
}
+ @Override
+ public boolean isInfoLetterHeight()
+ {
+ return infoLetterHeight;
+ }
+
// property change stuff
// JBPNote Prolly only need this in the applet version.
private PropertyChangeSupport changeSupport = new PropertyChangeSupport(
public void removePropertyChangeListener(
java.beans.PropertyChangeListener listener)
{
- changeSupport.removePropertyChangeListener(listener);
+ if (changeSupport != null)
+ {
+ changeSupport.removePropertyChangeListener(listener);
+ }
}
/**
}
@Override
- public CigarArray getViewAsCigars(boolean selectedRegionOnly)
- {
- return new CigarArray(alignment, alignment.getHiddenColumns(),
- (selectedRegionOnly ? selectionGroup : null));
- }
-
- @Override
public jalview.datamodel.AlignmentView getAlignmentView(
boolean selectedOnly)
{
updateInformation(ap);
List<SequenceI> hmmSequences;
- hmmSequences = alignment.getHMMConsensusSequences(false);
+ hmmSequences = alignment.getHMMConsensusSequences();
for (SequenceI seq : hmmSequences)
{
@Override
public void initInformation()
{
- for (SequenceI seq : alignment.getHMMConsensusSequences(false))
+ for (SequenceI seq : alignment.getHMMConsensusSequences())
{
if (!seq.hasHMMAnnotation())
{
- AlignmentAnnotation information;
- information = new AlignmentAnnotation(seq.getName(),
+ AlignmentAnnotation info = new AlignmentAnnotation(seq.getName(),
MessageManager.getString("label.information_description"),
new Annotation[1], 0f, 6.52f,
AlignmentAnnotation.BAR_GRAPH);
- information.hasText = true;
- information.autoCalculated = true;
- information.hasText = true;
- information.autoCalculated = false;
- information.sequenceRef = seq;
- information.setCalcId("HMM");
- this.information.add(information);
+ info.hasText = true;
+ info.autoCalculated = true;
+ info.hasText = true;
+ info.autoCalculated = false;
+ info.sequenceRef = seq;
+ info.setCalcId("HMM");
+ this.information.add(info);
hinformation.add(new Profiles(new ProfileI[1]));
- alignment.addAnnotation(information);
+ alignment.addAnnotation(info);
seq.updateHMMMapping();
seq.setHasInfo(true);
- seq.addAlignmentAnnotation(information);
+ seq.addAlignmentAnnotation(info);
}
}
-
}
// these should be extracted from the view model - style and settings for
*/
private SearchResultsI searchResults = null;
+ protected TreeModel currentTree = null;
+
@Override
public boolean hasSearchResults()
{
+ ((ignoreGapsInConsensusCalculation) ? " without gaps" : ""));
return sq;
}
+
+ public boolean hasReferenceAnnotation()
+ {
+ AlignmentAnnotation[] annots = this.alignment.getAlignmentAnnotation();
+ for (AlignmentAnnotation annot : annots)
+ {
+ if ("RF".equals(annot.label) || annot.label.contains("Reference"))
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public void setCurrentTree(TreeModel tree)
+ {
+ currentTree = tree;
+ }
+
+ @Override
+ public TreeModel getCurrentTree()
+ {
+ return currentTree;
+ }
}