- boolean addMenu = false; // indicates if there are any group links to give to user
- for (int i = 0; i < groupURLLinks.size(); i++) {
- String link = groupURLLinks.elementAt(i).toString();
- String descr = groupURLdescr.elementAt(i).toString();
-// boolean specialCase = additionalPar.elementAt(i).toString().equals(BACKGROUND);
- GroupUrlLink urlLink = null;
- try
- {
- urlLink = new GroupUrlLink(link);
- } catch (Exception foo)
- {
- jalview.bin.Cache.log.error("Exception for GroupURLLink '" + link
- + "'", foo);
- continue;
- }
- ;
- if (!urlLink.isValid())
+ Hashtable<String, JMenu[]> gurlMenus = new Hashtable<String, JMenu[]>();
+ /**
+ * last number of sequences where URL generation failed
+ */
+ int[] nsqtype = new int[] { 0,0,0,0,0,0,0,0,0,0};
+ for (int i = 0; i < groupURLLinks.size(); i++)
+ {
+ String link = (String) groupURLLinks.elementAt(i);
+ String descr = (String) groupURLdescr.elementAt(i);
+
+ // boolean specialCase =
+ // additionalPar.elementAt(i).toString().equals(BACKGROUND);
+ GroupUrlLink urlLink = null;
+ try
+ {
+ urlLink = new GroupUrlLink(link);
+ } catch (Exception foo)
+ {
+ jalview.bin.Cache.log.error("Exception for GroupURLLink '" + link
+ + "'", foo);
+ continue;
+ }
+ ;
+ if (!urlLink.isValid())
+ {
+ jalview.bin.Cache.log.error(urlLink.getInvalidMessage());
+ continue;
+ }
+ final String label = urlLink.getLabel();
+ // create/recover the sub menus that might be populated for this link.
+ JMenu[] wflinkMenus = gurlMenus.get(label);
+ if (wflinkMenus == null)
+ {
+ // three types of url that might be
+ // created.
+ wflinkMenus = new JMenu[]
+ { null, new JMenu("IDS"), new JMenu("Sequences"),
+ new JMenu("IDS and Sequences") };
+ gurlMenus.put(label, wflinkMenus);
+ }
+
+ boolean usingNames = false;
+ // Now see which parts of the group apply for this URL
+ String ltarget;
+ String[] seqstr, ids; // input to makeUrl
+ for (int t = 0; t < allowedDb.length; t++)
+ {
+ ltarget = allowedDb[t]; // jalview.util.DBRefUtils.getCanonicalName(urlLink.getTarget());
+ Object[] idset = (Object[]) commonDbrefs.get(ltarget.toUpperCase());
+ if (idset != null)