+ int uniprotCount = 0;\r
+ for (int i = 0; i < selectedSources.size(); i++)\r
+ {\r
+ DasSource source = (DasSource) selectedSources.elementAt(i);\r
+ DasCoordinateSystem[] coords = source.getCoordinateSystem();\r
+ for (int c = 0; c < coords.length; c++)\r
+ {\r
+ if (coords[c].getName().indexOf("UniProt")>-1)\r
+ {\r
+ uniprotCount++;\r
+ break;\r
+ }\r
+ }\r
+ }\r
+\r
+ int refCount = 0;\r
+ for(int i=0; i<sequences.length; i++)\r
+ {\r
+ DBRefEntry [] dbref = sequences[i].getDBRef();\r
+ if(dbref!=null)\r
+ {\r
+ for(int j=0; j<dbref.length; j++)\r
+ {\r
+ if(dbref[j].getSource()\r
+ .equals(jalview.datamodel.DBRefSource.UNIPROT))\r
+ {\r
+ refCount++;\r
+ break;\r
+ }\r
+ }\r
+ }\r
+ }\r
+\r
+ if(refCount<sequences.length && uniprotCount>0)\r
+ {\r
+\r
+ int reply = JOptionPane.showInternalConfirmDialog(Desktop.desktop,\r
+ "Do you want Jalview to find\n"\r
+ +"Uniprot Accession ids for given sequence names?",\r
+ "Find Uniprot Accession Ids",\r
+ JOptionPane.YES_NO_OPTION,\r
+ JOptionPane.QUESTION_MESSAGE);\r
+\r
+ if(reply == JOptionPane.YES_OPTION)\r
+ {\r
+ Thread thread = new Thread(new FetchDBRefs());\r
+ thread.start();\r
+ }\r
+ else\r
+ startFetching();\r
+ }\r
+ else\r
+ startFetching();\r
+\r
+ /* System.out.println("User selection is " +\r
+ ( ( (float) uniprotCount / (float) selectedSources.size()) * 100)\r
+ + " % Uniprot, and "+refCount+" / " +sequences.length+" have uniprot accession");\r
+*/\r
+ }\r
+\r
+ void startFetching()\r
+ {\r