/* * Jalview - A Sequence Alignment Editor and Viewer * Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ package jalview.appletgui; import java.awt.*; import java.awt.event.*; import java.util.Vector; import jalview.analysis.*; import jalview.datamodel.*; import jalview.schemes.*; public class APopupMenu extends java.awt.PopupMenu { Menu groupMenu = new Menu(); protected MenuItem clustalColour = new MenuItem(); protected MenuItem zappoColour = new MenuItem(); protected MenuItem taylorColour = new MenuItem(); protected MenuItem hydrophobicityColour = new MenuItem(); protected MenuItem helixColour = new MenuItem(); protected MenuItem strandColour = new MenuItem(); protected MenuItem turnColour = new MenuItem(); protected MenuItem buriedColour = new MenuItem(); protected CheckboxMenuItem abovePIDColour = new CheckboxMenuItem(); protected MenuItem userDefinedColour = new MenuItem(); protected MenuItem PIDColour = new MenuItem(); protected MenuItem BLOSUM62Colour = new MenuItem(); MenuItem noColourmenuItem = new MenuItem(); protected CheckboxMenuItem conservationMenuItem = new CheckboxMenuItem(); AlignmentPanel ap; MenuItem unGroupMenuItem = new MenuItem(); MenuItem nucleotideMenuItem = new MenuItem(); Menu colourMenu = new Menu(); CheckboxMenuItem showBoxes = new CheckboxMenuItem(); CheckboxMenuItem showText = new CheckboxMenuItem(); CheckboxMenuItem showColourText = new CheckboxMenuItem(); public APopupMenu(AlignmentPanel ap, Sequence seq, Vector links) { /////////////////////////////////////////////////////////// // If this is activated from the sequence panel, the user may want to // edit or annotate a particular residue. Therefore display the residue menu // // If from the IDPanel, we must display the sequence menu ////////////////////////////////////////////////////////// this.ap = ap; try { jbInit(); } catch (Exception e) { e.printStackTrace(); } SequenceGroup sg = ap.av.getSelectionGroup(); if (sg != null) { showText.setState(sg.getDisplayText()); showColourText.setState(sg.getColourText()); showBoxes.setState(sg.getDisplayBoxes()); } if (!ap.av.alignment.getGroups().contains(sg)) { groupMenu.remove(unGroupMenuItem); } if (seq != null && links!=null) { Menu linkMenu = new Menu("Link"); MenuItem item; String link; for(int i=0; i