import javax.swing.JScrollPane;
import javax.swing.SwingUtilities;
+import ext.vamsas.ServiceHandle;
+
/**
* DOCUMENT ME!
*
* @author $author$
* @version $Revision$
*/
+@SuppressWarnings("serial")
public class AlignFrame extends GAlignFrame implements DropTargetListener,
IProgressIndicator, AlignViewControllerGuiI, ColourChangeListener
{
&& Desktop.jalviewClipboard[1] != alignment.getDataset();
// importDs==true instructs us to copy over new dataset sequences from
// an existing alignment
- Vector newDs = (importDs) ? new Vector() : null; // used to create
+ Vector<SequenceI> newDs = (importDs) ? new Vector<>() : null; // used to
+ // create
// minimum dataset set
for (int i = 0; i < sequences.length; i++)
* @param toggleSeqs
* @param toggleCols
*/
- private void toggleHiddenRegions(boolean toggleSeqs, boolean toggleCols)
+ protected void toggleHiddenRegions(boolean toggleSeqs, boolean toggleCols)
{
boolean hide = false;
{
sortByAnnotScore.removeAll();
// almost certainly a quicker way to do this - but we keep it simple
- Hashtable scoreSorts = new Hashtable();
+ Hashtable<String, String> scoreSorts = new Hashtable<>();
AlignmentAnnotation aann[];
for (SequenceI sqa : viewport.getAlignment().getSequences())
{
}
}
}
- Enumeration labels = scoreSorts.keys();
+ Enumeration<String> labels = scoreSorts.keys();
while (labels.hasMoreElements())
{
addSortByAnnotScoreMenuItem(sortByAnnotScore,
- (String) labels.nextElement());
+ labels.nextElement());
}
sortByAnnotScore.setVisible(scoreSorts.size() > 0);
scoreSorts.clear();
// No MSAWS used any more:
// Vector msaws = null; // (Vector)
// Discoverer.services.get("MsaWS");
- Vector secstrpr = (Vector) Discoverer.services
+ Vector<ServiceHandle> secstrpr = Discoverer.services
.get("SecStrPred");
if (secstrpr != null)
{
// Add any secondary structure prediction services
for (int i = 0, j = secstrpr.size(); i < j; i++)
{
- final ext.vamsas.ServiceHandle sh = (ext.vamsas.ServiceHandle) secstrpr
+ final ext.vamsas.ServiceHandle sh = secstrpr
.get(i);
jalview.ws.WSMenuEntryProviderI impl = jalview.ws.jws1.Discoverer
.getServiceClient(sh);
*
* @param webService
*/
- private void build_urlServiceMenu(JMenu webService)
+ protected void build_urlServiceMenu(JMenu webService)
{
// TODO: remove this code when 2.7 is released
// DEBUG - alignmentView
import jalview.gui.JvOptionPane;
import jalview.util.MessageManager;
+import java.net.URL;
import java.util.Hashtable;
import java.util.StringTokenizer;
import java.util.Vector;
static private java.net.URL RootServiceURL = null;
- static public Vector ServiceURLList = null;
+ static public Vector<URL> ServiceURLList = null;
static private boolean reallyDiscoverServices = true;
- public static java.util.Hashtable services = null; // vectors of services
-
+ public static java.util.Hashtable<String, Vector<ServiceHandle>> services = null;
// stored by
// abstractServiceType
// string
- public static java.util.Vector serviceList = null; // flat list of services
+ public static java.util.Vector<ServiceHandle> serviceList = null;
- static private Vector getDiscoveryURLS()
+ static private Vector<URL> getDiscoveryURLS()
{
- Vector urls = new Vector();
+ Vector<URL> urls = new Vector<>();
String RootServiceURLs = jalview.bin.Cache.getDefault("DISCOVERY_URLS",
"http://www.compbio.dundee.ac.uk/JalviewWS/services/ServiceRegistry");
else
{
jalview.bin.Cache.log.debug("Setting default services");
- services = new Hashtable();
+ services = new Hashtable<>();
// Muscle, Clustal and JPred.
ServiceHandle[] defServices = { new ServiceHandle("MsaWS",
"Edgar, Robert C. (2004), MUSCLE: multiple sequence alignment "
+ "\ndoi://10.1093/nar/gkv332",
"http://www.compbio.dundee.ac.uk/JalviewWS/services/jpred",
"JPred Secondary Structure Prediction") };
- services = new Hashtable();
- serviceList = new Vector();
+ services = new Hashtable<>();
+ serviceList = new Vector<>();
buildServiceLists(defServices, serviceList, services);
}
* Hashtable
* @return boolean
*/
- static private boolean buildServiceLists(ServiceHandle[] sh, Vector cat,
- Hashtable sscat)
+ static private boolean buildServiceLists(ServiceHandle[] sh,
+ Vector<ServiceHandle> cat,
+ Hashtable<String, Vector<ServiceHandle>> sscat)
{
boolean seenNewDiscovery = false;
for (int i = 0, j = sh.length; i < j; i++)
+ sh[i].getEndpointURL() + "\n");
if (!sscat.containsKey(sh[i].getAbstractName()))
{
- sscat.put(sh[i].getAbstractName(), cat = new Vector());
+ sscat.put(sh[i].getAbstractName(), cat = new Vector<>());
}
else
{
- cat = (Vector) sscat.get(sh[i].getAbstractName());
+ cat = sscat.get(sh[i].getAbstractName());
}
cat.add(sh[i]);
if (sh[i].getAbstractName().equals("Registry"))
public void discoverServices()
{
- Hashtable sscat = new Hashtable();
- Vector cat = new Vector();
+ Hashtable<String, Vector<ServiceHandle>> sscat = new Hashtable<>();
+ Vector<ServiceHandle> cat = new Vector<>();
ServiceHandle sh[] = null;
int s_url = 0;
if (ServiceURLList == null)
while (s_url < ServiceURLList.size())
{
if ((sh = getServices(
- (java.net.URL) ServiceURLList.get(s_url))) != null)
+ ServiceURLList.get(s_url))) != null)
{
buildServiceLists(sh, cat, sscat);
// so no need to access original discovery thread.
// Curent decision is to change properties then notify listeners with old
// and new values.
- Hashtable oldServices = services;
+ Hashtable<String, Vector<ServiceHandle>> oldServices = services;
// Vector oldServicelist = serviceList;
services = sscat;
serviceList = cat;
@Override
public void run()
{
- discoverer.doDiscovery();
+ Discoverer.doDiscovery();
discoverer.discoverServices();
}
};
/**
* binding service abstract name to handler class
*/
- private static Hashtable serviceClientBindings;
+ private static Hashtable<String, WS1Client> serviceClientBindings;
public static WS1Client getServiceClient(ServiceHandle sh)
{
if (serviceClientBindings == null)
{
// get a list from Config or create below
- serviceClientBindings = new Hashtable();
+ serviceClientBindings = new Hashtable<>();
serviceClientBindings.put("MsaWS", new MsaWSClient());
serviceClientBindings.put("SecStrPred", new JPredClient());
serviceClientBindings.put("SeqSearch", new SeqSearchWSClient());
}
- WS1Client instance = (WS1Client) serviceClientBindings
+ WS1Client instance = serviceClientBindings
.get(sh.getAbstractName());
if (instance == null)
{