jmol update
authorjprocter <Jim Procter>
Wed, 22 Sep 2010 01:03:16 +0000 (01:03 +0000)
committerjprocter <Jim Procter>
Wed, 22 Sep 2010 01:03:16 +0000 (01:03 +0000)
.classpath
appletlib/JmolApplet-12.1.13.jar [moved from appletlib/JmolApplet-12.1.11_dev.jar with 65% similarity]
build.xml
lib/Jmol-12.1.13.jar [moved from lib/Jmol-12.1.11_dev.jar with 82% similarity]
src/jalview/appletgui/AppletJmolBinding.java
src/jalview/appletgui/ExtJmol.java
src/jalview/ext/jmol/JalviewJmolBinding.java
src/jalview/gui/AppJmol.java
src/jalview/gui/AppJmolBinding.java
utils/InstallAnywhere/Jalview.iap_xml

index 6815d73..a20ed44 100644 (file)
@@ -19,7 +19,7 @@
        <classpathentry kind="lib" path="lib/JGoogleAnalytics-0.2.1-SNAPSHOT.jar" sourcepath="/JGoogleAnalytics/src/main/java"/>
        <classpathentry kind="lib" path="lib/vamsas-client.jar"/>
        <classpathentry kind="lib" path="lib/min-jaba-client.jar" sourcepath="/clustengine/webservices"/>
-       <classpathentry kind="lib" path="lib/Jmol-12.1.11_dev.jar"/>
-       <classpathentry kind="lib" path="appletlib/JmolApplet-12.1.11_dev.jar"/>
+       <classpathentry kind="lib" path="lib/Jmol-12.1.13.jar" sourcepath="/Jmol/src"/>
+       <classpathentry kind="lib" path="appletlib/JmolApplet-12.1.13.jar"/>
        <classpathentry kind="output" path="classes"/>
 </classpath>
similarity index 65%
rename from appletlib/JmolApplet-12.1.11_dev.jar
rename to appletlib/JmolApplet-12.1.13.jar
index f1a51a2..27c7bd6 100644 (file)
Binary files a/appletlib/JmolApplet-12.1.11_dev.jar and b/appletlib/JmolApplet-12.1.13.jar differ
index 818415d..fdefa36 100755 (executable)
--- a/build.xml
+++ b/build.xml
@@ -99,7 +99,7 @@
                <property name="packageDir" value="dist" />
                <property name="outputJar" value="jalview.jar" />
                <!-- Jalview Applet JMol Jar Dependency -->
-               <property name="jmolJar" value="JmolApplet-12.1.11_dev.jar" />
+               <property name="jmolJar" value="JmolApplet-12.1.13.jar" />
                <property name="jalviewLiteJar" value="jalviewApplet.jar" />
                <!-- switch to indicate if we should obfuscate jalviewLite -->
                <!--<property name="donotobfuscate" value="true"/> -->
similarity index 82%
rename from lib/Jmol-12.1.11_dev.jar
rename to lib/Jmol-12.1.13.jar
index 3aac3ca..a017034 100644 (file)
Binary files a/lib/Jmol-12.1.11_dev.jar and b/lib/Jmol-12.1.13.jar differ
index 12a09d5..472ac75 100644 (file)
@@ -129,5 +129,17 @@ class AppletJmolBinding extends jalview.ext.jmol.JalviewJmolBinding
   {
     return new AppletConsole(viewer2, consolePanel);
   }
+  @Override
+  protected void releaseUIResources()
+  {
+    appletJmolBinding = null;
+    if (console!=null) {
+      try {
+        console.setVisible(false);
+      } catch (Error e) {} catch (Exception x) {};
+      console=null;
+    }
+    
+  }
 
 }
\ No newline at end of file
index 63c1ca7..4bee84c 100644 (file)
@@ -138,4 +138,17 @@ public class ExtJmol extends JalviewJmolBinding
     // TODO Auto-generated method stub
     return null;
   }
+  @Override
+  protected void releaseUIResources()
+  {
+    ap = null;
+    if (console!=null) {
+      try {
+        console.setVisible(false);
+      } catch (Error e) {} catch (Exception x) {};
+      console=null;
+    }
+    
+  }
+
 }
index 916579f..3bac3bc 100644 (file)
@@ -43,7 +43,8 @@ import org.jmol.viewer.Viewer;
 import jalview.schemes.*;
 
 public abstract class JalviewJmolBinding implements StructureListener,
