/*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.6)
* Copyright (C) 2010 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
import jalview.io.*;
import jalview.schemes.*;
import jalview.util.GroupUrlLink;
+import jalview.util.GroupUrlLink.UrlStringTooLongException;
import jalview.util.UrlLink;
/**
{
conservationMenuItem.setSelected(true);
}
- displayNonconserved.setSelected(sg.getShowunconserved());
+ displayNonconserved.setSelected(sg.getShowNonconserved());
showText.setSelected(sg.getDisplayText());
showColourText.setSelected(sg.getColourText());
showBoxes.setSelected(sg.getDisplayBoxes());
{
// collect matching db-refs
- DBRefEntry[] dbr = jalview.util.DBRefUtils.selectRefs(seq
- .getDBRef(), new String[]
- { urlLink.getTarget() });
+ DBRefEntry[] dbr = jalview.util.DBRefUtils.selectRefs(
+ seq.getDBRef(), new String[]
+ { urlLink.getTarget() });
// collect id string too
String id = seq.getName();
String descr = seq.getDescription();
}
// and try and make the groupURL!
- Object[] urlset = urlLink.makeUrlStubs(ids, seqstr, "FromJalview"
- + System.currentTimeMillis(), false);
+ Object[] urlset = null;
+ try
+ {
+ urlset = urlLink.makeUrlStubs(ids, seqstr,
+ "FromJalview" + System.currentTimeMillis(), false);
+ } catch (UrlStringTooLongException e)
+ {
+ }
if (urlset != null)
{
int type = urlLink.getGroupURLType() & 3;
public void run()
{
- showLink(urlgenerator.constructFrom(urlstub));
+ try
+ {
+ showLink(urlgenerator.constructFrom(urlstub));
+ } catch (UrlStringTooLongException e)
+ {
+ }
}
}).start();
protected void showNonconserved_actionPerformed()
{
- getGroup().setShowunconserved(displayNonconserved.isSelected());
+ getGroup().setShowNonconserved(displayNonconserved.isSelected());
refresh();
}
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();
}
if (abovePIDColour.isSelected())
{
- sg.cs.setConsensus(AAFrequency.calculate(sg
- .getSequences(ap.av.hiddenRepSequences), sg.getStartRes(), sg
- .getEndRes() + 1));
+ sg.cs.setConsensus(AAFrequency.calculate(
+ sg.getSequences(ap.av.hiddenRepSequences), sg.getStartRes(),
+ sg.getEndRes() + 1));
int threshold = SliderPanel.setPIDSliderSource(ap, sg.cs, getGroup()
.getName());
{
SequenceGroup sg = getGroup();
sg.cs = new PIDColourScheme();
- sg.cs.setConsensus(AAFrequency.calculate(sg
- .getSequences(ap.av.hiddenRepSequences), sg.getStartRes(), sg
- .getEndRes() + 1));
+ sg.cs.setConsensus(AAFrequency.calculate(
+ sg.getSequences(ap.av.hiddenRepSequences), sg.getStartRes(),
+ sg.getEndRes() + 1));
refresh();
}
sg.cs = new Blosum62ColourScheme();
- sg.cs.setConsensus(AAFrequency.calculate(sg
- .getSequences(ap.av.hiddenRepSequences), sg.getStartRes(), sg
- .getEndRes() + 1));
+ sg.cs.setConsensus(AAFrequency.calculate(
+ sg.getSequences(ap.av.hiddenRepSequences), sg.getStartRes(),
+ sg.getEndRes() + 1));
refresh();
}
if (conservationMenuItem.isSelected())
{
Conservation c = new Conservation("Group",
- ResidueProperties.propHash, 3, sg
- .getSequences(ap.av.hiddenRepSequences), sg
- .getStartRes(), sg.getEndRes() + 1);
+ ResidueProperties.propHash, 3,
+ sg.getSequences(ap.av.hiddenRepSequences), sg.getStartRes(),
+ sg.getEndRes() + 1);
c.calculate();
c.verdict(false, ap.av.ConsPercGaps);
return;
}
- AnnotationColourGradient acg = new AnnotationColourGradient(sequence
- .getAnnotation()[0], null,
+ AnnotationColourGradient acg = new AnnotationColourGradient(
+ sequence.getAnnotation()[0], null,
AnnotationColourGradient.NO_THRESHOLD);
acg.predefinedColours = true;
{
SequenceGroup sg = getGroup();
- EditNameDialog dialog = new EditNameDialog(sg.getName(), sg
- .getDescription(), " Group Name ", "Group Description ",
- "Edit Group Name/Description");
+ EditNameDialog dialog = new EditNameDialog(sg.getName(),
+ sg.getDescription(), " Group Name ",
+ "Group Description ", "Edit Group Name/Description",
+ ap.alignFrame);
if (!dialog.accept)
{
*/
void sequenceName_actionPerformed()
{
- EditNameDialog dialog = new EditNameDialog(sequence.getName(), sequence
- .getDescription(), " Sequence Name ",
- "Sequence Description ", "Edit Sequence Name/Description");
+ EditNameDialog dialog = new EditNameDialog(sequence.getName(),
+ sequence.getDescription(), " Sequence Name ",
+ "Sequence Description ", "Edit Sequence Name/Description",
+ ap.alignFrame);
if (!dialog.accept)
{
caseChange = ChangeCaseCommand.TO_LOWER;
}
- ChangeCaseCommand caseCommand = new ChangeCaseCommand(description, sg
- .getSequencesAsArray(ap.av.hiddenRepSequences), startEnd,
+ ChangeCaseCommand caseCommand = new ChangeCaseCommand(description,
+ sg.getSequencesAsArray(ap.av.hiddenRepSequences), startEnd,
caseChange);
ap.alignFrame.addHistoryItem(caseCommand);
{
CutAndPasteTransfer cap = new CutAndPasteTransfer();
cap.setForInput(null);
- Desktop.addInternalFrame(cap, "Alignment output - "
- + e.getActionCommand(), 600, 500);
+ Desktop.addInternalFrame(cap,
+ "Alignment output - " + e.getActionCommand(), 600, 500);
String[] omitHidden = null;
omitHidden = ap.av.getViewAsString(true);
Alignment oal = new Alignment(ap.av.getSequenceSelection());
AlignmentAnnotation[] nala = ap.av.alignment.getAlignmentAnnotation();
- for (int i = 0; i < nala.length; i++)
+ if (nala != null)
{
- AlignmentAnnotation na = nala[i];
- oal.addAnnotation(na);
+ for (int i = 0; i < nala.length; i++)
+ {
+ AlignmentAnnotation na = nala[i];
+ oal.addAnnotation(na);
+ }
}
cap.setText(new FormatAdapter().formatSequences(e.getActionCommand(),
oal, omitHidden, csel, sg));
if (sequence == null)
sequence = (Sequence) sg.getSequenceAt(0);
- EditNameDialog dialog = new EditNameDialog(sequence
- .getSequenceAsString(sg.getStartRes(), sg.getEndRes() + 1),
- null, "Edit Sequence ", null, "Edit Sequence");
+ EditNameDialog dialog = new EditNameDialog(
+ sequence.getSequenceAsString(sg.getStartRes(),
+ sg.getEndRes() + 1), null, "Edit Sequence ", null,
+ "Edit Sequence", ap.alignFrame);
if (dialog.accept)
{
EditCommand editCommand = new EditCommand("Edit Sequences",
EditCommand.REPLACE, dialog.getName().replace(' ',
- ap.av.getGapCharacter()), sg
- .getSequencesAsArray(ap.av.hiddenRepSequences), sg
- .getStartRes(), sg.getEndRes() + 1, ap.av.alignment);
+ ap.av.getGapCharacter()),
+ sg.getSequencesAsArray(ap.av.hiddenRepSequences),
+ sg.getStartRes(), sg.getEndRes() + 1, ap.av.alignment);
ap.alignFrame.addHistoryItem(editCommand);