JAL-3210 Merge branch 'develop' into trialMerge
[jalview.git] / src / jalview / io / AnnotationFile.java
index e578a45..f0f1ca3 100755 (executable)
@@ -274,7 +274,7 @@ public class AnnotationFile
           if (row.graphGroup > -1)
           {
             graphGroupSeen.set(row.graphGroup);
-            Integer key = new Integer(row.graphGroup);
+            Integer key = Integer.valueOf(row.graphGroup);
             if (graphGroup.containsKey(key))
             {
               graphGroup.put(key, graphGroup.get(key) + "\t" + row.label);
@@ -646,7 +646,7 @@ public class AnnotationFile
 
   String refSeqId = null;
 
-  public boolean annotateAlignmentView(AlignViewportI viewport, String file,
+  public boolean annotateAlignmentView(AlignViewportI viewport, Object file,
           DataSourceType protocol)
   {
     ColumnSelection colSel = viewport.getColumnSelection();
@@ -677,23 +677,23 @@ public class AnnotationFile
   }
 
   public boolean readAnnotationFile(AlignmentI al, HiddenColumns hidden,
-          String file, DataSourceType sourceType)
+          Object file, DataSourceType sourceType)
   {
     BufferedReader in = null;
     try
     {
       if (sourceType == DataSourceType.FILE)
       {
-        in = new BufferedReader(new FileReader(file));
+        in = FileLoader.getBufferedReader(file);
       }
       else if (sourceType == DataSourceType.URL)
       {
-        URL url = new URL(file);
+        URL url = new URL(file.toString());
         in = new BufferedReader(new InputStreamReader(url.openStream()));
       }
       else if (sourceType == DataSourceType.PASTE)
       {
-        in = new BufferedReader(new StringReader(file));
+        in = new BufferedReader(new StringReader(file.toString()));
       }
       else if (sourceType == DataSourceType.CLASSLOADER)
       {
@@ -762,7 +762,7 @@ public class AnnotationFile
                       autoAnnotsKey(aa[aai], aa[aai].sequenceRef,
                               (aa[aai].groupRef == null ? null
                                       : aa[aai].groupRef.getName())),
-                      new Integer(1));
+                      Integer.valueOf(1));
             }
           }
         }
@@ -1271,7 +1271,7 @@ public class AnnotationFile
         {
           displayChar = token;
           // foo
-          value = new Float(token).floatValue();
+          value = Float.valueOf(token).floatValue();
           parsedValue = true;
           continue;
         } catch (NumberFormatException ex)
@@ -1617,8 +1617,10 @@ public class AnnotationFile
         }
         else if (key.equalsIgnoreCase("colour"))
         {
+          // TODO need to notify colourscheme of view reference once it is
+          // available
           sg.cs.setColourScheme(
-                  ColourSchemeProperty.getColourScheme(al, value));
+                  ColourSchemeProperty.getColourScheme(null, al, value));
         }
         else if (key.equalsIgnoreCase("pidThreshold"))
         {