- SequenceI sequence = av.alignment.getSequenceAt(seq);
- StringBuffer tip = new StringBuffer();
- tip.append("<i>");
-
- int maxWidth = 0;
- if (sequence.getDescription() != null)
- {
- tmp = sequence.getDescription();
- tip.append("<br>" + tmp);
- maxWidth = Math.max(maxWidth, tmp.length());
- }
-
- DBRefEntry[] dbrefs = sequence.getDatasetSequence().getDBRef();
- if (av.isShowDbRefs() && dbrefs != null)
- {
- for (int i = 0; i < dbrefs.length; i++)
- {
- tip.append("<br>");
- tmp = dbrefs[i].getSource() + " " + dbrefs[i].getAccessionId();
- tip.append(tmp);
- maxWidth = Math.max(maxWidth, tmp.length());
- }
- }
-
- // ADD NON POSITIONAL SEQUENCE INFO
- SequenceFeature[] features = sequence.getDatasetSequence()
- .getSequenceFeatures();
- SequenceFeature[] tfeat = new SequenceFeature[1];
- if (av.isShowNpFeats() && features != null)
- {
- for (int i = 0; i < features.length; i++)
- {
- if (features[i].begin == 0 && features[i].end == 0)
- {
- int sz = -tip.length();
- tfeat[0] = features[i];
- SeqPanel.appendFeatures(tip, linkImageURL, 0, tfeat);
- sz+=tip.length();
- maxWidth = Math.max(maxWidth, sz);
- }
- }
- }
-
- if (maxWidth > 60)
- {
- tip.insert(0, "<table width=350 border=0><tr><td><i>");
- tip.append("</i></td></tr></table>");
- }
-
- tip.append("</html>");
-
- setToolTipText("<html>" + sequence.getDisplayId(true)
- + tip.toString());
+ SequenceI sequence = av.getAlignment().getSequenceAt(seq);
+ StringBuffer tip = new StringBuffer(64);
+ seqAnnotReport.createSequenceAnnotationReport(tip, sequence,
+ av.isShowDBRefs(), av.isShowNPFeats(),
+ sp.seqCanvas.fr.getMinMax());
+ setToolTipText("<html>" + sequence.getDisplayId(true) + " "
+ + tip.toString() + "</html>");