}
// and try and make the groupURL!
- Object[] urlset = urlLink.makeUrls(ids,seqstr, "FromJalview"+System.currentTimeMillis(),false);
+ Object[] urlset = urlLink.makeUrlStubs(ids,seqstr, "FromJalview"+System.currentTimeMillis(),false);
if (urlset!=null)
{
- System.out.println(urlLink.getGroupURLType() +" "+((String[])urlset[3])[0]);
+ int type = urlLink.getGroupURLType() & 3;
+ //System.out.println(urlLink.getGroupURLType() +" "+((String[])urlset[3])[0]);
// first two bits ofurlLink type bitfield are sequenceids and sequences
// TODO: FUTURE: ensure the groupURL menu structure can be generalised
- addshowLink(linkMenus[urlLink.getGroupURLType() & 3], label + "("+(usingNames ? "Names" : ltarget)+")", ((String[])urlset[3])[0]);
+ addshowLink(linkMenus[type], label + (((type & 1)==1) ? ("("+(usingNames ? "Names" : ltarget)+")") : ""), urlLink, urlset);
addMenu = true;
}
}
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()
+ {
+ showLink(urlgenerator.constructFrom(urlstub));
+ }
+
+ }).start();
+ }
+ });
+
+ linkMenu.add(item);
+ }
/**
* DOCUMENT ME!
*
sg.setName(dialog.getName());
sg.setDescription(dialog.getDescription());
+ refresh();
}
/**
- * DOCUMENT ME!
+ * Get selection group - adding it to the alignment if necessary.
*
- * @return DOCUMENT ME!
+ * @return sequence group to operate on
*/
SequenceGroup getGroup()
{
}
ap.av.hideSequence(hseqs);
+ // refresh(); TODO: ? needed ?
ap.av.sendSelection();
}