+ initConservation();
+ initQuality();
+ }
+ else
+ {
+ initRNAStructure();
+ }
+ initConsensus();
+ }
+ }
+
+ private void initConsensus()
+ {
+
+ consensus = new AlignmentAnnotation("Consensus", "PID",
+ new Annotation[1], 0f, 100f, AlignmentAnnotation.BAR_GRAPH);
+ consensus.hasText = true;
+ consensus.autoCalculated = true;
+
+ if (showConsensus)
+ {
+ alignment.addAnnotation(consensus);
+ }
+ }
+
+ private void initConservation()
+ {
+ if (showConservation)
+ {
+ if (conservation == null)
+ {
+ conservation = new AlignmentAnnotation("Conservation",
+ "Conservation of total alignment less than "
+ + getConsPercGaps() + "% gaps", new Annotation[1],
+ 0f, 11f, AlignmentAnnotation.BAR_GRAPH);
+ conservation.hasText = true;
+ conservation.autoCalculated = true;
+ alignment.addAnnotation(conservation);
+ }
+ }
+ }
+
+ private void initQuality()
+ {
+ if (showQuality)
+ {
+ if (quality == null)
+ {
+ quality = new AlignmentAnnotation("Quality",
+ "Alignment Quality based on Blosum62 scores",
+ new Annotation[1], 0f, 11f, AlignmentAnnotation.BAR_GRAPH);
+ quality.hasText = true;
+ quality.autoCalculated = true;
+ alignment.addAnnotation(quality);
+ }
+ }
+ }
+
+ private void initRNAStructure()
+ {
+ if (alignment.hasRNAStructure() && strucConsensus == null)
+ {
+ strucConsensus = new AlignmentAnnotation("StrucConsensus", "PID",
+ new Annotation[1], 0f, 100f, AlignmentAnnotation.BAR_GRAPH);
+ strucConsensus.hasText = true;
+ strucConsensus.autoCalculated = true;
+
+ if (showConsensus)
+ {
+ alignment.addAnnotation(strucConsensus);
+ }
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see jalview.api.AlignViewportI#calcPanelHeight()
+ */
+ @Override
+ public int calcPanelHeight()
+ {
+ // setHeight of panels
+ AlignmentAnnotation[] aa = getAlignment().getAlignmentAnnotation();
+ int height = 0;
+ int charHeight = getCharHeight();
+ if (aa != null)
+ {
+ BitSet graphgrp = new BitSet();
+ for (int i = 0; i < aa.length; i++)
+ {
+ if (aa[i] == null)