+
+ /**
+ * @return the score
+ */
+ public double getScore()
+ {
+ return score;
+ }
+
+ /**
+ * @param score
+ * the score to set
+ */
+ public void setScore(double score)
+ {
+ hasScore = true;
+ this.score = score;
+ }
+
+ /**
+ *
+ * @return true if annotation has an associated score
+ */
+ public boolean hasScore()
+ {
+ return hasScore || !Double.isNaN(score);
+ }
+
+ /**
+ * Score only annotation
+ *
+ * @param label
+ * @param description
+ * @param score
+ */
+ public AlignmentAnnotation(String label, String description, double score)
+ {
+ this(label, description, null);
+ setScore(score);
+ }
+
+ /**
+ * copy constructor with edit based on the hidden columns marked in colSel
+ *
+ * @param alignmentAnnotation
+ * @param colSel
+ */
+ public AlignmentAnnotation(AlignmentAnnotation alignmentAnnotation,
+ ColumnSelection colSel)
+ {
+ this(alignmentAnnotation);
+ if (annotations == null)
+ {
+ return;
+ }
+ colSel.makeVisibleAnnotation(this);
+ }
+
+ public void setPadGaps(boolean padgaps, char gapchar)
+ {
+ this.padGaps = padgaps;
+ if (padgaps)
+ {
+ hasText = true;
+ for (int i = 0; i < annotations.length; i++)
+ {
+ if (annotations[i] == null)
+ annotations[i] = new Annotation(String.valueOf(gapchar), null,
+ ' ', 0f);
+ else if (annotations[i].displayCharacter == null
+ || annotations[i].displayCharacter.equals(" "))
+ annotations[i].displayCharacter = String.valueOf(gapchar);
+ }
+ }
+ }
+
+ /**
+ * format description string for display
+ *
+ * @param seqname
+ * @return Get the annotation description string optionally prefixed by
+ * associated sequence name (if any)
+ */
+ public String getDescription(boolean seqname)
+ {
+ if (seqname && this.sequenceRef != null)
+ {
+ int i = description.toLowerCase().indexOf("<html>");
+ if (i > -1)
+ {
+ // move the html tag to before the sequence reference.
+ return "<html>" + sequenceRef.getName() + " : "
+ + description.substring(i + 6);
+ }
+ return sequenceRef.getName() + " : " + description;
+ }
+ return description;
+ }
+
+ public boolean isValidStruc()
+ {
+ return invalidrnastruc == -1;
+ }
+
+ public long getInvalidStrucPos()
+ {
+ return invalidrnastruc;
+ }
+
+ /**
+ * machine readable ID string indicating what generated this annotation
+ */
+ protected String calcId = "";
+
+ /**
+ * base colour for line graphs. If null, will be set automatically by
+ * searching the alignment annotation
+ */
+ public java.awt.Color _linecolour;
+
+ public String getCalcId()
+ {
+ return calcId;
+ }
+
+ public void setCalcId(String calcId)
+ {
+ this.calcId = calcId;
+ }
+