- 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)
+ /*
+ * mouse is over an annotation label in wrapped mode
+ */
+ AlignmentAnnotation annotation = av.getAlignment()
+ .getAlignmentAnnotation()[pos.annotationIndex];
+ setToolTipText(AnnotationLabels.getTooltip(annotation));
+ }
+ else
+ {
+ int seq = Math.max(0, pos.seqIndex);
+ if (seq < av.getAlignment().getHeight())