/* * 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.datamodel; import jalview.datamodel.*; import jalview.schemes.*; import java.util.*; /** * DOCUMENT ME! * * @author $author$ * @version $Revision$ */ public class SuperGroup { String groupName; boolean displayBoxes; boolean displayText; boolean colourText; /** DOCUMENT ME!! */ public ColourSchemeI cs; Vector sequenceGroups = new Vector(); /** * Creates a new SuperGroup object. */ public SuperGroup() { groupName = "Super group"; this.displayBoxes = true; this.displayText = true; this.colourText = false; cs = null; } /** * Creates a new SuperGroup object. * * @param groupName DOCUMENT ME! * @param scheme DOCUMENT ME! * @param displayBoxes DOCUMENT ME! * @param displayText DOCUMENT ME! * @param colourText DOCUMENT ME! */ public SuperGroup(String groupName, ColourSchemeI scheme, boolean displayBoxes, boolean displayText, boolean colourText) { this.groupName = groupName; this.displayBoxes = displayBoxes; this.displayText = displayText; this.colourText = colourText; this.cs = scheme; } /** * DOCUMENT ME! * * @return DOCUMENT ME! */ public String getName() { return groupName; } /** * DOCUMENT ME! * * @param name DOCUMENT ME! */ public void setName(String name) { groupName = name; } /** * DOCUMENT ME! * * @param sg DOCUMENT ME! */ public void addGroup(SequenceGroup sg) { if (!sequenceGroups.contains(sg)) { sequenceGroups.addElement(sg); } } /** * DOCUMENT ME! * * @param sg DOCUMENT ME! */ public void addOrRemove(SequenceGroup sg) { if (sequenceGroups.contains(sg)) { deleteGroup(sg); } else { addGroup(sg); } } /** * DOCUMENT ME! * * @param sg DOCUMENT ME! */ public void deleteGroup(SequenceGroup sg) { sequenceGroups.removeElement(sg); } /** * DOCUMENT ME! * * @param sg DOCUMENT ME! */ public void setSuperGroupProperties(SequenceGroup sg) { cs = sg.cs; colourText = sg.colourText; displayText = sg.displayText; displayBoxes = sg.displayBoxes; for (int i = 0; i < sequenceGroups.size(); i++) { SequenceGroup temp = (SequenceGroup) sequenceGroups.elementAt(i); temp.cs = sg.cs; temp.colourText = sg.colourText; temp.displayText = sg.displayText; temp.displayBoxes = sg.displayBoxes; } } /** * DOCUMENT ME! * * @return DOCUMENT ME! */ public int getSize() { return sequenceGroups.size(); } /** * DOCUMENT ME! * * @param i DOCUMENT ME! * * @return DOCUMENT ME! */ public SequenceGroup getGroupeAt(int i) { return (SequenceGroup) sequenceGroups.elementAt(i); } }