/*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.1)
- * Copyright (C) 2014 The Jalview Authors
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
*
* This file is part of Jalview.
*
* 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.
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
*
* 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/>.
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
* The Jalview Authors are detailed in the 'AUTHORS' file.
*/
package jalview.ws.jws1;
-import java.util.*;
-
-import jalview.analysis.*;
-import jalview.bin.*;
-import jalview.datamodel.*;
-import jalview.gui.*;
+import jalview.analysis.AlignSeq;
+import jalview.analysis.AlignmentSorter;
+import jalview.analysis.SeqsetUtils;
+import jalview.bin.Cache;
+import jalview.datamodel.Alignment;
+import jalview.datamodel.AlignmentOrder;
+import jalview.datamodel.AlignmentView;
+import jalview.datamodel.ColumnSelection;
+import jalview.datamodel.Sequence;
+import jalview.datamodel.SequenceI;
+import jalview.gui.AlignFrame;
+import jalview.gui.Desktop;
+import jalview.gui.WebserviceInfo;
+import jalview.util.Comparison;
+import jalview.util.MessageManager;
import jalview.ws.AWsJob;
import jalview.ws.JobStateSummary;
import jalview.ws.WSClientI;
+
+import java.util.Hashtable;
+import java.util.Vector;
+
import vamsas.objects.simple.MsaResult;
class MsaWSThread extends JWS1Thread implements WSClientI
subjobComplete = true;
result = new MsaResult();
result.setFinished(true);
- result.setStatus("Job never ran - input returned to user.");
+ result.setStatus(MessageManager.getString("label.job_never_ran"));
}
}
int nseqs = 0;
if (minlen < 0)
{
- throw new Error(
- "Implementation error: minlen must be zero or more.");
+ throw new Error(MessageManager.getString("error.implementation_error_minlen_must_be_greater_zero"));
}
for (int i = 0; i < seqs.length; i++)
{
for (int i = 0, n = 0; i < seqs.length; i++)
{
- String newname = jalview.analysis.SeqsetUtils.unique_name(i); // same
+ String newname = SeqsetUtils.unique_name(i); // same
// for
// any
// subjob
- SeqNames.put(newname,
- jalview.analysis.SeqsetUtils.SeqCharacterHash(seqs[i]));
+ SeqNames.put(newname, SeqsetUtils.SeqCharacterHash(seqs[i]));
if (valid && seqs[i].getEnd() - seqs[i].getStart() > minlen - 1)
{
seqarray[n] = new vamsas.objects.simple.Sequence();
seqarray[n].setId(newname);
seqarray[n++].setSeq((submitGaps) ? seqs[i].getSequenceAsString()
- : AlignSeq.extractGaps(jalview.util.Comparison.GapChars,
+ : AlignSeq.extractGaps(Comparison.GapChars,
seqs[i].getSequenceAsString()));
}
else
if (seqs[i].getEnd() >= seqs[i].getStart())
{
empty = (submitGaps) ? seqs[i].getSequenceAsString() : AlignSeq
- .extractGaps(jalview.util.Comparison.GapChars,
+ .extractGaps(Comparison.GapChars,
seqs[i].getSequenceAsString());
}
emptySeqs.add(new String[]
String[] es = (String[]) emptySeqs.get(i);
if (es[1] == null)
{
- t_alseqs[i + alseq_l] = new jalview.datamodel.Sequence(es[0],
+ t_alseqs[i + alseq_l] = new Sequence(es[0],
insbuff.toString(), 1, 0);
}
else
{
if (es[1].length() < nw)
{
- t_alseqs[i + alseq_l] = new jalview.datamodel.Sequence(
+ t_alseqs[i + alseq_l] = new Sequence(
es[0],
es[1] + insbuff.substring(0, nw - es[1].length()),
1, 1 + es[1].length());
}
else
{
- t_alseqs[i + alseq_l] = new jalview.datamodel.Sequence(
+ t_alseqs[i + alseq_l] = new Sequence(
es[0], es[1]);
}
}
}
AlignmentOrder msaorder = new AlignmentOrder(alseqs);
// always recover the order - makes parseResult()'s life easier.
- jalview.analysis.AlignmentSorter.recoverOrder(alseqs);
+ AlignmentSorter.recoverOrder(alseqs);
// account for any missing sequences
- jalview.analysis.SeqsetUtils.deuniquify(SeqNames, alseqs);
+ SeqsetUtils.deuniquify(SeqNames, alseqs);
return new Object[]
{ alseqs, msaorder };
}
* boolean
*/
MsaWSThread(ext.vamsas.MuscleWS server, String wsUrl,
- WebserviceInfo wsinfo, jalview.gui.AlignFrame alFrame,
+ WebserviceInfo wsinfo, AlignFrame alFrame,
AlignmentView alview, String wsname, boolean subgaps,
boolean presorder)
{
* Alignment
*/
MsaWSThread(ext.vamsas.MuscleWS server, String wsUrl,
- WebserviceInfo wsinfo, jalview.gui.AlignFrame alFrame,
+ WebserviceInfo wsinfo, AlignFrame alFrame,
String wsname, String title, AlignmentView _msa, boolean subgaps,
boolean presorder, Alignment seqset)
{
{
if (!(job instanceof MsaWSJob))
{
- throw new Error("StartJob(MsaWSJob) called on a WSJobInstance "
- + job.getClass());
+ throw new Error(MessageManager.formatMessage("error.implementation_error_msawbjob_called", new String[]{job.getClass().toString()}));
}
MsaWSJob j = (MsaWSJob) job;
if (j.isSubmitted())
j.setSubmitted(true);
j.result = new MsaResult();
j.result.setFinished(true);
- j.result.setStatus("Empty Alignment Job");
+ j.result.setStatus(MessageManager.getString("label.empty_alignment_job"));
((MsaResult) j.result).setMsa(null);
}
try
{
if (jobsubmit == null)
{
- throw new Exception(
- "Server at "
- + WsUrl
- + " returned null object, it probably cannot be contacted. Try again later ?");
+ throw new Exception(MessageManager.formatMessage("exception.web_service_returned_null_try_later", new String[]{WsUrl}));
}
throw new Exception(jobsubmit.getJobId());
WebserviceInfo.STATE_STOPPED_SERVERERROR);
wsInfo.appendProgressText(
j.getJobnum(),
- "Failed to submit sequences for alignment.\n"
- + "It is most likely that there is a problem with the server.\n"
- + "Just close the window\n");
+ MessageManager.getString("info.failed_to_submit_sequences_for_alignment"));
// e.printStackTrace(); // TODO: JBPNote DEBUG
}
}
- private jalview.datamodel.Sequence[] getVamsasAlignment(
+ private Sequence[] getVamsasAlignment(
vamsas.objects.simple.Alignment valign)
{
// TODO: refactor to helper class for vamsas.objects.simple objects
vamsas.objects.simple.Sequence[] seqs = valign.getSeqs().getSeqs();
- jalview.datamodel.Sequence[] msa = new jalview.datamodel.Sequence[seqs.length];
+ Sequence[] msa = new Sequence[seqs.length];
for (int i = 0, j = seqs.length; i < j; i++)
{
- msa[i] = new jalview.datamodel.Sequence(seqs[i].getId(),
+ msa[i] = new Sequence(seqs[i].getId(),
seqs[i].getSeq());
}
if (valign != null)
{
wsInfo.appendProgressText(jobs[j].getJobnum(),
- "\nAlignment Object Method Notes\n");
+ MessageManager.getString("info.alignment_object_method_notes"));
String[] lines = valign.getMethod();
for (int line = 0; line < lines.length; line++)
{
while (j < l)
{
if (((AlignmentOrder) alorders.get(i))
- .equals(((AlignmentOrder) alorders.get(j))))
+ .equals((alorders.get(j))))
{
alorders.remove(j);
l--;