Merge branch 'develop' into trialMerge
[jalview.git] / src / jalview / project / Jalview2XML.java
index 4d772a1..5618529 100644 (file)
@@ -1672,7 +1672,7 @@ public class Jalview2XML
       // using save and then load
       try
       {
-       fileName = fileName.replace('\\', '/');
+        fileName = fileName.replace('\\', '/');
         System.out.println("Writing jar entry " + fileName);
         JarEntry entry = new JarEntry(fileName);
         jout.putNextEntry(entry);
@@ -2771,52 +2771,52 @@ public class Jalview2XML
     return af;
   }
 
-       @SuppressWarnings("unused")
-       private jarInputStreamProvider createjarInputStreamProvider(final Object ofile) throws MalformedURLException {
+        @SuppressWarnings("unused")
+        private jarInputStreamProvider createjarInputStreamProvider(final Object ofile) throws MalformedURLException {
 
-               // BH 2018 allow for bytes already attached to File object
-               try {
-                       String file = (ofile instanceof File ? ((File) ofile).getCanonicalPath() : ofile.toString());
+                // BH 2018 allow for bytes already attached to File object
+                try {
+                        String file = (ofile instanceof File ? ((File) ofile).getCanonicalPath() : ofile.toString());
       byte[] bytes = Platform.isJS() ? Platform.getFileBytes((File) ofile)
               : null;
-                       URL url = null;
-                       errorMessage = null;
-                       uniqueSetSuffix = null;
-                       seqRefIds = null;
-                       viewportsAdded.clear();
-                       frefedSequence = null;
-
-                       if (file.startsWith("http://")) {
-                               url = new URL(file);
-                       }
-                       final URL _url = url;
-                       return new jarInputStreamProvider() {
-
-                               @Override
-                               public JarInputStream getJarInputStream() throws IOException {
-                                       if (bytes != null) {
-//                                             System.out.println("Jalview2XML: opening byte jarInputStream for bytes.length=" + bytes.length);
-                                               return new JarInputStream(new ByteArrayInputStream(bytes));
-                                       }
-                                       if (_url != null) {
-//                                             System.out.println("Jalview2XML: opening url jarInputStream for " + _url);
-                                               return new JarInputStream(_url.openStream());
-                                       } else {
-//                                             System.out.println("Jalview2XML: opening file jarInputStream for " + file);
-                                               return new JarInputStream(new FileInputStream(file));
-                                       }
-                               }
-
-                               @Override
-                               public String getFilename() {
-                                       return file;
-                               }
-                       };
-               } catch (IOException e) {
-                       e.printStackTrace();
-                       return null;
-               }
-       }
+                        URL url = null;
+                        errorMessage = null;
+                        uniqueSetSuffix = null;
+                        seqRefIds = null;
+                        viewportsAdded.clear();
+                        frefedSequence = null;
+
+                        if (file.startsWith("http://")) {
+                                url = new URL(file);
+                        }
+                        final URL _url = url;
+                        return new jarInputStreamProvider() {
+
+                                @Override
+                                public JarInputStream getJarInputStream() throws IOException {
+                                        if (bytes != null) {
+//                                              System.out.println("Jalview2XML: opening byte jarInputStream for bytes.length=" + bytes.length);
+                                                return new JarInputStream(new ByteArrayInputStream(bytes));
+                                        }
+                                        if (_url != null) {
+//                                              System.out.println("Jalview2XML: opening url jarInputStream for " + _url);
+                                                return new JarInputStream(_url.openStream());
+                                        } else {
+//                                              System.out.println("Jalview2XML: opening file jarInputStream for " + file);
+                                                return new JarInputStream(new FileInputStream(file));
+                                        }
+                                }
+
+                                @Override
+                                public String getFilename() {
+                                        return file;
+                                }
+                        };
+                } catch (IOException e) {
+                        e.printStackTrace();
+                        return null;
+                }
+        }
 
   /**
    * Recover jalview session from a jalview project archive. Caller may
@@ -4536,7 +4536,7 @@ public class Jalview2XML
           String reformatedOldFilename = oldfilenam.replaceAll("/", "\\\\");
           filedat = oldFiles.get(new File(reformatedOldFilename));
         }
-        newFileLoc.append(Platform.escapeString(filedat.getFilePath()));
+        newFileLoc.append(Platform.escapeBackslashes(filedat.getFilePath()));
         pdbfilenames.add(filedat.getFilePath());
         pdbids.add(filedat.getPdbId());
         seqmaps.add(filedat.getSeqList().toArray(new SequenceI[0]));
@@ -4857,14 +4857,14 @@ public class Jalview2XML
     af = new AlignFrame(al, safeInt(view.getWidth()),
             safeInt(view.getHeight()), uniqueSeqSetId, viewId) 
 //    {
-//     
-//     @Override
-//     protected void processKeyEvent(java.awt.event.KeyEvent e) {
-//             System.out.println("Jalview2XML   AF " + e);
-//             super.processKeyEvent(e);
-//             
-//     }
-//     
+//      
+//      @Override
+//      protected void processKeyEvent(java.awt.event.KeyEvent e) {
+//              System.out.println("Jalview2XML   AF " + e);
+//              super.processKeyEvent(e);
+//              
+//      }
+//      
 //    }
     ;
 
@@ -5140,7 +5140,7 @@ public class Jalview2XML
         }
         else
         {
-          featureOrder.put(featureType, new Float(
+          featureOrder.put(featureType, Float.valueOf(
                   fs / jm.getFeatureSettings().getSetting().size()));
         }
         if (safeBoolean(setting.isDisplay()))
@@ -5152,7 +5152,7 @@ public class Jalview2XML
       for (int gs = 0; gs < jm.getFeatureSettings().getGroup().size(); gs++)
       {
         Group grp = jm.getFeatureSettings().getGroup().get(gs);
-        fgtable.put(grp.getName(), new Boolean(grp.isDisplay()));
+        fgtable.put(grp.getName(), Boolean.valueOf(grp.isDisplay()));
       }
       // FeatureRendererSettings frs = new FeatureRendererSettings(renderOrder,
       // fgtable, featureColours, jms.getFeatureSettings().hasTransparency() ?