2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
3 * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, 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/>.
18 package jalview.appletgui;
23 import java.awt.event.*;
25 import jalview.analysis.*;
26 import jalview.commands.*;
27 import jalview.datamodel.*;
28 import jalview.schemes.*;
29 import jalview.util.UrlLink;
30 import jalview.io.AppletFormatAdapter;
32 public class APopupMenu extends java.awt.PopupMenu implements
33 ActionListener, ItemListener
35 Menu groupMenu = new Menu();
37 MenuItem editGroupName = new MenuItem();
39 protected MenuItem clustalColour = new MenuItem();
41 protected MenuItem zappoColour = new MenuItem();
43 protected MenuItem taylorColour = new MenuItem();
45 protected MenuItem hydrophobicityColour = new MenuItem();
47 protected MenuItem helixColour = new MenuItem();
49 protected MenuItem strandColour = new MenuItem();
51 protected MenuItem turnColour = new MenuItem();
53 protected MenuItem buriedColour = new MenuItem();
55 protected CheckboxMenuItem abovePIDColour = new CheckboxMenuItem();
57 protected MenuItem userDefinedColour = new MenuItem();
59 protected MenuItem PIDColour = new MenuItem();
61 protected MenuItem BLOSUM62Colour = new MenuItem();
63 MenuItem noColourmenuItem = new MenuItem();
65 protected CheckboxMenuItem conservationMenuItem = new CheckboxMenuItem();
67 final AlignmentPanel ap;
69 MenuItem unGroupMenuItem = new MenuItem();
71 MenuItem nucleotideMenuItem = new MenuItem();
73 Menu colourMenu = new Menu();
75 CheckboxMenuItem showBoxes = new CheckboxMenuItem();
77 CheckboxMenuItem showText = new CheckboxMenuItem();
79 CheckboxMenuItem showColourText = new CheckboxMenuItem();
81 CheckboxMenuItem displayNonconserved = new CheckboxMenuItem();
83 Menu editMenu = new Menu("Edit");
85 MenuItem copy = new MenuItem("Copy (Jalview Only)");
87 MenuItem cut = new MenuItem("Cut (Jalview Only)");
89 MenuItem toUpper = new MenuItem("To Upper Case");
91 MenuItem toLower = new MenuItem("To Lower Case");
93 MenuItem toggleCase = new MenuItem("Toggle Case");
95 Menu outputmenu = new Menu();
97 Menu seqMenu = new Menu();
99 MenuItem pdb = new MenuItem();
101 MenuItem hideSeqs = new MenuItem();
103 MenuItem repGroup = new MenuItem();
105 MenuItem sequenceName = new MenuItem("Edit Name/Description");
107 MenuItem sequenceFeature = new MenuItem("Create Sequence Feature");
109 MenuItem editSequence = new MenuItem("Edit Sequence");
113 MenuItem revealAll = new MenuItem();
115 MenuItem revealSeq = new MenuItem();
117 * index of sequence to be revealed
119 int revealSeq_index=-1;
120 Menu menu1 = new Menu();
122 public APopupMenu(AlignmentPanel apanel, final Sequence seq, Vector links)
124 // /////////////////////////////////////////////////////////
125 // If this is activated from the sequence panel, the user may want to
126 // edit or annotate a particular residue. Therefore display the residue menu
128 // If from the IDPanel, we must display the sequence menu
129 // ////////////////////////////////////////////////////////
137 } catch (Exception e)
142 for (int i = 0; i < jalview.io.AppletFormatAdapter.WRITEABLE_FORMATS.length; i++)
144 MenuItem item = new MenuItem(
145 jalview.io.AppletFormatAdapter.WRITEABLE_FORMATS[i]);
147 item.addActionListener(this);
148 outputmenu.add(item);
151 SequenceGroup sg = ap.av.getSelectionGroup();
153 if (sg != null && sg.getSize() > 0)
155 editGroupName.setLabel("Name: "+sg.getName());
156 showText.setState(sg.getDisplayText());
157 showColourText.setState(sg.getColourText());
158 showBoxes.setState(sg.getDisplayBoxes());
159 displayNonconserved.setState(sg.getShowNonconserved());
160 if (!ap.av.getAlignment().getGroups().contains(sg))
162 groupMenu.remove(unGroupMenuItem);
172 if (links != null && links.size() > 0)
174 Menu linkMenu = new Menu("Link");
176 for (int i = 0; i < links.size(); i++)
178 link = links.elementAt(i).toString();
179 UrlLink urlLink = new UrlLink(link);
180 if (!urlLink.isValid())
182 System.err.println(urlLink.getInvalidMessage());
185 final String target = urlLink.getTarget(); // link.substring(0,
186 // link.indexOf("|"));
187 final String label = urlLink.getLabel();
188 if (seq!=null && urlLink.isDynamic())
191 // collect matching db-refs
192 DBRefEntry[] dbr = jalview.util.DBRefUtils.selectRefs(
193 seq.getDBRef(), new String[]
195 // collect id string too
196 String id = seq.getName();
197 String descr = seq.getDescription();
198 if (descr != null && descr.length() < 1)
204 for (int r = 0; r < dbr.length; r++)
206 if (id != null && dbr[r].getAccessionId().equals(id))
208 // suppress duplicate link creation for the bare sequence ID
209 // string with this link
212 // create Bare ID link for this RUL
213 String[] urls = urlLink.makeUrls(dbr[r].getAccessionId(),
217 for (int u = 0; u < urls.length; u += 2)
219 addshowLink(linkMenu, label + "|" + urls[u], urls[u + 1]);
226 // create Bare ID link for this RUL
227 String[] urls = urlLink.makeUrls(id, true);
230 for (int u = 0; u < urls.length; u += 2)
232 addshowLink(linkMenu, label, urls[u + 1]);
235 // addshowLink(linkMenu, target, url_pref + id + url_suff);
237 // Now construct URLs from description but only try to do it for regex
239 if (descr != null && urlLink.getRegexReplace() != null)
241 // create link for this URL from description only if regex matches
242 String[] urls = urlLink.makeUrls(descr, true);
245 for (int u = 0; u < urls.length; u += 2)
247 addshowLink(linkMenu, label, urls[u + 1]);
254 addshowLink(linkMenu, target, urlLink.getUrl_prefix()); // link.substring(link.lastIndexOf("|")+1));
259 * if (link.indexOf("$SEQUENCE_ID$") > -1) { // Substitute SEQUENCE_ID
260 * string and any matching database reference accessions String url_pref
261 * = link.substring(link.indexOf("|") + 1,
262 * link.indexOf("$SEQUENCE_ID$"));
264 * String url_suff = link.substring(link.indexOf("$SEQUENCE_ID$") + 13);
265 * // collect matching db-refs DBRefEntry[] dbr =
266 * jalview.util.DBRefUtils.selectRefs(seq.getDBRef(), new
267 * String[]{target}); // collect id string too String id =
268 * seq.getName(); if (id.indexOf("|") > -1) { id =
269 * id.substring(id.lastIndexOf("|") + 1); } if (dbr!=null) { for (int
270 * r=0;r<dbr.length; r++) { if (dbr[r].getAccessionId().equals(id)) { //
271 * suppress duplicate link creation for the bare sequence ID string with
272 * this link id = null; } addshowLink(linkMenu,
273 * dbr[r].getSource()+"|"+dbr[r].getAccessionId(), target,
274 * url_pref+dbr[r].getAccessionId()+url_suff); } } if (id!=null) { //
275 * create Bare ID link for this RUL addshowLink(linkMenu, target,
276 * url_pref + id + url_suff); } } else { addshowLink(linkMenu, target,
277 * link.substring(link.lastIndexOf("|")+1)); }
280 if (linkMenu.getItemCount() > 0)
284 seqMenu.add(linkMenu);
292 // TODO: add group link menu entry here
295 seqMenu.setLabel(seq.getName());
296 repGroup.setLabel("Represent Group with " + seq.getName());
303 if (!ap.av.hasHiddenRows())
308 final int index = ap.av.getAlignment().findIndex(seq);
310 if (ap.av.adjustForHiddenSeqs(index)
311 - ap.av.adjustForHiddenSeqs(index - 1) > 1)
313 revealSeq_index=index;
321 * add a show URL menu item to the given linkMenu
325 * - menu label string
329 private void addshowLink(Menu linkMenu, final String target,
332 addshowLink(linkMenu, target, target, url);
336 * add a show URL menu item to the given linkMenu
340 * - URL target window
342 * - menu label string
346 private void addshowLink(Menu linkMenu, final String target,
347 final String label, final String url)
349 MenuItem item = new MenuItem(label);
350 item.addActionListener(new java.awt.event.ActionListener()
352 public void actionPerformed(ActionEvent e)
354 ap.alignFrame.showURL(url, target);
360 public void itemStateChanged(ItemEvent evt)
362 if (evt.getSource() == abovePIDColour)
364 abovePIDColour_itemStateChanged();
366 else if (evt.getSource() == showColourText)
368 showColourText_itemStateChanged();
370 else if (evt.getSource() == showText)
372 showText_itemStateChanged();
374 else if (evt.getSource() == showBoxes)
376 showBoxes_itemStateChanged();
378 else if (evt.getSource() == displayNonconserved)
380 this.showNonconserved_itemStateChanged();
384 public void actionPerformed(ActionEvent evt)
386 Object source = evt.getSource();
387 if (source == clustalColour)
389 clustalColour_actionPerformed();
391 else if (source == zappoColour)
393 zappoColour_actionPerformed();
395 else if (source == taylorColour)
397 taylorColour_actionPerformed();
399 else if (source == hydrophobicityColour)
401 hydrophobicityColour_actionPerformed();
403 else if (source == helixColour)
405 helixColour_actionPerformed();
407 else if (source == strandColour)
409 strandColour_actionPerformed();
411 else if (source == turnColour)
413 turnColour_actionPerformed();
415 else if (source == buriedColour)
417 buriedColour_actionPerformed();
419 else if (source == nucleotideMenuItem)
421 nucleotideMenuItem_actionPerformed();
424 else if (source == userDefinedColour)
426 userDefinedColour_actionPerformed();
428 else if (source == PIDColour)
430 PIDColour_actionPerformed();
432 else if (source == BLOSUM62Colour)
434 BLOSUM62Colour_actionPerformed();
436 else if (source == noColourmenuItem)
438 noColourmenuItem_actionPerformed();
440 else if (source == conservationMenuItem)
442 conservationMenuItem_itemStateChanged();
444 else if (source == unGroupMenuItem)
446 unGroupMenuItem_actionPerformed();
449 else if (source == sequenceName)
453 else if (source == pdb)
457 else if (source == hideSeqs)
459 hideSequences(false);
461 else if (source == repGroup)
465 else if (source == revealSeq)
467 ap.av.showSequence(revealSeq_index);
469 else if (source == revealAll)
471 ap.av.showAllHiddenSeqs();
474 else if (source == editGroupName)
476 EditNameDialog dialog = new EditNameDialog(getGroup().getName(),
477 getGroup().getDescription(), " Group Name",
478 "Group Description", ap.alignFrame,
479 "Edit Group Name / Description", 500, 100, true);
483 getGroup().setName(dialog.getName().replace(' ', '_'));
484 getGroup().setDescription(dialog.getDescription());
488 else if (source == copy)
490 ap.alignFrame.copy_actionPerformed();
492 else if (source == cut)
494 ap.alignFrame.cut_actionPerformed();
496 else if (source == editSequence)
498 SequenceGroup sg = ap.av.getSelectionGroup();
503 seq = (Sequence) sg.getSequenceAt(0);
505 EditNameDialog dialog = new EditNameDialog(seq.getSequenceAsString(
506 sg.getStartRes(), sg.getEndRes() + 1), null,
507 "Edit Sequence ", null,
509 ap.alignFrame, "Edit Sequence", 500, 100, true);
513 EditCommand editCommand = new EditCommand("Edit Sequences",
514 EditCommand.REPLACE, dialog.getName().replace(' ',
515 ap.av.getGapCharacter()),
516 sg.getSequencesAsArray(ap.av.getHiddenRepSequences()),
517 sg.getStartRes(), sg.getEndRes() + 1, ap.av.getAlignment());
519 ap.alignFrame.addHistoryItem(editCommand);
521 ap.av.firePropertyChange("alignment", null, ap.av.getAlignment()
526 else if (source == toUpper || source == toLower || source == toggleCase)
528 SequenceGroup sg = ap.av.getSelectionGroup();
529 Vector regions = new Vector();
532 int[][] startEnd = ap.av.getVisibleRegionBoundaries(sg.getStartRes(),
538 if (source == toggleCase)
540 description = "Toggle Case";
541 caseChange = ChangeCaseCommand.TOGGLE_CASE;
543 else if (source == toUpper)
545 description = "To Upper Case";
546 caseChange = ChangeCaseCommand.TO_UPPER;
550 description = "To Lower Case";
551 caseChange = ChangeCaseCommand.TO_LOWER;
554 ChangeCaseCommand caseCommand = new ChangeCaseCommand(description,
555 sg.getSequencesAsArray(ap.av.getHiddenRepSequences()), startEnd,
558 ap.alignFrame.addHistoryItem(caseCommand);
560 ap.av.firePropertyChange("alignment", null, ap.av.getAlignment()
565 else if (source == sequenceFeature)
567 SequenceGroup sg = ap.av.getSelectionGroup();
573 int rsize = 0, gSize = sg.getSize();
574 SequenceI[] rseqs, seqs = new SequenceI[gSize];
575 SequenceFeature[] tfeatures, features = new SequenceFeature[gSize];
577 for (int i = 0; i < gSize; i++)
579 int start = sg.getSequenceAt(i).findPosition(sg.getStartRes());
580 int end = sg.findEndRes(sg.getSequenceAt(i));
583 seqs[rsize] = sg.getSequenceAt(i);
584 features[rsize] = new SequenceFeature(null, null, null, start,
589 rseqs = new SequenceI[rsize];
590 tfeatures = new SequenceFeature[rsize];
591 System.arraycopy(seqs, 0, rseqs, 0, rsize);
592 System.arraycopy(features, 0, tfeatures, 0, rsize);
593 features = tfeatures;
596 if (ap.seqPanel.seqCanvas.getFeatureRenderer().amendFeatures(seqs,
599 ap.alignFrame.sequenceFeatures.setState(true);
600 ap.av.showSequenceFeatures(true);
601 ap.highlightSearchResults(null);
611 void outputText(ActionEvent e)
613 CutAndPasteTransfer cap = new CutAndPasteTransfer(true, ap.alignFrame);
615 Frame frame = new Frame();
617 jalview.bin.JalviewLite.addFrame(frame,
618 "Selection output - " + e.getActionCommand(), 600, 500);
619 // JBPNote: getSelectionAsNewSequence behaviour has changed - this method now returns a full copy of sequence data
620 // TODO consider using getSequenceSelection instead here
622 cap.setText(new jalview.io.AppletFormatAdapter().formatSequences(
623 e.getActionCommand(),
624 new Alignment(ap.av.getSelectionAsNewSequence()),
625 ap.av.showJVSuffix));
631 EditNameDialog dialog = new EditNameDialog(seq.getName(),
632 seq.getDescription(), " Sequence Name",
633 "Sequence Description", ap.alignFrame,
634 "Edit Sequence Name / Description", 500, 100, true);
638 seq.setName(dialog.getName());
639 seq.setDescription(dialog.getDescription());
640 ap.paintAlignment(false);
646 if (seq.getPDBId() != null)
648 PDBEntry entry = (PDBEntry) seq.getPDBId().firstElement();
650 if (ap.av.applet.jmolAvailable)
651 new jalview.appletgui.AppletJmol(entry, new Sequence[]
652 { seq }, null, ap, AppletFormatAdapter.URL);
654 new MCview.AppletPDBViewer(entry, new Sequence[]
655 { seq }, null, ap, AppletFormatAdapter.URL);
660 CutAndPasteTransfer cap = new CutAndPasteTransfer(true, ap.alignFrame);
661 cap.setText("Paste your PDB file here.");
662 cap.setPDBImport(seq);
663 Frame frame = new Frame();
665 jalview.bin.JalviewLite.addFrame(frame, "Paste PDB file for sequence "+seq.getName(), 400, 300);
669 private void jbInit() throws Exception
671 groupMenu.setLabel("Group");
672 groupMenu.setLabel("Selection");
673 sequenceFeature.addActionListener(this);
675 editGroupName.addActionListener(this);
676 unGroupMenuItem.setLabel("Remove Group");
677 unGroupMenuItem.addActionListener(this);
679 nucleotideMenuItem.setLabel("Nucleotide");
680 nucleotideMenuItem.addActionListener(this);
681 conservationMenuItem.addItemListener(this);
682 abovePIDColour.addItemListener(this);
683 colourMenu.setLabel("Group Colour");
684 showBoxes.setLabel("Boxes");
685 showBoxes.setState(true);
686 showBoxes.addItemListener(this);
687 sequenceName.addActionListener(this);
688 displayNonconserved.setLabel("Show Nonconserved");
689 displayNonconserved.setState(false);
690 displayNonconserved.addItemListener(this);
691 showText.setLabel("Text");
692 showText.addItemListener(this);
693 showColourText.setLabel("Colour Text");
694 showColourText.addItemListener(this);
695 outputmenu.setLabel("Output to Textbox...");
696 seqMenu.setLabel("Sequence");
697 pdb.setLabel("View PDB Structure");
698 hideSeqs.setLabel("Hide Sequences");
699 repGroup.setLabel("Represent Group with");
700 revealAll.setLabel("Reveal All");
701 revealSeq.setLabel("Reveal Sequences");
702 menu1.setLabel("Group");
708 groupMenu.add(editGroupName);
709 groupMenu.add(editMenu);
710 groupMenu.add(outputmenu);
711 groupMenu.add(sequenceFeature);
712 groupMenu.add(menu1);
714 colourMenu.add(noColourmenuItem);
715 colourMenu.add(clustalColour);
716 colourMenu.add(BLOSUM62Colour);
717 colourMenu.add(PIDColour);
718 colourMenu.add(zappoColour);
719 colourMenu.add(taylorColour);
720 colourMenu.add(hydrophobicityColour);
721 colourMenu.add(helixColour);
722 colourMenu.add(strandColour);
723 colourMenu.add(turnColour);
724 colourMenu.add(buriedColour);
725 colourMenu.add(nucleotideMenuItem);
726 colourMenu.add(userDefinedColour);
727 colourMenu.addSeparator();
728 colourMenu.add(abovePIDColour);
729 colourMenu.add(conservationMenuItem);
731 noColourmenuItem.setLabel("None");
732 noColourmenuItem.addActionListener(this);
734 clustalColour.setLabel("Clustalx colours");
735 clustalColour.addActionListener(this);
736 zappoColour.setLabel("Zappo");
737 zappoColour.addActionListener(this);
738 taylorColour.setLabel("Taylor");
739 taylorColour.addActionListener(this);
740 hydrophobicityColour.setLabel("Hydrophobicity");
741 hydrophobicityColour.addActionListener(this);
742 helixColour.setLabel("Helix propensity");
743 helixColour.addActionListener(this);
744 strandColour.setLabel("Strand propensity");
745 strandColour.addActionListener(this);
746 turnColour.setLabel("Turn propensity");
747 turnColour.addActionListener(this);
748 buriedColour.setLabel("Buried Index");
749 buriedColour.addActionListener(this);
750 abovePIDColour.setLabel("Above % Identity");
752 userDefinedColour.setLabel("User Defined");
753 userDefinedColour.addActionListener(this);
754 PIDColour.setLabel("Percentage Identity");
755 PIDColour.addActionListener(this);
756 BLOSUM62Colour.setLabel("BLOSUM62");
757 BLOSUM62Colour.addActionListener(this);
758 conservationMenuItem.setLabel("Conservation");
761 copy.addActionListener(this);
763 cut.addActionListener(this);
765 editMenu.add(editSequence);
766 editSequence.addActionListener(this);
768 editMenu.add(toUpper);
769 toUpper.addActionListener(this);
770 editMenu.add(toLower);
771 toLower.addActionListener(this);
772 editMenu.add(toggleCase);
773 seqMenu.add(sequenceName);
774 if (!ap.av.applet.useXtrnalSviewer)
778 seqMenu.add(repGroup);
779 menu1.add(unGroupMenuItem);
780 menu1.add(colourMenu);
781 menu1.add(showBoxes);
783 menu1.add(showColourText);
784 menu1.add(displayNonconserved);
785 toggleCase.addActionListener(this);
786 pdb.addActionListener(this);
787 hideSeqs.addActionListener(this);
788 repGroup.addActionListener(this);
789 revealAll.addActionListener(this);
790 revealSeq.addActionListener(this);
795 ap.paintAlignment(true);
798 protected void clustalColour_actionPerformed()
800 SequenceGroup sg = getGroup();
801 sg.cs = new ClustalxColourScheme(
802 sg.getSequences(ap.av.getHiddenRepSequences()),
803 ap.av.getAlignment().getWidth());
807 protected void zappoColour_actionPerformed()
809 getGroup().cs = new ZappoColourScheme();
813 protected void taylorColour_actionPerformed()
815 getGroup().cs = new TaylorColourScheme();
819 protected void hydrophobicityColour_actionPerformed()
821 getGroup().cs = new HydrophobicColourScheme();
825 protected void helixColour_actionPerformed()
827 getGroup().cs = new HelixColourScheme();
831 protected void strandColour_actionPerformed()
833 getGroup().cs = new StrandColourScheme();
837 protected void turnColour_actionPerformed()
839 getGroup().cs = new TurnColourScheme();
843 protected void buriedColour_actionPerformed()
845 getGroup().cs = new BuriedColourScheme();
849 public void nucleotideMenuItem_actionPerformed()
851 getGroup().cs = new NucleotideColourScheme();
855 protected void abovePIDColour_itemStateChanged()
857 SequenceGroup sg = getGroup();
863 if (abovePIDColour.getState())
865 sg.cs.setConsensus(AAFrequency.calculate(
866 sg.getSequences(ap.av.getHiddenRepSequences()), 0,
867 ap.av.getAlignment().getWidth()));
868 int threshold = SliderPanel.setPIDSliderSource(ap, sg.cs, getGroup()
871 sg.cs.setThreshold(threshold, ap.av.getIgnoreGapsConsensus());
873 SliderPanel.showPIDSlider();
877 // remove PIDColouring
879 sg.cs.setThreshold(0, ap.av.getIgnoreGapsConsensus());
886 protected void userDefinedColour_actionPerformed()
888 new UserDefinedColours(ap, getGroup());
891 protected void PIDColour_actionPerformed()
893 SequenceGroup sg = getGroup();
894 sg.cs = new PIDColourScheme();
895 sg.cs.setConsensus(AAFrequency.calculate(
896 sg.getSequences(ap.av.getHiddenRepSequences()), 0,
897 ap.av.getAlignment().getWidth()));
901 protected void BLOSUM62Colour_actionPerformed()
903 SequenceGroup sg = getGroup();
905 sg.cs = new Blosum62ColourScheme();
907 sg.cs.setConsensus(AAFrequency.calculate(
908 sg.getSequences(ap.av.getHiddenRepSequences()), 0,
909 ap.av.getAlignment().getWidth()));
914 protected void noColourmenuItem_actionPerformed()
916 getGroup().cs = null;
920 protected void conservationMenuItem_itemStateChanged()
922 SequenceGroup sg = getGroup();
928 if (conservationMenuItem.getState())
931 sg.cs.setConservation(Conservation.calculateConservation("Group",
932 ResidueProperties.propHash, 3,
933 sg.getSequences(ap.av.getHiddenRepSequences()), 0,
934 ap.av.getAlignment().getWidth(),
935 false, ap.av.getConsPercGaps(),false));
936 SliderPanel.setConservationSlider(ap, sg.cs, sg.getName());
937 SliderPanel.showConservationSlider();
940 // remove ConservationColouring
942 sg.cs.setConservation(null);
948 SequenceGroup getGroup()
950 SequenceGroup sg = ap.av.getSelectionGroup();
952 // this method won't add a new group if it already exists
955 ap.av.getAlignment().addGroup(sg);
961 void unGroupMenuItem_actionPerformed()
963 SequenceGroup sg = ap.av.getSelectionGroup();
964 ap.av.getAlignment().deleteGroup(sg);
965 ap.av.setSelectionGroup(null);
966 ap.paintAlignment(true);
969 public void showColourText_itemStateChanged()
971 getGroup().setColourText(showColourText.getState());
975 public void showText_itemStateChanged()
977 getGroup().setDisplayText(showText.getState());
981 public void showNonconserved_itemStateChanged()
983 getGroup().setShowNonconserved(this.displayNonconserved.getState());
987 public void showBoxes_itemStateChanged()
989 getGroup().setDisplayBoxes(showBoxes.getState());
993 void hideSequences(boolean representGroup)
995 SequenceGroup sg = ap.av.getSelectionGroup();
996 if (sg == null || sg.getSize() < 1)
998 ap.av.hideSequence(new SequenceI[]
1003 ap.av.setSelectionGroup(null);
1007 ap.av.hideRepSequences(seq, sg);
1012 int gsize = sg.getSize();
1015 hseqs = new SequenceI[gsize];
1018 for (int i = 0; i < gsize; i++)
1020 hseqs[index++] = sg.getSequenceAt(i);
1023 ap.av.hideSequence(hseqs);
1024 ap.av.sendSelection();