new constructors for setting IDs
authorjprocter <Jim Procter>
Wed, 12 Nov 2008 17:00:21 +0000 (17:00 +0000)
committerjprocter <Jim Procter>
Wed, 12 Nov 2008 17:00:21 +0000 (17:00 +0000)
src/jalview/gui/AppJmol.java

index 3a87f8c..32fc85f 100644 (file)
@@ -74,6 +74,11 @@ public class AppJmol extends GStructureViewer implements StructureListener,
   public AppJmol(String file, String id, SequenceI[] seq,
           AlignmentPanel ap, String loadStatus, Rectangle bounds)
   {
+    this(file, id, seq, ap, loadStatus, bounds, null);
+  }
+  public AppJmol(String file, String id, SequenceI[] seq,
+            AlignmentPanel ap, String loadStatus, Rectangle bounds, String viewid)
+  {
     loadingFromArchive = true;
     pdbentry = new PDBEntry();
     pdbentry.setFile(file);
@@ -84,7 +89,7 @@ public class AppJmol extends GStructureViewer implements StructureListener,
     this.setBounds(bounds);
     colourBySequence = false;
     seqColour.setSelected(false);
-
+    viewId = viewid;
     // jalview.gui.Desktop.addInternalFrame(this, "Loading File",
     // bounds.width,bounds.height);
 
@@ -968,5 +973,14 @@ public class AppJmol extends GStructureViewer implements StructureListener,
       }
     }
   }
+  String viewId=null;
+  public String getViewId()
+  {
+    if (viewId==null)
+    {
+      viewId=System.currentTimeMillis()+"."+this.hashCode();
+    }
+    return viewId;
+  }
 
 }