* retain any colour thresholds per group while
* changing choice of colour scheme (JAL-2386)
*/
- sg.setColourScheme(cs.getInstance(this, sg));
+ sg.setColourScheme(
+ cs == null ? null : cs.getInstance(this, sg));
if (cs != null)
{
sg.getGroupColourScheme().alignmentChanged(sg,
{
if (!alignment.isNucleotide())
{
- initConservation();
- initQuality();
+ if (showConservation && conservation == null)
+ {
+ initConservation();
+ }
+ if (showQuality && quality == null)
+ {
+ initQuality();
+ }
}
else
{
- initRNAStructure();
+ if (showConsensus && alignment.hasRNAStructure()
+ && strucConsensus == null)
+ {
+ initRNAStructure();
+ }
+ }
+ if (showConsensus)
+ {
+ initConsensus();
+ }
+ if (showOccupancy)
+ {
+ initOccupancy();
}
- consensus = new AlignmentAnnotation("Consensus",
- MessageManager.getString("label.consensus_descr"),
- new Annotation[1], 0f, 100f, AlignmentAnnotation.BAR_GRAPH);
- initConsensus(consensus);
- initGapCounts();
initComplementConsensus();
}
.getString("label.complement_consensus_descr"),
new Annotation[1], 0f, 100f,
AlignmentAnnotation.BAR_GRAPH);
- initConsensus(complementConsensus);
+ complementConsensus.hasText = true;
+ complementConsensus.autoCalculated = true;
+ alignment.addAnnotation(complementConsensus);
return true;
}
}
return false;
}
- private void initConsensus(AlignmentAnnotation aa)
+ @Override
+ public void initConsensus()
{
- aa.hasText = true;
- aa.autoCalculated = true;
-
- if (showConsensus)
- {
- alignment.addAnnotation(aa);
- }
+ consensus = new AlignmentAnnotation("Consensus",
+ MessageManager.getString("label.consensus_descr"),
+ new Annotation[1], 0f, 100f, AlignmentAnnotation.BAR_GRAPH);
+ consensus.hasText = true;
+ consensus.autoCalculated = true;
+ alignment.addAnnotation(consensus);
}
- // these should be extracted from the view model - style and settings for
- // derived annotation
- private void initGapCounts()
+ @Override
+ public void initOccupancy()
{
- if (showOccupancy)
- {
- gapcounts = new AlignmentAnnotation("Occupancy",
- MessageManager.getString("label.occupancy_descr"),
- new Annotation[1], 0f, alignment.getHeight(),
- AlignmentAnnotation.BAR_GRAPH);
- gapcounts.hasText = true;
- gapcounts.autoCalculated = true;
- gapcounts.scaleColLabel = true;
- gapcounts.graph = AlignmentAnnotation.BAR_GRAPH;
+ gapcounts = new AlignmentAnnotation("Occupancy",
+ MessageManager.getString("label.occupancy_descr"),
+ new Annotation[1], 0f, alignment.getHeight(),
+ AlignmentAnnotation.BAR_GRAPH);
+ gapcounts.hasText = true;
+ gapcounts.autoCalculated = true;
+ gapcounts.scaleColLabel = true;
+ gapcounts.graph = AlignmentAnnotation.BAR_GRAPH;
- alignment.addAnnotation(gapcounts);
- }
+ alignment.addAnnotation(gapcounts);
}
- private void initConservation()
+ @Override
+ public void initConservation()
{
- if (showConservation)
- {
- if (conservation == null)
- {
- conservation = new AlignmentAnnotation("Conservation",
- MessageManager.formatMessage("label.conservation_descr",
- getConsPercGaps()),
- new Annotation[1], 0f, 11f, AlignmentAnnotation.BAR_GRAPH);
- conservation.hasText = true;
- conservation.autoCalculated = true;
- alignment.addAnnotation(conservation);
- }
- }
+ conservation = new AlignmentAnnotation("Conservation",
+ MessageManager.formatMessage("label.conservation_descr",
+ getConsPercGaps()),
+ new Annotation[1], 0f, 11f, AlignmentAnnotation.BAR_GRAPH);
+ conservation.hasText = true;
+ conservation.autoCalculated = true;
+ alignment.addAnnotation(conservation);
}
- private void initQuality()
+ @Override
+ public void initQuality()
{
- if (showQuality)
- {
- if (quality == null)
- {
- quality = new AlignmentAnnotation("Quality",
- MessageManager.getString("label.quality_descr"),
- new Annotation[1], 0f, 11f, AlignmentAnnotation.BAR_GRAPH);
- quality.hasText = true;
- quality.autoCalculated = true;
- alignment.addAnnotation(quality);
- }
- }
+ quality = new AlignmentAnnotation("Quality",
+ MessageManager.getString("label.quality_descr"),
+ new Annotation[1], 0f, 11f, AlignmentAnnotation.BAR_GRAPH);
+ quality.hasText = true;
+ quality.autoCalculated = true;
+ alignment.addAnnotation(quality);
}
- private void initRNAStructure()
+ @Override
+ public void initRNAStructure()
{
- if (alignment.hasRNAStructure() && strucConsensus == null)
- {
- strucConsensus = new AlignmentAnnotation("StrucConsensus",
- MessageManager.getString("label.strucconsensus_descr"),
- new Annotation[1], 0f, 100f, AlignmentAnnotation.BAR_GRAPH);
- strucConsensus.hasText = true;
- strucConsensus.autoCalculated = true;
-
- if (showConsensus)
- {
- alignment.addAnnotation(strucConsensus);
- }
- }
+ strucConsensus = new AlignmentAnnotation("StrucConsensus",
+ MessageManager.getString("label.strucconsensus_descr"),
+ new Annotation[1], 0f, 100f, AlignmentAnnotation.BAR_GRAPH);
+ strucConsensus.hasText = true;
+ strucConsensus.autoCalculated = true;
+ alignment.addAnnotation(strucConsensus);
}
/*
viewStyle.setProteinFontAsCdna(b);
}
+ @Override
+ public void setShowComplementFeatures(boolean b)
+ {
+ viewStyle.setShowComplementFeatures(b);
+ }
+
+ @Override
+ public boolean isShowComplementFeatures()
+ {
+ return viewStyle.isShowComplementFeatures();
+ }
+
+ @Override
+ public void setShowComplementFeaturesOnTop(boolean b)
+ {
+ viewStyle.setShowComplementFeaturesOnTop(b);
+ }
+
+ @Override
+ public boolean isShowComplementFeaturesOnTop()
+ {
+ return viewStyle.isShowComplementFeaturesOnTop();
+ }
+
/**
* @return true if view should scroll to show the highlighted region of a
* sequence