git://source.jalview.org
/
jalview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
patch for JAL-655
[jalview.git]
/
src
/
jalview
/
appletgui
/
APopupMenu.java
diff --git
a/src/jalview/appletgui/APopupMenu.java
b/src/jalview/appletgui/APopupMenu.java
index
eab52f2
..
5288fe4
100755
(executable)
--- a/
src/jalview/appletgui/APopupMenu.java
+++ b/
src/jalview/appletgui/APopupMenu.java
@@
-1,20
+1,19
@@
/*
/*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.4)
- * Copyright (C) 2008 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.6)
+ * 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 <http://www.gnu.org/licenses/>.
*/
package jalview.appletgui;
*/
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());
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);
if (!ap.av.alignment.getGroups().contains(sg))
{
groupMenu.remove(unGroupMenuItem);
@@
-185,9
+184,9
@@
public class APopupMenu extends java.awt.PopupMenu implements
{
// collect matching db-refs
{
// collect matching db-refs
- DBRefEntry[] dbr = jalview.util.DBRefUtils.selectRefs(seq
- .getDBRef(), new String[]
- { target });
+ DBRefEntry[] dbr = jalview.util.DBRefUtils.selectRefs(
+ seq.getDBRef(), new String[]
+ { target });
// collect id string too
String id = seq.getName();
String descr = seq.getDescription();
// collect id string too
String id = seq.getName();
String descr = seq.getDescription();
@@
-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());
if (seq != null)
{
seqMenu.setLabel(seq.getName());
@@
-492,8
+492,8
@@
public class APopupMenu extends java.awt.PopupMenu implements
{
EditCommand editCommand = new EditCommand("Edit Sequences",
EditCommand.REPLACE, dialog.getName().replace(' ',
{
EditCommand editCommand = new EditCommand("Edit Sequences",
EditCommand.REPLACE, dialog.getName().replace(' ',
- ap.av.getGapCharacter()), sg
- .getSequencesAsArray(ap.av.hiddenRepSequences),
+ ap.av.getGapCharacter()),
+ sg.getSequencesAsArray(ap.av.hiddenRepSequences),
sg.getStartRes(), sg.getEndRes() + 1, ap.av.alignment);
ap.alignFrame.addHistoryItem(editCommand);
sg.getStartRes(), sg.getEndRes() + 1, ap.av.alignment);
ap.alignFrame.addHistoryItem(editCommand);
@@
-586,18
+586,28
@@
public class APopupMenu extends java.awt.PopupMenu implements
return;
}
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++)
{
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));
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))
if (ap.seqPanel.seqCanvas.getFeatureRenderer().amendFeatures(seqs,
features, true, ap))
@@
-620,19
+630,20
@@
public class APopupMenu extends java.awt.PopupMenu implements
Frame frame = new Frame();
frame.add(cap);
Frame frame = new Frame();
frame.add(cap);
- jalview.bin.JalviewLite.addFrame(frame, "Selection output - "
- + e.getActionCommand(), 600, 500);
+ jalview.bin.JalviewLite.addFrame(frame,
+ "Selection output - " + e.getActionCommand(), 600, 500);
- cap.setText(new jalview.io.AppletFormatAdapter().formatSequences(e
- .getActionCommand(), new Alignment(ap.av
- .getSelectionAsNewSequence()), ap.av.showJVSuffix));
+ cap.setText(new jalview.io.AppletFormatAdapter().formatSequences(
+ e.getActionCommand(),
+ new Alignment(ap.av.getSelectionAsNewSequence()),
+ ap.av.showJVSuffix));
}
void editName()
{
}
void editName()
{
- EditNameDialog dialog = new EditNameDialog(seq.getName(), seq
- .getDescription(), " Sequence Name",
+ EditNameDialog dialog = new EditNameDialog(seq.getName(),
+ seq.getDescription(), " Sequence Name",
"Sequence Description", ap.alignFrame,
"Edit Sequence Name / Description", 500, 100, true);
"Sequence Description", ap.alignFrame,
"Edit Sequence Name / Description", 500, 100, true);
@@
-795,9
+806,9
@@
public class APopupMenu extends java.awt.PopupMenu implements
protected void clustalColour_actionPerformed()
{
SequenceGroup sg = getGroup();
protected void clustalColour_actionPerformed()
{
SequenceGroup sg = getGroup();
- sg.cs = new ClustalxColourScheme(sg
- .getSequences(ap.av.hiddenRepSequences), ap.av.alignment
- .getWidth());
+ sg.cs = new ClustalxColourScheme(
+ sg.getSequences(ap.av.hiddenRepSequences),
+ ap.av.alignment.getWidth());
refresh();
}
refresh();
}
@@
-859,9
+870,9
@@
public class APopupMenu extends java.awt.PopupMenu implements
if (abovePIDColour.getState())
{
if (abovePIDColour.getState())
{
- sg.cs.setConsensus(AAFrequency.calculate(sg
- .getSequences(ap.av.hiddenRepSequences), 0, ap.av.alignment
- .getWidth()));
+ sg.cs.setConsensus(AAFrequency.calculate(
+ sg.getSequences(ap.av.hiddenRepSequences), 0,
+ ap.av.alignment.getWidth()));
int threshold = SliderPanel.setPIDSliderSource(ap, sg.cs, getGroup()
.getName());
int threshold = SliderPanel.setPIDSliderSource(ap, sg.cs, getGroup()
.getName());
@@
-889,9
+900,9
@@
public class APopupMenu extends java.awt.PopupMenu implements
{
SequenceGroup sg = getGroup();
sg.cs = new PIDColourScheme();
{
SequenceGroup sg = getGroup();
sg.cs = new PIDColourScheme();
- sg.cs.setConsensus(AAFrequency.calculate(sg
- .getSequences(ap.av.hiddenRepSequences), 0, ap.av.alignment
- .getWidth()));
+ sg.cs.setConsensus(AAFrequency.calculate(
+ sg.getSequences(ap.av.hiddenRepSequences), 0,
+ ap.av.alignment.getWidth()));
refresh();
}
refresh();
}
@@
-901,9
+912,9
@@
public class APopupMenu extends java.awt.PopupMenu implements
sg.cs = new Blosum62ColourScheme();
sg.cs = new Blosum62ColourScheme();
- sg.cs.setConsensus(AAFrequency.calculate(sg
- .getSequences(ap.av.hiddenRepSequences), 0, ap.av.alignment
- .getWidth()));
+ sg.cs.setConsensus(AAFrequency.calculate(
+ sg.getSequences(ap.av.hiddenRepSequences), 0,
+ ap.av.alignment.getWidth()));
refresh();
}
refresh();
}
@@
-926,8
+937,8
@@
public class APopupMenu extends java.awt.PopupMenu implements
{
Conservation c = new Conservation("Group",
{
Conservation c = new Conservation("Group",
- ResidueProperties.propHash, 3, sg
- .getSequences(ap.av.hiddenRepSequences), 0,
+ ResidueProperties.propHash, 3,
+ sg.getSequences(ap.av.hiddenRepSequences), 0,
ap.av.alignment.getWidth());
c.calculate();
ap.av.alignment.getWidth());
c.calculate();
@@
-982,7
+993,7
@@
public class APopupMenu extends java.awt.PopupMenu implements
public void showNonconserved_itemStateChanged()
{
public void showNonconserved_itemStateChanged()
{
- getGroup().setShowunconserved(this.displayNonconserved.getState());
+ getGroup().setShowNonconserved(this.displayNonconserved.getState());
refresh();
}
refresh();
}