From: amwaterhouse Date: Wed, 22 Nov 2006 14:58:30 +0000 (+0000) Subject: View name X-Git-Tag: Release_2_2~56 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=afba2b4617d752fcf30b8c4e018aaeb7f4e17336;p=jalview.git View name --- diff --git a/src/jalview/appletgui/AlignFrame.java b/src/jalview/appletgui/AlignFrame.java index 04d2045..afc103e 100755 --- a/src/jalview/appletgui/AlignFrame.java +++ b/src/jalview/appletgui/AlignFrame.java @@ -723,7 +723,10 @@ public void itemStateChanged(ItemEvent evt) public void closeMenuItem_actionPerformed() { - PaintRefresher.components.remove(viewport.alignment); + PaintRefresher.RemoveComponent(alignPanel); + PaintRefresher.RemoveComponent(alignPanel.seqPanel.seqCanvas); + PaintRefresher.RemoveComponent(alignPanel.idPanel.idCanvas); + if(PaintRefresher.components.size()==0 && viewport.applet==null) System.exit(0); @@ -1337,11 +1340,9 @@ public void itemStateChanged(ItemEvent evt) else newal = new Alignment(viewport.alignment.getSequencesArray()); - - AlignFrame newaf = new AlignFrame(newal, viewport.applet, - this.getTitle()+" (New View)", + "", false); newaf.viewport.sequenceSetID = alignPanel.av.getSequenceSetId(); @@ -1354,6 +1355,25 @@ public void itemStateChanged(ItemEvent evt) PaintRefresher.Register(newaf.alignPanel.seqPanel.seqCanvas, newaf.alignPanel.av.getSequenceSetId()); + Vector comps = (Vector)PaintRefresher.components.get(viewport.getSequenceSetId()); + int viewSize = -1; + for (int i = 0; i < comps.size(); i++) + { + if (comps.elementAt(i) instanceof AlignmentPanel) + viewSize++; + } + + StringBuffer title = new StringBuffer(this.getTitle()); + if (title.indexOf("(View") > -1) + title.setLength(title.indexOf("(View")); + + title.append("(View "); + title.append(viewSize); + title.append(")"); + + newaf.setTitle(title.toString()); + + newaf.viewport.historyList = viewport.historyList; newaf.viewport.redoList = viewport.redoList;