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.*;
28 import jalview.analysis.*;
29 import jalview.commands.*;
30 import jalview.datamodel.*;
32 import jalview.schemes.*;
33 import jalview.util.GroupUrlLink;
34 import jalview.util.GroupUrlLink.UrlStringTooLongException;
35 import jalview.util.UrlLink;
41 * @version $Revision: 1.118 $
43 public class PopupMenu extends JPopupMenu
45 JMenu groupMenu = new JMenu();
47 JMenuItem groupName = new JMenuItem();
49 protected JRadioButtonMenuItem clustalColour = new JRadioButtonMenuItem();
51 protected JRadioButtonMenuItem zappoColour = new JRadioButtonMenuItem();
53 protected JRadioButtonMenuItem taylorColour = new JRadioButtonMenuItem();
55 protected JRadioButtonMenuItem hydrophobicityColour = new JRadioButtonMenuItem();
57 protected JRadioButtonMenuItem helixColour = new JRadioButtonMenuItem();
59 protected JRadioButtonMenuItem strandColour = new JRadioButtonMenuItem();
61 protected JRadioButtonMenuItem turnColour = new JRadioButtonMenuItem();
63 protected JRadioButtonMenuItem buriedColour = new JRadioButtonMenuItem();
65 protected JCheckBoxMenuItem abovePIDColour = new JCheckBoxMenuItem();
67 protected JRadioButtonMenuItem userDefinedColour = new JRadioButtonMenuItem();
69 protected JRadioButtonMenuItem PIDColour = new JRadioButtonMenuItem();
71 protected JRadioButtonMenuItem BLOSUM62Colour = new JRadioButtonMenuItem();
73 protected JRadioButtonMenuItem purinePyrimidineColour = new JRadioButtonMenuItem();
75 // protected JRadioButtonMenuItem covariationColour = new
76 // JRadioButtonMenuItem();
78 JRadioButtonMenuItem noColourmenuItem = new JRadioButtonMenuItem();
80 protected JCheckBoxMenuItem conservationMenuItem = new JCheckBoxMenuItem();
84 JMenu sequenceMenu = new JMenu();
86 JMenuItem sequenceName = new JMenuItem();
88 JMenuItem sequenceDetails = new JMenuItem();
90 JMenuItem sequenceSelDetails = new JMenuItem();
94 JMenuItem unGroupMenuItem = new JMenuItem();
96 JMenuItem outline = new JMenuItem();
98 JRadioButtonMenuItem nucleotideMenuItem = new JRadioButtonMenuItem();
100 JMenu colourMenu = new JMenu();
102 JCheckBoxMenuItem showBoxes = new JCheckBoxMenuItem();
104 JCheckBoxMenuItem showText = new JCheckBoxMenuItem();
106 JCheckBoxMenuItem showColourText = new JCheckBoxMenuItem();
108 JCheckBoxMenuItem displayNonconserved = new JCheckBoxMenuItem();
110 JMenu editMenu = new JMenu();
112 JMenuItem cut = new JMenuItem();
114 JMenuItem copy = new JMenuItem();
116 JMenuItem upperCase = new JMenuItem();
118 JMenuItem lowerCase = new JMenuItem();
120 JMenuItem toggle = new JMenuItem();
122 JMenu pdbMenu = new JMenu();
124 JMenuItem pdbFromFile = new JMenuItem();
126 JMenuItem enterPDB = new JMenuItem();
128 JMenuItem discoverPDB = new JMenuItem();
130 JMenu outputMenu = new JMenu();
132 JMenuItem sequenceFeature = new JMenuItem();
134 JMenuItem textColour = new JMenuItem();
136 JMenu jMenu1 = new JMenu();
138 JMenu structureMenu = new JMenu();
140 JMenu viewStructureMenu = new JMenu();
142 // JMenu colStructureMenu = new JMenu();
143 JMenuItem editSequence = new JMenuItem();
145 // JMenuItem annotationMenuItem = new JMenuItem();
147 JMenu groupLinksMenu;
150 * Creates a new PopupMenu object.
157 public PopupMenu(final AlignmentPanel ap, Sequence seq, Vector links)
159 this(ap, seq, links, null);
169 public PopupMenu(final AlignmentPanel ap, final SequenceI seq,
170 Vector links, Vector groupLinks)
172 // /////////////////////////////////////////////////////////
173 // If this is activated from the sequence panel, the user may want to
174 // edit or annotate a particular residue. Therefore display the residue menu
176 // If from the IDPanel, we must display the sequence menu
177 // ////////////////////////////////////////////////////////
181 ButtonGroup colours = new ButtonGroup();
182 colours.add(noColourmenuItem);
183 colours.add(clustalColour);
184 colours.add(zappoColour);
185 colours.add(taylorColour);
186 colours.add(hydrophobicityColour);
187 colours.add(helixColour);
188 colours.add(strandColour);
189 colours.add(turnColour);
190 colours.add(buriedColour);
191 colours.add(abovePIDColour);
192 colours.add(userDefinedColour);
193 colours.add(PIDColour);
194 colours.add(BLOSUM62Colour);
195 colours.add(purinePyrimidineColour);
196 // colours.add(covariationColour);
198 for (int i = 0; i < jalview.io.FormatAdapter.WRITEABLE_FORMATS.length; i++)
200 JMenuItem item = new JMenuItem(
201 jalview.io.FormatAdapter.WRITEABLE_FORMATS[i]);
203 item.addActionListener(new java.awt.event.ActionListener()
205 public void actionPerformed(ActionEvent e)
207 outputText_actionPerformed(e);
211 outputMenu.add(item);
217 } catch (Exception e)
225 sequenceMenu.setText(sequence.getName());
227 if (seq.getDatasetSequence().getPDBId() != null
228 && seq.getDatasetSequence().getPDBId().size() > 0)
230 java.util.Enumeration e = seq.getDatasetSequence().getPDBId()
233 while (e.hasMoreElements())
235 final PDBEntry pdb = (PDBEntry) e.nextElement();
237 menuItem = new JMenuItem();
238 menuItem.setText(pdb.getId());
239 menuItem.addActionListener(new java.awt.event.ActionListener()
241 public void actionPerformed(ActionEvent e)
243 // TODO re JAL-860: optionally open dialog or provide a menu entry
244 // allowing user to open just one structure per sequence
245 new AppJmol(pdb, ap.av.collateForPDB(new PDBEntry[]
246 { pdb })[0], null, ap);
247 // new PDBViewer(pdb, seqs2, null, ap, AppletFormatAdapter.FILE);
251 viewStructureMenu.add(menuItem);
254 * menuItem = new JMenuItem(); menuItem.setText(pdb.getId());
255 * menuItem.addActionListener(new java.awt.event.ActionListener() {
256 * public void actionPerformed(ActionEvent e) {
257 * colourByStructure(pdb.getId()); } });
258 * colStructureMenu.add(menuItem);
264 if (ap.av.getAlignment().isNucleotide() == false)
266 structureMenu.remove(viewStructureMenu);
268 // structureMenu.remove(colStructureMenu);
271 if (ap.av.getAlignment().isNucleotide() == true)
273 AlignmentAnnotation[] aa = ap.av.getAlignment()
274 .getAlignmentAnnotation();
275 for (int i = 0; i < aa.length; i++)
277 if (aa[i].getRNAStruc() != null)
279 final String rnastruc = aa[i].getRNAStruc();
280 final String structureLine = aa[i].label;
281 menuItem = new JMenuItem();
282 menuItem.setText("2D RNA " + structureLine);
283 menuItem.addActionListener(new java.awt.event.ActionListener()
285 public void actionPerformed(ActionEvent e)
287 new AppVarna(structureLine, seq, seq.getSequenceAsString(),
288 rnastruc, seq.getName(), ap);
291 viewStructureMenu.add(menuItem);
295 // SequenceFeatures[] test = seq.getSequenceFeatures();
297 if (seq.getAnnotation() != null)
299 AlignmentAnnotation seqAnno[] = seq.getAnnotation();
300 for (int i = 0; i < seqAnno.length; i++)
302 if (seqAnno[i].getRNAStruc() != null)
304 final String rnastruc = seqAnno[i].getRNAStruc();
306 // TODO: make rnastrucF a bit more nice
307 menuItem = new JMenuItem();
308 menuItem.setText("2D RNA - " + seq.getName());
309 menuItem.addActionListener(new java.awt.event.ActionListener()
311 public void actionPerformed(ActionEvent e)
313 // TODO: VARNA does'nt print gaps in the sequence
314 new AppVarna(seq.getName() + " structure", seq, seq
315 .getSequenceAsString(), rnastruc, seq.getName(),
319 viewStructureMenu.add(menuItem);
326 menuItem = new JMenuItem("Hide Sequences");
327 menuItem.addActionListener(new java.awt.event.ActionListener()
329 public void actionPerformed(ActionEvent e)
331 hideSequences(false);
336 if (ap.av.getSelectionGroup() != null
337 && ap.av.getSelectionGroup().getSize() > 1)
339 menuItem = new JMenuItem("Represent Group with " + seq.getName());
340 menuItem.addActionListener(new java.awt.event.ActionListener()
342 public void actionPerformed(ActionEvent e)
347 sequenceMenu.add(menuItem);
350 if (ap.av.hasHiddenRows())
352 final int index = ap.av.getAlignment().findIndex(seq);
354 if (ap.av.adjustForHiddenSeqs(index)
355 - ap.av.adjustForHiddenSeqs(index - 1) > 1)
357 menuItem = new JMenuItem("Reveal Sequences");
358 menuItem.addActionListener(new ActionListener()
360 public void actionPerformed(ActionEvent e)
362 ap.av.showSequence(index);
363 if (ap.overviewPanel != null)
365 ap.overviewPanel.updateOverviewImage();
373 // for the case when no sequences are even visible
374 if (ap.av.hasHiddenRows())
377 menuItem = new JMenuItem("Reveal All");
378 menuItem.addActionListener(new ActionListener()
380 public void actionPerformed(ActionEvent e)
382 ap.av.showAllHiddenSeqs();
383 if (ap.overviewPanel != null)
385 ap.overviewPanel.updateOverviewImage();
395 SequenceGroup sg = ap.av.getSelectionGroup();
397 if (sg != null && sg.getSize() > 0)
399 groupName.setText("Name: " + sg.getName());
400 groupName.setText("Edit name and description of current group.");
402 if (sg.cs instanceof ZappoColourScheme)
404 zappoColour.setSelected(true);
406 else if (sg.cs instanceof TaylorColourScheme)
408 taylorColour.setSelected(true);
410 else if (sg.cs instanceof PIDColourScheme)
412 PIDColour.setSelected(true);
414 else if (sg.cs instanceof Blosum62ColourScheme)
416 BLOSUM62Colour.setSelected(true);
418 else if (sg.cs instanceof UserColourScheme)
420 userDefinedColour.setSelected(true);
422 else if (sg.cs instanceof HydrophobicColourScheme)
424 hydrophobicityColour.setSelected(true);
426 else if (sg.cs instanceof HelixColourScheme)
428 helixColour.setSelected(true);
430 else if (sg.cs instanceof StrandColourScheme)
432 strandColour.setSelected(true);
434 else if (sg.cs instanceof TurnColourScheme)
436 turnColour.setSelected(true);
438 else if (sg.cs instanceof BuriedColourScheme)
440 buriedColour.setSelected(true);
442 else if (sg.cs instanceof ClustalxColourScheme)
444 clustalColour.setSelected(true);
446 else if (sg.cs instanceof PurinePyrimidineColourScheme)
448 purinePyrimidineColour.setSelected(true);
451 * else if (sg.cs instanceof CovariationColourScheme) {
452 * covariationColour.setSelected(true); }
456 noColourmenuItem.setSelected(true);
459 if (sg.cs != null && sg.cs.conservationApplied())
461 conservationMenuItem.setSelected(true);
463 displayNonconserved.setSelected(sg.getShowNonconserved());
464 showText.setSelected(sg.getDisplayText());
465 showColourText.setSelected(sg.getColourText());
466 showBoxes.setSelected(sg.getDisplayBoxes());
467 // add any groupURLs to the groupURL submenu and make it visible
468 if (groupLinks != null && groupLinks.size() > 0)
470 buildGroupURLMenu(sg, groupLinks);
472 // Add a 'show all structures' for the current selection
473 Hashtable<String, PDBEntry> pdbe = new Hashtable<String, PDBEntry>();
474 SequenceI sqass = null;
475 for (SequenceI sq : ap.av.getSequenceSelection())
477 Vector<PDBEntry> pes = (Vector<PDBEntry>) sq.getDatasetSequence()
481 for (PDBEntry pe : pes)
483 pdbe.put(pe.getId(), pe);
493 final PDBEntry[] pe = pdbe.values().toArray(
494 new PDBEntry[pdbe.size()]);
495 final JMenuItem gpdbview;
496 if (pdbe.size() == 1)
498 structureMenu.add(gpdbview = new JMenuItem("View structure for "
499 + sqass.getDisplayId(false)));
503 structureMenu.add(gpdbview = new JMenuItem("View all "
504 + pdbe.size() + " structures."));
506 gpdbview.setToolTipText("Open a new Jmol view with all structures associated with the current selection and superimpose them using the alignment.");
507 gpdbview.addActionListener(new ActionListener()
511 public void actionPerformed(ActionEvent e)
513 new AppJmol(ap, pe, ap.av.collateForPDB(pe));
520 groupMenu.setVisible(false);
521 editMenu.setVisible(false);
524 if (!ap.av.getAlignment().getGroups().contains(sg))
526 unGroupMenuItem.setVisible(false);
531 sequenceMenu.setVisible(false);
532 structureMenu.setVisible(false);
535 if (links != null && links.size() > 0)
538 JMenu linkMenu = new JMenu("Link");
539 Vector linkset = new Vector();
540 for (int i = 0; i < links.size(); i++)
542 String link = links.elementAt(i).toString();
543 UrlLink urlLink = null;
546 urlLink = new UrlLink(link);
547 } catch (Exception foo)
549 jalview.bin.Cache.log.error("Exception for URLLink '" + link
554 if (!urlLink.isValid())
556 jalview.bin.Cache.log.error(urlLink.getInvalidMessage());
559 final String label = urlLink.getLabel();
560 if (seq != null && urlLink.isDynamic())
563 // collect matching db-refs
564 DBRefEntry[] dbr = jalview.util.DBRefUtils.selectRefs(
565 seq.getDBRef(), new String[]
566 { urlLink.getTarget() });
567 // collect id string too
568 String id = seq.getName();
569 String descr = seq.getDescription();
570 if (descr != null && descr.length() < 1)
577 for (int r = 0; r < dbr.length; r++)
579 if (id != null && dbr[r].getAccessionId().equals(id))
581 // suppress duplicate link creation for the bare sequence ID
582 // string with this link
585 // create Bare ID link for this RUL
586 String[] urls = urlLink.makeUrls(dbr[r].getAccessionId(),
590 for (int u = 0; u < urls.length; u += 2)
592 if (!linkset.contains(urls[u] + "|" + urls[u + 1]))
594 linkset.addElement(urls[u] + "|" + urls[u + 1]);
595 addshowLink(linkMenu, label + "|" + urls[u],
604 // create Bare ID link for this RUL
605 String[] urls = urlLink.makeUrls(id, true);
608 for (int u = 0; u < urls.length; u += 2)
610 if (!linkset.contains(urls[u] + "|" + urls[u + 1]))
612 linkset.addElement(urls[u] + "|" + urls[u + 1]);
613 addshowLink(linkMenu, label, urls[u + 1]);
618 // Create urls from description but only for URL links which are regex
620 if (descr != null && urlLink.getRegexReplace() != null)
622 // create link for this URL from description where regex matches
623 String[] urls = urlLink.makeUrls(descr, true);
626 for (int u = 0; u < urls.length; u += 2)
628 if (!linkset.contains(urls[u] + "|" + urls[u + 1]))
630 linkset.addElement(urls[u] + "|" + urls[u + 1]);
631 addshowLink(linkMenu, label, urls[u + 1]);
639 if (!linkset.contains(label + "|" + urlLink.getUrl_prefix()))
641 linkset.addElement(label + "|" + urlLink.getUrl_prefix());
642 // Add a non-dynamic link
643 addshowLink(linkMenu, label, urlLink.getUrl_prefix());
647 if (sequence != null)
649 sequenceMenu.add(linkMenu);
658 private void buildGroupURLMenu(SequenceGroup sg, Vector groupLinks)
661 // TODO: usability: thread off the generation of group url content so root
663 // sequence only URLs
664 // ID/regex match URLs
665 groupLinksMenu = new JMenu("Group Link");
666 JMenu[] linkMenus = new JMenu[]
667 { null, new JMenu("IDS"), new JMenu("Sequences"),
668 new JMenu("IDS and Sequences") }; // three types of url that might be
670 SequenceI[] seqs = ap.av.getSelectionAsNewSequence();
671 String[][] idandseqs = GroupUrlLink.formStrings(seqs);
672 Hashtable commonDbrefs = new Hashtable();
673 for (int sq = 0; sq < seqs.length; sq++)
676 int start = seqs[sq].findPosition(sg.getStartRes()), end = seqs[sq]
677 .findPosition(sg.getEndRes());
678 // just collect ids from dataset sequence
679 // TODO: check if IDs collected from selecton group intersects with the
680 // current selection, too
681 SequenceI sqi = seqs[sq];
682 while (sqi.getDatasetSequence() != null)
684 sqi = sqi.getDatasetSequence();
686 DBRefEntry[] dbr = sqi.getDBRef();
687 if (dbr != null && dbr.length > 0)
689 for (int d = 0; d < dbr.length; d++)
691 String src = dbr[d].getSource(); // jalview.util.DBRefUtils.getCanonicalName(dbr[d].getSource()).toUpperCase();
692 Object[] sarray = (Object[]) commonDbrefs.get(src);
695 sarray = new Object[2];
696 sarray[0] = new int[]
698 sarray[1] = new String[seqs.length];
700 commonDbrefs.put(src, sarray);
703 if (((String[]) sarray[1])[sq] == null)
706 || (dbr[d].getMap().locateMappedRange(start, end) != null))
708 ((String[]) sarray[1])[sq] = dbr[d].getAccessionId();
709 ((int[]) sarray[0])[0]++;
715 // now create group links for all distinct ID/sequence sets.
716 boolean addMenu = false; // indicates if there are any group links to give
718 for (int i = 0; i < groupLinks.size(); i++)
720 String link = groupLinks.elementAt(i).toString();
721 GroupUrlLink urlLink = null;
724 urlLink = new GroupUrlLink(link);
725 } catch (Exception foo)
727 jalview.bin.Cache.log.error("Exception for GroupURLLink '" + link
732 if (!urlLink.isValid())
734 jalview.bin.Cache.log.error(urlLink.getInvalidMessage());
737 final String label = urlLink.getLabel();
738 boolean usingNames = false;
739 // Now see which parts of the group apply for this URL
740 String ltarget = urlLink.getTarget(); // jalview.util.DBRefUtils.getCanonicalName(urlLink.getTarget());
741 Object[] idset = (Object[]) commonDbrefs.get(ltarget.toUpperCase());
742 String[] seqstr, ids; // input to makeUrl
745 int numinput = ((int[]) idset[0])[0];
746 String[] allids = ((String[]) idset[1]);
747 seqstr = new String[numinput];
748 ids = new String[numinput];
749 for (int sq = 0, idcount = 0; sq < seqs.length; sq++)
751 if (allids[sq] != null)
753 ids[idcount] = allids[sq];
754 seqstr[idcount++] = idandseqs[1][sq];
760 // just use the id/seq set
761 seqstr = idandseqs[1];
765 // and try and make the groupURL!
767 Object[] urlset = null;
770 urlset = urlLink.makeUrlStubs(ids, seqstr,
771 "FromJalview" + System.currentTimeMillis(), false);
772 } catch (UrlStringTooLongException e)
777 int type = urlLink.getGroupURLType() & 3;
778 // System.out.println(urlLink.getGroupURLType()
779 // +" "+((String[])urlset[3])[0]);
780 // first two bits ofurlLink type bitfield are sequenceids and sequences
781 // TODO: FUTURE: ensure the groupURL menu structure can be generalised
782 addshowLink(linkMenus[type], label
783 + (((type & 1) == 1) ? ("("
784 + (usingNames ? "Names" : ltarget) + ")") : ""),
791 groupLinksMenu = new JMenu("Group Links");
792 for (int m = 0; m < linkMenus.length; m++)
794 if (linkMenus[m] != null
795 && linkMenus[m].getMenuComponentCount() > 0)
797 groupLinksMenu.add(linkMenus[m]);
801 groupMenu.add(groupLinksMenu);
806 * add a show URL menu item to the given linkMenu
810 * - menu label string
814 private void addshowLink(JMenu linkMenu, String label, final String url)
816 JMenuItem item = new JMenuItem(label);
817 item.setToolTipText("open URL: " + url);
818 item.addActionListener(new java.awt.event.ActionListener()
820 public void actionPerformed(ActionEvent e)
822 new Thread(new Runnable()
838 * add a late bound groupURL item to the given linkMenu
842 * - menu label string
843 * @param urlgenerator
844 * GroupURLLink used to generate URL
846 * Object array returned from the makeUrlStubs function.
848 private void addshowLink(JMenu linkMenu, String label,
849 final GroupUrlLink urlgenerator, final Object[] urlstub)
851 JMenuItem item = new JMenuItem(label);
852 item.setToolTipText("open URL (" + urlgenerator.getUrl_prefix()
853 + "..) (" + urlgenerator.getNumberInvolved(urlstub) + " seqs)"); // TODO:
862 item.addActionListener(new java.awt.event.ActionListener()
864 public void actionPerformed(ActionEvent e)
866 new Thread(new Runnable()
873 showLink(urlgenerator.constructFrom(urlstub));
874 } catch (UrlStringTooLongException e)
892 private void jbInit() throws Exception
894 groupMenu.setText("Group");
895 groupMenu.setText("Selection");
896 groupName.setText("Name");
897 groupName.addActionListener(new java.awt.event.ActionListener()
899 public void actionPerformed(ActionEvent e)
901 groupName_actionPerformed();
904 sequenceMenu.setText("Sequence");
905 sequenceName.setText("Edit Name/Description");
906 sequenceName.addActionListener(new java.awt.event.ActionListener()
908 public void actionPerformed(ActionEvent e)
910 sequenceName_actionPerformed();
913 sequenceDetails.setText("Sequence Details ...");
914 sequenceDetails.addActionListener(new java.awt.event.ActionListener()
916 public void actionPerformed(ActionEvent e)
918 sequenceDetails_actionPerformed();
921 sequenceSelDetails.setText("Sequence Details ...");
923 .addActionListener(new java.awt.event.ActionListener()
925 public void actionPerformed(ActionEvent e)
927 sequenceSelectionDetails_actionPerformed();
930 PIDColour.setFocusPainted(false);
931 unGroupMenuItem.setText("Remove Group");
932 unGroupMenuItem.addActionListener(new java.awt.event.ActionListener()
934 public void actionPerformed(ActionEvent e)
936 unGroupMenuItem_actionPerformed();
940 outline.setText("Border colour");
941 outline.addActionListener(new java.awt.event.ActionListener()
943 public void actionPerformed(ActionEvent e)
945 outline_actionPerformed();
948 nucleotideMenuItem.setText("Nucleotide");
949 nucleotideMenuItem.addActionListener(new ActionListener()
951 public void actionPerformed(ActionEvent e)
953 nucleotideMenuItem_actionPerformed();
956 colourMenu.setText("Group Colour");
957 showBoxes.setText("Boxes");
958 showBoxes.setState(true);
959 showBoxes.addActionListener(new ActionListener()
961 public void actionPerformed(ActionEvent e)
963 showBoxes_actionPerformed();
966 showText.setText("Text");
967 showText.setState(true);
968 showText.addActionListener(new ActionListener()
970 public void actionPerformed(ActionEvent e)
972 showText_actionPerformed();
975 showColourText.setText("Colour Text");
976 showColourText.addActionListener(new ActionListener()
978 public void actionPerformed(ActionEvent e)
980 showColourText_actionPerformed();
983 displayNonconserved.setText("Show Nonconserved");
984 displayNonconserved.setState(true);
985 displayNonconserved.addActionListener(new ActionListener()
987 public void actionPerformed(ActionEvent e)
989 showNonconserved_actionPerformed();
992 editMenu.setText("Edit");
994 cut.addActionListener(new ActionListener()
996 public void actionPerformed(ActionEvent e)
998 cut_actionPerformed();
1001 upperCase.setText("To Upper Case");
1002 upperCase.addActionListener(new ActionListener()
1004 public void actionPerformed(ActionEvent e)
1009 copy.setText("Copy");
1010 copy.addActionListener(new ActionListener()
1012 public void actionPerformed(ActionEvent e)
1014 copy_actionPerformed();
1017 lowerCase.setText("To Lower Case");
1018 lowerCase.addActionListener(new ActionListener()
1020 public void actionPerformed(ActionEvent e)
1025 toggle.setText("Toggle Case");
1026 toggle.addActionListener(new ActionListener()
1028 public void actionPerformed(ActionEvent e)
1033 pdbMenu.setText("Associate Structure with Sequence");
1034 pdbFromFile.setText("From File");
1035 pdbFromFile.addActionListener(new ActionListener()
1037 public void actionPerformed(ActionEvent e)
1039 pdbFromFile_actionPerformed();
1042 enterPDB.setText("Enter PDB Id");
1043 enterPDB.addActionListener(new ActionListener()
1045 public void actionPerformed(ActionEvent e)
1047 enterPDB_actionPerformed();
1050 discoverPDB.setText("Discover PDB ids");
1051 discoverPDB.addActionListener(new ActionListener()
1053 public void actionPerformed(ActionEvent e)
1055 discoverPDB_actionPerformed();
1058 outputMenu.setText("Output to Textbox...");
1059 sequenceFeature.setText("Create Sequence Feature");
1060 sequenceFeature.addActionListener(new ActionListener()
1062 public void actionPerformed(ActionEvent e)
1064 sequenceFeature_actionPerformed();
1067 textColour.setText("Text Colour");
1068 textColour.addActionListener(new ActionListener()
1070 public void actionPerformed(ActionEvent e)
1072 textColour_actionPerformed();
1075 jMenu1.setText("Group");
1076 structureMenu.setText("Structure");
1077 viewStructureMenu.setText("View Structure");
1078 // colStructureMenu.setText("Colour By Structure");
1079 editSequence.setText("Edit Sequence...");
1080 editSequence.addActionListener(new ActionListener()
1082 public void actionPerformed(ActionEvent actionEvent)
1084 editSequence_actionPerformed(actionEvent);
1089 * annotationMenuItem.setText("By Annotation");
1090 * annotationMenuItem.addActionListener(new ActionListener() { public void
1091 * actionPerformed(ActionEvent actionEvent) {
1092 * annotationMenuItem_actionPerformed(actionEvent); } });
1094 groupMenu.add(sequenceSelDetails);
1097 this.add(structureMenu);
1098 groupMenu.add(editMenu);
1099 groupMenu.add(outputMenu);
1100 groupMenu.add(sequenceFeature);
1101 groupMenu.add(jMenu1);
1102 sequenceMenu.add(sequenceName);
1103 sequenceMenu.add(sequenceDetails);
1104 colourMenu.add(textColour);
1105 colourMenu.add(noColourmenuItem);
1106 colourMenu.add(clustalColour);
1107 colourMenu.add(BLOSUM62Colour);
1108 colourMenu.add(PIDColour);
1109 colourMenu.add(zappoColour);
1110 colourMenu.add(taylorColour);
1111 colourMenu.add(hydrophobicityColour);
1112 colourMenu.add(helixColour);
1113 colourMenu.add(strandColour);
1114 colourMenu.add(turnColour);
1115 colourMenu.add(buriedColour);
1116 colourMenu.add(nucleotideMenuItem);
1117 if (ap.getAlignment().isNucleotide())
1119 colourMenu.add(purinePyrimidineColour);
1121 // colourMenu.add(covariationColour);
1122 colourMenu.add(userDefinedColour);
1124 if (jalview.gui.UserDefinedColours.getUserColourSchemes() != null)
1126 java.util.Enumeration userColours = jalview.gui.UserDefinedColours
1127 .getUserColourSchemes().keys();
1129 while (userColours.hasMoreElements())
1131 JMenuItem item = new JMenuItem(userColours.nextElement().toString());
1132 item.addActionListener(new ActionListener()
1134 public void actionPerformed(ActionEvent evt)
1136 userDefinedColour_actionPerformed(evt);
1139 colourMenu.add(item);
1143 colourMenu.addSeparator();
1144 colourMenu.add(abovePIDColour);
1145 colourMenu.add(conservationMenuItem);
1146 // colourMenu.add(annotationMenuItem);
1149 editMenu.add(editSequence);
1150 editMenu.add(upperCase);
1151 editMenu.add(lowerCase);
1152 editMenu.add(toggle);
1153 pdbMenu.add(pdbFromFile);
1154 pdbMenu.add(enterPDB);
1155 pdbMenu.add(discoverPDB);
1156 jMenu1.add(groupName);
1157 jMenu1.add(unGroupMenuItem);
1158 jMenu1.add(colourMenu);
1159 jMenu1.add(showBoxes);
1160 jMenu1.add(showText);
1161 jMenu1.add(showColourText);
1162 jMenu1.add(outline);
1163 jMenu1.add(displayNonconserved);
1164 structureMenu.add(pdbMenu);
1165 structureMenu.add(viewStructureMenu);
1166 // structureMenu.add(colStructureMenu);
1167 noColourmenuItem.setText("None");
1168 noColourmenuItem.addActionListener(new java.awt.event.ActionListener()
1170 public void actionPerformed(ActionEvent e)
1172 noColourmenuItem_actionPerformed();
1176 clustalColour.setText("Clustalx colours");
1177 clustalColour.addActionListener(new java.awt.event.ActionListener()
1179 public void actionPerformed(ActionEvent e)
1181 clustalColour_actionPerformed();
1184 zappoColour.setText("Zappo");
1185 zappoColour.addActionListener(new java.awt.event.ActionListener()
1187 public void actionPerformed(ActionEvent e)
1189 zappoColour_actionPerformed();
1192 taylorColour.setText("Taylor");
1193 taylorColour.addActionListener(new java.awt.event.ActionListener()
1195 public void actionPerformed(ActionEvent e)
1197 taylorColour_actionPerformed();
1200 hydrophobicityColour.setText("Hydrophobicity");
1201 hydrophobicityColour
1202 .addActionListener(new java.awt.event.ActionListener()
1204 public void actionPerformed(ActionEvent e)
1206 hydrophobicityColour_actionPerformed();
1209 helixColour.setText("Helix propensity");
1210 helixColour.addActionListener(new java.awt.event.ActionListener()
1212 public void actionPerformed(ActionEvent e)
1214 helixColour_actionPerformed();
1217 strandColour.setText("Strand propensity");
1218 strandColour.addActionListener(new java.awt.event.ActionListener()
1220 public void actionPerformed(ActionEvent e)
1222 strandColour_actionPerformed();
1225 turnColour.setText("Turn propensity");
1226 turnColour.addActionListener(new java.awt.event.ActionListener()
1228 public void actionPerformed(ActionEvent e)
1230 turnColour_actionPerformed();
1233 buriedColour.setText("Buried Index");
1234 buriedColour.addActionListener(new java.awt.event.ActionListener()
1236 public void actionPerformed(ActionEvent e)
1238 buriedColour_actionPerformed();
1241 abovePIDColour.setText("Above % Identity");
1242 abovePIDColour.addActionListener(new java.awt.event.ActionListener()
1244 public void actionPerformed(ActionEvent e)
1246 abovePIDColour_actionPerformed();
1249 userDefinedColour.setText("User Defined...");
1250 userDefinedColour.addActionListener(new java.awt.event.ActionListener()
1252 public void actionPerformed(ActionEvent e)
1254 userDefinedColour_actionPerformed(e);
1257 PIDColour.setText("Percentage Identity");
1258 PIDColour.addActionListener(new java.awt.event.ActionListener()
1260 public void actionPerformed(ActionEvent e)
1262 PIDColour_actionPerformed();
1265 BLOSUM62Colour.setText("BLOSUM62");
1266 BLOSUM62Colour.addActionListener(new java.awt.event.ActionListener()
1268 public void actionPerformed(ActionEvent e)
1270 BLOSUM62Colour_actionPerformed();
1273 purinePyrimidineColour.setText("Purine/Pyrimidine");
1274 purinePyrimidineColour
1275 .addActionListener(new java.awt.event.ActionListener()
1277 public void actionPerformed(ActionEvent e)
1279 purinePyrimidineColour_actionPerformed();
1283 * covariationColour.addActionListener(new java.awt.event.ActionListener() {
1284 * public void actionPerformed(ActionEvent e) {
1285 * covariationColour_actionPerformed(); } });
1288 conservationMenuItem.setText("Conservation");
1289 conservationMenuItem
1290 .addActionListener(new java.awt.event.ActionListener()
1292 public void actionPerformed(ActionEvent e)
1294 conservationMenuItem_actionPerformed();
1299 protected void sequenceSelectionDetails_actionPerformed()
1301 createSequenceDetailsReport(ap.av.getSequenceSelection());
1304 protected void sequenceDetails_actionPerformed()
1306 createSequenceDetailsReport(new SequenceI[]
1310 public void createSequenceDetailsReport(SequenceI[] sequences)
1312 CutAndPasteHtmlTransfer cap = new CutAndPasteHtmlTransfer();
1313 StringBuffer contents = new StringBuffer();
1314 for (SequenceI seq : sequences)
1316 contents.append("<p><h2>Annotation for " + seq.getDisplayId(true)
1318 new SequenceAnnotationReport(null)
1319 .createSequenceAnnotationReport(
1325 (ap.seqPanel.seqCanvas.fr != null) ? ap.seqPanel.seqCanvas.fr.minmax
1327 contents.append("</p>");
1329 cap.setText("<html>" + contents.toString() + "</html>");
1331 Desktop.instance.addInternalFrame(cap, "Sequence Details for "
1332 + (sequences.length == 1 ? sequences[0].getDisplayId(true)
1333 : "Selection"), 500, 400);
1337 protected void showNonconserved_actionPerformed()
1339 getGroup().setShowNonconserved(displayNonconserved.isSelected());
1344 * call to refresh view after settings change
1348 ap.updateAnnotation();
1349 ap.paintAlignment(true);
1351 PaintRefresher.Refresh(this, ap.av.getSequenceSetId());
1360 protected void clustalColour_actionPerformed()
1362 SequenceGroup sg = getGroup();
1363 sg.cs = new ClustalxColourScheme(sg, ap.av.getHiddenRepSequences());
1373 protected void zappoColour_actionPerformed()
1375 getGroup().cs = new ZappoColourScheme();
1385 protected void taylorColour_actionPerformed()
1387 getGroup().cs = new TaylorColourScheme();
1397 protected void hydrophobicityColour_actionPerformed()
1399 getGroup().cs = new HydrophobicColourScheme();
1409 protected void helixColour_actionPerformed()
1411 getGroup().cs = new HelixColourScheme();
1421 protected void strandColour_actionPerformed()
1423 getGroup().cs = new StrandColourScheme();
1433 protected void turnColour_actionPerformed()
1435 getGroup().cs = new TurnColourScheme();
1445 protected void buriedColour_actionPerformed()
1447 getGroup().cs = new BuriedColourScheme();
1457 public void nucleotideMenuItem_actionPerformed()
1459 getGroup().cs = new NucleotideColourScheme();
1463 protected void purinePyrimidineColour_actionPerformed()
1465 getGroup().cs = new PurinePyrimidineColourScheme();
1470 * protected void covariationColour_actionPerformed() { getGroup().cs = new
1471 * CovariationColourScheme(sequence.getAnnotation()[0]); refresh(); }
1479 protected void abovePIDColour_actionPerformed()
1481 SequenceGroup sg = getGroup();
1487 if (abovePIDColour.isSelected())
1489 sg.cs.setConsensus(AAFrequency.calculate(
1490 sg.getSequences(ap.av.getHiddenRepSequences()),
1491 sg.getStartRes(), sg.getEndRes() + 1));
1493 int threshold = SliderPanel.setPIDSliderSource(ap, sg.cs, getGroup()
1496 sg.cs.setThreshold(threshold, ap.av.getIgnoreGapsConsensus());
1498 SliderPanel.showPIDSlider();
1501 // remove PIDColouring
1503 sg.cs.setThreshold(0, ap.av.getIgnoreGapsConsensus());
1515 protected void userDefinedColour_actionPerformed(ActionEvent e)
1517 SequenceGroup sg = getGroup();
1519 if (e.getActionCommand().equals("User Defined..."))
1521 new UserDefinedColours(ap, sg);
1525 UserColourScheme udc = (UserColourScheme) UserDefinedColours
1526 .getUserColourSchemes().get(e.getActionCommand());
1539 protected void PIDColour_actionPerformed()
1541 SequenceGroup sg = getGroup();
1542 sg.cs = new PIDColourScheme();
1543 sg.cs.setConsensus(AAFrequency.calculate(
1544 sg.getSequences(ap.av.getHiddenRepSequences()),
1545 sg.getStartRes(), sg.getEndRes() + 1));
1555 protected void BLOSUM62Colour_actionPerformed()
1557 SequenceGroup sg = getGroup();
1559 sg.cs = new Blosum62ColourScheme();
1561 sg.cs.setConsensus(AAFrequency.calculate(
1562 sg.getSequences(ap.av.getHiddenRepSequences()),
1563 sg.getStartRes(), sg.getEndRes() + 1));
1574 protected void noColourmenuItem_actionPerformed()
1576 getGroup().cs = null;
1586 protected void conservationMenuItem_actionPerformed()
1588 SequenceGroup sg = getGroup();
1594 if (conservationMenuItem.isSelected())
1596 Conservation c = new Conservation("Group",
1597 ResidueProperties.propHash, 3, sg.getSequences(ap.av
1598 .getHiddenRepSequences()), sg.getStartRes(),
1599 sg.getEndRes() + 1);
1602 c.verdict(false, ap.av.getConsPercGaps());
1604 sg.cs.setConservation(c);
1606 SliderPanel.setConservationSlider(ap, sg.cs, sg.getName());
1607 SliderPanel.showConservationSlider();
1610 // remove ConservationColouring
1612 sg.cs.setConservation(null);
1618 public void annotationMenuItem_actionPerformed(ActionEvent actionEvent)
1620 SequenceGroup sg = getGroup();
1626 AnnotationColourGradient acg = new AnnotationColourGradient(
1627 sequence.getAnnotation()[0], null,
1628 AnnotationColourGradient.NO_THRESHOLD);
1630 acg.predefinedColours = true;
1642 protected void groupName_actionPerformed()
1645 SequenceGroup sg = getGroup();
1646 EditNameDialog dialog = new EditNameDialog(sg.getName(),
1647 sg.getDescription(), " Group Name ",
1648 "Group Description ", "Edit Group Name/Description",
1656 sg.setName(dialog.getName());
1657 sg.setDescription(dialog.getDescription());
1662 * Get selection group - adding it to the alignment if necessary.
1664 * @return sequence group to operate on
1666 SequenceGroup getGroup()
1668 SequenceGroup sg = ap.av.getSelectionGroup();
1669 // this method won't add a new group if it already exists
1672 ap.av.getAlignment().addGroup(sg);
1684 void sequenceName_actionPerformed()
1686 EditNameDialog dialog = new EditNameDialog(sequence.getName(),
1687 sequence.getDescription(), " Sequence Name ",
1688 "Sequence Description ", "Edit Sequence Name/Description",
1696 if (dialog.getName() != null)
1698 if (dialog.getName().indexOf(" ") > -1)
1700 JOptionPane.showMessageDialog(ap,
1701 "Spaces have been converted to \"_\"",
1702 "No spaces allowed in Sequence Name",
1703 JOptionPane.WARNING_MESSAGE);
1706 sequence.setName(dialog.getName().replace(' ', '_'));
1707 ap.paintAlignment(false);
1710 sequence.setDescription(dialog.getDescription());
1712 ap.av.firePropertyChange("alignment", null, ap.av.getAlignment()
1723 void unGroupMenuItem_actionPerformed()
1725 SequenceGroup sg = ap.av.getSelectionGroup();
1726 ap.av.getAlignment().deleteGroup(sg);
1727 ap.av.setSelectionGroup(null);
1737 protected void outline_actionPerformed()
1739 SequenceGroup sg = getGroup();
1740 Color col = JColorChooser.showDialog(this, "Select Outline Colour",
1745 sg.setOutlineColour(col);
1757 public void showBoxes_actionPerformed()
1759 getGroup().setDisplayBoxes(showBoxes.isSelected());
1769 public void showText_actionPerformed()
1771 getGroup().setDisplayText(showText.isSelected());
1781 public void showColourText_actionPerformed()
1783 getGroup().setColourText(showColourText.isSelected());
1787 public void showLink(String url)
1791 jalview.util.BrowserLauncher.openURL(url);
1792 } catch (Exception ex)
1795 .showInternalMessageDialog(
1797 "Unixers: Couldn't find default web browser."
1798 + "\nAdd the full path to your browser in Preferences.",
1799 "Web browser not found", JOptionPane.WARNING_MESSAGE);
1801 ex.printStackTrace();
1805 void hideSequences(boolean representGroup)
1807 SequenceGroup sg = ap.av.getSelectionGroup();
1808 if (sg == null || sg.getSize() < 1)
1810 ap.av.hideSequence(new SequenceI[]
1815 ap.av.setSelectionGroup(null);
1819 ap.av.hideRepSequences(sequence, sg);
1824 int gsize = sg.getSize();
1827 hseqs = new SequenceI[gsize];
1830 for (int i = 0; i < gsize; i++)
1832 hseqs[index++] = sg.getSequenceAt(i);
1835 ap.av.hideSequence(hseqs);
1836 // refresh(); TODO: ? needed ?
1837 ap.av.sendSelection();
1840 public void copy_actionPerformed()
1842 ap.alignFrame.copy_actionPerformed(null);
1845 public void cut_actionPerformed()
1847 ap.alignFrame.cut_actionPerformed(null);
1850 void changeCase(ActionEvent e)
1852 Object source = e.getSource();
1853 SequenceGroup sg = ap.av.getSelectionGroup();
1857 int[][] startEnd = ap.av.getVisibleRegionBoundaries(sg.getStartRes(),
1858 sg.getEndRes() + 1);
1863 if (source == toggle)
1865 description = "Toggle Case";
1866 caseChange = ChangeCaseCommand.TOGGLE_CASE;
1868 else if (source == upperCase)
1870 description = "To Upper Case";
1871 caseChange = ChangeCaseCommand.TO_UPPER;
1875 description = "To Lower Case";
1876 caseChange = ChangeCaseCommand.TO_LOWER;
1879 ChangeCaseCommand caseCommand = new ChangeCaseCommand(description,
1880 sg.getSequencesAsArray(ap.av.getHiddenRepSequences()),
1881 startEnd, caseChange);
1883 ap.alignFrame.addHistoryItem(caseCommand);
1885 ap.av.firePropertyChange("alignment", null, ap.av.getAlignment()
1891 public void outputText_actionPerformed(ActionEvent e)
1893 CutAndPasteTransfer cap = new CutAndPasteTransfer();
1894 cap.setForInput(null);
1895 Desktop.addInternalFrame(cap,
1896 "Alignment output - " + e.getActionCommand(), 600, 500);
1898 String[] omitHidden = null;
1900 System.out.println("PROMPT USER HERE"); // TODO: decide if a prompt happens
1901 // or we simply trust the user wants
1902 // wysiwig behaviour
1903 SequenceGroup sg = ap.av.getSelectionGroup();
1904 ColumnSelection csel = new ColumnSelection(ap.av.getColumnSelection());
1905 omitHidden = ap.av.getViewAsString(true);
1906 Alignment oal = new Alignment(ap.av.getSequenceSelection());
1907 AlignmentAnnotation[] nala = ap.av.getAlignment()
1908 .getAlignmentAnnotation();
1911 for (int i = 0; i < nala.length; i++)
1913 AlignmentAnnotation na = nala[i];
1914 oal.addAnnotation(na);
1917 cap.setText(new FormatAdapter().formatSequences(e.getActionCommand(),
1918 oal, omitHidden, csel, sg));
1922 public void pdbFromFile_actionPerformed()
1924 jalview.io.JalviewFileChooser chooser = new jalview.io.JalviewFileChooser(
1925 jalview.bin.Cache.getProperty("LAST_DIRECTORY"));
1926 chooser.setFileView(new jalview.io.JalviewFileView());
1927 chooser.setDialogTitle("Select a PDB file for "
1928 + sequence.getDisplayId(false));
1929 chooser.setToolTipText("Load a PDB file and associate it with sequence '"
1930 + sequence.getDisplayId(false) + "'");
1932 int value = chooser.showOpenDialog(null);
1934 if (value == jalview.io.JalviewFileChooser.APPROVE_OPTION)
1936 String choice = chooser.getSelectedFile().getPath();
1937 jalview.bin.Cache.setProperty("LAST_DIRECTORY", choice);
1938 new AssociatePdbFileWithSeq().associatePdbWithSeq(choice,
1939 jalview.io.AppletFormatAdapter.FILE, sequence, true);
1944 public void enterPDB_actionPerformed()
1946 String id = JOptionPane.showInternalInputDialog(Desktop.desktop,
1947 "Enter PDB Id", "Enter PDB Id", JOptionPane.QUESTION_MESSAGE);
1949 if (id != null && id.length() > 0)
1951 PDBEntry entry = new PDBEntry();
1952 entry.setId(id.toUpperCase());
1953 sequence.getDatasetSequence().addPDBId(entry);
1957 public void discoverPDB_actionPerformed()
1960 final SequenceI[] sequences = ((ap.av.getSelectionGroup() == null) ? new SequenceI[]
1962 : ap.av.getSequenceSelection());
1963 Thread discpdb = new Thread(new Runnable()
1968 new jalview.ws.DBRefFetcher(sequences, ap.alignFrame)
1969 .fetchDBRefs(false);
1976 public void sequenceFeature_actionPerformed()
1978 SequenceGroup sg = ap.av.getSelectionGroup();
1984 int rsize = 0, gSize = sg.getSize();
1985 SequenceI[] rseqs, seqs = new SequenceI[gSize];
1986 SequenceFeature[] tfeatures, features = new SequenceFeature[gSize];
1988 for (int i = 0; i < gSize; i++)
1990 int start = sg.getSequenceAt(i).findPosition(sg.getStartRes());
1991 int end = sg.findEndRes(sg.getSequenceAt(i));
1994 seqs[rsize] = sg.getSequenceAt(i).getDatasetSequence();
1995 features[rsize] = new SequenceFeature(null, null, null, start, end,
2000 rseqs = new SequenceI[rsize];
2001 tfeatures = new SequenceFeature[rsize];
2002 System.arraycopy(seqs, 0, rseqs, 0, rsize);
2003 System.arraycopy(features, 0, tfeatures, 0, rsize);
2004 features = tfeatures;
2006 if (ap.seqPanel.seqCanvas.getFeatureRenderer().amendFeatures(seqs,
2007 features, true, ap))
2009 ap.alignFrame.setShowSeqFeatures(true);
2010 ap.highlightSearchResults(null);
2014 public void textColour_actionPerformed()
2016 SequenceGroup sg = getGroup();
2019 new TextColourChooser().chooseColour(ap, sg);
2023 public void colourByStructure(String pdbid)
2025 Annotation[] anots = ap.av.getStructureSelectionManager()
2026 .colourSequenceFromStructure(sequence, pdbid);
2028 AlignmentAnnotation an = new AlignmentAnnotation("Structure",
2029 "Coloured by " + pdbid, anots);
2031 ap.av.getAlignment().addAnnotation(an);
2032 an.createSequenceMapping(sequence, 0, true);
2033 // an.adjustForAlignment();
2034 ap.av.getAlignment().setAnnotationIndex(an, 0);
2036 ap.adjustAnnotationHeight();
2038 sequence.addAlignmentAnnotation(an);
2042 public void editSequence_actionPerformed(ActionEvent actionEvent)
2044 SequenceGroup sg = ap.av.getSelectionGroup();
2048 if (sequence == null)
2049 sequence = (Sequence) sg.getSequenceAt(0);
2051 EditNameDialog dialog = new EditNameDialog(
2052 sequence.getSequenceAsString(sg.getStartRes(),
2053 sg.getEndRes() + 1), null, "Edit Sequence ", null,
2054 "Edit Sequence", ap.alignFrame);
2058 EditCommand editCommand = new EditCommand("Edit Sequences",
2059 EditCommand.REPLACE, dialog.getName().replace(' ',
2060 ap.av.getGapCharacter()),
2061 sg.getSequencesAsArray(ap.av.getHiddenRepSequences()),
2062 sg.getStartRes(), sg.getEndRes() + 1, ap.av.getAlignment());
2064 ap.alignFrame.addHistoryItem(editCommand);
2066 ap.av.firePropertyChange("alignment", null, ap.av.getAlignment()