JAL-3026 VARNA files
authorhansonr <hansonr@stolaf.edu>
Tue, 3 Jul 2018 14:15:33 +0000 (15:15 +0100)
committerhansonr <hansonr@stolaf.edu>
Tue, 3 Jul 2018 14:15:33 +0000 (15:15 +0100)
build-zip-varna-BH.xml [new file with mode: 0644]
libjs/VARNA-site.zip
src/jalview/gui/AppVarnaBinding.java
srcjar/fr/orsay/lri/varna/VARNAPanel.java
srcjar/fr/orsay/lri/varna/applications/VARNAEditor.java
srcjar/fr/orsay/lri/varna/applications/VARNAGUI.java

diff --git a/build-zip-varna-BH.xml b/build-zip-varna-BH.xml
new file mode 100644 (file)
index 0000000..f9a6b04
--- /dev/null
@@ -0,0 +1,31 @@
+<?xml version="1.0"?>
+<!--
+ * just a crude unzip of non-Jalview classes for development purposes -BH 2018
+-->
+<project name="jalviewX" default="zipvarna" basedir="."
+ xmlns:if="ant:if"
+    xmlns:unless="ant:unless">
+       
+  <target name="zipvarna">
+       
+       
+       <!-- inputs directories -->
+    <property name="resourceDir" value="resources" />          
+       <property name="libjsDir" value="libjs"/>
+    <property name="swingjsDir" value="swingjs"/>
+       
+       <!-- inputs zip files -->
+       <property name="swingjs.zip" value="${swingjsDir}/SwingJS-site.zip" />
+    <property name="varna.zip" value="${libjsDir}/VARNA-site.zip" />
+
+       <!-- output directories -->
+       <property name="site" value="site"/>
+       <property name="j2sDir" value="${site}/swingjs/j2s"/>
+
+
+       <property name="libjsDir" value="libjs"/>
+               
+       <echo> Zipping up ${varna.zip} </echo>
+       <zip destfile="${varna.zip}" basedir="site" includes="fr_*,swingjs/j2s/fr/**" />
+</target>
+</project>
index 00b7830..53d36df 100644 (file)
Binary files a/libjs/VARNA-site.zip and b/libjs/VARNA-site.zip differ
index ee4ef79..7430856 100644 (file)
@@ -289,7 +289,8 @@ public class AppVarnaBinding extends JalviewVarnaBinding
                         name += " (Model " + mn++ + ")";
                       }
                       _rnaList.add(varnaPanel.getConfig().clone(), r, name,
-                              true);
+                              true); 
+                      // BH 2018 SwingJS clone of varnaPanel or its config will be the object itself, not a clone
                     }
                   }
                 }
@@ -545,7 +546,7 @@ public class AppVarnaBinding extends JalviewVarnaBinding
    */
   public void addStructure(RNA rna)
   {
-    VARNAConfig config = vp.getConfig().clone();
+    VARNAConfig config = vp.getConfig().clone(); // BH 2018 this will NOT be a clone in SwingJS
     addStructure(rna, config);
   }
 
index 13906af..3ab14b7 100644 (file)
@@ -2454,6 +2454,8 @@ public class VARNAPanel extends JPanel implements PropertyChangeListener {
                        super.setBackground(new Color(0, 0, 0, 120));
                }
 
+               // BH 2018 was lt, not lteq here
+               // SwingJS sets the minimum panel size -- probably incorrectly -- to the size for VARNAPanel
                if (getMinimumSize().height <= getSize().height
                                && getMinimumSize().width <= getSize().width) {
                        // Draw Title
index 665e9fc..818cfda 100644 (file)
@@ -193,6 +193,9 @@ public class VARNAEditor extends JFrame implements DropTargetListener, Interface
                e3.printStackTrace();
                }
                _vp.setPreferredSize(new Dimension(400, 400));
+               // 
+               
+                // BH 2018 this will NOT be a clone in SwingJS
            _rnaList.add(_vp.getConfig().clone(),_RNA2,generateDefaultName());
            _rnaList.add(_vp.getConfig().clone(),_RNA1,generateDefaultName(),true);
 
index fe468c4..e62503f 100644 (file)
@@ -271,7 +271,7 @@ public class VARNAGUI extends JFrame implements DropTargetListener, InterfaceVAR
                });
                // BH 2018 SwingJS can't clone, as it does not implement serialization 
                if (/** @j2sNative false && */ true)
-               _duplicateButton.addActionListener(new ActionListener() {
+                 _duplicateButton.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent e) {
                                        _rnaList.add((VARNAConfig)_vp.getConfig().clone(),_vp.getRNA().clone(),_vp.getRNA().getName()+"-"+DateFormat.getTimeInstance(DateFormat.LONG).format(new Date()),true); 
                        }});
@@ -279,7 +279,8 @@ public class VARNAGUI extends JFrame implements DropTargetListener, InterfaceVAR
                JPanel ops = new JPanel();
                ops.setLayout(new GridLayout(1,2));
                ops.add(_deleteButton);
-               ops.add(_duplicateButton);
+                if (/** @j2sNative false && */ true)
+                  ops.add(_duplicateButton);
                
                JPanel opspanel = new JPanel(new BorderLayout());
                opspanel.add(ops,BorderLayout.NORTH);