if (selectedRow > -1 && ap.av.getAlignment()
.getAlignmentAnnotation().length > selectedRow)
{
- AlignmentAnnotation aa = ap.av.getAlignment()
- .getAlignmentAnnotation()[selectedRow];
+ AlignmentAnnotation[] anns = ap.av.getAlignment()
+ .getAlignmentAnnotation();
+ AlignmentAnnotation aa = anns[selectedRow];
String desc = getTooltip(aa);
this.setToolTipText(desc);
- ap.alignFrame.setStatus(aa.label);
+ String msg = getStatusMessage(aa, anns);
+ ap.alignFrame.setStatus(msg);
}
}
/**
+ * Constructs suitable text to show in the status bar when over an annotation
+ * label, containing the associated sequence name (if any), and the annotation
+ * labels (or all labels for a graph group annotation)
+ *
+ * @param aa
+ * @param anns
+ * @return
+ */
+ static String getStatusMessage(AlignmentAnnotation aa,
+ AlignmentAnnotation[] anns)
+ {
+ if (aa == null)
+ {
+ return null;
+ }
+
+ StringBuilder msg = new StringBuilder(32);
+ if (aa.sequenceRef != null)
+ {
+ msg.append(aa.sequenceRef.getName()).append(" : ");
+ }
+
+ if (aa.graphGroup == -1)
+ {
+ msg.append(aa.label);
+ }
+ else if (anns != null)
+ {
+ boolean first = true;
+ for (int i = anns.length - 1; i >= 0; i--)
+ {
+ if (anns[i].graphGroup == aa.graphGroup)
+ {
+ if (!first)
+ {
+ msg.append(", ");
+ }
+ msg.append(anns[i].label);
+ first = false;
+ }
+ }
+ }
+
+ return msg.toString();
+ }
+
+ /**
* Answers a tooltip, formatted as html, containing the annotation description
* (prefixed by associated sequence id if applicable), and the annotation
* (non-positional) score if it has one. Answers null if neither description
int width = getWidth();
if (width == 0)
{
- width = ap.calculateIdWidth().width + 4;
+ width = ap.calculateIdWidth().width;
}
Graphics2D g2 = (Graphics2D) g;