2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.6)
3 * Copyright (C) 2010 J Procter, AM Waterhouse, 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 Menu menu1 = new Menu();
117 public APopupMenu(AlignmentPanel apanel, final Sequence seq, Vector links)
119 // /////////////////////////////////////////////////////////
120 // If this is activated from the sequence panel, the user may want to
121 // edit or annotate a particular residue. Therefore display the residue menu
123 // If from the IDPanel, we must display the sequence menu
124 // ////////////////////////////////////////////////////////
132 } catch (Exception e)
137 for (int i = 0; i < jalview.io.AppletFormatAdapter.WRITEABLE_FORMATS.length; i++)
139 MenuItem item = new MenuItem(
140 jalview.io.AppletFormatAdapter.WRITEABLE_FORMATS[i]);
142 item.addActionListener(this);
143 outputmenu.add(item);
146 SequenceGroup sg = ap.av.getSelectionGroup();
148 if (sg != null && sg.getSize() > 0)
150 editGroupName.setLabel(sg.getName());
151 showText.setState(sg.getDisplayText());
152 showColourText.setState(sg.getColourText());
153 showBoxes.setState(sg.getDisplayBoxes());
154 displayNonconserved.setState(sg.getShowNonconserved());
155 if (!ap.av.alignment.getGroups().contains(sg))
157 groupMenu.remove(unGroupMenuItem);
167 if (links != null && links.size() > 0)
169 Menu linkMenu = new Menu("Link");
171 for (int i = 0; i < links.size(); i++)
173 link = links.elementAt(i).toString();
174 UrlLink urlLink = new UrlLink(link);
175 if (!urlLink.isValid())
177 System.err.println(urlLink.getInvalidMessage());
180 final String target = urlLink.getTarget(); // link.substring(0,
181 // link.indexOf("|"));
182 final String label = urlLink.getLabel();
183 if (urlLink.isDynamic())
186 // collect matching db-refs
187 DBRefEntry[] dbr = jalview.util.DBRefUtils.selectRefs(
188 seq.getDBRef(), new String[]
190 // collect id string too
191 String id = seq.getName();
192 String descr = seq.getDescription();
193 if (descr != null && descr.length() < 1)
199 for (int r = 0; r < dbr.length; r++)
201 if (id != null && dbr[r].getAccessionId().equals(id))
203 // suppress duplicate link creation for the bare sequence ID
204 // string with this link
207 // create Bare ID link for this RUL
208 String[] urls = urlLink.makeUrls(dbr[r].getAccessionId(),
212 for (int u = 0; u < urls.length; u += 2)
214 addshowLink(linkMenu, label + "|" + urls[u], urls[u + 1]);
221 // create Bare ID link for this RUL
222 String[] urls = urlLink.makeUrls(id, true);
225 for (int u = 0; u < urls.length; u += 2)
227 addshowLink(linkMenu, label, urls[u + 1]);
230 // addshowLink(linkMenu, target, url_pref + id + url_suff);
232 // Now construct URLs from description but only try to do it for regex
234 if (descr != null && urlLink.getRegexReplace() != null)
236 // create link for this URL from description only if regex matches
237 String[] urls = urlLink.makeUrls(descr, true);
240 for (int u = 0; u < urls.length; u += 2)
242 addshowLink(linkMenu, label, urls[u + 1]);
249 addshowLink(linkMenu, target, urlLink.getUrl_prefix()); // link.substring(link.lastIndexOf("|")+1));
254 * if (link.indexOf("$SEQUENCE_ID$") > -1) { // Substitute SEQUENCE_ID
255 * string and any matching database reference accessions String url_pref
256 * = link.substring(link.indexOf("|") + 1,
257 * link.indexOf("$SEQUENCE_ID$"));
259 * String url_suff = link.substring(link.indexOf("$SEQUENCE_ID$") + 13);
260 * // collect matching db-refs DBRefEntry[] dbr =
261 * jalview.util.DBRefUtils.selectRefs(seq.getDBRef(), new
262 * String[]{target}); // collect id string too String id =
263 * seq.getName(); if (id.indexOf("|") > -1) { id =
264 * id.substring(id.lastIndexOf("|") + 1); } if (dbr!=null) { for (int
265 * r=0;r<dbr.length; r++) { if (dbr[r].getAccessionId().equals(id)) { //
266 * suppress duplicate link creation for the bare sequence ID string with
267 * this link id = null; } addshowLink(linkMenu,
268 * dbr[r].getSource()+"|"+dbr[r].getAccessionId(), target,
269 * url_pref+dbr[r].getAccessionId()+url_suff); } } if (id!=null) { //
270 * create Bare ID link for this RUL addshowLink(linkMenu, target,
271 * url_pref + id + url_suff); } } else { addshowLink(linkMenu, target,
272 * link.substring(link.lastIndexOf("|")+1)); }
275 if (linkMenu.getItemCount() > 0)
279 seqMenu.add(linkMenu);
287 // TODO: add group link menu entry here
290 seqMenu.setLabel(seq.getName());
291 repGroup.setLabel("Represent Group with " + seq.getName());
298 if (!ap.av.hasHiddenRows)
305 * add a show URL menu item to the given linkMenu
309 * - menu label string
313 private void addshowLink(Menu linkMenu, final String target,
316 addshowLink(linkMenu, target, target, url);
320 * add a show URL menu item to the given linkMenu
324 * - URL target window
326 * - menu label string
330 private void addshowLink(Menu linkMenu, final String target,
331 final String label, final String url)
333 MenuItem item = new MenuItem(label);
334 item.addActionListener(new java.awt.event.ActionListener()
336 public void actionPerformed(ActionEvent e)
338 ap.alignFrame.showURL(url, target);
344 public void itemStateChanged(ItemEvent evt)
346 if (evt.getSource() == abovePIDColour)
348 abovePIDColour_itemStateChanged();
350 else if (evt.getSource() == showColourText)
352 showColourText_itemStateChanged();
354 else if (evt.getSource() == showText)
356 showText_itemStateChanged();
358 else if (evt.getSource() == showBoxes)
360 showBoxes_itemStateChanged();
362 else if (evt.getSource() == displayNonconserved)
364 this.showNonconserved_itemStateChanged();
368 public void actionPerformed(ActionEvent evt)
370 Object source = evt.getSource();
371 if (source == clustalColour)
373 clustalColour_actionPerformed();
375 else if (source == zappoColour)
377 zappoColour_actionPerformed();
379 else if (source == taylorColour)
381 taylorColour_actionPerformed();
383 else if (source == hydrophobicityColour)
385 hydrophobicityColour_actionPerformed();
387 else if (source == helixColour)
389 helixColour_actionPerformed();
391 else if (source == strandColour)
393 strandColour_actionPerformed();
395 else if (source == turnColour)
397 turnColour_actionPerformed();
399 else if (source == buriedColour)
401 buriedColour_actionPerformed();
403 else if (source == nucleotideMenuItem)
405 nucleotideMenuItem_actionPerformed();
408 else if (source == userDefinedColour)
410 userDefinedColour_actionPerformed();
412 else if (source == PIDColour)
414 PIDColour_actionPerformed();
416 else if (source == BLOSUM62Colour)
418 BLOSUM62Colour_actionPerformed();
420 else if (source == noColourmenuItem)
422 noColourmenuItem_actionPerformed();
424 else if (source == conservationMenuItem)
426 conservationMenuItem_itemStateChanged();
428 else if (source == unGroupMenuItem)
430 unGroupMenuItem_actionPerformed();
433 else if (source == sequenceName)
437 else if (source == pdb)
441 else if (source == hideSeqs)
443 hideSequences(false);
445 else if (source == repGroup)
449 else if (source == revealAll)
451 ap.av.showAllHiddenSeqs();
454 else if (source == editGroupName)
456 EditNameDialog dialog = new EditNameDialog(getGroup().getName(),
457 getGroup().getDescription(), " Group Name",
458 "Group Description", ap.alignFrame,
459 "Edit Group Name / Description", 500, 100, true);
463 getGroup().setName(dialog.getName().replace(' ', '_'));
464 getGroup().setDescription(dialog.getDescription());
468 else if (source == copy)
470 ap.alignFrame.copy_actionPerformed();
472 else if (source == cut)
474 ap.alignFrame.cut_actionPerformed();
476 else if (source == editSequence)
478 SequenceGroup sg = ap.av.getSelectionGroup();
483 seq = (Sequence) sg.getSequenceAt(0);
485 EditNameDialog dialog = new EditNameDialog(seq.getSequenceAsString(
486 sg.getStartRes(), sg.getEndRes() + 1), null,
487 "Edit Sequence ", null,
489 ap.alignFrame, "Edit Sequence", 500, 100, true);
493 EditCommand editCommand = new EditCommand("Edit Sequences",
494 EditCommand.REPLACE, dialog.getName().replace(' ',
495 ap.av.getGapCharacter()),
496 sg.getSequencesAsArray(ap.av.hiddenRepSequences),
497 sg.getStartRes(), sg.getEndRes() + 1, ap.av.alignment);
499 ap.alignFrame.addHistoryItem(editCommand);
501 ap.av.firePropertyChange("alignment", null, ap.av.getAlignment()
506 else if (source == toUpper || source == toLower || source == toggleCase)
508 SequenceGroup sg = ap.av.getSelectionGroup();
509 Vector regions = new Vector();
512 int start = sg.getStartRes();
513 int end = sg.getEndRes() + 1;
517 if (ap.av.hasHiddenColumns)
521 start = ap.av.colSel.adjustForHiddenColumns(start);
524 end = ap.av.colSel.getHiddenBoundaryRight(start);
527 end = sg.getEndRes() + 1;
529 if (end > sg.getEndRes())
531 end = sg.getEndRes() + 1;
535 regions.addElement(new int[]
538 if (ap.av.hasHiddenColumns)
540 start = ap.av.colSel.adjustForHiddenColumns(end);
541 start = ap.av.colSel.getHiddenBoundaryLeft(start) + 1;
543 } while (end < sg.getEndRes());
545 int[][] startEnd = new int[regions.size()][2];
546 for (int i = 0; i < regions.size(); i++)
548 startEnd[i] = (int[]) regions.elementAt(i);
554 if (source == toggleCase)
556 description = "Toggle Case";
557 caseChange = ChangeCaseCommand.TOGGLE_CASE;
559 else if (source == toUpper)
561 description = "To Upper Case";
562 caseChange = ChangeCaseCommand.TO_UPPER;
566 description = "To Lower Case";
567 caseChange = ChangeCaseCommand.TO_LOWER;
570 ChangeCaseCommand caseCommand = new ChangeCaseCommand(description,
571 sg.getSequencesAsArray(ap.av.hiddenRepSequences), startEnd,
574 ap.alignFrame.addHistoryItem(caseCommand);
576 ap.av.firePropertyChange("alignment", null, ap.av.getAlignment()
581 else if (source == sequenceFeature)
583 SequenceGroup sg = ap.av.getSelectionGroup();
589 int rsize = 0, gSize = sg.getSize();
590 SequenceI[] rseqs, seqs = new SequenceI[gSize];
591 SequenceFeature[] tfeatures, features = new SequenceFeature[gSize];
593 for (int i = 0; i < gSize; i++)
595 int start = sg.getSequenceAt(i).findPosition(sg.getStartRes());
596 int end = sg.findEndRes(sg.getSequenceAt(i));
599 seqs[rsize] = sg.getSequenceAt(i);
600 features[rsize] = new SequenceFeature(null, null, null, start,
605 rseqs = new SequenceI[rsize];
606 tfeatures = new SequenceFeature[rsize];
607 System.arraycopy(seqs, 0, rseqs, 0, rsize);
608 System.arraycopy(features, 0, tfeatures, 0, rsize);
609 features = tfeatures;
612 if (ap.seqPanel.seqCanvas.getFeatureRenderer().amendFeatures(seqs,
615 ap.alignFrame.sequenceFeatures.setState(true);
616 ap.av.showSequenceFeatures(true);
617 ap.highlightSearchResults(null);
627 void outputText(ActionEvent e)
629 CutAndPasteTransfer cap = new CutAndPasteTransfer(true, ap.alignFrame);
631 Frame frame = new Frame();
633 jalview.bin.JalviewLite.addFrame(frame,
634 "Selection output - " + e.getActionCommand(), 600, 500);
636 cap.setText(new jalview.io.AppletFormatAdapter().formatSequences(
637 e.getActionCommand(),
638 new Alignment(ap.av.getSelectionAsNewSequence()),
639 ap.av.showJVSuffix));
645 EditNameDialog dialog = new EditNameDialog(seq.getName(),
646 seq.getDescription(), " Sequence Name",
647 "Sequence Description", ap.alignFrame,
648 "Edit Sequence Name / Description", 500, 100, true);
652 seq.setName(dialog.getName());
653 seq.setDescription(dialog.getDescription());
654 ap.paintAlignment(false);
660 if (seq.getPDBId() != null)
662 PDBEntry entry = (PDBEntry) seq.getPDBId().firstElement();
664 if (ap.av.applet.jmolAvailable)
665 new jalview.appletgui.AppletJmol(entry, new Sequence[]
666 { seq }, null, ap, AppletFormatAdapter.URL);
668 new MCview.AppletPDBViewer(entry, new Sequence[]
669 { seq }, null, ap, AppletFormatAdapter.URL);
674 CutAndPasteTransfer cap = new CutAndPasteTransfer(true, ap.alignFrame);
675 cap.setText("Paste your PDB file here.");
676 cap.setPDBImport(seq);
677 Frame frame = new Frame();
679 jalview.bin.JalviewLite.addFrame(frame, "Paste PDB file ", 400, 300);
683 private void jbInit() throws Exception
685 groupMenu.setLabel("Group");
686 groupMenu.setLabel("Selection");
687 sequenceFeature.addActionListener(this);
689 editGroupName.addActionListener(this);
690 unGroupMenuItem.setLabel("Remove Group");
691 unGroupMenuItem.addActionListener(this);
693 nucleotideMenuItem.setLabel("Nucleotide");
694 nucleotideMenuItem.addActionListener(this);
695 conservationMenuItem.addItemListener(this);
696 abovePIDColour.addItemListener(this);
697 colourMenu.setLabel("Group Colour");
698 showBoxes.setLabel("Boxes");
699 showBoxes.setState(true);
700 showBoxes.addItemListener(this);
701 sequenceName.addActionListener(this);
702 displayNonconserved.setLabel("Show Nonconserved");
703 displayNonconserved.setState(false);
704 displayNonconserved.addItemListener(this);
705 showText.setLabel("Text");
706 showText.addItemListener(this);
707 showColourText.setLabel("Colour Text");
708 showColourText.addItemListener(this);
709 outputmenu.setLabel("Output to Textbox...");
710 seqMenu.setLabel("Sequence");
711 pdb.setLabel("View PDB Structure");
712 hideSeqs.setLabel("Hide Sequences");
713 repGroup.setLabel("Represent Group with");
714 revealAll.setLabel("Reveal All");
715 menu1.setLabel("Group");
720 groupMenu.add(editGroupName);
721 groupMenu.add(editMenu);
722 groupMenu.add(outputmenu);
723 groupMenu.add(sequenceFeature);
724 groupMenu.add(menu1);
726 colourMenu.add(noColourmenuItem);
727 colourMenu.add(clustalColour);
728 colourMenu.add(BLOSUM62Colour);
729 colourMenu.add(PIDColour);
730 colourMenu.add(zappoColour);
731 colourMenu.add(taylorColour);
732 colourMenu.add(hydrophobicityColour);
733 colourMenu.add(helixColour);
734 colourMenu.add(strandColour);
735 colourMenu.add(turnColour);
736 colourMenu.add(buriedColour);
737 colourMenu.add(nucleotideMenuItem);
738 colourMenu.add(userDefinedColour);
739 colourMenu.addSeparator();
740 colourMenu.add(abovePIDColour);
741 colourMenu.add(conservationMenuItem);
743 noColourmenuItem.setLabel("None");
744 noColourmenuItem.addActionListener(this);
746 clustalColour.setLabel("Clustalx colours");
747 clustalColour.addActionListener(this);
748 zappoColour.setLabel("Zappo");
749 zappoColour.addActionListener(this);
750 taylorColour.setLabel("Taylor");
751 taylorColour.addActionListener(this);
752 hydrophobicityColour.setLabel("Hydrophobicity");
753 hydrophobicityColour.addActionListener(this);
754 helixColour.setLabel("Helix propensity");
755 helixColour.addActionListener(this);
756 strandColour.setLabel("Strand propensity");
757 strandColour.addActionListener(this);
758 turnColour.setLabel("Turn propensity");
759 turnColour.addActionListener(this);
760 buriedColour.setLabel("Buried Index");
761 buriedColour.addActionListener(this);
762 abovePIDColour.setLabel("Above % Identity");
764 userDefinedColour.setLabel("User Defined");
765 userDefinedColour.addActionListener(this);
766 PIDColour.setLabel("Percentage Identity");
767 PIDColour.addActionListener(this);
768 BLOSUM62Colour.setLabel("BLOSUM62");
769 BLOSUM62Colour.addActionListener(this);
770 conservationMenuItem.setLabel("Conservation");
773 copy.addActionListener(this);
775 cut.addActionListener(this);
777 editMenu.add(editSequence);
778 editSequence.addActionListener(this);
780 editMenu.add(toUpper);
781 toUpper.addActionListener(this);
782 editMenu.add(toLower);
783 toLower.addActionListener(this);
784 editMenu.add(toggleCase);
785 seqMenu.add(sequenceName);
787 seqMenu.add(repGroup);
788 menu1.add(unGroupMenuItem);
789 menu1.add(colourMenu);
790 menu1.add(showBoxes);
792 menu1.add(showColourText);
793 menu1.add(displayNonconserved);
794 toggleCase.addActionListener(this);
795 pdb.addActionListener(this);
796 hideSeqs.addActionListener(this);
797 repGroup.addActionListener(this);
798 revealAll.addActionListener(this);
803 ap.paintAlignment(true);
806 protected void clustalColour_actionPerformed()
808 SequenceGroup sg = getGroup();
809 sg.cs = new ClustalxColourScheme(
810 sg.getSequences(ap.av.hiddenRepSequences),
811 ap.av.alignment.getWidth());
815 protected void zappoColour_actionPerformed()
817 getGroup().cs = new ZappoColourScheme();
821 protected void taylorColour_actionPerformed()
823 getGroup().cs = new TaylorColourScheme();
827 protected void hydrophobicityColour_actionPerformed()
829 getGroup().cs = new HydrophobicColourScheme();
833 protected void helixColour_actionPerformed()
835 getGroup().cs = new HelixColourScheme();
839 protected void strandColour_actionPerformed()
841 getGroup().cs = new StrandColourScheme();
845 protected void turnColour_actionPerformed()
847 getGroup().cs = new TurnColourScheme();
851 protected void buriedColour_actionPerformed()
853 getGroup().cs = new BuriedColourScheme();
857 public void nucleotideMenuItem_actionPerformed()
859 getGroup().cs = new NucleotideColourScheme();
863 protected void abovePIDColour_itemStateChanged()
865 SequenceGroup sg = getGroup();
871 if (abovePIDColour.getState())
873 sg.cs.setConsensus(AAFrequency.calculate(
874 sg.getSequences(ap.av.hiddenRepSequences), 0,
875 ap.av.alignment.getWidth()));
876 int threshold = SliderPanel.setPIDSliderSource(ap, sg.cs, getGroup()
879 sg.cs.setThreshold(threshold, ap.av.getIgnoreGapsConsensus());
881 SliderPanel.showPIDSlider();
885 // remove PIDColouring
887 sg.cs.setThreshold(0, ap.av.getIgnoreGapsConsensus());
894 protected void userDefinedColour_actionPerformed()
896 new UserDefinedColours(ap, getGroup());
899 protected void PIDColour_actionPerformed()
901 SequenceGroup sg = getGroup();
902 sg.cs = new PIDColourScheme();
903 sg.cs.setConsensus(AAFrequency.calculate(
904 sg.getSequences(ap.av.hiddenRepSequences), 0,
905 ap.av.alignment.getWidth()));
909 protected void BLOSUM62Colour_actionPerformed()
911 SequenceGroup sg = getGroup();
913 sg.cs = new Blosum62ColourScheme();
915 sg.cs.setConsensus(AAFrequency.calculate(
916 sg.getSequences(ap.av.hiddenRepSequences), 0,
917 ap.av.alignment.getWidth()));
922 protected void noColourmenuItem_actionPerformed()
924 getGroup().cs = null;
928 protected void conservationMenuItem_itemStateChanged()
930 SequenceGroup sg = getGroup();
936 if (conservationMenuItem.getState())
939 Conservation c = new Conservation("Group",
940 ResidueProperties.propHash, 3,
941 sg.getSequences(ap.av.hiddenRepSequences), 0,
942 ap.av.alignment.getWidth());
945 c.verdict(false, ap.av.ConsPercGaps);
947 sg.cs.setConservation(c);
949 SliderPanel.setConservationSlider(ap, sg.cs, sg.getName());
950 SliderPanel.showConservationSlider();
953 // remove ConservationColouring
955 sg.cs.setConservation(null);
961 SequenceGroup getGroup()
963 SequenceGroup sg = ap.av.getSelectionGroup();
965 // this method won't add a new group if it already exists
968 ap.av.alignment.addGroup(sg);
974 void unGroupMenuItem_actionPerformed()
976 SequenceGroup sg = ap.av.getSelectionGroup();
977 ap.av.alignment.deleteGroup(sg);
978 ap.av.setSelectionGroup(null);
979 ap.paintAlignment(true);
982 public void showColourText_itemStateChanged()
984 getGroup().setColourText(showColourText.getState());
988 public void showText_itemStateChanged()
990 getGroup().setDisplayText(showText.getState());
994 public void showNonconserved_itemStateChanged()
996 getGroup().setShowNonconserved(this.displayNonconserved.getState());
1000 public void showBoxes_itemStateChanged()
1002 getGroup().setDisplayBoxes(showBoxes.getState());
1006 void hideSequences(boolean representGroup)
1008 SequenceGroup sg = ap.av.getSelectionGroup();
1009 if (sg == null || sg.getSize() < 1)
1011 ap.av.hideSequence(new SequenceI[]
1016 ap.av.setSelectionGroup(null);
1020 ap.av.hideRepSequences(seq, sg);
1025 int gsize = sg.getSize();
1028 hseqs = new SequenceI[gsize];
1031 for (int i = 0; i < gsize; i++)
1033 hseqs[index++] = sg.getSequenceAt(i);
1036 ap.av.hideSequence(hseqs);