-        JmolStatusListener, SequenceStructureBinding, JmolSelectionListener, ComponentListener
+        JmolStatusListener, SequenceStructureBinding,
+        JmolSelectionListener, ComponentListener
 
 {
   /**
@@ -79,6 +80,7 @@ public abstract class JalviewJmolBinding implements StructureListener,
   Vector atomsPicked = new Vector();
 
   public Vector chainNames;
+
   Hashtable chainFile;
 
   /**
@@ -212,8 +214,8 @@ public abstract class JalviewJmolBinding implements StructureListener,
         mlength = lbl.indexOf(":", p);
       } while (p < mlength && mlength < (lbl.length() - 2));
       // TODO: lookup each pdb id and recover proper model number for it.
-      cmd.append(":" +  lbl.substring(mlength + 1) + " /"
-              + (1+getModelNum((String)chainFile.get(lbl))) + " or ");
+      cmd.append(":" + lbl.substring(mlength + 1) + " /"
+              + (1 + getModelNum((String) chainFile.get(lbl))) + " or ");
     }
     if (cmd.length() > 0)
       cmd.setLength(cmd.length() - 4);
@@ -231,8 +233,15 @@ public abstract class JalviewJmolBinding implements StructureListener,
     viewer.setJmolStatusListener(null);
     lastCommand = null;
     viewer = null;
+    releaseUIResources();
   }
 
+  /**
+   * called by JalviewJmolbinding after closeViewer is called - release any
+   * resources and references so they can be garbage collected.
+   */
+  protected abstract void releaseUIResources();
+
   public void colourByChain()
   {
     colourBySequence = false;
@@ -545,7 +554,7 @@ public abstract class JalviewJmolBinding implements StructureListener,
 
               Color col = sr.getResidueBoxColour(sequence[pdbfnum][s], r);
 
-              if (showFeatures && fr!=null)
+              if (showFeatures && fr != null)
                 col = fr.findFeatureColour(col, sequence[pdbfnum][s], r);
               String newSelcom = (mapping[m].getChain() != " " ? ":"
                       + mapping[m].getChain() : "")
@@ -1319,7 +1328,7 @@ public abstract class JalviewJmolBinding implements StructureListener,
    * @param codeBase
    * @param commandOptions
    */
-  public void allocateViewer(Component renderPanel, boolean jmolfileio,
+  public void allocateViewer(Container renderPanel, boolean jmolfileio,
           String htmlName, URL documentBase, URL codeBase,
           String commandOptions)
   {
@@ -1342,7 +1351,7 @@ public abstract class JalviewJmolBinding implements StructureListener,
    * @param buttonsToShow
    *          - buttons to show on the console, in ordr
    */
-  public void allocateViewer(Component renderPanel, boolean jmolfileio,
+  public void allocateViewer(Container renderPanel, boolean jmolfileio,
           String htmlName, URL documentBase, URL codeBase,
           String commandOptions, final Container consolePanel,
           String buttonsToShow)
@@ -1356,9 +1365,8 @@ public abstract class JalviewJmolBinding implements StructureListener,
     if (consolePanel != null)
     {
       consolePanel.addComponentListener(this);
-      
-    }
 
+    }
 
   }
 
@@ -1367,30 +1375,29 @@ public abstract class JalviewJmolBinding implements StructureListener,
 
   protected org.jmol.api.JmolAppConsoleInterface console = null;
 
-@Override
-public void componentResized(ComponentEvent e)
-{
-  
-}
+  @Override
+  public void componentResized(ComponentEvent e)
+  {
 
-@Override
-public void componentMoved(ComponentEvent e)
-{
-  
-}
+  }
 
-@Override
-public void componentShown(ComponentEvent e)
-{
-  showConsole(true);
-}
+  @Override
+  public void componentMoved(ComponentEvent e)
+  {
 
-@Override
-public void componentHidden(ComponentEvent e)
-{
-  showConsole(false);
-}
+  }
 
+  @Override
+  public void componentShown(ComponentEvent e)
+  {
+    showConsole(true);
+  }
+
+  @Override
+  public void componentHidden(ComponentEvent e)
+  {
+    showConsole(false);
+  }
 
   public void setLoadingFromArchive(boolean loadingFromArchive)
   {
index 1b0a5cb..7af2cfb 100644 (file)
@@ -414,6 +414,7 @@ public class AppJmol extends GStructureViewer implements Runnable,
   void closeViewer()
   {
     jmb.closeViewer();
+    
     // TODO: check for memory leaks where instance isn't finalised because jmb
     // holds a reference to the window
     jmb = null;
index 5280900..f051838 100644 (file)
@@ -174,4 +174,17 @@ public class AppJmolBinding extends jalview.ext.jmol.JalviewJmolBinding
   {
     return new AppConsole(viewer, consolePanel, buttonsToShow);
   }
+
+  @Override
+  protected void releaseUIResources()
+  {
+    appJmolWindow = null;
+    if (console!=null) {
+      try {
+        console.setVisible(false);
+      } catch (Error e) {} catch (Exception x) {};
+      console=null;
+    }
+    
+  }
 }
\ No newline at end of file
index 88416aa..8563793 100755 (executable)
@@ -964,7 +964,7 @@ and any path to a file to save to the file]]></string>
                                                                <string><![CDATA[664]]></string>
                                                        </property>
                                                        <property name="sourceName">
-                                                               <string><![CDATA[Jmol-12.1.11_dev.jar]]></string>
+                                                               <string><![CDATA[Jmol-12.1.13.jar]]></string>
                                                        </property>
                                                        <property name="overrideUnixPermissions">
                                                                <boolean>false</boolean>
@@ -982,7 +982,7 @@ and any path to a file to save to the file]]></string>
                                                                <boolean>true</boolean>
                                                        </property>
                                                        <property name="destinationName">
-                                                               <string><![CDATA[Jmol-12.1.5.jar]]></string>
+                                                               <string><![CDATA[Jmol-12.1.13.jar]]></string>
                                                        </property>
                                                        <property name="fileSize">
                                                                <long>5898736</long>