+ attachReferenceAnnotations(seqs, false, false);
+
+ testee.configureReferenceAnnotationsMenu(menu, seqs);
+ assertTrue(menu.isEnabled());
+ String expected = "<html><table width=350 border=0><tr><td>Add annotations for<br/>JMOL/secondary structure<br/>PBD/Temp</td></tr></table></html>";
+ assertEquals(expected, menu.getToolTipText());
+ }
+
+ /**
+ * Test building the 'add reference annotations' menu for the case where
+ * several reference annotations are on the dataset and the sequences but not
+ * on the alignment. The menu item should be enabled, and acquire a tooltip
+ * which lists the annotation sources (calcIds) and type (labels).
+ */
+ @Test
+ public void testConfigureReferenceAnnotationsMenu_notOnAlignment()
+ {
+ JMenuItem menu = new JMenuItem();
+ List<SequenceI> seqs = parentPanel.getAlignment().getSequences();
+
+ // make up new annotations and add to dataset sequences and sequences
+ attachReferenceAnnotations(seqs, true, false);
+
+ testee.configureReferenceAnnotationsMenu(menu, seqs);
+ assertTrue(menu.isEnabled());
+ String expected = "<html><table width=350 border=0><tr><td>Add annotations for<br/>JMOL/secondary structure<br/>PBD/Temp</td></tr></table></html>";
+ assertEquals(expected, menu.getToolTipText());
+ }