View name
authoramwaterhouse <Andrew Waterhouse>
Wed, 22 Nov 2006 14:58:30 +0000 (14:58 +0000)
committeramwaterhouse <Andrew Waterhouse>
Wed, 22 Nov 2006 14:58:30 +0000 (14:58 +0000)
src/jalview/appletgui/AlignFrame.java

index 04d2045..afc103e 100755 (executable)
@@ -723,7 +723,10 @@ public void itemStateChanged(ItemEvent evt)
 \r
   public void closeMenuItem_actionPerformed()\r
   {\r
-    PaintRefresher.components.remove(viewport.alignment);\r
+    PaintRefresher.RemoveComponent(alignPanel);\r
+    PaintRefresher.RemoveComponent(alignPanel.seqPanel.seqCanvas);\r
+    PaintRefresher.RemoveComponent(alignPanel.idPanel.idCanvas);\r
+\r
     if(PaintRefresher.components.size()==0 && viewport.applet==null)\r
       System.exit(0);\r
 \r
@@ -1337,11 +1340,9 @@ public void itemStateChanged(ItemEvent evt)
     else\r
       newal = new Alignment(viewport.alignment.getSequencesArray());\r
 \r
-\r
-\r
     AlignFrame newaf = new AlignFrame(newal,\r
                                       viewport.applet,\r
-                                      this.getTitle()+" (New View)",\r
+                                      "",\r
                                       false);\r
 \r
     newaf.viewport.sequenceSetID = alignPanel.av.getSequenceSetId();\r
@@ -1354,6 +1355,25 @@ public void itemStateChanged(ItemEvent evt)
     PaintRefresher.Register(newaf.alignPanel.seqPanel.seqCanvas,\r
                             newaf.alignPanel.av.getSequenceSetId());\r
 \r
+    Vector comps = (Vector)PaintRefresher.components.get(viewport.getSequenceSetId());\r
+    int viewSize = -1;\r
+    for (int i = 0; i < comps.size(); i++)\r
+    {\r
+      if (comps.elementAt(i) instanceof AlignmentPanel)\r
+        viewSize++;\r
+    }\r
+\r
+    StringBuffer title = new StringBuffer(this.getTitle());\r
+    if (title.indexOf("(View") > -1)\r
+      title.setLength(title.indexOf("(View"));\r
+\r
+    title.append("(View ");\r
+    title.append(viewSize);\r
+    title.append(")");\r
+\r
+    newaf.setTitle(title.toString());\r
+\r
+\r
     newaf.viewport.historyList = viewport.historyList;\r
     newaf.viewport.redoList = viewport.redoList;\r
 \r