package jalview.ws.jws2;
import jalview.datamodel.Alignment;
-import jalview.datamodel.AlignmentI;
import jalview.datamodel.AlignmentView;
import jalview.datamodel.SequenceI;
import jalview.gui.AlignFrame;
return;
}
+
startMsaWSClient(altitle, msa, submitGaps, preserveOrder, seqdataset);
+
}
public MsaWSClient()
WsURL, wsInfo, alignFrame, WebServiceName, jobtitle, msa,
submitGaps, preserveOrder, seqdataset);
wsInfo.setthisService(msathread);
- if (isValidAlignment(alignFrame.getCurrentView().getAlignment()))
- {
msathread.start();
- }
+
}
- private boolean isValidAlignment(AlignmentI seqdataset)
+ private boolean isValidAlignment(AlignmentView av)
{
- String header = wsInfo.getInfoText()
- + "\nValidating submited Alignment...";
- wsInfo.setInfoText(header);
int validSeqCount = 0;
- List<SequenceI> seqs = seqdataset.getSequences();
+ List<SequenceI> seqs = av.getVisibleAlignment('c').getSequences(); // .getSequences();
if (seqs.size() < 2)
{
- wsInfo.setInfoText(header
- + "\nA minimum of two sequences is required to perform this operation");
+ JOptionPane
+ .showMessageDialog(
+ alignFrame,
+ "A minimum of two sequences is required to perform this operation",
+ "Invalid selection", JOptionPane.INFORMATION_MESSAGE);
+
return false;
}
}
if (validSeqCount > 1)
{
- wsInfo.setInfoText(header
- + "\nAlignment sequences was successfully validated");
return true;
}
}
- wsInfo.setInfoText(header
- + "\nA minimum of two sequences with at least one non-gap character in each sequence is required to perform this operation");
+ JOptionPane
+ .showMessageDialog(
+ alignFrame,
+ "A minimum of two sequences with at least one non-gap character \nin each sequence is required to perform this operation",
+ "Invalid selection", JOptionPane.INFORMATION_MESSAGE);
+
return false;
}
public void actionPerformed(ActionEvent e)
{
AlignmentView msa = alignFrame.gatherSequencesForAlignment();
+
+ if (isValidAlignment(msa))
+ {
new MsaWSClient(service, alignFrame.getTitle(), msa, withGaps,
true, alignFrame.getViewport().getAlignment()
.getDataset(), alignFrame);
+ }
}
});
public void actionPerformed(ActionEvent e)
{
AlignmentView msa = alignFrame.gatherSequencesForAlignment();
+
+ if (isValidAlignment(msa))
+ {
new MsaWSClient(service, null, null, true, alignFrame
.getTitle(), msa, withGaps, true, alignFrame
.getViewport().getAlignment().getDataset(), alignFrame);
+ }
}
});
{
AlignmentView msa = alignFrame
.gatherSequencesForAlignment();
+
+ if (isValidAlignment(msa))
+ {
new MsaWSClient(service, preset, alignFrame.getTitle(),
msa, false, true, alignFrame.getViewport()
.getAlignment().getDataset(), alignFrame);
+ }
}