2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8)
3 * Copyright (C) 2012 J Procter, AM Waterhouse, LM Lui, J Engelhardt, G Barton, M Clamp, S Searle
5 * This file is part of Jalview.
7 * Jalview is free software: you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
11 * Jalview is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty
13 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 * PURPOSE. See the GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.
23 import java.awt.event.*;
27 import jalview.analysis.*;
28 import jalview.commands.*;
29 import jalview.datamodel.*;
31 import jalview.schemes.*;
32 import jalview.util.GroupUrlLink;
33 import jalview.util.GroupUrlLink.UrlStringTooLongException;
34 import jalview.util.UrlLink;
40 * @version $Revision: 1.118 $
42 public class PopupMenu extends JPopupMenu
44 JMenu groupMenu = new JMenu();
46 JMenuItem groupName = new JMenuItem();
48 protected JRadioButtonMenuItem clustalColour = new JRadioButtonMenuItem();
50 protected JRadioButtonMenuItem zappoColour = new JRadioButtonMenuItem();
52 protected JRadioButtonMenuItem taylorColour = new JRadioButtonMenuItem();
54 protected JRadioButtonMenuItem hydrophobicityColour = new JRadioButtonMenuItem();
56 protected JRadioButtonMenuItem helixColour = new JRadioButtonMenuItem();
58 protected JRadioButtonMenuItem strandColour = new JRadioButtonMenuItem();
60 protected JRadioButtonMenuItem turnColour = new JRadioButtonMenuItem();
62 protected JRadioButtonMenuItem buriedColour = new JRadioButtonMenuItem();
64 protected JCheckBoxMenuItem abovePIDColour = new JCheckBoxMenuItem();
66 protected JRadioButtonMenuItem userDefinedColour = new JRadioButtonMenuItem();
68 protected JRadioButtonMenuItem PIDColour = new JRadioButtonMenuItem();
70 protected JRadioButtonMenuItem BLOSUM62Colour = new JRadioButtonMenuItem();
72 protected JRadioButtonMenuItem purinePyrimidineColour = new JRadioButtonMenuItem();
74 // protected JRadioButtonMenuItem covariationColour = new
75 // JRadioButtonMenuItem();
77 JRadioButtonMenuItem noColourmenuItem = new JRadioButtonMenuItem();
79 protected JCheckBoxMenuItem conservationMenuItem = new JCheckBoxMenuItem();
83 JMenu sequenceMenu = new JMenu();
85 JMenuItem sequenceName = new JMenuItem();
87 JMenuItem sequenceDetails = new JMenuItem();
89 JMenuItem sequenceSelDetails = new JMenuItem();
93 JMenuItem unGroupMenuItem = new JMenuItem();
95 JMenuItem outline = new JMenuItem();
97 JRadioButtonMenuItem nucleotideMenuItem = new JRadioButtonMenuItem();
99 JMenu colourMenu = new JMenu();
101 JCheckBoxMenuItem showBoxes = new JCheckBoxMenuItem();
103 JCheckBoxMenuItem showText = new JCheckBoxMenuItem();
105 JCheckBoxMenuItem showColourText = new JCheckBoxMenuItem();
107 JCheckBoxMenuItem displayNonconserved = new JCheckBoxMenuItem();
109 JMenu editMenu = new JMenu();
111 JMenuItem cut = new JMenuItem();
113 JMenuItem copy = new JMenuItem();
115 JMenuItem upperCase = new JMenuItem();
117 JMenuItem lowerCase = new JMenuItem();
119 JMenuItem toggle = new JMenuItem();
121 JMenu pdbMenu = new JMenu();
123 JMenuItem pdbFromFile = new JMenuItem();
125 JMenuItem enterPDB = new JMenuItem();
127 JMenuItem discoverPDB = new JMenuItem();
129 JMenu outputMenu = new JMenu();
131 JMenuItem sequenceFeature = new JMenuItem();
133 JMenuItem textColour = new JMenuItem();
135 JMenu jMenu1 = new JMenu();
137 JMenu structureMenu = new JMenu();
139 JMenu viewStructureMenu = new JMenu();
141 // JMenu colStructureMenu = new JMenu();
142 JMenuItem editSequence = new JMenuItem();
144 // JMenuItem annotationMenuItem = new JMenuItem();
146 JMenu groupLinksMenu;
149 * Creates a new PopupMenu object.
156 public PopupMenu(final AlignmentPanel ap, Sequence seq, Vector links)
158 this(ap, seq, links, null);
168 public PopupMenu(final AlignmentPanel ap, final SequenceI seq,
169 Vector links, Vector groupLinks)
171 // /////////////////////////////////////////////////////////
172 // If this is activated from the sequence panel, the user may want to
173 // edit or annotate a particular residue. Therefore display the residue menu
175 // If from the IDPanel, we must display the sequence menu
176 // ////////////////////////////////////////////////////////
180 ButtonGroup colours = new ButtonGroup();
181 colours.add(noColourmenuItem);
182 colours.add(clustalColour);
183 colours.add(zappoColour);
184 colours.add(taylorColour);
185 colours.add(hydrophobicityColour);
186 colours.add(helixColour);
187 colours.add(strandColour);
188 colours.add(turnColour);
189 colours.add(buriedColour);
190 colours.add(abovePIDColour);
191 colours.add(userDefinedColour);
192 colours.add(PIDColour);
193 colours.add(BLOSUM62Colour);
194 colours.add(purinePyrimidineColour);
195 // colours.add(covariationColour);
197 for (int i = 0; i < jalview.io.FormatAdapter.WRITEABLE_FORMATS.length; i++)
199 JMenuItem item = new JMenuItem(
200 jalview.io.FormatAdapter.WRITEABLE_FORMATS[i]);
202 item.addActionListener(new java.awt.event.ActionListener()
204 public void actionPerformed(ActionEvent e)
206 outputText_actionPerformed(e);
210 outputMenu.add(item);
216 } catch (Exception e)
224 sequenceMenu.setText(sequence.getName());
226 if (seq.getDatasetSequence().getPDBId() != null
227 && seq.getDatasetSequence().getPDBId().size() > 0)
229 java.util.Enumeration e = seq.getDatasetSequence().getPDBId()
232 while (e.hasMoreElements())
234 final PDBEntry pdb = (PDBEntry) e.nextElement();
236 menuItem = new JMenuItem();
237 menuItem.setText(pdb.getId());
238 menuItem.addActionListener(new java.awt.event.ActionListener()
240 public void actionPerformed(ActionEvent e)
242 // TODO re JAL-860: optionally open dialog or provide a menu entry
243 // allowing user to open just one structure per sequence
244 new AppJmol(pdb, ap.av.collateForPDB(new PDBEntry[]
245 { pdb })[0], null, ap);
246 // new PDBViewer(pdb, seqs2, null, ap, AppletFormatAdapter.FILE);
250 viewStructureMenu.add(menuItem);
253 * menuItem = new JMenuItem(); menuItem.setText(pdb.getId());
254 * menuItem.addActionListener(new java.awt.event.ActionListener() {
255 * public void actionPerformed(ActionEvent e) {
256 * colourByStructure(pdb.getId()); } });
257 * colStructureMenu.add(menuItem);
263 if (ap.av.getAlignment().isNucleotide() == false)
265 structureMenu.remove(viewStructureMenu);
267 // structureMenu.remove(colStructureMenu);
270 if (ap.av.getAlignment().isNucleotide() == true)
272 AlignmentAnnotation[] aa = ap.av.getAlignment()
273 .getAlignmentAnnotation();
274 for (int i = 0; i < aa.length; i++)
276 if (aa[i].getRNAStruc() != null)
278 final String rnastruc = aa[i].getRNAStruc();
279 final String structureLine = aa[i].label;
280 menuItem = new JMenuItem();
281 menuItem.setText("2D RNA " + structureLine);
282 menuItem.addActionListener(new java.awt.event.ActionListener()
284 public void actionPerformed(ActionEvent e)
286 new AppVarna(structureLine, seq, seq.getSequenceAsString(),
287 rnastruc, seq.getName(), ap);
290 viewStructureMenu.add(menuItem);
294 // SequenceFeatures[] test = seq.getSequenceFeatures();
296 if (seq.getAnnotation() != null)
298 AlignmentAnnotation seqAnno[] = seq.getAnnotation();
299 for (int i = 0; i < seqAnno.length; i++)
301 if (seqAnno[i].getRNAStruc() != null)
303 final String rnastruc = seqAnno[i].getRNAStruc();
305 // TODO: make rnastrucF a bit more nice
306 menuItem = new JMenuItem();
307 menuItem.setText("2D RNA - " + seq.getName());
308 menuItem.addActionListener(new java.awt.event.ActionListener()
310 public void actionPerformed(ActionEvent e)
312 // TODO: VARNA does'nt print gaps in the sequence
313 new AppVarna(seq.getName() + " structure", seq, seq
314 .getSequenceAsString(), rnastruc, seq.getName(),
318 viewStructureMenu.add(menuItem);
325 menuItem = new JMenuItem("Hide Sequences");
326 menuItem.addActionListener(new java.awt.event.ActionListener()
328 public void actionPerformed(ActionEvent e)
330 hideSequences(false);
335 if (ap.av.getSelectionGroup() != null
336 && ap.av.getSelectionGroup().getSize() > 1)
338 menuItem = new JMenuItem("Represent Group with " + seq.getName());
339 menuItem.addActionListener(new java.awt.event.ActionListener()
341 public void actionPerformed(ActionEvent e)
346 sequenceMenu.add(menuItem);
349 if (ap.av.hasHiddenRows())
351 final int index = ap.av.getAlignment().findIndex(seq);
353 if (ap.av.adjustForHiddenSeqs(index)
354 - ap.av.adjustForHiddenSeqs(index - 1) > 1)
356 menuItem = new JMenuItem("Reveal Sequences");
357 menuItem.addActionListener(new ActionListener()
359 public void actionPerformed(ActionEvent e)
361 ap.av.showSequence(index);
362 if (ap.overviewPanel != null)
364 ap.overviewPanel.updateOverviewImage();
372 // for the case when no sequences are even visible
373 if (ap.av.hasHiddenRows())
376 menuItem = new JMenuItem("Reveal All");
377 menuItem.addActionListener(new ActionListener()
379 public void actionPerformed(ActionEvent e)
381 ap.av.showAllHiddenSeqs();
382 if (ap.overviewPanel != null)
384 ap.overviewPanel.updateOverviewImage();
394 SequenceGroup sg = ap.av.getSelectionGroup();
396 if (sg != null && sg.getSize() > 0)
398 groupName.setText("Name: " + sg.getName());
399 groupName.setText("Edit name and description of current group.");
401 if (sg.cs instanceof ZappoColourScheme)
403 zappoColour.setSelected(true);
405 else if (sg.cs instanceof TaylorColourScheme)
407 taylorColour.setSelected(true);
409 else if (sg.cs instanceof PIDColourScheme)
411 PIDColour.setSelected(true);
413 else if (sg.cs instanceof Blosum62ColourScheme)
415 BLOSUM62Colour.setSelected(true);
417 else if (sg.cs instanceof UserColourScheme)
419 userDefinedColour.setSelected(true);
421 else if (sg.cs instanceof HydrophobicColourScheme)
423 hydrophobicityColour.setSelected(true);
425 else if (sg.cs instanceof HelixColourScheme)
427 helixColour.setSelected(true);
429 else if (sg.cs instanceof StrandColourScheme)
431 strandColour.setSelected(true);
433 else if (sg.cs instanceof TurnColourScheme)
435 turnColour.setSelected(true);
437 else if (sg.cs instanceof BuriedColourScheme)
439 buriedColour.setSelected(true);
441 else if (sg.cs instanceof ClustalxColourScheme)
443 clustalColour.setSelected(true);
445 else if (sg.cs instanceof PurinePyrimidineColourScheme)
447 purinePyrimidineColour.setSelected(true);
450 * else if (sg.cs instanceof CovariationColourScheme) {
451 * covariationColour.setSelected(true); }
455 noColourmenuItem.setSelected(true);
458 if (sg.cs != null && sg.cs.conservationApplied())
460 conservationMenuItem.setSelected(true);
462 displayNonconserved.setSelected(sg.getShowNonconserved());
463 showText.setSelected(sg.getDisplayText());
464 showColourText.setSelected(sg.getColourText());
465 showBoxes.setSelected(sg.getDisplayBoxes());
466 // add any groupURLs to the groupURL submenu and make it visible
467 if (groupLinks != null && groupLinks.size() > 0)
469 buildGroupURLMenu(sg, groupLinks);
471 // Add a 'show all structures' for the current selection
472 Hashtable<String, PDBEntry> pdbe = new Hashtable<String, PDBEntry>();
473 SequenceI sqass = null;
474 for (SequenceI sq : ap.av.getSequenceSelection())
476 Vector<PDBEntry> pes = (Vector<PDBEntry>) sq.getDatasetSequence()
480 for (PDBEntry pe : pes)
482 pdbe.put(pe.getId(), pe);
492 final PDBEntry[] pe = pdbe.values().toArray(
493 new PDBEntry[pdbe.size()]);
494 final JMenuItem gpdbview;
495 if (pdbe.size() == 1)
497 structureMenu.add(gpdbview = new JMenuItem("View structure for "
498 + sqass.getDisplayId(false)));
502 structureMenu.add(gpdbview = new JMenuItem("View all "
503 + pdbe.size() + " structures."));
505 gpdbview.setToolTipText("Open a new Jmol view with all structures associated with the current selection and superimpose them using the alignment.");
506 gpdbview.addActionListener(new ActionListener()
510 public void actionPerformed(ActionEvent e)
512 new AppJmol(ap, pe, ap.av.collateForPDB(pe));
519 groupMenu.setVisible(false);
520 editMenu.setVisible(false);
523 if (!ap.av.getAlignment().getGroups().contains(sg))
525 unGroupMenuItem.setVisible(false);
530 sequenceMenu.setVisible(false);
531 structureMenu.setVisible(false);
534 if (links != null && links.size() > 0)
537 JMenu linkMenu = new JMenu("Link");
538 Vector linkset = new Vector();
539 for (int i = 0; i < links.size(); i++)
541 String link = links.elementAt(i).toString();
542 UrlLink urlLink = null;
545 urlLink = new UrlLink(link);
546 } catch (Exception foo)
548 jalview.bin.Cache.log.error("Exception for URLLink '" + link
553 if (!urlLink.isValid())
555 jalview.bin.Cache.log.error(urlLink.getInvalidMessage());
558 final String label = urlLink.getLabel();
559 if (seq != null && urlLink.isDynamic())
562 // collect matching db-refs
563 DBRefEntry[] dbr = jalview.util.DBRefUtils.selectRefs(
564 seq.getDBRef(), new String[]
565 { urlLink.getTarget() });
566 // collect id string too
567 String id = seq.getName();
568 String descr = seq.getDescription();
569 if (descr != null && descr.length() < 1)
576 for (int r = 0; r < dbr.length; r++)
578 if (id != null && dbr[r].getAccessionId().equals(id))
580 // suppress duplicate link creation for the bare sequence ID
581 // string with this link
584 // create Bare ID link for this RUL
585 String[] urls = urlLink.makeUrls(dbr[r].getAccessionId(),
589 for (int u = 0; u < urls.length; u += 2)
591 if (!linkset.contains(urls[u] + "|" + urls[u + 1]))
593 linkset.addElement(urls[u] + "|" + urls[u + 1]);
594 addshowLink(linkMenu, label + "|" + urls[u],
603 // create Bare ID link for this RUL
604 String[] urls = urlLink.makeUrls(id, true);
607 for (int u = 0; u < urls.length; u += 2)
609 if (!linkset.contains(urls[u] + "|" + urls[u + 1]))
611 linkset.addElement(urls[u] + "|" + urls[u + 1]);
612 addshowLink(linkMenu, label, urls[u + 1]);
617 // Create urls from description but only for URL links which are regex
619 if (descr != null && urlLink.getRegexReplace() != null)
621 // create link for this URL from description where regex matches
622 String[] urls = urlLink.makeUrls(descr, true);
625 for (int u = 0; u < urls.length; u += 2)
627 if (!linkset.contains(urls[u] + "|" + urls[u + 1]))
629 linkset.addElement(urls[u] + "|" + urls[u + 1]);
630 addshowLink(linkMenu, label, urls[u + 1]);
638 if (!linkset.contains(label + "|" + urlLink.getUrl_prefix()))
640 linkset.addElement(label + "|" + urlLink.getUrl_prefix());
641 // Add a non-dynamic link
642 addshowLink(linkMenu, label, urlLink.getUrl_prefix());
646 if (sequence != null)
648 sequenceMenu.add(linkMenu);
657 private void buildGroupURLMenu(SequenceGroup sg, Vector groupLinks)
660 // TODO: usability: thread off the generation of group url content so root
662 // sequence only URLs
663 // ID/regex match URLs
664 groupLinksMenu = new JMenu("Group Link");
665 JMenu[] linkMenus = new JMenu[]
666 { null, new JMenu("IDS"), new JMenu("Sequences"),
667 new JMenu("IDS and Sequences") }; // three types of url that might be
669 SequenceI[] seqs = ap.av.getSelectionAsNewSequence();
670 String[][] idandseqs = GroupUrlLink.formStrings(seqs);
671 Hashtable commonDbrefs = new Hashtable();
672 for (int sq = 0; sq < seqs.length; sq++)
675 int start = seqs[sq].findPosition(sg.getStartRes()), end = seqs[sq]
676 .findPosition(sg.getEndRes());
677 // just collect ids from dataset sequence
678 // TODO: check if IDs collected from selecton group intersects with the
679 // current selection, too
680 SequenceI sqi = seqs[sq];
681 while (sqi.getDatasetSequence() != null)
683 sqi = sqi.getDatasetSequence();
685 DBRefEntry[] dbr = sqi.getDBRef();
686 if (dbr != null && dbr.length > 0)
688 for (int d = 0; d < dbr.length; d++)
690 String src = dbr[d].getSource(); // jalview.util.DBRefUtils.getCanonicalName(dbr[d].getSource()).toUpperCase();
691 Object[] sarray = (Object[]) commonDbrefs.get(src);
694 sarray = new Object[2];
695 sarray[0] = new int[]
697 sarray[1] = new String[seqs.length];
699 commonDbrefs.put(src, sarray);
702 if (((String[]) sarray[1])[sq] == null)
705 || (dbr[d].getMap().locateMappedRange(start, end) != null))
707 ((String[]) sarray[1])[sq] = dbr[d].getAccessionId();
708 ((int[]) sarray[0])[0]++;
714 // now create group links for all distinct ID/sequence sets.
715 boolean addMenu = false; // indicates if there are any group links to give
717 for (int i = 0; i < groupLinks.size(); i++)
719 String link = groupLinks.elementAt(i).toString();
720 GroupUrlLink urlLink = null;
723 urlLink = new GroupUrlLink(link);
724 } catch (Exception foo)
726 jalview.bin.Cache.log.error("Exception for GroupURLLink '" + link
731 if (!urlLink.isValid())
733 jalview.bin.Cache.log.error(urlLink.getInvalidMessage());
736 final String label = urlLink.getLabel();
737 boolean usingNames = false;
738 // Now see which parts of the group apply for this URL
739 String ltarget = urlLink.getTarget(); // jalview.util.DBRefUtils.getCanonicalName(urlLink.getTarget());
740 Object[] idset = (Object[]) commonDbrefs.get(ltarget.toUpperCase());
741 String[] seqstr, ids; // input to makeUrl
744 int numinput = ((int[]) idset[0])[0];
745 String[] allids = ((String[]) idset[1]);
746 seqstr = new String[numinput];
747 ids = new String[numinput];
748 for (int sq = 0, idcount = 0; sq < seqs.length; sq++)
750 if (allids[sq] != null)
752 ids[idcount] = allids[sq];
753 seqstr[idcount++] = idandseqs[1][sq];
759 // just use the id/seq set
760 seqstr = idandseqs[1];
764 // and try and make the groupURL!
766 Object[] urlset = null;
769 urlset = urlLink.makeUrlStubs(ids, seqstr,
770 "FromJalview" + System.currentTimeMillis(), false);
771 } catch (UrlStringTooLongException e)
776 int type = urlLink.getGroupURLType() & 3;
777 // System.out.println(urlLink.getGroupURLType()
778 // +" "+((String[])urlset[3])[0]);
779 // first two bits ofurlLink type bitfield are sequenceids and sequences
780 // TODO: FUTURE: ensure the groupURL menu structure can be generalised
781 addshowLink(linkMenus[type], label
782 + (((type & 1) == 1) ? ("("
783 + (usingNames ? "Names" : ltarget) + ")") : ""),
790 groupLinksMenu = new JMenu("Group Links");
791 for (int m = 0; m < linkMenus.length; m++)
793 if (linkMenus[m] != null
794 && linkMenus[m].getMenuComponentCount() > 0)
796 groupLinksMenu.add(linkMenus[m]);
800 groupMenu.add(groupLinksMenu);
805 * add a show URL menu item to the given linkMenu
809 * - menu label string
813 private void addshowLink(JMenu linkMenu, String label, final String url)
815 JMenuItem item = new JMenuItem(label);
816 item.setToolTipText("open URL: " + url);
817 item.addActionListener(new java.awt.event.ActionListener()
819 public void actionPerformed(ActionEvent e)
821 new Thread(new Runnable()
837 * add a late bound groupURL item to the given linkMenu
841 * - menu label string
842 * @param urlgenerator
843 * GroupURLLink used to generate URL
845 * Object array returned from the makeUrlStubs function.
847 private void addshowLink(JMenu linkMenu, String label,
848 final GroupUrlLink urlgenerator, final Object[] urlstub)
850 JMenuItem item = new JMenuItem(label);
851 item.setToolTipText("open URL (" + urlgenerator.getUrl_prefix()
852 + "..) (" + urlgenerator.getNumberInvolved(urlstub) + " seqs)"); // TODO:
861 item.addActionListener(new java.awt.event.ActionListener()
863 public void actionPerformed(ActionEvent e)
865 new Thread(new Runnable()
872 showLink(urlgenerator.constructFrom(urlstub));
873 } catch (UrlStringTooLongException e)
891 private void jbInit() throws Exception
893 groupMenu.setText("Group");
894 groupMenu.setText("Selection");
895 groupName.setText("Name");
896 groupName.addActionListener(new java.awt.event.ActionListener()
898 public void actionPerformed(ActionEvent e)
900 groupName_actionPerformed();
903 sequenceMenu.setText("Sequence");
904 sequenceName.setText("Edit Name/Description");
905 sequenceName.addActionListener(new java.awt.event.ActionListener()
907 public void actionPerformed(ActionEvent e)
909 sequenceName_actionPerformed();
912 sequenceDetails.setText("Sequence Details ...");
913 sequenceDetails.addActionListener(new java.awt.event.ActionListener()
915 public void actionPerformed(ActionEvent e)
917 sequenceDetails_actionPerformed();
920 sequenceSelDetails.setText("Sequence Details ...");
922 .addActionListener(new java.awt.event.ActionListener()
924 public void actionPerformed(ActionEvent e)
926 sequenceSelectionDetails_actionPerformed();
929 PIDColour.setFocusPainted(false);
930 unGroupMenuItem.setText("Remove Group");
931 unGroupMenuItem.addActionListener(new java.awt.event.ActionListener()
933 public void actionPerformed(ActionEvent e)
935 unGroupMenuItem_actionPerformed();
939 outline.setText("Border colour");
940 outline.addActionListener(new java.awt.event.ActionListener()
942 public void actionPerformed(ActionEvent e)
944 outline_actionPerformed();
947 nucleotideMenuItem.setText("Nucleotide");
948 nucleotideMenuItem.addActionListener(new ActionListener()
950 public void actionPerformed(ActionEvent e)
952 nucleotideMenuItem_actionPerformed();
955 colourMenu.setText("Group Colour");
956 showBoxes.setText("Boxes");
957 showBoxes.setState(true);
958 showBoxes.addActionListener(new ActionListener()
960 public void actionPerformed(ActionEvent e)
962 showBoxes_actionPerformed();
965 showText.setText("Text");
966 showText.setState(true);
967 showText.addActionListener(new ActionListener()
969 public void actionPerformed(ActionEvent e)
971 showText_actionPerformed();
974 showColourText.setText("Colour Text");
975 showColourText.addActionListener(new ActionListener()
977 public void actionPerformed(ActionEvent e)
979 showColourText_actionPerformed();
982 displayNonconserved.setText("Show Nonconserved");
983 displayNonconserved.setState(true);
984 displayNonconserved.addActionListener(new ActionListener()
986 public void actionPerformed(ActionEvent e)
988 showNonconserved_actionPerformed();
991 editMenu.setText("Edit");
993 cut.addActionListener(new ActionListener()
995 public void actionPerformed(ActionEvent e)
997 cut_actionPerformed();
1000 upperCase.setText("To Upper Case");
1001 upperCase.addActionListener(new ActionListener()
1003 public void actionPerformed(ActionEvent e)
1008 copy.setText("Copy");
1009 copy.addActionListener(new ActionListener()
1011 public void actionPerformed(ActionEvent e)
1013 copy_actionPerformed();
1016 lowerCase.setText("To Lower Case");
1017 lowerCase.addActionListener(new ActionListener()
1019 public void actionPerformed(ActionEvent e)
1024 toggle.setText("Toggle Case");
1025 toggle.addActionListener(new ActionListener()
1027 public void actionPerformed(ActionEvent e)
1032 pdbMenu.setText("Associate Structure with Sequence");
1033 pdbFromFile.setText("From File");
1034 pdbFromFile.addActionListener(new ActionListener()
1036 public void actionPerformed(ActionEvent e)
1038 pdbFromFile_actionPerformed();
1041 enterPDB.setText("Enter PDB Id");
1042 enterPDB.addActionListener(new ActionListener()
1044 public void actionPerformed(ActionEvent e)
1046 enterPDB_actionPerformed();
1049 discoverPDB.setText("Discover PDB ids");
1050 discoverPDB.addActionListener(new ActionListener()
1052 public void actionPerformed(ActionEvent e)
1054 discoverPDB_actionPerformed();
1057 outputMenu.setText("Output to Textbox...");
1058 sequenceFeature.setText("Create Sequence Feature");
1059 sequenceFeature.addActionListener(new ActionListener()
1061 public void actionPerformed(ActionEvent e)
1063 sequenceFeature_actionPerformed();
1066 textColour.setText("Text Colour");
1067 textColour.addActionListener(new ActionListener()
1069 public void actionPerformed(ActionEvent e)
1071 textColour_actionPerformed();
1074 jMenu1.setText("Group");
1075 structureMenu.setText("Structure");
1076 viewStructureMenu.setText("View Structure");
1077 // colStructureMenu.setText("Colour By Structure");
1078 editSequence.setText("Edit Sequence...");
1079 editSequence.addActionListener(new ActionListener()
1081 public void actionPerformed(ActionEvent actionEvent)
1083 editSequence_actionPerformed(actionEvent);
1088 * annotationMenuItem.setText("By Annotation");
1089 * annotationMenuItem.addActionListener(new ActionListener() { public void
1090 * actionPerformed(ActionEvent actionEvent) {
1091 * annotationMenuItem_actionPerformed(actionEvent); } });
1093 groupMenu.add(sequenceSelDetails);
1096 this.add(structureMenu);
1097 groupMenu.add(editMenu);
1098 groupMenu.add(outputMenu);
1099 groupMenu.add(sequenceFeature);
1100 groupMenu.add(jMenu1);
1101 sequenceMenu.add(sequenceName);
1102 sequenceMenu.add(sequenceDetails);
1103 colourMenu.add(textColour);
1104 colourMenu.add(noColourmenuItem);
1105 colourMenu.add(clustalColour);
1106 colourMenu.add(BLOSUM62Colour);
1107 colourMenu.add(PIDColour);
1108 colourMenu.add(zappoColour);
1109 colourMenu.add(taylorColour);
1110 colourMenu.add(hydrophobicityColour);
1111 colourMenu.add(helixColour);
1112 colourMenu.add(strandColour);
1113 colourMenu.add(turnColour);
1114 colourMenu.add(buriedColour);
1115 colourMenu.add(nucleotideMenuItem);
1116 if (ap.getAlignment().isNucleotide())
1118 colourMenu.add(purinePyrimidineColour);
1120 // colourMenu.add(covariationColour);
1121 colourMenu.add(userDefinedColour);
1123 if (jalview.gui.UserDefinedColours.getUserColourSchemes() != null)
1125 java.util.Enumeration userColours = jalview.gui.UserDefinedColours
1126 .getUserColourSchemes().keys();
1128 while (userColours.hasMoreElements())
1130 JMenuItem item = new JMenuItem(userColours.nextElement().toString());
1131 item.addActionListener(new ActionListener()
1133 public void actionPerformed(ActionEvent evt)
1135 userDefinedColour_actionPerformed(evt);
1138 colourMenu.add(item);
1142 colourMenu.addSeparator();
1143 colourMenu.add(abovePIDColour);
1144 colourMenu.add(conservationMenuItem);
1145 // colourMenu.add(annotationMenuItem);
1148 editMenu.add(editSequence);
1149 editMenu.add(upperCase);
1150 editMenu.add(lowerCase);
1151 editMenu.add(toggle);
1152 pdbMenu.add(pdbFromFile);
1153 pdbMenu.add(enterPDB);
1154 pdbMenu.add(discoverPDB);
1155 jMenu1.add(groupName);
1156 jMenu1.add(unGroupMenuItem);
1157 jMenu1.add(colourMenu);
1158 jMenu1.add(showBoxes);
1159 jMenu1.add(showText);
1160 jMenu1.add(showColourText);
1161 jMenu1.add(outline);
1162 jMenu1.add(displayNonconserved);
1163 structureMenu.add(pdbMenu);
1164 structureMenu.add(viewStructureMenu);
1165 // structureMenu.add(colStructureMenu);
1166 noColourmenuItem.setText("None");
1167 noColourmenuItem.addActionListener(new java.awt.event.ActionListener()
1169 public void actionPerformed(ActionEvent e)
1171 noColourmenuItem_actionPerformed();
1175 clustalColour.setText("Clustalx colours");
1176 clustalColour.addActionListener(new java.awt.event.ActionListener()
1178 public void actionPerformed(ActionEvent e)
1180 clustalColour_actionPerformed();
1183 zappoColour.setText("Zappo");
1184 zappoColour.addActionListener(new java.awt.event.ActionListener()
1186 public void actionPerformed(ActionEvent e)
1188 zappoColour_actionPerformed();
1191 taylorColour.setText("Taylor");
1192 taylorColour.addActionListener(new java.awt.event.ActionListener()
1194 public void actionPerformed(ActionEvent e)
1196 taylorColour_actionPerformed();
1199 hydrophobicityColour.setText("Hydrophobicity");
1200 hydrophobicityColour
1201 .addActionListener(new java.awt.event.ActionListener()
1203 public void actionPerformed(ActionEvent e)
1205 hydrophobicityColour_actionPerformed();
1208 helixColour.setText("Helix propensity");
1209 helixColour.addActionListener(new java.awt.event.ActionListener()
1211 public void actionPerformed(ActionEvent e)
1213 helixColour_actionPerformed();
1216 strandColour.setText("Strand propensity");
1217 strandColour.addActionListener(new java.awt.event.ActionListener()
1219 public void actionPerformed(ActionEvent e)
1221 strandColour_actionPerformed();
1224 turnColour.setText("Turn propensity");
1225 turnColour.addActionListener(new java.awt.event.ActionListener()
1227 public void actionPerformed(ActionEvent e)
1229 turnColour_actionPerformed();
1232 buriedColour.setText("Buried Index");
1233 buriedColour.addActionListener(new java.awt.event.ActionListener()
1235 public void actionPerformed(ActionEvent e)
1237 buriedColour_actionPerformed();
1240 abovePIDColour.setText("Above % Identity");
1241 abovePIDColour.addActionListener(new java.awt.event.ActionListener()
1243 public void actionPerformed(ActionEvent e)
1245 abovePIDColour_actionPerformed();
1248 userDefinedColour.setText("User Defined...");
1249 userDefinedColour.addActionListener(new java.awt.event.ActionListener()
1251 public void actionPerformed(ActionEvent e)
1253 userDefinedColour_actionPerformed(e);
1256 PIDColour.setText("Percentage Identity");
1257 PIDColour.addActionListener(new java.awt.event.ActionListener()
1259 public void actionPerformed(ActionEvent e)
1261 PIDColour_actionPerformed();
1264 BLOSUM62Colour.setText("BLOSUM62");
1265 BLOSUM62Colour.addActionListener(new java.awt.event.ActionListener()
1267 public void actionPerformed(ActionEvent e)
1269 BLOSUM62Colour_actionPerformed();
1272 purinePyrimidineColour.setText("Purine/Pyrimidine");
1273 purinePyrimidineColour
1274 .addActionListener(new java.awt.event.ActionListener()
1276 public void actionPerformed(ActionEvent e)
1278 purinePyrimidineColour_actionPerformed();
1282 * covariationColour.addActionListener(new java.awt.event.ActionListener() {
1283 * public void actionPerformed(ActionEvent e) {
1284 * covariationColour_actionPerformed(); } });
1287 conservationMenuItem.setText("Conservation");
1288 conservationMenuItem
1289 .addActionListener(new java.awt.event.ActionListener()
1291 public void actionPerformed(ActionEvent e)
1293 conservationMenuItem_actionPerformed();
1298 protected void sequenceSelectionDetails_actionPerformed()
1300 createSequenceDetailsReport(ap.av.getSequenceSelection());
1303 protected void sequenceDetails_actionPerformed()
1305 createSequenceDetailsReport(new SequenceI[]
1309 public void createSequenceDetailsReport(SequenceI[] sequences)
1311 CutAndPasteHtmlTransfer cap = new CutAndPasteHtmlTransfer();
1312 StringBuffer contents = new StringBuffer();
1313 for (SequenceI seq : sequences)
1315 contents.append("<p><h2>Annotation for " + seq.getDisplayId(true)
1317 new SequenceAnnotationReport(null)
1318 .createSequenceAnnotationReport(
1324 (ap.seqPanel.seqCanvas.fr != null) ? ap.seqPanel.seqCanvas.fr.minmax
1326 contents.append("</p>");
1328 cap.setText("<html>" + contents.toString() + "</html>");
1330 Desktop.instance.addInternalFrame(cap, "Sequence Details for "
1331 + (sequences.length == 1 ? sequences[0].getDisplayId(true)
1332 : "Selection"), 500, 400);
1336 protected void showNonconserved_actionPerformed()
1338 getGroup().setShowNonconserved(displayNonconserved.isSelected());
1343 * call to refresh view after settings change
1347 ap.updateAnnotation();
1348 ap.paintAlignment(true);
1350 PaintRefresher.Refresh(this, ap.av.getSequenceSetId());
1359 protected void clustalColour_actionPerformed()
1361 SequenceGroup sg = getGroup();
1362 sg.cs = new ClustalxColourScheme(sg, ap.av.getHiddenRepSequences());
1372 protected void zappoColour_actionPerformed()
1374 getGroup().cs = new ZappoColourScheme();
1384 protected void taylorColour_actionPerformed()
1386 getGroup().cs = new TaylorColourScheme();
1396 protected void hydrophobicityColour_actionPerformed()
1398 getGroup().cs = new HydrophobicColourScheme();
1408 protected void helixColour_actionPerformed()
1410 getGroup().cs = new HelixColourScheme();
1420 protected void strandColour_actionPerformed()
1422 getGroup().cs = new StrandColourScheme();
1432 protected void turnColour_actionPerformed()
1434 getGroup().cs = new TurnColourScheme();
1444 protected void buriedColour_actionPerformed()
1446 getGroup().cs = new BuriedColourScheme();
1456 public void nucleotideMenuItem_actionPerformed()
1458 getGroup().cs = new NucleotideColourScheme();
1462 protected void purinePyrimidineColour_actionPerformed()
1464 getGroup().cs = new PurinePyrimidineColourScheme();
1469 * protected void covariationColour_actionPerformed() { getGroup().cs = new
1470 * CovariationColourScheme(sequence.getAnnotation()[0]); refresh(); }
1478 protected void abovePIDColour_actionPerformed()
1480 SequenceGroup sg = getGroup();
1486 if (abovePIDColour.isSelected())
1488 sg.cs.setConsensus(AAFrequency.calculate(
1489 sg.getSequences(ap.av.getHiddenRepSequences()),
1490 sg.getStartRes(), sg.getEndRes() + 1));
1492 int threshold = SliderPanel.setPIDSliderSource(ap, sg.cs, getGroup()
1495 sg.cs.setThreshold(threshold, ap.av.getIgnoreGapsConsensus());
1497 SliderPanel.showPIDSlider();
1500 // remove PIDColouring
1502 sg.cs.setThreshold(0, ap.av.getIgnoreGapsConsensus());
1514 protected void userDefinedColour_actionPerformed(ActionEvent e)
1516 SequenceGroup sg = getGroup();
1518 if (e.getActionCommand().equals("User Defined..."))
1520 new UserDefinedColours(ap, sg);
1524 UserColourScheme udc = (UserColourScheme) UserDefinedColours
1525 .getUserColourSchemes().get(e.getActionCommand());
1538 protected void PIDColour_actionPerformed()
1540 SequenceGroup sg = getGroup();
1541 sg.cs = new PIDColourScheme();
1542 sg.cs.setConsensus(AAFrequency.calculate(
1543 sg.getSequences(ap.av.getHiddenRepSequences()),
1544 sg.getStartRes(), sg.getEndRes() + 1));
1554 protected void BLOSUM62Colour_actionPerformed()
1556 SequenceGroup sg = getGroup();
1558 sg.cs = new Blosum62ColourScheme();
1560 sg.cs.setConsensus(AAFrequency.calculate(
1561 sg.getSequences(ap.av.getHiddenRepSequences()),
1562 sg.getStartRes(), sg.getEndRes() + 1));
1573 protected void noColourmenuItem_actionPerformed()
1575 getGroup().cs = null;
1585 protected void conservationMenuItem_actionPerformed()
1587 SequenceGroup sg = getGroup();
1593 if (conservationMenuItem.isSelected())
1595 Conservation c = new Conservation("Group",
1596 ResidueProperties.propHash, 3, sg.getSequences(ap.av
1597 .getHiddenRepSequences()), sg.getStartRes(),
1598 sg.getEndRes() + 1);
1601 c.verdict(false, ap.av.getConsPercGaps());
1603 sg.cs.setConservation(c);
1605 SliderPanel.setConservationSlider(ap, sg.cs, sg.getName());
1606 SliderPanel.showConservationSlider();
1609 // remove ConservationColouring
1611 sg.cs.setConservation(null);
1617 public void annotationMenuItem_actionPerformed(ActionEvent actionEvent)
1619 SequenceGroup sg = getGroup();
1625 AnnotationColourGradient acg = new AnnotationColourGradient(
1626 sequence.getAnnotation()[0], null,
1627 AnnotationColourGradient.NO_THRESHOLD);
1629 acg.predefinedColours = true;
1641 protected void groupName_actionPerformed()
1644 SequenceGroup sg = getGroup();
1645 EditNameDialog dialog = new EditNameDialog(sg.getName(),
1646 sg.getDescription(), " Group Name ",
1647 "Group Description ", "Edit Group Name/Description",
1655 sg.setName(dialog.getName());
1656 sg.setDescription(dialog.getDescription());
1661 * Get selection group - adding it to the alignment if necessary.
1663 * @return sequence group to operate on
1665 SequenceGroup getGroup()
1667 SequenceGroup sg = ap.av.getSelectionGroup();
1668 // this method won't add a new group if it already exists
1671 ap.av.getAlignment().addGroup(sg);
1683 void sequenceName_actionPerformed()
1685 EditNameDialog dialog = new EditNameDialog(sequence.getName(),
1686 sequence.getDescription(), " Sequence Name ",
1687 "Sequence Description ", "Edit Sequence Name/Description",
1695 if (dialog.getName() != null)
1697 if (dialog.getName().indexOf(" ") > -1)
1699 JOptionPane.showMessageDialog(ap,
1700 "Spaces have been converted to \"_\"",
1701 "No spaces allowed in Sequence Name",
1702 JOptionPane.WARNING_MESSAGE);
1705 sequence.setName(dialog.getName().replace(' ', '_'));
1706 ap.paintAlignment(false);
1709 sequence.setDescription(dialog.getDescription());
1711 ap.av.firePropertyChange("alignment", null, ap.av.getAlignment()
1722 void unGroupMenuItem_actionPerformed()
1724 SequenceGroup sg = ap.av.getSelectionGroup();
1725 ap.av.getAlignment().deleteGroup(sg);
1726 ap.av.setSelectionGroup(null);
1736 protected void outline_actionPerformed()
1738 SequenceGroup sg = getGroup();
1739 Color col = JColorChooser.showDialog(this, "Select Outline Colour",
1744 sg.setOutlineColour(col);
1756 public void showBoxes_actionPerformed()
1758 getGroup().setDisplayBoxes(showBoxes.isSelected());
1768 public void showText_actionPerformed()
1770 getGroup().setDisplayText(showText.isSelected());
1780 public void showColourText_actionPerformed()
1782 getGroup().setColourText(showColourText.isSelected());
1786 public void showLink(String url)
1790 jalview.util.BrowserLauncher.openURL(url);
1791 } catch (Exception ex)
1794 .showInternalMessageDialog(
1796 "Unixers: Couldn't find default web browser."
1797 + "\nAdd the full path to your browser in Preferences.",
1798 "Web browser not found", JOptionPane.WARNING_MESSAGE);
1800 ex.printStackTrace();
1804 void hideSequences(boolean representGroup)
1806 SequenceGroup sg = ap.av.getSelectionGroup();
1807 if (sg == null || sg.getSize() < 1)
1809 ap.av.hideSequence(new SequenceI[]
1814 ap.av.setSelectionGroup(null);
1818 ap.av.hideRepSequences(sequence, sg);
1823 int gsize = sg.getSize();
1826 hseqs = new SequenceI[gsize];
1829 for (int i = 0; i < gsize; i++)
1831 hseqs[index++] = sg.getSequenceAt(i);
1834 ap.av.hideSequence(hseqs);
1835 // refresh(); TODO: ? needed ?
1836 ap.av.sendSelection();
1839 public void copy_actionPerformed()
1841 ap.alignFrame.copy_actionPerformed(null);
1844 public void cut_actionPerformed()
1846 ap.alignFrame.cut_actionPerformed(null);
1849 void changeCase(ActionEvent e)
1851 Object source = e.getSource();
1852 SequenceGroup sg = ap.av.getSelectionGroup();
1856 int[][] startEnd = ap.av.getVisibleRegionBoundaries(sg.getStartRes(),
1857 sg.getEndRes() + 1);
1862 if (source == toggle)
1864 description = "Toggle Case";
1865 caseChange = ChangeCaseCommand.TOGGLE_CASE;
1867 else if (source == upperCase)
1869 description = "To Upper Case";
1870 caseChange = ChangeCaseCommand.TO_UPPER;
1874 description = "To Lower Case";
1875 caseChange = ChangeCaseCommand.TO_LOWER;
1878 ChangeCaseCommand caseCommand = new ChangeCaseCommand(description,
1879 sg.getSequencesAsArray(ap.av.getHiddenRepSequences()),
1880 startEnd, caseChange);
1882 ap.alignFrame.addHistoryItem(caseCommand);
1884 ap.av.firePropertyChange("alignment", null, ap.av.getAlignment()
1890 public void outputText_actionPerformed(ActionEvent e)
1892 CutAndPasteTransfer cap = new CutAndPasteTransfer();
1893 cap.setForInput(null);
1894 Desktop.addInternalFrame(cap,
1895 "Alignment output - " + e.getActionCommand(), 600, 500);
1897 String[] omitHidden = null;
1899 System.out.println("PROMPT USER HERE"); // TODO: decide if a prompt happens
1900 // or we simply trust the user wants
1901 // wysiwig behaviour
1902 SequenceGroup sg = ap.av.getSelectionGroup();
1903 ColumnSelection csel = new ColumnSelection(ap.av.getColumnSelection());
1904 omitHidden = ap.av.getViewAsString(true);
1905 Alignment oal = new Alignment(ap.av.getSequenceSelection());
1906 AlignmentAnnotation[] nala = ap.av.getAlignment()
1907 .getAlignmentAnnotation();
1910 for (int i = 0; i < nala.length; i++)
1912 AlignmentAnnotation na = nala[i];
1913 oal.addAnnotation(na);
1916 cap.setText(new FormatAdapter().formatSequences(e.getActionCommand(),
1917 oal, omitHidden, csel, sg));
1921 public void pdbFromFile_actionPerformed()
1923 jalview.io.JalviewFileChooser chooser = new jalview.io.JalviewFileChooser(
1924 jalview.bin.Cache.getProperty("LAST_DIRECTORY"));
1925 chooser.setFileView(new jalview.io.JalviewFileView());
1926 chooser.setDialogTitle("Select a PDB file for "
1927 + sequence.getDisplayId(false));
1928 chooser.setToolTipText("Load a PDB file and associate it with sequence '"
1929 + sequence.getDisplayId(false) + "'");
1931 int value = chooser.showOpenDialog(null);
1933 if (value == jalview.io.JalviewFileChooser.APPROVE_OPTION)
1935 String choice = chooser.getSelectedFile().getPath();
1936 jalview.bin.Cache.setProperty("LAST_DIRECTORY", choice);
1937 new AssociatePdbFileWithSeq().associatePdbWithSeq(choice,
1938 jalview.io.AppletFormatAdapter.FILE, sequence, true);
1943 public void enterPDB_actionPerformed()
1945 String id = JOptionPane.showInternalInputDialog(Desktop.desktop,
1946 "Enter PDB Id", "Enter PDB Id", JOptionPane.QUESTION_MESSAGE);
1948 if (id != null && id.length() > 0)
1950 PDBEntry entry = new PDBEntry();
1951 entry.setId(id.toUpperCase());
1952 sequence.getDatasetSequence().addPDBId(entry);
1956 public void discoverPDB_actionPerformed()
1959 final SequenceI[] sequences = ((ap.av.getSelectionGroup() == null) ? new SequenceI[]
1961 : ap.av.getSequenceSelection());
1962 Thread discpdb = new Thread(new Runnable()
1967 new jalview.ws.DBRefFetcher(sequences, ap.alignFrame)
1968 .fetchDBRefs(false);
1975 public void sequenceFeature_actionPerformed()
1977 SequenceGroup sg = ap.av.getSelectionGroup();
1983 int rsize = 0, gSize = sg.getSize();
1984 SequenceI[] rseqs, seqs = new SequenceI[gSize];
1985 SequenceFeature[] tfeatures, features = new SequenceFeature[gSize];
1987 for (int i = 0; i < gSize; i++)
1989 int start = sg.getSequenceAt(i).findPosition(sg.getStartRes());
1990 int end = sg.findEndRes(sg.getSequenceAt(i));
1993 seqs[rsize] = sg.getSequenceAt(i).getDatasetSequence();
1994 features[rsize] = new SequenceFeature(null, null, null, start, end,
1999 rseqs = new SequenceI[rsize];
2000 tfeatures = new SequenceFeature[rsize];
2001 System.arraycopy(seqs, 0, rseqs, 0, rsize);
2002 System.arraycopy(features, 0, tfeatures, 0, rsize);
2003 features = tfeatures;
2005 if (ap.seqPanel.seqCanvas.getFeatureRenderer().amendFeatures(seqs,
2006 features, true, ap))
2008 ap.alignFrame.setShowSeqFeatures(true);
2009 ap.highlightSearchResults(null);
2013 public void textColour_actionPerformed()
2015 SequenceGroup sg = getGroup();
2018 new TextColourChooser().chooseColour(ap, sg);
2022 public void colourByStructure(String pdbid)
2024 Annotation[] anots = ap.av.getStructureSelectionManager()
2025 .colourSequenceFromStructure(sequence, pdbid);
2027 AlignmentAnnotation an = new AlignmentAnnotation("Structure",
2028 "Coloured by " + pdbid, anots);
2030 ap.av.getAlignment().addAnnotation(an);
2031 an.createSequenceMapping(sequence, 0, true);
2032 // an.adjustForAlignment();
2033 ap.av.getAlignment().setAnnotationIndex(an, 0);
2035 ap.adjustAnnotationHeight();
2037 sequence.addAlignmentAnnotation(an);
2041 public void editSequence_actionPerformed(ActionEvent actionEvent)
2043 SequenceGroup sg = ap.av.getSelectionGroup();
2047 if (sequence == null)
2048 sequence = (Sequence) sg.getSequenceAt(0);
2050 EditNameDialog dialog = new EditNameDialog(
2051 sequence.getSequenceAsString(sg.getStartRes(),
2052 sg.getEndRes() + 1), null, "Edit Sequence ", null,
2053 "Edit Sequence", ap.alignFrame);
2057 EditCommand editCommand = new EditCommand("Edit Sequences",
2058 EditCommand.REPLACE, dialog.getName().replace(' ',
2059 ap.av.getGapCharacter()),
2060 sg.getSequencesAsArray(ap.av.getHiddenRepSequences()),
2061 sg.getStartRes(), sg.getEndRes() + 1, ap.av.getAlignment());
2063 ap.alignFrame.addHistoryItem(editCommand);
2065 ap.av.firePropertyChange("alignment", null, ap.av.getAlignment()