- int seq = Math.max(0, sp.findSeq(e));
- if (seq > -1 && seq < av.getAlignment().getHeight())
- {
- 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>");
+ MousePos pos = sp.findMousePosition(e);
+ if (pos.isOverAnnotation())
+ {
+ /*
+ * mouse is over an annotation label in wrapped mode
+ */
+ AlignmentAnnotation[] anns = av.getAlignment()
+ .getAlignmentAnnotation();
+ AlignmentAnnotation annotation = anns[pos.annotationIndex];
+ setToolTipText(AnnotationLabels.getTooltip(annotation));
+ alignPanel.alignFrame.setStatus(
+ AnnotationLabels.getStatusMessage(annotation, anns));
+ }
+ else
+ {
+ int seq = Math.max(0, pos.seqIndex);
+ if (seq < av.getAlignment().getHeight())
+ {
+ SequenceI sequence = av.getAlignment().getSequenceAt(seq);
+ StringBuilder tip = new StringBuilder(64);
+ tip.append(sequence.getDisplayId(true)).append(" ");
+ seqAnnotReport.createTooltipAnnotationReport(tip, sequence,
+ av.isShowDBRefs(), av.isShowNPFeats(), sp.seqCanvas.fr);
+ setToolTipText(JvSwingUtils.wrapTooltip(true, tip.toString()));
+
+ StringBuilder text = new StringBuilder();
+ text.append("Sequence ").append(String.valueOf(seq + 1))
+ .append(" ID: ").append(sequence.getName());
+ alignPanel.alignFrame.setStatus(text.toString());
+ }