testee.configureReferenceAnnotationsMenu(menu, seqs);
assertTrue(menu.isEnabled());
String s = MessageManager.getString("label.add_annotations_for");
- String expected = "<html><style> p.ttip {width: 350; text-align: justify; word-wrap: break-word;}</style><p class=\"ttip\">"
- + s + "<br/>Jmol/secondary structure<br/>PDB/Temp</p></html>";
+ // String expected = "<html><style> p.ttip {width: 350; text-align: justify;
+ // word-wrap: break-word;}</style><p class=\"ttip\">"
+ // + s + "<br/>Jmol/secondary structure<br/>PDB/Temp</p></html>";
+ String expected = "<html><style> div.ttip {width:350px;white-space:pre-wrap;padding:2px;overflow-wrap:break-word;}</style>"
+ + "<div class=\"ttip\">" + s
+ + "<br/>Jmol/secondary structure<br/>PDB/Temp </div></html>";
assertEquals(expected, menu.getToolTipText());
}
testee.configureReferenceAnnotationsMenu(menu, seqs);
assertTrue(menu.isEnabled());
String s = MessageManager.getString("label.add_annotations_for");
- String expected = "<html><style> p.ttip {width: 350; text-align: justify; word-wrap: break-word;}</style><p class=\"ttip\">"
- + s + "<br/>Jmol/secondary structure<br/>PDB/Temp</p></html>";
+ // String expected = "<html><style> p.ttip {width: 350; text-align: justify;
+ // word-wrap: break-word;}</style><p class=\"ttip\">"
+ // + s + "<br/>Jmol/secondary structure<br/>PDB/Temp</p></html>";
+ String expected = "<html><style> div.ttip {width:350px;white-space:pre-wrap;padding:2px;overflow-wrap:break-word;}</style>"
+ + "<div class=\"ttip\">Add annotations for<br/>Jmol/secondary structure<br/>PDB/Temp </div></html>";
assertEquals(expected, menu.getToolTipText());
}
* Test for adding sequence id, dbref and feature links
*/
@Test(groups = { "Functional" })
- public void testConstructor_links()
+ public void testBuildLinkMenu()
{
List<SequenceI> seqs = parentPanel.getAlignment().getSequences();
final SequenceI seq0 = seqs.get(0);
seq1.addDBRef(new DBRefEntry("GENE3D", "1", "3.10.20.30"));
/*
- * check the Popup Menu for the first sequence
+ * check the Link Menu for the first sequence
*/
- testee = new PopupMenu(parentPanel, seq0, noFeatures);
- Component[] seqItems = testee.sequenceMenu.getMenuComponents();
- JMenu linkMenu = (JMenu) seqItems[6];
+ JMenu linkMenu = PopupMenu.buildLinkMenu(seq0, noFeatures);
assertEquals(linkText, linkMenu.getText());
Component[] linkItems = linkMenu.getMenuComponents();
assertEquals("UNIPROT|P83527", ((JMenuItem) linkItems[4]).getText());
/*
- * check the Popup Menu for second sequence
+ * check the Link Menu for the second sequence
* note dbref GENE3D is matched to link Gene3D, the latter is displayed
*/
- testee = new PopupMenu(parentPanel, seq1, noFeatures);
- seqItems = testee.sequenceMenu.getMenuComponents();
- linkMenu = (JMenu) seqItems[6];
+ linkMenu = PopupMenu.buildLinkMenu(seq1, noFeatures);
assertEquals(linkText, linkMenu.getText());
linkItems = linkMenu.getMenuComponents();
assertEquals(3, linkItems.length);
unmatched, "");
Preferences.sequenceUrlLinks = factory.createUrlProvider();
- testee = new PopupMenu(parentPanel, seq1, noFeatures);
- seqItems = testee.sequenceMenu.getMenuComponents();
- linkMenu = (JMenu) seqItems[6];
+ linkMenu = PopupMenu.buildLinkMenu(seq1, noFeatures);
assertEquals(linkText, linkMenu.getText());
linkItems = linkMenu.getMenuComponents();
assertEquals(1, linkItems.length);