+ if (addMenu)
+ {
+ groupLinksMenu = new JMenu("Group Links");
+ for (int m = 0; m < linkMenus.length; m++)
+ {
+ if (linkMenus[m] != null
+ && linkMenus[m].getMenuComponentCount() > 0)
+ {
+ groupLinksMenu.add(linkMenus[m]);
+ }
+ }
+
+ groupMenu.add(groupLinksMenu);
+ }
+ }
+
+ /**
+ * add a show URL menu item to the given linkMenu
+ *
+ * @param linkMenu
+ * @param label
+ * - menu label string
+ * @param url
+ * - url to open
+ */
+ private void addshowLink(JMenu linkMenu, String label, final String url)
+ {
+ JMenuItem item = new JMenuItem(label);
+ item.setToolTipText("open URL: " + url);
+ item.addActionListener(new java.awt.event.ActionListener()
+ {
+ public void actionPerformed(ActionEvent e)
+ {
+ new Thread(new Runnable()
+ {
+
+ public void run()
+ {
+ showLink(url);
+ }
+
+ }).start();
+ }
+ });
+
+ linkMenu.add(item);
+ }
+
+ /**
+ * add a late bound groupURL item to the given linkMenu
+ *
+ * @param linkMenu
+ * @param label
+ * - menu label string
+ * @param urlgenerator
+ * GroupURLLink used to generate URL
+ * @param urlstub
+ * Object array returned from the makeUrlStubs function.
+ */
+ private void addshowLink(JMenu linkMenu, String label,
+ final GroupUrlLink urlgenerator, final Object[] urlstub)
+ {
+ JMenuItem item = new JMenuItem(label);
+ item.setToolTipText("open URL (" + urlgenerator.getUrl_prefix()
+ + "..) (" + urlgenerator.getNumberInvolved(urlstub) + " seqs)"); // TODO:
+ // put
+ // in
+ // info
+ // about
+ // what
+ // is
+ // being
+ // sent.
+ item.addActionListener(new java.awt.event.ActionListener()
+ {
+ public void actionPerformed(ActionEvent e)
+ {
+ new Thread(new Runnable()
+ {
+
+ public void run()
+ {
+ try
+ {
+ showLink(urlgenerator.constructFrom(urlstub));
+ } catch (UrlStringTooLongException e)
+ {
+ }
+ }
+
+ }).start();
+ }
+ });
+
+ linkMenu.add(item);