+ output.appendText(buffer.toString());\r
+ }\r
+\r
+ void updateIds()\r
+ {\r
+ // This must be outside the run() body as java 1.5\r
+ // will not return any value from the OptionPane to the expired thread.\r
+ int reply = JOptionPane.showConfirmDialog(\r
+ Desktop.desktop, "Automatically update suggested ids?",\r
+ "Auto replace sequence ids", JOptionPane.YES_NO_OPTION);\r
+\r
+ if (reply == JOptionPane.YES_OPTION)\r
+ {\r
+ Enumeration keys = suggestedIds.elements();\r
+ while(keys.hasMoreElements())\r
+ {\r
+ Object [] object = (Object[])keys.nextElement();\r
+\r
+ Sequence oldseq = (Sequence)object[0];\r
+\r
+ oldseq.setName( object[1].toString() );\r
+\r
+ // Oldseq is actually in the dataset, we must find the\r
+ // Visible seq and change its name also.\r
+ for (int i = 0; i < al.getHeight(); i++)\r
+ {\r
+ if (al.getSequenceAt(i).getDatasetSequence() == oldseq)\r
+ {\r
+ al.getSequenceAt(i).setName(oldseq.getName());\r
+ break;\r
+ }\r
+ }\r
+\r
+ DBRefEntry [] entries = oldseq.getDBRef();\r
+ if (entries != null)\r
+ {\r
+ oldseq.addDBRef(new jalview.datamodel.\r
+ DBRefEntry(jalview.datamodel.DBRefSource.UNIPROT,\r
+ "0",\r
+ entries[0].getAccessionId()));\r
+ }\r
+ }\r
+ }\r
+ ap.repaint();\r
+\r