+
+ /**
+ * Clear the last structure selection
+ */
+ public void clearLastSelection()
+ {
+ if (_lastRNAhighlighted != null)
+ {
+ _lastRNAhighlighted.removeHighlightRegion(_lastHighlight);
+ _lastRNAhighlighted = null;
+ _lastHighlight = null;
+ }
+ }
+ }
+
+ /**
+ * Constructor
+ *
+ * @param seq
+ * the RNA sequence
+ * @param aa
+ * the annotation with the secondary structure string
+ * @param ap
+ * the AlignmentPanel creating this object
+ */
+ public AppVarna(SequenceI seq, AlignmentAnnotation aa, AlignmentPanel ap)
+ {
+ this(ap);
+
+ String sname = aa.sequenceRef == null
+ ? "secondary structure (alignment)"
+ : seq.getName() + " structure";
+ String theTitle = sname
+ + (aa.sequenceRef == null ? " trimmed to " + seq.getName()
+ : "");
+ theTitle = MessageManager.formatMessage("label.varna_params",
+ new String[]
+ { theTitle });
+ setTitle(theTitle);
+
+ String gappedTitle = sname + " (with gaps)";
+ RnaModel gappedModel = new RnaModel(gappedTitle, aa, seq, null, true);
+ addModel(gappedModel, gappedTitle);
+
+ String trimmedTitle = "trimmed " + sname;
+ RnaModel trimmedModel = new RnaModel(trimmedTitle, aa, seq, null,
+ false);
+ addModel(trimmedModel, trimmedTitle);
+ vab.setSelectedIndex(0);
+ }
+
+ /**
+ * Constructor that links the viewer to a parent panel (but has no structures
+ * yet - use addModel to add them)
+ *
+ * @param ap
+ */
+ protected AppVarna(AlignmentPanel ap)
+ {
+ this.ap = ap;
+ this.viewId = System.currentTimeMillis() + "." + this.hashCode();
+ vab = new AppVarnaBinding();