Jalview-JS/JAL-3253-applet also comments relating to JAL-3268
[jalview.git] / src / jalview / project / Jalview2XML.java
index 9d9faa1..ab4a3eb 100644 (file)
@@ -800,6 +800,9 @@ public class Jalview2XML
           String fileName, JarOutputStream jout)
   {
 
+    // BH: Question: What is this Dataset for, as it seems to
+    // duplicate the actual XML file data.
+
     for (String dssids : dsses.keySet())
     {
       AlignFrame _af = dsses.get(dssids);
@@ -2854,8 +2857,12 @@ public class Jalview2XML
         {
           jarentry = jin.getNextJarEntry();
         }
-
-        if (jarentry != null && jarentry.getName().endsWith(".xml"))
+        String name = (jarentry == null ? null : jarentry.getName());
+        if (name != null && name.endsWith(".xml")
+        // The question here is what to do with the two
+        // .xml files in the jvp file. They are identical?
+        // && name.indexOf(" Dataset for ") < 0 // BH 2019.05.21
+        )
         {
           JAXBContext jc = JAXBContext
                   .newInstance("jalview.xml.binding.jalview");
@@ -4973,8 +4980,18 @@ public class Jalview2XML
       viewport.setViewName(view.getViewName());
       af.setInitialTabVisible();
     }
-    af.setBounds(safeInt(view.getXpos()), safeInt(view.getYpos()),
-            safeInt(view.getWidth()), safeInt(view.getHeight()));
+    int x = safeInt(view.getXpos());
+    int y = safeInt(view.getYpos());
+    int w = safeInt(view.getWidth());
+    int h = safeInt(view.getHeight());
+    // // BH we cannot let the title bar go off the top
+    // if (Platform.isJS())
+    // {
+    // x = Math.max(50 - w, x);
+    // y = Math.max(0, y);
+    // }
+
+    af.setBounds(x, y, w, h);
     // startSeq set in af.alignPanel.updateLayout below
     af.alignPanel.updateLayout();
     ColourSchemeI cs = null;