Rename AppJMol to AppJmol - also AppJmol works with independant sequence sets
authoramwaterhouse <Andrew Waterhouse>
Fri, 4 May 2007 13:32:23 +0000 (13:32 +0000)
committeramwaterhouse <Andrew Waterhouse>
Fri, 4 May 2007 13:32:23 +0000 (13:32 +0000)
src/jalview/gui/Jalview2XML.java
src/jalview/gui/PopupMenu.java
src/jalview/gui/ScriptWindow.java
src/jalview/gui/UserDefinedColours.java

index 198db44..16d7bd5 100755 (executable)
@@ -351,14 +351,14 @@ public class Jalview2XML
           pdb.setId(entry.getId());
           pdb.setType(entry.getType());
 
-          AppJMol jmol;
+          AppJmol jmol;
           //This must have been loaded, is it still visible?
           JInternalFrame[] frames = Desktop.desktop.getAllFrames();
           for (int f = frames.length - 1; f > -1; f--)
           {
-            if (frames[f] instanceof AppJMol)
+            if (frames[f] instanceof AppJmol)
             {
-              jmol = (AppJMol) frames[f];
+              jmol = (AppJmol) frames[f];
               if (!jmol.pdbentry.getId().equals(entry.getId()))
                 continue;
 
@@ -1884,7 +1884,23 @@ public class Jalview2XML
               int width = ids[p].getStructureState(s).getWidth();
               int height = ids[p].getStructureState(s).getHeight();
 
-              java.awt.Component comp = Desktop.desktop.getComponentAt(x, y);
+              java.awt.Component comp = null;
+
+              JInternalFrame [] frames = Desktop.desktop.getAllFrames();
+              for(int f=0; f<frames.length; f++)
+              {
+                if(frames[f] instanceof AppJmol)
+                {
+                  if(frames[f].getWidth()==width && frames[f].getHeight()==height)
+                  {
+                    comp = frames[f];
+                    break;
+                  }
+                }
+              }
+
+
+              Desktop.desktop.getComponentAt(x, y);
 
               String pdbFile = loadPDBFile(file, ids[p].getId());
 
@@ -1892,8 +1908,8 @@ public class Jalview2XML
                   {
                   al.getSequenceAt(i)};
 
-              if (comp == null ||
-                  (comp.getWidth() != width && comp.getHeight() != height))
+
+              if (comp == null)
               {
                 String state = ids[p].getStructureState(s).getContent();
 
@@ -1904,7 +1920,7 @@ public class Jalview2XML
                 newFileLoc.append(state.substring(
                     state.indexOf("\"", state.indexOf("load \"") + 6)));
 
-                new AppJMol(pdbFile,
+                new AppJmol(pdbFile,
                             ids[p].getId(),
                             seq,
                             af.alignPanel,
@@ -1918,7 +1934,7 @@ public class Jalview2XML
                     .setMapping(seq, null, pdbFile,
                                 jalview.io.AppletFormatAdapter.FILE);
 
-                ( (AppJMol) comp).addSequence(seq);
+                ( (AppJmol) comp).addSequence(seq);
               }
             }
           }
index 75dfce2..10a7f92 100755 (executable)
@@ -189,7 +189,7 @@ public class PopupMenu
               SequenceI [] seqs2 = new SequenceI[seqs.size()];\r
               seqs.toArray(seqs2);\r
 \r
-              new AppJMol(pdb, seqs2, null, ap);\r
+              new AppJmol(pdb, seqs2, null, ap);\r
             }\r
           });\r
           viewStructureMenu.add(menuItem);\r
index fcbf261..8e69584 100644 (file)
@@ -51,9 +51,9 @@ public final class ScriptWindow extends JPanel
   private JButton historyButton;\r
   private JButton stateButton;\r
    JmolViewer viewer;\r
-  AppJMol appJmol;\r
+  AppJmol appJmol;\r
 \r
-  public ScriptWindow(AppJMol appJmol)\r
+  public ScriptWindow(AppJmol appJmol)\r
   {\r
     this.viewer = appJmol.viewer;\r
     this.appJmol = appJmol;\r
index d3916ab..133dcaf 100755 (executable)
@@ -45,7 +45,7 @@ public class UserDefinedColours
   Vector selectedButtons;\r
   ColourSchemeI oldColourScheme;\r
   JInternalFrame frame;\r
-  AppJMol jmol;\r
+  AppJmol jmol;\r
   Vector upperCaseButtons;\r
   Vector lowerCaseButtons;\r
 \r
@@ -95,7 +95,7 @@ public class UserDefinedColours
     showFrame();\r
   }\r
 \r
-  public UserDefinedColours(AppJMol jmol, ColourSchemeI oldcs)\r
+  public UserDefinedColours(AppJmol jmol, ColourSchemeI oldcs)\r
   {\r
     super();\r
     this.jmol = jmol;\r