X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fappletgui%2FAPopupMenu.java;h=13390d92d3cb42d629e69b611797489c1349cb83;hb=cdb2c3afc153577cceb0d5c6a4b12532f6dde601;hp=5f2a977d892c19dffa7ba0d63de13d50589cb142;hpb=2de8acfae59aced665e4c37ad0f7dcc2ed68818e;p=jalview.git diff --git a/src/jalview/appletgui/APopupMenu.java b/src/jalview/appletgui/APopupMenu.java index 5f2a977..13390d9 100755 --- a/src/jalview/appletgui/APopupMenu.java +++ b/src/jalview/appletgui/APopupMenu.java @@ -1,20 +1,19 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Development Version 2.4.1) - * Copyright (C) 2009 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5) + * Copyright (C) 2010 J Procter, AM Waterhouse, 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 file is part of Jalview. * - * 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. + * Jalview 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 3 of the License, or (at your option) any later version. * - * 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 + * Jalview 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 Jalview. If not, see . */ package jalview.appletgui; @@ -152,7 +151,7 @@ public class APopupMenu extends java.awt.PopupMenu implements showText.setState(sg.getDisplayText()); showColourText.setState(sg.getColourText()); showBoxes.setState(sg.getDisplayBoxes()); - displayNonconserved.setState(sg.getShowunconserved()); + displayNonconserved.setState(sg.getShowNonconserved()); if (!ap.av.alignment.getGroups().contains(sg)) { groupMenu.remove(unGroupMenuItem); @@ -285,6 +284,7 @@ public class APopupMenu extends java.awt.PopupMenu implements } } } + // TODO: add group link menu entry here if (seq != null) { seqMenu.setLabel(seq.getName()); @@ -586,18 +586,28 @@ public class APopupMenu extends java.awt.PopupMenu implements return; } - int gSize = sg.getSize(); - SequenceI[] seqs = new SequenceI[gSize]; - SequenceFeature[] features = new SequenceFeature[gSize]; + int rsize = 0, gSize = sg.getSize(); + SequenceI[] rseqs, seqs = new SequenceI[gSize]; + SequenceFeature[] tfeatures, features = new SequenceFeature[gSize]; for (int i = 0; i < gSize; i++) { - seqs[i] = sg.getSequenceAt(i); int start = sg.getSequenceAt(i).findPosition(sg.getStartRes()); int end = sg.findEndRes(sg.getSequenceAt(i)); - features[i] = new SequenceFeature(null, null, null, start, end, - "Jalview"); + if (start <= end) + { + seqs[rsize] = sg.getSequenceAt(i); + features[rsize] = new SequenceFeature(null, null, null, start, + end, "Jalview"); + rsize++; + } } + rseqs = new SequenceI[rsize]; + tfeatures = new SequenceFeature[rsize]; + System.arraycopy(seqs, 0, rseqs, 0, rsize); + System.arraycopy(features, 0, tfeatures, 0, rsize); + features = tfeatures; + seqs = rseqs; if (ap.seqPanel.seqCanvas.getFeatureRenderer().amendFeatures(seqs, features, true, ap)) @@ -982,7 +992,7 @@ public class APopupMenu extends java.awt.PopupMenu implements public void showNonconserved_itemStateChanged() { - getGroup().setShowunconserved(this.displayNonconserved.getState()); + getGroup().setShowNonconserved(this.displayNonconserved.getState()); refresh(); }