// the start and end points.
// Align the sequence to the pdb
// TODO: DNa/Pep switch
- AlignSeq as = new AlignSeq(sequence, ((PDBChain) pdb.chains
- .elementAt(i)).sequence, ((PDBChain) pdb.chains.elementAt(i)).isNa ? AlignSeq.DNA : AlignSeq.PEP);
+ AlignSeq as = new AlignSeq(sequence,
+ ((PDBChain) pdb.chains.elementAt(i)).sequence,
+ ((PDBChain) pdb.chains.elementAt(i)).isNa ? AlignSeq.DNA
+ : AlignSeq.PEP);
as.calcScoreMatrix();
as.traceAlignment();
PrintStream ps = new PrintStream(System.out)
// /StructureListener
public String[] getPdbFile()
{
- return new String[] { pdbentry.getFile() };
+ return new String[]
+ { pdbentry.getFile() };
}
String lastMessage;
// Now lets compare the sequences to get
// the start and end points.
// Align the sequence to the pdb
- AlignSeq as = new AlignSeq(sequence, ((PDBChain) pdb.chains
- .elementAt(i)).sequence, "pep");
+ AlignSeq as = new AlignSeq(sequence,
+ ((PDBChain) pdb.chains.elementAt(i)).sequence, "pep");
as.calcScoreMatrix();
as.traceAlignment();
PrintStream ps = new PrintStream(System.out)
// /StructureListener
public String[] getPdbFile()
{
- return new String[] { pdbentry.getFile() };
+ return new String[]
+ { pdbentry.getFile() };
}
String lastMessage;
public int offset;
public Sequence sequence;
- public boolean isNa=false;
+
+ public boolean isNa = false;
+
public boolean isVisible = true;
public int pdbstart = 0;
- offset)).atoms.elementAt(0)).alignmentMapping);
tx.setEnd(1 + ((Atom) ((Residue) residues.elementAt(tx.getEnd()
- offset)).atoms.elementAt(0)).alignmentMapping);
- tx
- .setStatus(status
- + ((tx.getStatus() == null || tx.getStatus()
- .length() == 0) ? "" : ":" + tx.getStatus()));
+ tx.setStatus(status
+ + ((tx.getStatus() == null || tx.getStatus().length() == 0) ? ""
+ : ":" + tx.getStatus()));
if (tx.begin != 0 && tx.end != 0)
sq.addSequenceFeature(tx);
}
public void makeCaBondList()
{
- boolean na=false;
- int numNa=0;
+ boolean na = false;
+ int numNa = 0;
for (int i = 0; i < (residues.size() - 1); i++)
{
Residue tmpres = (Residue) residues.elementAt(i);
Residue tmpres2 = (Residue) residues.elementAt(i + 1);
Atom at1 = tmpres.findAtom("CA");
Atom at2 = tmpres2.findAtom("CA");
- na=false;
+ na = false;
if ((at1 == null) && (at2 == null))
{
- na=true;
+ na = true;
at1 = tmpres.findAtom("P");
at2 = tmpres2.findAtom("P");
}
System.out.println("not found " + i);
}
}
- if (numNa>0 && ((numNa/residues.size())>0.99))
+ if (numNa > 0 && ((numNa / residues.size()) > 0.99))
{
- isNa=true;
+ isNa = true;
}
}
// Keep totting up the sequence
if ((symbol = ResidueProperties.getAA3Hash().get(tmpat.resName)) == null)
{
- String nucname=tmpat.resName.trim();
+ String nucname = tmpat.resName.trim();
if (ResidueProperties.nucleotideIndex[nucname.charAt(0)] == -1)
{
seq.append("X");
{
id = " ";
}
- isNa=nucleotide;
+ isNa = nucleotide;
sequence = new Sequence(id, seq.toString(), offset, resNumber - 1); // Note:
// resNumber-offset
// ~=
}
}
}
- sq
- .addAlignmentAnnotation(new AlignmentAnnotation("PDB.RESNUM",
- "PDB Residue Numbering for " + this.pdbid + ":"
- + this.id, an, (float) min, (float) max,
- AlignmentAnnotation.LINE_GRAPH));
+ sq.addAlignmentAnnotation(new AlignmentAnnotation("PDB.RESNUM",
+ "PDB Residue Numbering for " + this.pdbid + ":" + this.id,
+ an, (float) min, (float) max, AlignmentAnnotation.LINE_GRAPH));
}
}
}
if (evt.isControlDown()
|| SwingUtilities.isRightMouseButton(evt))
{
- radioItem
- .removeActionListener(radioItem.getActionListeners()[0]);
+ radioItem.removeActionListener(radioItem.getActionListeners()[0]);
int option = JOptionPane.showInternalConfirmDialog(
jalview.gui.Desktop.desktop,
else
{
im = new jalview.util.ImageMaker(this, jalview.util.ImageMaker.EPS,
- "Make EPS file from view", width, height, null, this
- .getTitle());
+ "Make EPS file from view", width, height, null,
+ this.getTitle());
}
if (im.getGraphics() != null)
public void mapping_actionPerformed(ActionEvent e)
{
jalview.gui.CutAndPasteTransfer cap = new jalview.gui.CutAndPasteTransfer();
- try {
+ try
+ {
cap.setText(pdbcanvas.mappingDetails.toString());
Desktop.addInternalFrame(cap, "PDB - Sequence Mapping", 550, 600);
} catch (OutOfMemoryError oom)
{
- new OOMWarning("Opening sequence to structure mapping report",oom);
+ new OOMWarning("Opening sequence to structure mapping report", oom);
cap.dispose();
}
}
public void savePDB_actionPerformed(ActionEvent e)
{
- JalviewFileChooser chooser = new JalviewFileChooser(jalview.bin.Cache
- .getProperty("LAST_DIRECTORY"));
+ JalviewFileChooser chooser = new JalviewFileChooser(
+ jalview.bin.Cache.getProperty("LAST_DIRECTORY"));
chooser.setFileView(new JalviewFileView());
chooser.setDialogTitle("Save PDB File");
oper.setReturnType(new javax.xml.namespace.QName(
"http://simple.objects.vamsas", "JpredResult"));
oper.setReturnClass(vamsas.objects.simple.JpredResult.class);
- oper
- .setReturnQName(new javax.xml.namespace.QName("",
- "getresultReturn"));
+ oper.setReturnQName(new javax.xml.namespace.QName("", "getresultReturn"));
oper.setStyle(org.apache.axis.constants.Style.RPC);
oper.setUse(org.apache.axis.constants.Use.ENCODED);
_operations[3] = oper;
if (firstCall())
{
// must set encoding style before registering serializers
- _call
- .setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
+ _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
_call.setEncodingStyle(org.apache.axis.Constants.URI_SOAP11_ENC);
for (int i = 0; i < cachedSerFactories.size(); ++i)
{
_call.setOperation(_operations[0]);
_call.setUseSOAPAction(true);
_call.setSOAPActionURI("");
- _call
- .setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
+ _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
_call.setOperationName(new javax.xml.namespace.QName("vamsas",
"predict"));
_call.setOperation(_operations[1]);
_call.setUseSOAPAction(true);
_call.setSOAPActionURI("");
- _call
- .setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
+ _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
_call.setOperationName(new javax.xml.namespace.QName("vamsas",
"predictOnMsa"));
_call.setOperation(_operations[2]);
_call.setUseSOAPAction(true);
_call.setSOAPActionURI("");
- _call
- .setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
+ _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
_call.setOperationName(new javax.xml.namespace.QName("vamsas",
"getpredict"));
_call.setOperation(_operations[3]);
_call.setUseSOAPAction(true);
_call.setSOAPActionURI("");
- _call
- .setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
+ _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
_call.setOperationName(new javax.xml.namespace.QName("vamsas",
"getresult"));
oper.setReturnType(new javax.xml.namespace.QName(
"simple.objects.vamsas", "Alignment"));
oper.setReturnClass(vamsas.objects.simple.Alignment.class);
- oper
- .setReturnQName(new javax.xml.namespace.QName("",
- "getalignReturn"));
+ oper.setReturnQName(new javax.xml.namespace.QName("", "getalignReturn"));
oper.setStyle(org.apache.axis.constants.Style.RPC);
oper.setUse(org.apache.axis.constants.Use.ENCODED);
_operations[1] = oper;
oper.setReturnType(new javax.xml.namespace.QName(
"simple.objects.vamsas", "MsaResult"));
oper.setReturnClass(vamsas.objects.simple.MsaResult.class);
- oper
- .setReturnQName(new javax.xml.namespace.QName("",
- "getResultReturn"));
+ oper.setReturnQName(new javax.xml.namespace.QName("", "getResultReturn"));
oper.setStyle(org.apache.axis.constants.Style.RPC);
oper.setUse(org.apache.axis.constants.Use.ENCODED);
_operations[2] = oper;
if (firstCall())
{
// must set encoding style before registering serializers
- _call
- .setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
+ _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
_call.setEncodingStyle(org.apache.axis.Constants.URI_SOAP11_ENC);
for (int i = 0; i < cachedSerFactories.size(); ++i)
_call.setOperation(_operations[0]);
_call.setUseSOAPAction(true);
_call.setSOAPActionURI("");
- _call
- .setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
- _call
- .setOperationName(new javax.xml.namespace.QName("vamsas",
- "align"));
+ _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
+ _call.setOperationName(new javax.xml.namespace.QName("vamsas", "align"));
setRequestHeaders(_call);
setAttachments(_call);
_call.setOperation(_operations[1]);
_call.setUseSOAPAction(true);
_call.setSOAPActionURI("");
- _call
- .setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
+ _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
_call.setOperationName(new javax.xml.namespace.QName("vamsas",
"getalign"));
_call.setOperation(_operations[2]);
_call.setUseSOAPAction(true);
_call.setSOAPActionURI("");
- _call
- .setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
+ _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
_call.setOperationName(new javax.xml.namespace.QName("vamsas",
"getResult"));
_call.setOperation(_operations[3]);
_call.setUseSOAPAction(true);
_call.setSOAPActionURI("");
- _call
- .setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
- _call
- .setOperationName(new javax.xml.namespace.QName("vamsas",
- "cancel"));
+ _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
+ _call.setOperationName(new javax.xml.namespace.QName("vamsas", "cancel"));
setRequestHeaders(_call);
setAttachments(_call);
if (firstCall())
{
// must set encoding style before registering serializers
- _call
- .setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
+ _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
_call.setEncodingStyle(org.apache.axis.Constants.URI_SOAP11_ENC);
for (int i = 0; i < cachedSerFactories.size(); ++i)
{
_call.setOperation(_operations[0]);
_call.setUseSOAPAction(true);
_call.setSOAPActionURI("");
- _call
- .setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
+ _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
_call.setOperationName(new javax.xml.namespace.QName("vamsas",
"getServices"));
oper.setReturnType(new javax.xml.namespace.QName(\r
"simple.objects.vamsas", "SeqSearchResult"));\r
oper.setReturnClass(vamsas.objects.simple.SeqSearchResult.class);\r
- oper\r
- .setReturnQName(new javax.xml.namespace.QName("",\r
- "getResultReturn"));\r
+ oper.setReturnQName(new javax.xml.namespace.QName("", "getResultReturn"));\r
oper.setStyle(org.apache.axis.constants.Style.RPC);\r
oper.setUse(org.apache.axis.constants.Use.ENCODED);\r
_operations[1] = oper;\r
if (firstCall())\r
{\r
// must set encoding style before registering serializers\r
- _call\r
- .setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);\r
+ _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);\r
_call.setEncodingStyle(org.apache.axis.Constants.URI_SOAP11_ENC);\r
for (int i = 0; i < cachedSerFactories.size(); ++i)\r
{\r
_call.setOperation(_operations[0]);\r
_call.setUseSOAPAction(true);\r
_call.setSOAPActionURI("");\r
- _call\r
- .setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);\r
+ _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);\r
_call.setOperationName(new javax.xml.namespace.QName("vamsas",\r
"getDatabase"));\r
\r
_call.setOperation(_operations[1]);\r
_call.setUseSOAPAction(true);\r
_call.setSOAPActionURI("");\r
- _call\r
- .setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);\r
+ _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);\r
_call.setOperationName(new javax.xml.namespace.QName("vamsas",\r
"getResult"));\r
\r
_call.setOperation(_operations[2]);\r
_call.setUseSOAPAction(true);\r
_call.setSOAPActionURI("");\r
- _call\r
- .setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);\r
+ _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);\r
_call.setOperationName(new javax.xml.namespace.QName("vamsas",\r
"psearch"));\r
\r
_call.setOperation(_operations[3]);\r
_call.setUseSOAPAction(true);\r
_call.setSOAPActionURI("");\r
- _call\r
- .setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);\r
- _call\r
- .setOperationName(new javax.xml.namespace.QName("vamsas",\r
- "search"));\r
+ _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);\r
+ _call.setOperationName(new javax.xml.namespace.QName("vamsas", "search"));\r
\r
setRequestHeaders(_call);\r
setAttachments(_call);\r
_call.setOperation(_operations[4]);\r
_call.setUseSOAPAction(true);\r
_call.setSOAPActionURI("");\r
- _call\r
- .setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);\r
- _call\r
- .setOperationName(new javax.xml.namespace.QName("vamsas",\r
- "cancel"));\r
+ _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);\r
+ _call.setOperationName(new javax.xml.namespace.QName("vamsas", "cancel"));\r
\r
setRequestHeaders(_call);\r
setAttachments(_call);\r
boolean includeAllConsSymbols, char[] alphabet)
{
float tval, value;
- if (consensus==null || consensus.annotations==null || consensus.annotations.length<width)
+ if (consensus == null || consensus.annotations == null
+ || consensus.annotations.length < width)
{
- // called with a bad alignment annotation row - wait for it to be initialised properly
+ // called with a bad alignment annotation row - wait for it to be
+ // initialised properly
return;
}
for (int i = iStart; i < width; i++)
{
- if (i>=hconsensus.length) {
- // happens if sequences calculated over were shorter than alignment width
- consensus.annotations[i]=null;
+ if (i >= hconsensus.length)
+ {
+ // happens if sequences calculated over were shorter than alignment
+ // width
+ consensus.annotations[i] = null;
continue;
}
value = 0;
// TODO: Use original sequence characters rather than re-translated
// characters in output
// Find the biggest id length for formatting purposes
- String s1id=s1.getName(),s2id=s2.getName();
+ String s1id = s1.getName(), s2id = s2.getName();
int maxid = s1.getName().length();
if (s2.getName().length() > maxid)
{
maxid = s2.getName().length();
}
- if (maxid>30) {
+ if (maxid > 30)
+ {
maxid = 30;
// JAL-527 - truncate the sequence ids
- if (s1.getName().length()>maxid)
+ if (s1.getName().length() > maxid)
{
- s1id = s1.getName().substring(0,30);
+ s1id = s1.getName().substring(0, 30);
}
- if (s2.getName().length()>maxid)
+ if (s2.getName().length() > maxid)
{
- s2id = s2.getName().substring(0,30);
+ s2id = s2.getName().substring(0, 30);
}
}
int len = 72 - maxid - 1;
for (int j = 0; j < nochunks; j++)
{
// Print the first aligned sequence
- output.append(new Format("%" + (maxid) + "s").form(s1id)
- + " ");
+ output.append(new Format("%" + (maxid) + "s").form(s1id) + " ");
for (int i = 0; i < len; i++)
{
// filter for selection criteria
if (
// ignore features outwith alignment start-stop positions.
- (sf[f].end < sstart || sf[f].begin > sstop)
- ||
- // or ignore based on selection criteria
+ (sf[f].end < sstart || sf[f].begin > sstop) ||
+ // or ignore based on selection criteria
(featureLabels != null && !AlignmentSorter
.containsIgnoreCase(sf[f].type, featureLabels))
|| (groupLabels != null
public static Hashtable classifyDbRefs(DBRefEntry[] rfs)\r
{\r
Hashtable classes = new Hashtable();\r
- classes.put(DBRefSource.PROTEINDBS, jalview.util.DBRefUtils.selectRefs(\r
- rfs, DBRefSource.PROTEINDBS));\r
+ classes.put(DBRefSource.PROTEINDBS,\r
+ jalview.util.DBRefUtils.selectRefs(rfs, DBRefSource.PROTEINDBS));\r
classes.put(DBRefSource.DNACODINGDBS, jalview.util.DBRefUtils\r
.selectRefs(rfs, DBRefSource.DNACODINGDBS));\r
- classes.put(DBRefSource.DOMAINDBS, jalview.util.DBRefUtils.selectRefs(\r
- rfs, DBRefSource.DOMAINDBS));\r
+ classes.put(DBRefSource.DOMAINDBS,\r
+ jalview.util.DBRefUtils.selectRefs(rfs, DBRefSource.DOMAINDBS));\r
// classes.put(OTHER, )\r
return classes;\r
}\r
}\r
else\r
{\r
- poss = CrossRef.findXDbRefs(dna, poss); // \r
+ poss = CrossRef.findXDbRefs(dna, poss); //\r
cands = jalview.util.DBRefUtils.searchRefs(poss, xrf);\r
}\r
if (cands != null)\r
}\r
if (resSize > 0)\r
{\r
- SequenceI newseq = new Sequence(selection.getName(), protein\r
- .toString());\r
+ SequenceI newseq = new Sequence(selection.getName(),\r
+ protein.toString());\r
if (rf != 0)\r
{\r
jalview.bin.Cache.log\r
}\r
}\r
// register the mapping somehow\r
- // \r
+ //\r
return null;\r
}\r
\r
fgstate = (featureGroups == null) ? null : ((Boolean) featureGroups\r
.get(sf[f].featureGroup));\r
if ((featureTypes == null || featureTypes.containsKey(sf[f]\r
- .getType()))\r
- && (fgstate == null || fgstate.booleanValue()))\r
+ .getType())) && (fgstate == null || fgstate.booleanValue()))\r
{\r
if (FeatureProperties.isCodingFeature(null, sf[f].getType()))\r
{\r
{
try
{
- score += pwmatrix.getPairwiseScore(sequenceString[i]
- .charAt(k), sequenceString[j].charAt(k));
+ score += pwmatrix.getPairwiseScore(
+ sequenceString[i].charAt(k),
+ sequenceString[j].charAt(k));
} catch (Exception ex)
{
System.err.println("err creating BLOSUM62 tree");
details.append(" --- Eigenvalues ---\n");
eigenvector.printD(ps);
ps.println();
- /*for (int seq=0;seq<symm.rows;seq++)
- {
- ps.print("\"Seq"+seq+"\"");
- for (int ev=0;ev<symm.rows; ev++)
- {
-
- ps.print(","+component(seq, ev));
- }
- ps.println();
- }*/
+ /*
+ * for (int seq=0;seq<symm.rows;seq++) { ps.print("\"Seq"+seq+"\""); for
+ * (int ev=0;ev<symm.rows; ev++) {
+ *
+ * ps.print(","+component(seq, ev)); } ps.println(); }
+ */
}
}
sqinfo.put("SeqFeatures", sfeat);
sqinfo.put("PdbId", (seq.getPDBId() != null) ? seq.getPDBId()
: new Vector());
- sqinfo.put("datasetSequence", (seq.getDatasetSequence() != null) ? seq
- .getDatasetSequence() : new Sequence("THISISAPLACEHOLDER", ""));
+ sqinfo.put("datasetSequence",
+ (seq.getDatasetSequence() != null) ? seq.getDatasetSequence()
+ : new Sequence("THISISAPLACEHOLDER", ""));
return sqinfo;
}
for (int i = 0, j = sequences.length; i < j; i++)
{
String tempseq = jalview.analysis.AlignSeq.extractGaps(
- jalview.util.Comparison.GapChars, sequences[i]
- .getSequenceAsString());
+ jalview.util.Comparison.GapChars,
+ sequences[i].getSequenceAsString());
if (tempseq.length() == 0)
{
/**
* Abstract feature renderer interface
+ *
* @author JimP
- *
+ *
*/
public interface FeatureRenderer
{
package jalview.api;
/**
- * methods for interacting with the binding between a structure visualization and one or more Jalview views.
- * @author JimP
- * prototype class - this may disappear !
+ * methods for interacting with the binding between a structure visualization
+ * and one or more Jalview views.
+ *
+ * @author JimP prototype class - this may disappear !
*/
public interface SequenceStructureBinding
{
- // todo: decide what this really means - we could return a reference to the alignment/jmol binding, or some other binding.
+ // todo: decide what this really means - we could return a reference to the
+ // alignment/jmol binding, or some other binding.
}
{
// 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();
{
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);
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()
{
- 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);
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.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());
{
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();
}
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();
}
{
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();
* @param viewer
* JmolViewer instance
* @param sequenceIds
- * - sequence Ids to search for associations
- * This method doesn't work. See http://issues.jalview.org/browse/JAL-621
+ * - sequence Ids to search for associations This method doesn't
+ * work. See http://issues.jalview.org/browse/JAL-621
*
- public SequenceStructureBinding addStructureViewInstance(Object jmolviewer, String[] sequenceIds)
- {
- org.jmol.api.JmolViewer viewer=null;
- try {
- viewer = (org.jmol.api.JmolViewer) jmolviewer;
- }
- catch (ClassCastException ex) {
- System.err.println("Unsupported viewer object :"+jmolviewer.getClass());
- }
- if (viewer==null)
- {
- System.err.println("Can't use this object as a structure viewer:"+jmolviewer.getClass());
- return null;
- }
- SequenceI[] seqs=null;
- if (sequenceIds==null || sequenceIds.length==0)
- {
- seqs = viewport.getAlignment().getSequencesArray();
- } else {
- Vector sqi=new Vector();
- AlignmentI al = viewport.getAlignment();
- for (int sid=0;sid<sequenceIds.length;sid++) {
- SequenceI sq = al.findName(sequenceIds[sid]);
- if (sq!=null) {
- sqi.addElement(sq);
- }
- }
- if (sqi.size()>0) {
- seqs = new SequenceI[sqi.size()];
- for (int sid=0,sSize=sqi.size();sid<sSize;sid++)
- {
- seqs[sid] = (SequenceI) sqi.elementAt(sid);
- }
- } else {
- return null;
- }
- }
- ExtJmol jmv=null;
- // TODO: search for a jmv that involves viewer
- if (jmv==null){
- // create a new viewer/jalview binding.
- jmv = new ExtJmol(viewer, alignPanel, seqs);
- }
- return jmv;
-
- }
+ * public SequenceStructureBinding addStructureViewInstance(Object
+ * jmolviewer, String[] sequenceIds) { org.jmol.api.JmolViewer
+ * viewer=null; try { viewer = (org.jmol.api.JmolViewer) jmolviewer;
+ * } catch (ClassCastException ex) {
+ * System.err.println("Unsupported viewer object :"
+ * +jmolviewer.getClass()); } if (viewer==null) {
+ * System.err.println("Can't use this object as a structure viewer:"
+ * +jmolviewer.getClass()); return null; } SequenceI[] seqs=null; if
+ * (sequenceIds==null || sequenceIds.length==0) { seqs =
+ * viewport.getAlignment().getSequencesArray(); } else { Vector
+ * sqi=new Vector(); AlignmentI al = viewport.getAlignment(); for
+ * (int sid=0;sid<sequenceIds.length;sid++) { SequenceI sq =
+ * al.findName(sequenceIds[sid]); if (sq!=null) { sqi.addElement(sq);
+ * } } if (sqi.size()>0) { seqs = new SequenceI[sqi.size()]; for (int
+ * sid=0,sSize=sqi.size();sid<sSize;sid++) { seqs[sid] = (SequenceI)
+ * sqi.elementAt(sid); } } else { return null; } } ExtJmol jmv=null;
+ * // TODO: search for a jmv that involves viewer if (jmv==null){ //
+ * create a new viewer/jalview binding. jmv = new ExtJmol(viewer,
+ * alignPanel, seqs); } return jmv;
+ *
+ * }
**/
public boolean addPdbFile(String sequenceId, String pdbEntryString,
String pdbFile)
if (needtoadd)
{
// make a note of the access mode and add
- if (pdbentry.getProperty()==null)
- {pdbentry.setProperty(new Hashtable());}
+ if (pdbentry.getProperty() == null)
+ {
+ pdbentry.setProperty(new Hashtable());
+ }
pdbentry.getProperty().put("protocol", protocol);
toaddpdb.addPDBId(pdbentry);
}
}
return true;
}
+
private Object[] cleanSeqChainArrays(SequenceI[] seqs, String[] chains)
{
if (seqs != null)
{
if (seqs[i] != null)
{
- sequences.addElement(new Object[] { seqs[i], (chains!=null) ? chains[i] : null});
+ sequences.addElement(new Object[]
+ { seqs[i], (chains != null) ? chains[i] : null });
}
}
seqs = new SequenceI[sequences.size()];
chains[i] = (String) oj[1];
}
}
- return new Object[] { seqs, chains};
+ return new Object[]
+ { seqs, chains };
}
+
public void newStructureView(JalviewLite applet, PDBEntry pdb,
SequenceI[] seqs, String[] chains, String protocol)
{
break;
}
}
- if (ajm!=null)
+ if (ajm != null)
{
- System.err.println("Incremental adding and aligning structure to existing Jmol view not yet implemented.");
+ System.err
+ .println("Incremental adding and aligning structure to existing Jmol view not yet implemented.");
// try and add the pdb structure
// ajm.addS
ajm = null;
}
Conservation cons = new jalview.analysis.Conservation("All",
- jalview.schemes.ResidueProperties.propHash, 3, alignment
- .getSequences(), 0, alWidth - 1);
+ jalview.schemes.ResidueProperties.propHash, 3,
+ alignment.getSequences(), 0, alWidth - 1);
cons.calculate();
cons.verdict(false, ConsPercGaps);
value = ((Double) cons.quality.elementAt(i)).floatValue();
vprop = value - qmin;
vprop /= qmax;
- quality.annotations[i] = new Annotation(" ", String
- .valueOf(value), ' ', value, new Color(minR
- + (maxR * vprop), minG + (maxG * vprop), minB
- + (maxB * vprop)));
+ quality.annotations[i] = new Annotation(" ",
+ String.valueOf(value), ' ', value, new Color(minR
+ + (maxR * vprop), minG + (maxG * vprop), minB
+ + (maxB * vprop)));
}
}
} catch (OutOfMemoryError error)
consensus.annotations = new Annotation[aWidth];
hconsensus = new Hashtable[aWidth];
- AAFrequency.calculate(alignment.getSequencesArray(), 0, alignment
- .getWidth(), hconsensus, true); // always calculate the full profile
+ AAFrequency.calculate(alignment.getSequencesArray(), 0,
+ alignment.getWidth(), hconsensus, true); // always calculate the
+ // full profile
AAFrequency.completeConsensus(consensus, hconsensus, 0, aWidth,
ignoreGapsInConsensusCalculation,
includeAllConsensusSymbols);
{
Alignment al = (Alignment) alignment;
Conservation c = new Conservation("All",
- ResidueProperties.propHash, 3, al.getSequences(), 0, al
- .getWidth() - 1);
+ ResidueProperties.propHash, 3, al.getSequences(), 0,
+ al.getWidth() - 1);
c.calculate();
c.verdict(false, ConsPercGaps);
SequenceGroup sg = (SequenceGroup) alignment.getGroups().elementAt(s);
if (sg.cs != null && sg.cs instanceof ClustalxColourScheme)
{
- ((ClustalxColourScheme) sg.cs).resetClustalX(sg
- .getSequences(hiddenRepSequences), sg.getWidth());
+ ((ClustalxColourScheme) sg.cs).resetClustalX(
+ sg.getSequences(hiddenRepSequences), sg.getWidth());
}
sg.recalcConservation();
}
}
av.setStartRes(x);
- av
- .setEndRes((x + (seqPanel.seqCanvas.getSize().width / av.charWidth)) - 1);
+ av.setEndRes((x + (seqPanel.seqCanvas.getSize().width / av.charWidth)) - 1);
hextent = seqPanel.seqCanvas.getSize().width / av.charWidth;
vextent = seqPanel.seqCanvas.getSize().height / av.charHeight;
AnnotationColourGradient acg = null;
if (currentColours.getState())
{
- acg = new AnnotationColourGradient(currentAnnotation, av
- .getGlobalColourScheme(), aboveThreshold);
+ acg = new AnnotationColourGradient(currentAnnotation,
+ av.getGlobalColourScheme(), aboveThreshold);
}
else
{
- acg = new AnnotationColourGradient(currentAnnotation, minColour
- .getBackground(), maxColour.getBackground(), aboveThreshold);
+ acg = new AnnotationColourGradient(currentAnnotation,
+ minColour.getBackground(), maxColour.getBackground(),
+ aboveThreshold);
}
if (currentAnnotation.graphMin == 0f
}
else
{
- sg.cs = new AnnotationColourGradient(currentAnnotation, minColour
- .getBackground(), maxColour.getBackground(),
+ sg.cs = new AnnotationColourGradient(currentAnnotation,
+ minColour.getBackground(), maxColour.getBackground(),
aboveThreshold);
}
/**
*
* @param y
- * @return -2 if no rows are visible at all, -1 if no visible rows were selected
+ * @return -2 if no rows are visible at all, -1 if no visible rows were
+ * selected
*/
int getSelectedRow(int y)
{
{
if (tooltip == null)
{
- tooltip = new Tooltip(ap.av.alignment.getAlignmentAnnotation()[row]
- .getDescription(true), this);
+ tooltip = new Tooltip(
+ ap.av.alignment.getAlignmentAnnotation()[row]
+ .getDescription(true),
+ this);
}
else
{
MenuItem item = new MenuItem(ADDNEW);
item.addActionListener(this);
popup.add(item);
- if (selectedRow<0)
+ if (selectedRow < 0)
{
- // this never happens at moment: - see comment on JAL-563
+ // this never happens at moment: - see comment on JAL-563
if (hasHiddenRows)
{
- item = new MenuItem(SHOWALL);
- item.addActionListener(this);
- popup.add(item);
+ item = new MenuItem(SHOWALL);
+ item.addActionListener(this);
+ popup.add(item);
}
this.add(popup);
popup.show(this, evt.getX(), evt.getY());
item = new MenuItem(HIDE);
item.addActionListener(this);
popup.add(item);
- if (hasHiddenRows) {
+ if (hasHiddenRows)
+ {
item = new MenuItem(SHOWALL);
item.addActionListener(this);
popup.add(item);
g.setColor(Color.black);
AlignmentAnnotation[] aa = av.alignment.getAlignmentAnnotation();
- int y = 0, fy=g.getFont().getSize();
+ int y = 0, fy = g.getFont().getSize();
int x = 0, offset;
if (aa != null)
{
- hasHiddenRows=false;
+ hasHiddenRows = false;
for (int i = 0; i < aa.length; i++)
{
if (!aa[i].visible)
{
- hasHiddenRows=true;
+ hasHiddenRows = true;
continue;
}
x = width - fm.stringWidth(aa[i].label) - 3;
y += aa[i].height;
- offset = -(aa[i].height-fy)/2;
+ offset = -(aa[i].height - fy) / 2;
- g.drawString(aa[i].label, x, y+offset);
+ g.drawString(aa[i].label, x, y + offset);
}
}
}
public void actionPerformed(ActionEvent evt)
{
AlignmentAnnotation[] aa = av.alignment.getAlignmentAnnotation();
- if (aa==null)
+ if (aa == null)
{
return;
}
if (needValidating)
{
ap.validate();
- needValidating=false;
+ needValidating = false;
}
ap.scalePanel.mouseReleased(evt);
}
public void mouseClicked(MouseEvent evt)
{
}
- boolean needValidating=false;
+
+ boolean needValidating = false;
+
public void mouseDragged(MouseEvent evt)
{
if (graphStretch > -1)
}
graphStretchY = evt.getY();
adjustPanelHeight();
- needValidating=true;
+ needValidating = true;
ap.paintAlignment(true);
}
else
height += aa[i].height;
}
}
- if (height==0)
+ if (height == 0)
{
height = 20;
}
if (v == column)
{
- g
- .fillRect(x * av.charWidth, y, av.charWidth,
- av.charHeight);
+ g.fillRect(x * av.charWidth, y, av.charWidth, av.charHeight);
}
}
}
if (sCol == 0 || row.annotations[sCol - 1] == null
|| row.annotations[sCol - 1].secondaryStructure != 'H')
{
- g
- .fillArc(lastSSX, y + 4 + iconOffset, av.charWidth, 8,
- 90, 180);
+ g.fillArc(lastSSX, y + 4 + iconOffset, av.charWidth, 8, 90, 180);
x1 += av.charWidth / 2;
}
* datasource protocol for access to PDBEntry
*/
String protocol = null;
+
/**
- * Load a bunch of pdb entries associated with sequences in the alignment and display them - aligning them if necessary.
- * @param pdbentries each pdb file (at least one needed)
- * @param boundseqs each set of sequences for each pdb file (must match number of pdb files)
- * @param boundchains the target pdb chain corresponding with each sequence associated with each pdb file (may be null at any level)
- * @param align true/false
- * @param ap associated alignment
- * @param protocol how to get pdb data
+ * Load a bunch of pdb entries associated with sequences in the alignment and
+ * display them - aligning them if necessary.
+ *
+ * @param pdbentries
+ * each pdb file (at least one needed)
+ * @param boundseqs
+ * each set of sequences for each pdb file (must match number of pdb
+ * files)
+ * @param boundchains
+ * the target pdb chain corresponding with each sequence associated
+ * with each pdb file (may be null at any level)
+ * @param align
+ * true/false
+ * @param ap
+ * associated alignment
+ * @param protocol
+ * how to get pdb data
*/
- public AppletJmol(PDBEntry[] pdbentries, SequenceI[][] boundseqs, String[][] boundchains, boolean align, AlignmentPanel ap, String protocol)
+ public AppletJmol(PDBEntry[] pdbentries, SequenceI[][] boundseqs,
+ String[][] boundchains, boolean align, AlignmentPanel ap,
+ String protocol)
{
throw new Error("Not yet implemented.");
}
+
public AppletJmol(PDBEntry pdbentry, SequenceI[] seq, String[] chains,
AlignmentPanel ap, String protocol)
{
this.ap = ap;
jmb = new AppletJmolBinding(this, new PDBEntry[]
- { pdbentry }, new SequenceI[][]{seq}, new String[][]{ chains }, protocol);
+ { pdbentry }, new SequenceI[][]
+ { seq }, new String[][]
+ { chains }, protocol);
jmb.setColourBySequence(true);
if (pdbentry.getId() == null || pdbentry.getId().length() < 1)
{
scriptWindow = new Panel();
scriptWindow.setVisible(false);
// this.add(scriptWindow, BorderLayout.SOUTH);
-
+
try
{
- jmb.allocateViewer(renderPanel, true, ap.av.applet.getName()+"_jmol_",
- ap.av.applet.getDocumentBase(), ap.av.applet.getCodeBase(),
- "-applet", scriptWindow, null);
+ jmb.allocateViewer(renderPanel, true, ap.av.applet.getName()
+ + "_jmol_", ap.av.applet.getDocumentBase(),
+ ap.av.applet.getCodeBase(), "-applet", scriptWindow, null);
} catch (Exception e)
{
System.err
closeViewer();
}
});
- if (pdbentry.getProperty()==null)
+ if (pdbentry.getProperty() == null)
{
pdbentry.setProperty(new Hashtable());
pdbentry.getProperty().put("protocol", protocol);
frame.add(cap);
StringBuffer sb = new StringBuffer();
- try {
- for (int s = 0; s < jmb.pdbentry.length; s++)
+ try
{
- sb.append(StructureSelectionManager.getStructureSelectionManager()
- .printMapping(jmb.pdbentry[s].getFile()));
- sb.append("\n");
- }
- cap.setText(sb.toString());
- }
- catch (OutOfMemoryError ex)
+ for (int s = 0; s < jmb.pdbentry.length; s++)
+ {
+ sb.append(StructureSelectionManager
+ .getStructureSelectionManager().printMapping(
+ jmb.pdbentry[s].getFile()));
+ sb.append("\n");
+ }
+ cap.setText(sb.toString());
+ } catch (OutOfMemoryError ex)
{
frame.dispose();
- System.err.println("Out of memory when trying to create dialog box with sequence-structure mapping.");
+ System.err
+ .println("Out of memory when trying to create dialog box with sequence-structure mapping.");
return;
}
jalview.bin.JalviewLite.addFrame(frame, "PDB - Sequence Mapping",
{
}
}
- Panel splitPane=null;
+
+ Panel splitPane = null;
+
public void showConsole(boolean showConsole)
{
if (showConsole)
{
remove(renderPanel);
splitPane = new Panel();
-
- splitPane.setLayout(new java.awt.GridLayout(2,1));
+
+ splitPane.setLayout(new java.awt.GridLayout(2, 1));
splitPane.add(renderPanel);
splitPane.add(scriptWindow);
scriptWindow.setVisible(true);
this.add(splitPane, BorderLayout.CENTER);
splitPane.setVisible(true);
splitPane.validate();
- } else {
+ }
+ else
+ {
scriptWindow.setVisible(false);
remove(splitPane);
add(renderPanel, BorderLayout.CENTER);
- splitPane=null;
+ splitPane = null;
}
validate();
}
*/
private AppletJmol appletJmolBinding;
- public AppletJmolBinding(AppletJmol appletJmol, PDBEntry[] pdbentry, SequenceI[][] seq,
- String[][] chains, String protocol)
+ public AppletJmolBinding(AppletJmol appletJmol, PDBEntry[] pdbentry,
+ SequenceI[][] seq, String[][] chains, String protocol)
{
super(pdbentry, seq, chains, protocol);
appletJmolBinding = appletJmol;
{
if (appletJmolBinding.fr == null)
{
- appletJmolBinding.fr = new jalview.appletgui.FeatureRenderer(appletJmolBinding.ap.av);
+ appletJmolBinding.fr = new jalview.appletgui.FeatureRenderer(
+ appletJmolBinding.ap.av);
}
- appletJmolBinding.fr.transferSettings(appletJmolBinding.ap.seqPanel.seqCanvas.getFeatureRenderer());
+ appletJmolBinding.fr
+ .transferSettings(appletJmolBinding.ap.seqPanel.seqCanvas
+ .getFeatureRenderer());
}
return appletJmolBinding.fr;
{
appletJmolBinding.updateTitleAndMenus();
}
-
+
public void updateColours(Object source)
{
AlignmentPanel ap = (AlignmentPanel) source;
{
try
{
- appletJmolBinding.ap.av.applet.getAppletContext().showDocument(new java.net.URL(url),
- "jmol");
+ appletJmolBinding.ap.av.applet.getAppletContext().showDocument(
+ new java.net.URL(url), "jmol");
} catch (java.net.MalformedURLException ex)
{
}
}
- public void newJmolPopup(boolean translateLocale, String menuName, boolean asPopup)
+ public void newJmolPopup(boolean translateLocale, String menuName,
+ boolean asPopup)
{
-
- jmolpopup = JmolPopup.newJmolPopup(viewer,translateLocale, menuName,asPopup);
+
+ jmolpopup = JmolPopup.newJmolPopup(viewer, translateLocale, menuName,
+ asPopup);
}
public void notifyScriptTermination(String strStatus, int msWalltime)
public void selectionChanged(BitSet arg0)
{
// TODO Auto-generated method stub
-
+
}
public void refreshPdbEntries()
{
// TODO Auto-generated method stub
-
+
}
@Override
{
return new AppletConsole(viewer2, consolePanel);
}
+
@Override
protected void releaseUIResources()
{
appletJmolBinding = null;
- if (console!=null) {
- try {
+ if (console != null)
+ {
+ try
+ {
console.setVisible(false);
- } catch (Error e) {} catch (Exception x) {};
- console=null;
+ } catch (Error e)
+ {
+ } catch (Exception x)
+ {
+ }
+ ;
+ console = null;
}
-
+
}
}
{
try
{
- jalview.io.NewickFile fin = new jalview.io.NewickFile(textarea
- .getText(), "Paste");
+ jalview.io.NewickFile fin = new jalview.io.NewickFile(
+ textarea.getText(), "Paste");
fin.parse();
if (fin.getTree() != null)
/**
* bind an alignment view to an external Jmol instance.
+ *
* @author JimP
- *
+ *
*/
public class ExtJmol extends JalviewJmolBinding
{
private AlignmentPanel ap;
- protected ExtJmol(jalview.appletgui.AlignFrame alframe, PDBEntry[] pdbentry, SequenceI[][] seq, String[][] chains,
+ protected ExtJmol(jalview.appletgui.AlignFrame alframe,
+ PDBEntry[] pdbentry, SequenceI[][] seq, String[][] chains,
String protocol)
{
super(pdbentry, seq, chains, protocol);
public void updateColours(Object source)
{
-
+
// TODO Auto-generated method stub
}
Vector pdbe = new Vector();
Hashtable fileids = new Hashtable();
SequenceI[] sq = ap.av.getAlignment().getSequencesArray();
- for (int s=0;s<sq.length;s++)
+ for (int s = 0; s < sq.length; s++)
{
Vector pdbids = sq[s].getPDBId();
- if (pdbids!=null)
+ if (pdbids != null)
{
- for (int pe=0,peSize=pdbids.size(); pe<peSize; pe++)
+ for (int pe = 0, peSize = pdbids.size(); pe < peSize; pe++)
{
PDBEntry pentry = (PDBEntry) pdbids.elementAt(pe);
- if (!fileids.containsKey(pentry.getId())) {
+ if (!fileids.containsKey(pentry.getId()))
+ {
pdbe.addElement(pentry);
}
}
}
}
pdbentry = new PDBEntry[pdbe.size()];
- for (int pe=0;pe<pdbe.size(); pe++)
+ for (int pe = 0; pe < pdbe.size(); pe++)
{
pdbentry[pe] = (PDBEntry) pdbe.elementAt(pe);
}
@Override
public void showConsole(boolean show)
{
- // This never gets called because we haven't overriden the associated Jmol's console
- System.err.println("WARNING: unexpected call to ExtJmol's showConsole method. (showConsole="+show);
+ // This never gets called because we haven't overriden the associated Jmol's
+ // console
+ System.err
+ .println("WARNING: unexpected call to ExtJmol's showConsole method. (showConsole="
+ + show);
}
@Override
// TODO Auto-generated method stub
return null;
}
+
@Override
protected void releaseUIResources()
{
ap = null;
- if (console!=null) {
- try {
+ if (console != null)
+ {
+ try
+ {
console.setVisible(false);
- } catch (Error e) {} catch (Exception x) {};
- console=null;
+ } catch (Error e)
+ {
+ } catch (Exception x)
+ {
+ }
+ ;
+ console = null;
}
-
+
}
}
{
if (newCol == null)
{
- UserDefinedColours udc = new UserDefinedColours(this, minColour
- .getBackground(), owner, "Select Colour for Minimum Value"); // frame.owner,
+ UserDefinedColours udc = new UserDefinedColours(this,
+ minColour.getBackground(), owner,
+ "Select Colour for Minimum Value"); // frame.owner,
}
else
{
// UserDefinedColours udc = new UserDefinedColours(this,
// "Select Colour for Maximum Value",maxColour.getBackground(),true);
- UserDefinedColours udc = new UserDefinedColours(this, maxColour
- .getBackground(), owner, "Select Colour for Maximum Value");
+ UserDefinedColours udc = new UserDefinedColours(this,
+ maxColour.getBackground(), owner,
+ "Select Colour for Maximum Value");
}
else
{
else if (sequenceFeatures[sfindex].type.equals("disulfide bond"))
{
- renderFeature(g, seq, seq
- .findIndex(sequenceFeatures[sfindex].begin) - 1, seq
- .findIndex(sequenceFeatures[sfindex].begin) - 1,
+ renderFeature(g, seq,
+ seq.findIndex(sequenceFeatures[sfindex].begin) - 1,
+ seq.findIndex(sequenceFeatures[sfindex].begin) - 1,
getColour(sequenceFeatures[sfindex])
// new Color(((Integer) av.featuresDisplayed
// .get(sequenceFeatures[sfindex].type)).intValue())
, start, end, y1);
- renderFeature(g, seq, seq
- .findIndex(sequenceFeatures[sfindex].end) - 1, seq
- .findIndex(sequenceFeatures[sfindex].end) - 1,
+ renderFeature(g, seq,
+ seq.findIndex(sequenceFeatures[sfindex].end) - 1,
+ seq.findIndex(sequenceFeatures[sfindex].end) - 1,
getColour(sequenceFeatures[sfindex])
// new Color(((Integer) av.featuresDisplayed
// .get(sequenceFeatures[sfindex].type)).intValue())
{
if (showFeature(sequenceFeatures[sfindex]))
{
- renderFeature(g, seq, seq
- .findIndex(sequenceFeatures[sfindex].begin) - 1, seq
- .findIndex(sequenceFeatures[sfindex].end) - 1,
+ renderFeature(g, seq,
+ seq.findIndex(sequenceFeatures[sfindex].begin) - 1,
+ seq.findIndex(sequenceFeatures[sfindex].end) - 1,
getColour(sequenceFeatures[sfindex]), start, end, y1);
}
}
}
Hashtable minmax = null;
+
/**
* Called when alignment in associated view has new/modified features to
* discover and display.
lastSeq = null;
findAllFeatures();
}
+
/**
* find all features on the alignment
*/
{
if (getColour(features[index].getType()) == null)
{
- featureColours.put(features[index].getType(), ucs
- .createColourFromName(features[index].getType()));
+ featureColours.put(features[index].getType(),
+ ucs.createColourFromName(features[index].getType()));
}
av.featuresDisplayed.put(features[index].getType(), new Integer(
Checkbox source = (Checkbox) evt.getSource();
if (fr.featureGroups.containsKey(source.getLabel()))
{
- fr.featureGroups.put(source.getLabel(), new Boolean(source
- .getState()));
+ fr.featureGroups.put(source.getLabel(),
+ new Boolean(source.getState()));
ap.seqPanel.seqCanvas.repaint();
if (ap.overviewPanel != null)
{
{
evt.consume();
String link = fr.featureLinks.get(check.type).toString();
- ap.alignFrame.showURL(link.substring(link.indexOf("|") + 1), link
- .substring(0, link.indexOf("|")));
+ ap.alignFrame.showURL(link.substring(link.indexOf("|") + 1),
+ link.substring(0, link.indexOf("|")));
}
}
av = ap.av;
}
createNewGroup.setEnabled(false);
- jalview.analysis.Finder finder = new jalview.analysis.Finder(av
- .getAlignment(), av.getSelectionGroup(), seqIndex, resIndex);
+ jalview.analysis.Finder finder = new jalview.analysis.Finder(
+ av.getAlignment(), av.getSelectionGroup(), seqIndex, resIndex);
finder.setCaseSensitive(caseSensitive.getState());
finder.setFindAll(findAll);
if (links.size() < 1)
{
links = new java.util.Vector();
- links
- .addElement("SRS|http://srs.ebi.ac.uk/srsbin/cgi-bin/wgetz?-newId+(([uniprot-all:$SEQUENCE_ID$]))+-view+SwissEntry");
+ links.addElement("SRS|http://srs.ebi.ac.uk/srsbin/cgi-bin/wgetz?-newId+(([uniprot-all:$SEQUENCE_ID$]))+-view+SwissEntry");
}
}
{
int fullsizeWidth = av.alignment.getWidth() * av.getCharWidth();
int fullsizeHeight = (av.alignment.getHeight() + av.alignment
- .getHiddenSequences().getSize())
- * av.getCharHeight();
+ .getHiddenSequences().getSize()) * av.getCharHeight();
int startRes = av.getStartRes();
int endRes = av.getEndRes();
if (av.getSelectionGroup() != null)
{
- if (av.getSelectionGroup().getSequences(null).contains(
- ((SequencePoint) points.elementAt(i)).sequence))
+ if (av.getSelectionGroup().getSequences(null)
+ .contains(((SequencePoint) points.elementAt(i)).sequence))
{
g.setColor(Color.gray);
}
if (showLabels)
{
g.setColor(Color.red);
- g.drawString(((SequencePoint) points.elementAt(i)).sequence
- .getName(), x - 3, y - 4);
+ g.drawString(
+ ((SequencePoint) points.elementAt(i)).sequence.getName(),
+ x - 3, y - 4);
}
}
}
{
if (av != null)
{
- if (!av.getSelectionGroup().getSequences(null).contains(
- sp.sequence))
+ if (!av.getSelectionGroup().getSequences(null)
+ .contains(sp.sequence))
{
av.getSelectionGroup().addSequence(sp.sequence, true);
}
maxX = (i - startx + 1) * av.charWidth + fm.stringWidth(string);
}
- gg
- .drawLine(
- (int) (((i - startx - 1) * av.charWidth) + (av.charWidth / 2)),
- y + 2,
- (int) (((i - startx - 1) * av.charWidth) + (av.charWidth / 2)),
- y + (fm.getDescent() * 2));
+ gg.drawLine(
+ (int) (((i - startx - 1) * av.charWidth) + (av.charWidth / 2)),
+ y + 2,
+ (int) (((i - startx - 1) * av.charWidth) + (av.charWidth / 2)),
+ y + (fm.getDescent() * 2));
}
else
{
- gg
- .drawLine(
- (int) (((i - startx - 1) * av.charWidth) + (av.charWidth / 2)),
- y + fm.getDescent(),
- (int) (((i - startx - 1) * av.charWidth) + (av.charWidth / 2)),
- y + (fm.getDescent() * 2));
+ gg.drawLine(
+ (int) (((i - startx - 1) * av.charWidth) + (av.charWidth / 2)),
+ y + fm.getDescent(),
+ (int) (((i - startx - 1) * av.charWidth) + (av.charWidth / 2)),
+ y + (fm.getDescent() * 2));
}
}
if (av.getShowHiddenMarkers())
{
g1.setColor(Color.blue);
- g1
- .drawLine((blockEnd - blockStart + 1) * av.charWidth - 1,
- 0 + offset, (blockEnd - blockStart + 1)
- * av.charWidth - 1, (endSeq - startSeq)
- * av.charHeight + offset);
+ g1.drawLine((blockEnd - blockStart + 1) * av.charWidth - 1,
+ 0 + offset, (blockEnd - blockStart + 1) * av.charWidth
+ - 1, (endSeq - startSeq) * av.charHeight + offset);
}
g1.translate(-screenY * av.charWidth, 0);
av.setSelectionGroup(null);
}
- SequenceFeature[] features = findFeaturesAtRes(sequence, sequence
- .findPosition(findRes(evt)));
+ SequenceFeature[] features = findFeaturesAtRes(sequence,
+ sequence.findPosition(findRes(evt)));
if (features != null && features.length > 0)
{
SearchResults highlight = new SearchResults();
- highlight.addResult(sequence, features[0].getBegin(), features[0]
- .getEnd());
+ highlight.addResult(sequence, features[0].getBegin(),
+ features[0].getEnd());
seqCanvas.highlightSearchResults(highlight);
}
if (features != null && features.length > 0)
y -= hgap;
- seq = Math.min((y % cHeight) / av.getCharHeight(), av.alignment
- .getHeight() - 1);
+ seq = Math.min((y % cHeight) / av.getCharHeight(),
+ av.alignment.getHeight() - 1);
if (seq < 0)
{
seq = -1;
}
// use aa to see if the mouse pointer is on a
- SequenceFeature[] allFeatures = findFeaturesAtRes(sequence, sequence
- .findPosition(res));
+ SequenceFeature[] allFeatures = findFeaturesAtRes(sequence,
+ sequence.findPosition(res));
int index = 0;
while (index < allFeatures.length)
fontSize = 1;
}
- av
- .setFont(new Font(av.font.getName(), av.font.getStyle(),
- fontSize));
+ av.setFont(new Font(av.font.getName(), av.font.getStyle(), fontSize));
av.charWidth = oldWidth;
}
else
// DETECT RIGHT MOUSE BUTTON IN AWT
if ((evt.getModifiers() & InputEvent.BUTTON3_MASK) == InputEvent.BUTTON3_MASK)
{
- SequenceFeature[] allFeatures = findFeaturesAtRes(sequence, sequence
- .findPosition(res));
+ SequenceFeature[] allFeatures = findFeaturesAtRes(sequence,
+ sequence.findPosition(res));
Vector links = null;
if (allFeatures != null)
{
if (stretchGroup.cs instanceof ClustalxColourScheme)
{
- ((ClustalxColourScheme) stretchGroup.cs).resetClustalX(stretchGroup
- .getSequences(av.hiddenRepSequences), stretchGroup
- .getWidth());
+ ((ClustalxColourScheme) stretchGroup.cs).resetClustalX(
+ stretchGroup.getSequences(av.hiddenRepSequences),
+ stretchGroup.getWidth());
}
if (stretchGroup.cs instanceof Blosum62ColourScheme
if (stretchGroup.cs.conservationApplied())
{
- SliderPanel.setConservationSlider(ap, stretchGroup.cs, stretchGroup
- .getName());
+ SliderPanel.setConservationSlider(ap, stretchGroup.cs,
+ stretchGroup.getName());
stretchGroup.recalcConservation();
}
else
{
- SliderPanel.setPIDSliderSource(ap, stretchGroup.cs, stretchGroup
- .getName());
+ SliderPanel.setPIDSliderSource(ap, stretchGroup.cs,
+ stretchGroup.getName());
}
}
changeEndRes = false;
g.drawImage(linkImage, x, i * fontHeight + 1, this);\r
if (lindex + 6 < tip[i].length())\r
{\r
- g.drawString(tip[i].substring(lindex + 6), x\r
- + linkImage.getWidth(this), (i + 1) * fontHeight - 3);\r
+ g.drawString(tip[i].substring(lindex + 6),\r
+ x + linkImage.getWidth(this), (i + 1) * fontHeight - 3);\r
}\r
}\r
else\r
{\r
return;\r
}\r
- setLocation((owner.getLocationOnScreen().x - mainContainer\r
- .getLocationOnScreen().x)\r
- + evt.getX(), (owner.getLocationOnScreen().y\r
- - mainContainer.getLocationOnScreen().y + VERTICAL_OFFSET)\r
- + evt.getY());\r
+ setLocation(\r
+ (owner.getLocationOnScreen().x - mainContainer.getLocationOnScreen().x)\r
+ + evt.getX(),\r
+ (owner.getLocationOnScreen().y\r
+ - mainContainer.getLocationOnScreen().y + VERTICAL_OFFSET)\r
+ + evt.getY());\r
\r
// correction, whole tool tip must be visible\r
if (mainContainer.getSize().width < (getLocation().x + getSize().width))\r
}
String name = (markPlaceholders && node.isPlaceholder()) ? (PLACEHOLDER + node
- .getName())
- : node.getName();
+ .getName()) : node.getName();
FontMetrics fm = g.getFontMetrics(font);
int charWidth = fm.stringWidth(name) + 3;
int charHeight = fm.getHeight();
for (int i = 0; i < tree.getGroups().size(); i++)
{
- Color col = new Color((int) (Math.random() * 255), (int) (Math
- .random() * 255), (int) (Math.random() * 255));
+ Color col = new Color((int) (Math.random() * 255),
+ (int) (Math.random() * 255), (int) (Math.random() * 255));
setColor((SequenceNode) tree.getGroups().elementAt(i), col.brighter());
- Vector l = tree.findLeaves((SequenceNode) tree.getGroups().elementAt(
- i), new Vector());
+ Vector l = tree.findLeaves(
+ (SequenceNode) tree.getGroups().elementAt(i), new Vector());
Vector sequences = new Vector();
for (int j = 0; j < l.size(); j++)
{
if (av.getGlobalColourScheme() instanceof UserColourScheme)
{
- cs = new UserColourScheme(((UserColourScheme) av
- .getGlobalColourScheme()).getColours());
+ cs = new UserColourScheme(
+ ((UserColourScheme) av.getGlobalColourScheme())
+ .getColours());
}
else
.getGlobalColourScheme()));
}
- cs.setThreshold(av.getGlobalColourScheme().getThreshold(), av
- .getIgnoreGapsConsensus());
+ cs.setThreshold(av.getGlobalColourScheme().getThreshold(),
+ av.getIgnoreGapsConsensus());
}
SequenceGroup sg = new SequenceGroup(sequences, "", cs, true, true,
&& av.getGlobalColourScheme().conservationApplied())
{
Conservation c = new Conservation("Group",
- ResidueProperties.propHash, 3, sg.getSequences(null), sg
- .getStartRes(), sg.getEndRes());
+ ResidueProperties.propHash, 3, sg.getSequences(null),
+ sg.getStartRes(), sg.getEndRes());
c.calculate();
c.verdict(false, av.ConsPercGaps);
public void newickOutput_actionPerformed()
{
- jalview.io.NewickFile fout = new jalview.io.NewickFile(tree
- .getTopNode());
+ jalview.io.NewickFile fout = new jalview.io.NewickFile(
+ tree.getTopNode());
String output = fout.print(false, true);
CutAndPasteTransfer cap = new CutAndPasteTransfer(false, null);
cap.setText(output);
int width = 400;
dialog.setBounds(alignframe.getBounds().x
- + (alignframe.getSize().width - width) / 2, alignframe
- .getBounds().y
- + (alignframe.getSize().height - height) / 2, width, height);
+ + (alignframe.getSize().width - width) / 2,
+ alignframe.getBounds().y
+ + (alignframe.getSize().height - height) / 2, width,
+ height);
}
* <li>SHOW_CONSENSUS_LOGO (false) Show consensus annotation row's sequence
* logo.</li>
* <li>FOLLOW_SELECTIONS (true) Controls whether a new alignment view should
- * respond to selections made in other alignments containing the same sequences.</li>
+ * respond to selections made in other alignments containing the same sequences.
+ * </li>
*
* <li></li>
*
public static void initLogger()
{
- if (log!=null)
+ if (log != null)
{
return;
}
System.out.println("Using proxyServer: "
+ getDefault("PROXY_SERVER", null) + " proxyPort: "
+ getDefault("PROXY_PORT", null));
- System
- .setProperty("http.proxyHost", getDefault("PROXY_SERVER",
- null));
+ System.setProperty("http.proxyHost", getDefault("PROXY_SERVER", null));
System.setProperty("http.proxyPort", getDefault("PROXY_PORT", null));
}
try
{
String buildDetails = "jar:".concat(Cache.class.getProtectionDomain()
- .getCodeSource().getLocation().toString().concat(
- "!/.build_properties"));
+ .getCodeSource().getLocation().toString()
+ .concat("!/.build_properties"));
java.net.URL localJarFileURL = new java.net.URL(buildDetails);
"com.boxysystems.jgoogleanalytics.FocusPoint");
} catch (Exception e)
{
- log
- .debug("com.boxysystems.jgoogleanalytics package is not present - tracking not enabled.");
+ log.debug("com.boxysystems.jgoogleanalytics package is not present - tracking not enabled.");
tracker = null;
jgoogleanalyticstracker = null;
trackerfocus = null;
if (log != null)
{
if (re != null)
- log
- .debug(
- "Caught runtime exception in googletracker init:",
- re);
+ log.debug("Caught runtime exception in googletracker init:", re);
if (ex != null)
log.warn(
"Failed to initialise GoogleTracker for Jalview Desktop with version "
+ System.getProperty("os.version"));
if (new Platform().isAMac())
{
- System.setProperty("com.apple.mrj.application.apple.menu.about.name", "Jalview");
- System.setProperty("apple.laf.useScreenMenuBar", "true");
+ System.setProperty("com.apple.mrj.application.apple.menu.about.name",
+ "Jalview");
+ System.setProperty("apple.laf.useScreenMenuBar", "true");
}
ArgsParser aparser = new ArgsParser(args);
}
}
// and finally, turn off batch mode indicator - if the desktop still exists
- if (desktop!=null)
+ if (desktop != null)
{
desktop.setInBatchMode(false);
}
public boolean jmolAvailable = false;
- private boolean alignPdbStructures=false;
+ private boolean alignPdbStructures = false;
public static boolean debug = false;
}
}
/*
- * <param name="alignpdbfiles" value="false/true"/>
- * Undocumented for 2.6 - related to JAL-434
+ * <param name="alignpdbfiles" value="false/true"/> Undocumented for 2.6
+ * - related to JAL-434
*/
- applet.setAlignPdbStructures(getDefaultParameter("alignpdbfiles",false));
+ applet.setAlignPdbStructures(getDefaultParameter("alignpdbfiles",
+ false));
/*
* <param name="PDBfile" value="1gaq.txt PDB|1GAQ|1GAQ|A PDB|1GAQ|1GAQ|B
* PDB|1GAQ|1GAQ|C">
*
* <param name="PDBfile3" value="1q0o Q45135_9MICO">
*/
-
+
int pdbFileCount = 0;
- // Accumulate pdbs here if they are heading for the same view (if alignPdbStructures is true)
- Vector pdbs=new Vector();
+ // Accumulate pdbs here if they are heading for the same view (if
+ // alignPdbStructures is true)
+ Vector pdbs = new Vector();
do
{
if (pdbFileCount > 0)
}
}
}
-
- if (!alignPdbStructures) {
+
+ if (!alignPdbStructures)
+ {
newAlignFrame.newStructureView(applet, pdb, seqs, chains,
- protocol);
- } else {
- pdbs.addElement(new Object[] { pdb, seqs, chains, new String(protocol)});
+ protocol);
+ }
+ else
+ {
+ pdbs.addElement(new Object[]
+ { pdb, seqs, chains, new String(protocol) });
}
}
}
pdbFileCount++;
} while (pdbFileCount < 10);
- if (pdbs.size()>0)
+ if (pdbs.size() > 0)
{
SequenceI[][] seqs = new SequenceI[pdbs.size()][];
PDBEntry[] pdb = new PDBEntry[pdbs.size()];
String[][] chains = new String[pdbs.size()][];
String[] protocols = new String[pdbs.size()];
- for (int pdbsi=0,pdbsiSize=pdbs.size(); pdbsi<pdbsiSize;pdbsi++)
+ for (int pdbsi = 0, pdbsiSize = pdbs.size(); pdbsi < pdbsiSize; pdbsi++)
{
Object[] o = (Object[]) pdbs.elementAt(pdbsi);
pdb[pdbsi] = (PDBEntry) o[0];
chains[pdbsi] = (String[]) o[2];
protocols[pdbsi] = (String) o[3];
}
- newAlignFrame.alignedStructureView(applet, pdb, seqs, chains, protocols);
-
+ newAlignFrame.alignedStructureView(applet, pdb, seqs, chains,
+ protocols);
+
}
// ///////////////////////////
// modify display of features
public String arrayToSeparatorList(String[] list)
{
StringBuffer v = new StringBuffer();
- if (list != null && list.length>0)
+ if (list != null && list.length > 0)
{
for (int i = 0, iSize = list.length - 1; i < iSize; i++)
{
}
/**
- * get all components associated with the applet of the given type
+ * get all components associated with the applet of the given type
+ *
* @param class1
* @return
*/
{
Vector wnds = new Vector();
Component[] cmp = getComponents();
- if (cmp!=null)
- {
- for (int i=0;i<cmp.length;i++)
+ if (cmp != null)
{
- if (class1.isAssignableFrom(cmp[i].getClass()))
+ for (int i = 0; i < cmp.length; i++)
{
- wnds.addElement(cmp);
+ if (class1.isAssignableFrom(cmp[i].getClass()))
+ {
+ wnds.addElement(cmp);
+ }
}
- }}
+ }
return wnds;
}
-
/**
* bind structures in a viewer to any matching sequences in an alignFrame (use
* sequenceIds to limit scope of search to specific sequences)
* @param viewer
* @param sequenceIds
* @return TODO: consider making an exception structure for indicating when
- * binding fails
- public SequenceStructureBinding addStructureViewInstance(
- AlignFrame alFrame, Object viewer, String sequenceIds)
- {
-
- if (sequenceIds != null && sequenceIds.length() > 0)
- {
- return alFrame.addStructureViewInstance(viewer,
- separatorListToArray(sequenceIds));
- }
- else
- {
- return alFrame.addStructureViewInstance(viewer, null);
- }
- // return null;
- }
+ * binding fails public SequenceStructureBinding
+ * addStructureViewInstance( AlignFrame alFrame, Object viewer, String
+ * sequenceIds) {
+ *
+ * if (sequenceIds != null && sequenceIds.length() > 0) { return
+ * alFrame.addStructureViewInstance(viewer,
+ * separatorListToArray(sequenceIds)); } else { return
+ * alFrame.addStructureViewInstance(viewer, null); } // return null; }
*/
}
final public void appendEdit(int command, SequenceI[] seqs, int position,
int number, AlignmentI al, boolean performEdit, AlignmentI[] views)
{
- Edit edit = new Edit(command, seqs, position, number, al
- .getGapCharacter());
+ Edit edit = new Edit(command, seqs, position, number,
+ al.getGapCharacter());
if (al.getHeight() == seqs.length)
{
edit.al = al;
command.oldds = new SequenceI[command.seqs.length];
}
command.oldds[i] = oldds;
- adjustFeatures(command, i, command.seqs[i]
- .findPosition(command.position), command.seqs[i]
- .findPosition(command.position + command.number), false);
+ adjustFeatures(
+ command,
+ i,
+ command.seqs[i].findPosition(command.position),
+ command.seqs[i].findPosition(command.position
+ + command.number), false);
}
}
}
if (command.editedFeatures != null
&& command.editedFeatures.containsKey(seq))
{
- sequence
- .setSequenceFeatures((SequenceFeature[]) command.editedFeatures
- .get(seq));
+ sequence.setSequenceFeatures((SequenceFeature[]) command.editedFeatures
+ .get(seq));
}
return;
for (int i = 0; i < sequences.size(); i++)
{
Sequence seq = (Sequence) sequences.elementAt(i);
- seq.setSequence(seq.getSequenceAsString().replace('.', gc).replace(
- '-', gc).replace(' ', gc));
+ seq.setSequence(seq.getSequenceAsString().replace('.', gc)
+ .replace('-', gc).replace(' ', gc));
}
}
public boolean deleteAnnotation(AlignmentAnnotation aa);
/**
- * Get the annotation associated with this alignment
- * (this can be null if no annotation has ever been created on the alignment)
+ * Get the annotation associated with this alignment (this can be null if no
+ * annotation has ever been created on the alignment)
+ *
* @return array of AlignmentAnnotation objects
*/
public AlignmentAnnotation[] getAlignmentAnnotation();
}\r
\r
/**\r
- * Use this method to find out where a column will appear in the visible alignment when\r
- * hidden columns exist. If the column is not visible, then the left-most visible column will always be returned.\r
+ * Use this method to find out where a column will appear in the visible\r
+ * alignment when hidden columns exist. If the column is not visible, then the\r
+ * left-most visible column will always be returned.\r
* \r
* @param hiddenColumn\r
* int\r
result -= region[1] + 1 - region[0];\r
}\r
} while ((hiddenColumn > region[1]) && (index < hiddenColumns.size()));\r
- if (hiddenColumn>region[0] && hiddenColumn<region[1])\r
+ if (hiddenColumn > region[0] && hiddenColumn < region[1])\r
{\r
- return region[0]+hiddenColumn-result;\r
+ return region[0] + hiddenColumn - result;\r
}\r
}\r
return result; // return the shifted position after removing hidden columns.\r
*/
public String getSequenceString(char GapChar)
{
- return (length == 0) ? "" : (String) getSequenceAndDeletions(refseq
- .getSequenceAsString(start, end), GapChar)[0];
+ return (length == 0) ? "" : (String) getSequenceAndDeletions(
+ refseq.getSequenceAsString(start, end), GapChar)[0];
}
/**
{
return null;
}
- Object[] edit_result = getSequenceAndDeletions(refseq
- .getSequenceAsString(start, end), GapChar);
+ Object[] edit_result = getSequenceAndDeletions(
+ refseq.getSequenceAsString(start, end), GapChar);
if (edit_result == null)
{
throw new Error(
"Implementation Error - unexpected null from getSequenceAndDeletions");
}
int bounds[] = (int[]) edit_result[1];
- seq = new Sequence(refseq.getName(), (String) edit_result[0], refseq
- .getStart()
- + start + bounds[0], refseq.getStart() + start
- + ((bounds[2] == 0) ? -1 : bounds[2]));
+ seq = new Sequence(refseq.getName(), (String) edit_result[0],
+ refseq.getStart() + start + bounds[0], refseq.getStart()
+ + start + ((bounds[2] == 0) ? -1 : bounds[2]));
seq.setDescription(refseq.getDescription());
int sstart = seq.getStart(), send = seq.getEnd();
// seq.checkValidRange(); probably not needed
}
else
{
- ds = new Sequence(seq.getName(), ungapped, seq.getStart(), seq
- .getStart()
- + ungapped.length() - 1);
+ ds = new Sequence(seq.getName(), ungapped, seq.getStart(),
+ seq.getStart() + ungapped.length() - 1);
// JBPNote: this would be consistent but may not be useful
// seq.setDatasetSequence(ds);
}
}
else
{
- g_seqs[s].insert(inspos, alseqs_string[i].substring(
- region[0], region[1] + 1));
+ g_seqs[s].insert(inspos,
+ alseqs_string[i].substring(region[0], region[1] + 1));
}
}
shifts.addShift(region[2], insert.length); // update shift in
{
int[] bounds = ((int[]) ((Object[]) gs_regions[i])[1]);
SequenceI ref = alseqs[i].getRefSeq();
- seqs[i] = new Sequence(ref.getName(), g_seqs[i].toString(), ref
- .getStart()
- + alseqs[i].start + bounds[0], ref.getStart()
- + alseqs[i].start + (bounds[2] == 0 ? -1 : bounds[2]));
+ seqs[i] = new Sequence(ref.getName(), g_seqs[i].toString(),
+ ref.getStart() + alseqs[i].start + bounds[0], ref.getStart()
+ + alseqs[i].start + (bounds[2] == 0 ? -1 : bounds[2]));
seqs[i].setDatasetSequence(ref);
seqs[i].setDescription(ref.getDescription());
}
if (!found)
continue;
}
- AlignmentAnnotation newannot = new AlignmentAnnotation(seq
- .getAnnotation()[a]);
+ AlignmentAnnotation newannot = new AlignmentAnnotation(
+ seq.getAnnotation()[a]);
newannot.restrict(startRes, endRes);
newannot.setSequenceRef(seqs[ipos]);
newannot.adjustForAlignment();
}
}
- SequenceI sq = new Sequence("Group" + getName() + " Consensus", seqs
- .toString());
+ SequenceI sq = new Sequence("Group" + getName() + " Consensus",
+ seqs.toString());
sq.setDescription("Percentage Identity Consensus "
+ ((ignoreGapsInConsensus) ? " without gaps" : ""));
return sq;
{
// extract proteins.
product = new Sequence(prid, prseq, 1, prseq.length());
- product
- .setDescription(((prname.length() == 0) ? "Protein Product from "
- + sourceDb
- : prname));
+ product.setDescription(((prname.length() == 0) ? "Protein Product from "
+ + sourceDb
+ : prname));
if (!noPeptide)
{
// Protein is also added to vector of sequences returned
}
if (product != null)
{
- DBRefEntry pref = new DBRefEntry(ref.getSource(), ref
- .getVersion(), ref.getAccessionId());
+ DBRefEntry pref = new DBRefEntry(ref.getSource(),
+ ref.getVersion(), ref.getAccessionId());
pref.setMap(null); // reference is direct
product.addDBRef(pref);
// Add converse mapping reference
if (map != null)
{
Mapping pmap = new Mapping(dna, map.getMap().getInverse());
- pref = new DBRefEntry(sourceDb, getVersion(), this
- .getAccession());
+ pref = new DBRefEntry(sourceDb, getVersion(),
+ this.getAccession());
pref.setMap(pmap);
if (map.getTo() != null)
{
});
rfetch.add(fetchr);
- final AlignFrame me=this;
+ final AlignFrame me = this;
new Thread(new Runnable()
{
public void run()
consensus.annotations = new Annotation[aWidth];
hconsensus = new Hashtable[aWidth];
- AAFrequency.calculate(alignment.getSequencesArray(), 0, alignment
- .getWidth(), hconsensus, true);
+ AAFrequency.calculate(alignment.getSequencesArray(), 0,
+ alignment.getWidth(), hconsensus, true);
updateAnnotation(true);
if (globalColourScheme != null)
protected void updateAnnotation(boolean immediate)
{
- // TODO: make calls thread-safe, so if another thread calls this method, it will either return or wait until one calculation is finished.
+ // TODO: make calls thread-safe, so if another thread calls this method,
+ // it will either return or wait until one calculation is finished.
if (immediate
|| (!updatingConsensus && consensus != null && hconsensus != null))
{
{
Alignment al = (Alignment) alignment;
Conservation c = new Conservation("All",
- ResidueProperties.propHash, 3, al.getSequences(), 0, al
- .getWidth() - 1);
+ ResidueProperties.propHash, 3, al.getSequences(), 0,
+ al.getWidth() - 1);
c.calculate();
c.verdict(false, ConsPercGaps);
SequenceGroup sg = (SequenceGroup) alignment.getGroups().elementAt(s);
if (sg.cs != null && sg.cs instanceof ClustalxColourScheme)
{
- ((ClustalxColourScheme) sg.cs).resetClustalX(sg
- .getSequences(hiddenRepSequences), sg.getWidth());
+ ((ClustalxColourScheme) sg.cs).resetClustalX(
+ sg.getSequences(hiddenRepSequences), sg.getWidth());
}
sg.recalcConservation();
}
AlignmentI al = av.getAlignment();
int afwidth = (alignFrame != null ? alignFrame.getWidth() : 300);
- int maxwidth = Math.max(20, Math.min(afwidth - 200, (int) 2 * afwidth
- / 3));
+ int maxwidth = Math.max(20,
+ Math.min(afwidth - 200, (int) 2 * afwidth / 3));
int i = 0;
int idWidth = 0;
String id;
}
int start = r[0];
int end = r[1];
- // System.err.println("Seq : "+seqIndex+" Scroll to "+start+","+end); // DEBUG
+ // System.err.println("Seq : "+seqIndex+" Scroll to "+start+","+end); //
+ // DEBUG
if (start < 0)
{
return false;
{
int x = hscroll.getValue();
av.setStartRes(x);
- av
- .setEndRes((x + (seqPanel.seqCanvas.getWidth() / av
- .getCharWidth())) - 1);
+ av.setEndRes((x + (seqPanel.seqCanvas.getWidth() / av.getCharWidth())) - 1);
}
if (evt.getSource() == vscroll)
}
pg.setColor(currentColor);
- pg.fillRect(0, (i - startSeq) * av.charHeight, idWidth, av
- .getCharHeight());
+ pg.fillRect(0, (i - startSeq) * av.charHeight, idWidth,
+ av.getCharHeight());
pg.setColor(currentTextColor);
- 4;
}
- pg.drawString(seq.getDisplayId(av.getShowJVSuffix()), xPos,
+ pg.drawString(
+ seq.getDisplayId(av.getShowJVSuffix()),
+ xPos,
(((i - startSeq) * av.charHeight) + av.getCharHeight())
- (av.getCharHeight() / 5));
}
public void updateAnnotation(boolean applyGlobalSettings)
{
- // TODO: this should be merged with other annotation update stuff - that sits on AlignViewport
+ // TODO: this should be merged with other annotation update stuff - that
+ // sits on AlignViewport
boolean updateCalcs = false;
boolean conv = av.isShowGroupConservation();
boolean cons = av.isShowGroupConsensus();
Hashtable oldrfs = new Hashtable();
if (aan != null)
{
- for (int an = 0; an < aan.length; an++)
- {
- if (aan[an].autoCalculated && aan[an].groupRef != null)
+ for (int an = 0; an < aan.length; an++)
{
- oldrfs.put(aan[an].groupRef, aan[an].groupRef);
- av.alignment.deleteAnnotation(aan[an]);
- aan[an] = null;
+ if (aan[an].autoCalculated && aan[an].groupRef != null)
+ {
+ oldrfs.put(aan[an].groupRef, aan[an].groupRef);
+ av.alignment.deleteAnnotation(aan[an]);
+ aan[an] = null;
+ }
}
}
- }
SequenceGroup sg;
if (gr != null)
{
- for (int g = 0; g < gr.size(); g++)
- {
- updateCalcs = false;
- sg = (SequenceGroup) gr.elementAt(g);
- if (applyGlobalSettings || !oldrfs.containsKey(sg))
- {
- // set defaults for this group's conservation/consensus
- sg.setshowSequenceLogo(showprf);
- sg.setShowConsensusHistogram(showConsHist);
- }
- if (conv)
- {
- updateCalcs = true;
- av.alignment.addAnnotation(sg.getConservationRow(), 0);
- }
- if (cons)
- {
- updateCalcs = true;
- av.alignment.addAnnotation(sg.getConsensus(), 0);
- }
- // refresh the annotation rows
- if (updateCalcs)
+ for (int g = 0; g < gr.size(); g++)
{
- sg.recalcConservation();
+ updateCalcs = false;
+ sg = (SequenceGroup) gr.elementAt(g);
+ if (applyGlobalSettings || !oldrfs.containsKey(sg))
+ {
+ // set defaults for this group's conservation/consensus
+ sg.setshowSequenceLogo(showprf);
+ sg.setShowConsensusHistogram(showConsHist);
+ }
+ if (conv)
+ {
+ updateCalcs = true;
+ av.alignment.addAnnotation(sg.getConservationRow(), 0);
+ }
+ if (cons)
+ {
+ updateCalcs = true;
+ av.alignment.addAnnotation(sg.getConsensus(), 0);
+ }
+ // refresh the annotation rows
+ if (updateCalcs)
+ {
+ sg.recalcConservation();
+ }
}
}
- }
oldrfs.clear();
adjustAnnotationHeight();
}
AnnotationColourGradient acg = null;
if (currentColours.isSelected())
{
- acg = new AnnotationColourGradient(currentAnnotation, av
- .getGlobalColourScheme(), aboveThreshold);
+ acg = new AnnotationColourGradient(currentAnnotation,
+ av.getGlobalColourScheme(), aboveThreshold);
}
else
{
- acg = new AnnotationColourGradient(currentAnnotation, minColour
- .getBackground(), maxColour.getBackground(), aboveThreshold);
+ acg = new AnnotationColourGradient(currentAnnotation,
+ minColour.getBackground(), maxColour.getBackground(),
+ aboveThreshold);
}
if (currentAnnotation.graphMin == 0f
}
else
{
- sg.cs = new AnnotationColourGradient(currentAnnotation, minColour
- .getBackground(), maxColour.getBackground(),
+ sg.cs = new AnnotationColourGradient(currentAnnotation,
+ minColour.getBackground(), maxColour.getBackground(),
aboveThreshold);
}
private Hashtable getDisplayedFeatureCols()\r
{\r
Hashtable fcols = new Hashtable();\r
- if (ap.av.featuresDisplayed==null)\r
+ if (ap.av.featuresDisplayed == null)\r
{\r
return fcols;\r
}\r
{
}
- BufferedImage bi = new BufferedImage(temp.getHeight(this), temp
- .getWidth(this), BufferedImage.TYPE_INT_RGB);
+ BufferedImage bi = new BufferedImage(temp.getHeight(this),
+ temp.getWidth(this), BufferedImage.TYPE_INT_RGB);
Graphics2D g = (Graphics2D) bi.getGraphics();
g.rotate(Math.toRadians(90));
g.drawImage(temp, 0, -bi.getWidth(this), this);
// todo: make the ap scroll to the selection
ap.seqPanel.ap.idPanel.highlightSearchResults(null);
ap.av.setSelectionGroup(// new SequenceGroup(
- aa[selectedRow].groupRef); // );
+ aa[selectedRow].groupRef); // );
ap.av.sendSelection();
ap.paintAlignment(false);
PaintRefresher.Refresh(ap, ap.av.getSequenceSetId());
final JCheckBoxMenuItem cbmi = new JCheckBoxMenuItem(
"Ignore Gaps In Consensus",
(aa[selectedRow].groupRef != null) ? aa[selectedRow].groupRef
- .getIgnoreGapsConsensus()
- : ap.av.getIgnoreGapsConsensus());
+ .getIgnoreGapsConsensus() : ap.av
+ .getIgnoreGapsConsensus());
final AlignmentAnnotation aaa = aa[selectedRow];
cbmi.addActionListener(new ActionListener()
{
if (aaa.groupRef != null)
{
final JCheckBoxMenuItem chist = new JCheckBoxMenuItem(
- "Show Group Histogram", aa[selectedRow].groupRef
- .isShowConsensusHistogram());
+ "Show Group Histogram",
+ aa[selectedRow].groupRef.isShowConsensusHistogram());
chist.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
});
pop.add(chist);
final JCheckBoxMenuItem cprofl = new JCheckBoxMenuItem(
- "Show Group Logo", aa[selectedRow].groupRef
- .isShowSequenceLogo());
+ "Show Group Logo",
+ aa[selectedRow].groupRef.isShowSequenceLogo());
cprofl.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
String output = new FormatAdapter().formatSequences("Fasta", seqs,
omitHidden);
- Toolkit.getDefaultToolkit().getSystemClipboard().setContents(
- new StringSelection(output), Desktop.instance);
+ Toolkit.getDefaultToolkit().getSystemClipboard()
+ .setContents(new StringSelection(output), Desktop.instance);
Vector hiddenColumns = null;
if (av.hasHiddenColumns)
g.setColor(aa[gg].annotations[0].colour);
}
- g.drawLine(x, y - graphExtras - 3, x
- + fm.stringWidth(aa[gg].label), y - graphExtras - 3);
+ g.drawLine(x, y - graphExtras - 3,
+ x + fm.stringWidth(aa[gg].label), y - graphExtras - 3);
g.setColor(Color.black);
graphExtras += fontHeight + 8;
else if (dragEvent != null && aa != null)
{
g.setColor(Color.lightGray);
- g.drawString(aa[selectedRow].label, dragEvent.getX(), dragEvent
- .getY()
- - scrollOffset);
+ g.drawString(aa[selectedRow].label, dragEvent.getX(),
+ dragEvent.getY() - scrollOffset);
}
if ((aa == null) || (aa.length < 1))
height += aa[i].height;
}
}
- if (height==0)
+ if (height == 0)
{
// set minimum
height = 20;
public void actionPerformed(ActionEvent evt)
{
AlignmentAnnotation[] aa = av.alignment.getAlignmentAnnotation();
- if (aa==null)
+ if (aa == null)
{
return;
}
if (v == column)
{
- g
- .fillRect(x * av.charWidth, y, av.charWidth,
- av.charHeight);
+ g.fillRect(x * av.charWidth, y, av.charWidth, av.charHeight);
}
}
}
if (sCol == 0 || row.annotations[sCol - 1] == null
|| row.annotations[sCol - 1].secondaryStructure != 'H')
{
- g
- .fillArc(lastSSX, y + 4 + iconOffset, av.charWidth, 8,
- 90, 180);
+ g.fillArc(lastSSX, y + 4 + iconOffset, av.charWidth, 8, 90, 180);
x1 += av.charWidth / 2;
}
// group(aa.groupRef.cs==null)
// ? av.textColour2 :
// cs.findColour(dc));
- g.drawChars(dc, 0, 1, x * av.charWidth, (int) (ht + lm
- .getHeight()));
+ g.drawChars(dc, 0, 1, x * av.charWidth,
+ (int) (ht + lm.getHeight()));
// ht+=g.getFontMetrics().getAscent()-g.getFontMetrics().getDescent();
}
}
&& aa.groupRef.isShowSequenceLogo())
{
return AAFrequency.extractProfile(
- aa.groupRef.consensusData[column], aa.groupRef
- .getIgnoreGapsConsensus());
+ aa.groupRef.consensusData[column],
+ aa.groupRef.getIgnoreGapsConsensus());
}
// TODO extend annotation row to enable dynamic and static profile data to
// be stored
if (aa.groupRef == null && aa.sequenceRef == null
&& av.isShowSequenceLogo())
{
- return AAFrequency.extractProfile(av.hconsensus[column], av
- .getIgnoreGapsConsensus());
+ return AAFrequency.extractProfile(av.hconsensus[column],
+ av.getIgnoreGapsConsensus());
}
}
return null;
AppJmolBinding jmb;
JPanel scriptWindow;
-
+
JSplitPane splitPane;
RenderPanel renderPanel;
* @param pdbentry
* @param seq
* @param chains
- * @param alignFrame
+ * @param alignFrame
* @param align
* if true, new structure(s) will be align using associated alignment
*/
private void addStructure(final PDBEntry pdbentry, final SequenceI[] seq,
- final String[] chains, final boolean b, final IProgressIndicator alignFrame)
+ final String[] chains, final boolean b,
+ final IProgressIndicator alignFrame)
{
if (pdbentry.getFile() == null)
{
addingStructures = true;
_started = false;
alignAddedStructures = b;
- progressBar = alignFrame; // visual indication happens on caller frame.
+ progressBar = alignFrame; // visual indication happens on caller frame.
(worker = new Thread(this)).start();
return;
}
bl.setVgap(0);
scriptWindow = new JPanel(bl);
scriptWindow.setVisible(false);
- };
- jmb.allocateViewer(renderPanel, true, "", null, null, "", scriptWindow, null);
+ }
+ ;
+ jmb.allocateViewer(renderPanel, true, "", null, null, "", scriptWindow,
+ null);
jmb.newJmolPopup(true, "Jmol", true);
jmb.evalStateCommand(command);
jmb.setFinishedInit(true);
void closeViewer()
{
jmb.closeViewer();
-
+
// TODO: check for memory leaks where instance isn't finalised because jmb
// holds a reference to the window
jmb = null;
// retrieve the pdb and store it locally
AlignmentI pdbseq = null;
pdbid = jmb.pdbentry[pi].getId();
- long hdl=pdbid.hashCode()-System.currentTimeMillis();
+ long hdl = pdbid.hashCode() - System.currentTimeMillis();
if (progressBar != null)
{
- progressBar.setProgressBar("Fetching PDB " + pdbid,
- hdl);
+ progressBar.setProgressBar("Fetching PDB " + pdbid, hdl);
}
try
{
{
Cache.log.error("Couldn't add files to Jmol viewer!", ex);
}
- long lastnotify=jmb.getLoadNotifiesHandled();
- // need to wait around until script has finished
- while (lastnotify>=jmb.getLoadNotifiesHandled());
+ long lastnotify = jmb.getLoadNotifiesHandled();
+ // need to wait around until script has finished
+ while (lastnotify >= jmb.getLoadNotifiesHandled())
+ ;
+ {
+ try
{
- try
- {
- Thread.sleep(35);
- } catch (Exception e)
- {
- }
- }
- // refresh the sequence colours for the new structure(s)
- jmb.updateColours(ap);
- // do superposition if asked to
- if (alignAddedStructures)
+ Thread.sleep(35);
+ } catch (Exception e)
{
- javax.swing.SwingUtilities.invokeLater(new Runnable()
+ }
+ }
+ // refresh the sequence colours for the new structure(s)
+ jmb.updateColours(ap);
+ // do superposition if asked to
+ if (alignAddedStructures)
+ {
+ javax.swing.SwingUtilities.invokeLater(new Runnable()
{
public void run()
{
{
}
}
-public void showConsole(boolean showConsole)
+
+ public void showConsole(boolean showConsole)
{
if (showConsole)
else
{
if (splitPane != null)
- {
- splitPane.setVisible(false);
- }
+ {
+ splitPane.setVisible(false);
+ }
splitPane = null;
validate();
}
+
class RenderPanel extends JPanel
{
final Dimension currentSize = new Dimension();
import org.jmol.popup.JmolPopup;
import org.openscience.jmol.app.jmolpanel.AppConsole;
-public class AppJmolBinding extends jalview.ext.jmol.JalviewJmolBinding
+public class AppJmolBinding extends jalview.ext.jmol.JalviewJmolBinding
{
/**
public void refreshGUI()
{
// appJmolWindow.repaint();
- javax.swing.SwingUtilities.invokeLater(new Runnable() {
- public void run() {
+ javax.swing.SwingUtilities.invokeLater(new Runnable()
+ {
+ public void run()
+ {
appJmolWindow.updateTitleAndMenus();
appJmolWindow.revalidate();
- }});
+ }
+ });
}
public void updateColours(Object source)
public void notifyScriptTermination(String strStatus, int msWalltime)
{
// todo - script termination doesn't happen ?
- //if (console != null)
- //console.notifyScriptTermination(strStatus,
- // msWalltime);
+ // if (console != null)
+ // console.notifyScriptTermination(strStatus,
+ // msWalltime);
}
public void showUrl(String url)
}
- public void showConsole(boolean b) {
+ public void showConsole(boolean b)
+ {
appJmolWindow.showConsole(b);
}
protected void releaseUIResources()
{
appJmolWindow = null;
- if (console!=null) {
- try {
+ if (console != null)
+ {
+ try
+ {
console.setVisible(false);
- } catch (Error e) {} catch (Exception x) {};
- console=null;
+ } catch (Error e)
+ {
+ } catch (Exception x)
+ {
+ }
+ ;
+ console = null;
}
-
+
}
}
private JFrame frame;
private JTextArea textArea;
-/* unused - tally and limit for lines in console window
- int lines = 0;
- int lim = 1000;
-*/
+ /*
+ * unused - tally and limit for lines in console window int lines = 0;
+ *
+ * int lim = 1000;
+ */
int byteslim = 102400, bytescut = 76800; // 100k and 75k cut point.
private Thread reader, reader2, textAppender;
{
initConsole(visible, true);
}
-
+
/**
*
- * @param visible - open the window
- * @param redirect - redirect std*
+ * @param visible
+ * - open the window
+ * @param redirect
+ * - redirect std*
*/
private void initConsole(boolean visible, boolean redirect)
{
if (redirect)
{
redirectStreams();
- } else {
+ }
+ else
+ {
unredirectStreams();
}
quit = false; // signals the Threads that they should exit
textAppender.setDaemon(true);
textAppender.start();
}
- PipedOutputStream pout=null,perr=null;
- public void redirectStreams() {
- if (pout==null)
+
+ PipedOutputStream pout = null, perr = null;
+
+ public void redirectStreams()
+ {
+ if (pout == null)
{
try
{
pout = new PipedOutputStream(this.pin);
System.setOut(new PrintStream(pout, true));
- } catch (java.io.IOException io)
- {
- textArea.append("Couldn't redirect STDOUT to this console\n"
- + io.getMessage());
- io.printStackTrace(stderr);
- } catch (SecurityException se)
- {
- textArea.append("Couldn't redirect STDOUT to this console\n"
- + se.getMessage());
- se.printStackTrace(stderr);
- }
+ } catch (java.io.IOException io)
+ {
+ textArea.append("Couldn't redirect STDOUT to this console\n"
+ + io.getMessage());
+ io.printStackTrace(stderr);
+ } catch (SecurityException se)
+ {
+ textArea.append("Couldn't redirect STDOUT to this console\n"
+ + se.getMessage());
+ se.printStackTrace(stderr);
+ }
- try
- {
- perr = new PipedOutputStream(this.pin2);
- System.setErr(new PrintStream(perr, true));
- } catch (java.io.IOException io)
- {
- textArea.append("Couldn't redirect STDERR to this console\n"
- + io.getMessage());
- io.printStackTrace(stderr);
- } catch (SecurityException se)
- {
- textArea.append("Couldn't redirect STDERR to this console\n"
- + se.getMessage());
- se.printStackTrace(stderr);
- }
+ try
+ {
+ perr = new PipedOutputStream(this.pin2);
+ System.setErr(new PrintStream(perr, true));
+ } catch (java.io.IOException io)
+ {
+ textArea.append("Couldn't redirect STDERR to this console\n"
+ + io.getMessage());
+ io.printStackTrace(stderr);
+ } catch (SecurityException se)
+ {
+ textArea.append("Couldn't redirect STDERR to this console\n"
+ + se.getMessage());
+ se.printStackTrace(stderr);
+ }
}
}
- public void unredirectStreams() {
- if (pout!=null)
+
+ public void unredirectStreams()
+ {
+ if (pout != null)
{
try
{
pout.flush();
pout.close();
pin = new PipedInputStream();
- pout=null;
- } catch (java.io.IOException io)
- {
- textArea.append("Couldn't unredirect STDOUT to this console\n"
- + io.getMessage());
- io.printStackTrace(stderr);
- } catch (SecurityException se)
- {
- textArea.append("Couldn't unredirect STDOUT to this console\n"
- + se.getMessage());
- se.printStackTrace(stderr);
- }
+ pout = null;
+ } catch (java.io.IOException io)
+ {
+ textArea.append("Couldn't unredirect STDOUT to this console\n"
+ + io.getMessage());
+ io.printStackTrace(stderr);
+ } catch (SecurityException se)
+ {
+ textArea.append("Couldn't unredirect STDOUT to this console\n"
+ + se.getMessage());
+ se.printStackTrace(stderr);
+ }
- try
- {
- System.setErr(stderr);
- perr.flush();
- perr.close();
- pin2 = new PipedInputStream();
- perr = null;
- } catch (java.io.IOException io)
- {
- textArea.append("Couldn't unredirect STDERR to this console\n"
- + io.getMessage());
+ try
+ {
+ System.setErr(stderr);
+ perr.flush();
+ perr.close();
+ pin2 = new PipedInputStream();
+ perr = null;
+ } catch (java.io.IOException io)
+ {
+ textArea.append("Couldn't unredirect STDERR to this console\n"
+ + io.getMessage());
io.printStackTrace(stderr);
- } catch (SecurityException se)
- {
- textArea.append("Couldn't unredirect STDERR to this console\n"
- + se.getMessage());
- se.printStackTrace(stderr);
- }
+ } catch (SecurityException se)
+ {
+ textArea.append("Couldn't unredirect STDERR to this console\n"
+ + se.getMessage());
+ se.printStackTrace(stderr);
+ }
}
}
{
// testing part
// you may omit this part for your application
- //
+ //
System.out.println("Hello World 2");
System.out.println("All fonts available to Graphic2D:\n");
{
this(desktop, true);
}
+
/**
* attach a console to the desktop - the desktop will open it if requested.
*
* @param desktop
- * @param showjconsole - if true, then redirect stdout immediately
+ * @param showjconsole
+ * - if true, then redirect stdout immediately
*/
public Console(Desktop desktop, boolean showjconsole)
{
org.apache.log4j.Logger.getRootLogger().addAppender(jappender);
}
-
public synchronized void stopConsole()
{
quit = true;
this.notifyAll();
- /*reader.notify();
- reader2.notify();
- if (errorThrower!=null)
- errorThrower.notify(); // stop all threads
- if (textAppender!=null)
- textAppender.notify();
- */
- if (pout!=null)
- {
- try
- {
- reader.join(10);
- pin.close();
- } catch (Exception e)
- {
- }
- try
- {
- reader2.join(10);
- pin2.close();
- } catch (Exception e)
+ /*
+ * reader.notify(); reader2.notify(); if (errorThrower!=null)
+ * errorThrower.notify(); // stop all threads if (textAppender!=null)
+ * textAppender.notify();
+ */
+ if (pout != null)
{
- }
- try
- {
- textAppender.join(10);
- } catch (Exception e)
- {
- }
+ try
+ {
+ reader.join(10);
+ pin.close();
+ } catch (Exception e)
+ {
+ }
+ try
+ {
+ reader2.join(10);
+ pin2.close();
+ } catch (Exception e)
+ {
+ }
+ try
+ {
+ textAppender.join(10);
+ } catch (Exception e)
+ {
+ }
}
if (!frame.isVisible())
{
frame.setVisible(false);
closeConsoleGui();
}
- private void closeConsoleGui() {
+
+ private void closeConsoleGui()
+ {
updateConsole = false;
if (parent == null)
{
{
frame.setVisible(false); // default behaviour of JFrame
closeConsoleGui();
-
+
// frame.dispose();
}
{
while (Thread.currentThread() == reader)
{
- if (pin==null || pin.available() == 0)
+ if (pin == null || pin.available() == 0)
{
try
{
stdout.print(input);
long time = System.nanoTime();
appendToTextArea(input);
- //stderr.println("Time taken to stdout append:\t"
- // + (System.nanoTime() - time) + " ns");
+ // stderr.println("Time taken to stdout append:\t"
+ // + (System.nanoTime() - time) + " ns");
// lines++;
}
if (quit)
stderr.print(input);
long time = System.nanoTime();
appendToTextArea(input);
- //stderr.println("Time taken to stderr append:\t"
- // + (System.nanoTime() - time) + " ns");
+ // stderr.println("Time taken to stderr append:\t"
+ // + (System.nanoTime() - time) + " ns");
// lines++;
}
if (quit)
{
long time = System.nanoTime();
textArea.replaceRange(header, 0, tlength - bytescut);
- //stderr.println("Time taken to cut:\t"
- // + (System.nanoTime() - time) + " ns");
+ // stderr.println("Time taken to cut:\t"
+ // + (System.nanoTime() - time) + " ns");
}
else
{
}
/**
- * set the banner that appears at the top of the console output
+ * set the banner that appears at the top of the console output
+ *
* @param string
*/
public void setHeader(String string)
{
header = string;
- if (header.charAt(header.length()-1)!='\n') {
- header+="\n";
+ if (header.charAt(header.length() - 1) != '\n')
+ {
+ header += "\n";
}
textArea.insert(header, 0);
}
+
/**
* get the banner
+ *
* @return
*/
public String getHeader()
public void save_actionPerformed(ActionEvent e)
{
- JalviewFileChooser chooser = new JalviewFileChooser(jalview.bin.Cache
- .getProperty("LAST_DIRECTORY"));
+ JalviewFileChooser chooser = new JalviewFileChooser(
+ jalview.bin.Cache.getProperty("LAST_DIRECTORY"));
chooser.setAcceptAllFileFilterUsed(false);
chooser.setFileView(new JalviewFileView());
init();\r
}\r
}\r
+\r
FeatureSettings fs = null;\r
+\r
public DasSourceBrowser()\r
{\r
this(null);\r
text.append("<font color=\"#0000FF\">URL:</font> "\r
+ dasSources[i].getUrl() + "<br>");\r
\r
- text\r
- .append("<font color=\"#0000FF\">Admin Email:</font> <a href=\"mailto:"\r
- + dasSources[i].getAdminemail()\r
- + "\">"\r
- + dasSources[i].getAdminemail() + "</a>" + "<br>");\r
+ text.append("<font color=\"#0000FF\">Admin Email:</font> <a href=\"mailto:"\r
+ + dasSources[i].getAdminemail()\r
+ + "\">"\r
+ + dasSources[i].getAdminemail() + "</a>" + "<br>");\r
\r
text.append("<font color=\"#0000FF\">Registered at:</font> "\r
+ dasSources[i].getRegisterDate() + "<br>");\r
\r
private void setParentGuiEnabled(boolean b)\r
{\r
- if (fs!=null)\r
+ if (fs != null)\r
{\r
fs.fetchDAS.setEnabled(b);\r
fs.saveDAS.setEnabled(b);\r
{\r
tmp[index] = dasSources[i];\r
data[index][0] = dasSources[i].getNickname();\r
- data[index][1] = new Boolean(selectedSources\r
- .contains(dasSources[i].getNickname()));\r
+ data[index][1] = new Boolean(\r
+ selectedSources.contains(dasSources[i].getNickname()));\r
index++;\r
}\r
}\r
// HAVE COORDINATE SYSTEMS, INFO WHICH AT PRESENT\r
// IS ADDED FROM THE REGISTRY\r
names.add(ds.getNickname());\r
- selected\r
- .add(new Boolean(selectedSources.contains(ds.getNickname())));\r
+ selected.add(new Boolean(selectedSources.contains(ds.getNickname())));\r
continue;\r
}\r
\r
if (!selectedInList(dummyFeatureList, ds.getCapabilities())\r
- || !selectedInList(filter3.getSelectedValues(), ds\r
- .getLabels()))\r
+ || !selectedInList(filter3.getSelectedValues(),\r
+ ds.getLabels()))\r
{\r
continue;\r
}\r
}\r
}\r
\r
- properties.setProperty(jalview.bin.Cache.DAS_ACTIVE_SOURCE, sb\r
- .toString());\r
+ properties.setProperty(jalview.bin.Cache.DAS_ACTIVE_SOURCE,\r
+ sb.toString());\r
\r
if (localSources != null)\r
{\r
+ ((DasSource) localSources.get(token)).getUrl() + "\t");\r
}\r
\r
- properties.setProperty(jalview.bin.Cache.DAS_LOCAL_SOURCE, sb\r
- .toString());\r
+ properties.setProperty(jalview.bin.Cache.DAS_LOCAL_SOURCE,\r
+ sb.toString());\r
}\r
\r
}\r
\r
/**\r
* disable or enable the buttons on the source browser\r
+ * \r
* @param b\r
*/\r
public void setGuiEnabled(boolean b)\r
/**
* @param listener
- * @see java.beans.PropertyChangeSupport#addPropertyChangeListener(
- * java.beans.PropertyChangeListener)
+ * @see java.beans.PropertyChangeSupport#addPropertyChangeListener(java.beans.PropertyChangeListener)
*/
public void addJalviewPropertyChangeListener(
PropertyChangeListener listener)
iw = (int) (iw * sw);
iy = (int) (iy * sh);
ih = (int) (ih * sh);
- while (ix>=screenSize.width) {
- jalview.bin.Cache.log.debug("Window geometry location recall error: shifting horizontal to within screenbounds.");
- ix-=screenSize.width;
+ while (ix >= screenSize.width)
+ {
+ jalview.bin.Cache.log
+ .debug("Window geometry location recall error: shifting horizontal to within screenbounds.");
+ ix -= screenSize.width;
}
- while (iy>=screenSize.height) {
- jalview.bin.Cache.log.debug("Window geometry location recall error: shifting vertical to within screenbounds.");
- iy-=screenSize.height;
+ while (iy >= screenSize.height)
+ {
+ jalview.bin.Cache.log
+ .debug("Window geometry location recall error: shifting vertical to within screenbounds.");
+ iy -= screenSize.height;
}
jalview.bin.Cache.log.debug("Got last known dimensions for "
+ windowName + ": x:" + ix + " y:" + iy + " width:" + iw
}
final JMenuItem menuItem = new JMenuItem(title);
- frame
- .addInternalFrameListener(new javax.swing.event.InternalFrameAdapter()
- {
- public void internalFrameActivated(
- javax.swing.event.InternalFrameEvent evt)
- {
- JInternalFrame itf = desktop.getSelectedFrame();
- if (itf != null)
- {
- itf.requestFocus();
- }
+ frame.addInternalFrameListener(new javax.swing.event.InternalFrameAdapter()
+ {
+ public void internalFrameActivated(
+ javax.swing.event.InternalFrameEvent evt)
+ {
+ JInternalFrame itf = desktop.getSelectedFrame();
+ if (itf != null)
+ {
+ itf.requestFocus();
+ }
- }
+ }
- public void internalFrameClosed(
- javax.swing.event.InternalFrameEvent evt)
- {
- PaintRefresher.RemoveComponent(frame);
- openFrameCount--;
- windowMenu.remove(menuItem);
- JInternalFrame itf = desktop.getSelectedFrame();
- if (itf != null)
- {
- itf.requestFocus();
- }
- System.gc();
- };
- });
+ public void internalFrameClosed(
+ javax.swing.event.InternalFrameEvent evt)
+ {
+ PaintRefresher.RemoveComponent(frame);
+ openFrameCount--;
+ windowMenu.remove(menuItem);
+ JInternalFrame itf = desktop.getSelectedFrame();
+ if (itf != null)
+ {
+ itf.requestFocus();
+ }
+ System.gc();
+ };
+ });
menuItem.addActionListener(new ActionListener()
{
*/
public void inputLocalFileMenuItem_actionPerformed(AlignViewport viewport)
{
- JalviewFileChooser chooser = new JalviewFileChooser(jalview.bin.Cache
- .getProperty("LAST_DIRECTORY"),
+ JalviewFileChooser chooser = new JalviewFileChooser(
+ jalview.bin.Cache.getProperty("LAST_DIRECTORY"),
jalview.io.AppletFormatAdapter.READABLE_EXTENSIONS,
jalview.io.AppletFormatAdapter.READABLE_FNAMES,
jalview.bin.Cache.getProperty("DEFAULT_FILE_FORMAT"));
if (!jalview.bin.Cache.getProperty("LATEST_VERSION").equals(
jalview.bin.Cache.getProperty("VERSION")))
{
- message
- .append("\n\n!! Jalview version "
- + jalview.bin.Cache.getProperty("LATEST_VERSION")
- + " is available for download from http://www.jalview.org !!\n");
+ message.append("\n\n!! Jalview version "
+ + jalview.bin.Cache.getProperty("LATEST_VERSION")
+ + " is available for download from http://www.jalview.org !!\n");
}
// TODO: update this text for each release or centrally store it for lite
// and application
- message
- .append("\nAuthors: Andrew Waterhouse, Jim Procter, Michele Clamp, James Cuff, Steve Searle,\n David Martin & Geoff Barton."
- + "\nDevelopment managed by The Barton Group, University of Dundee, Scotland, UK.\n"
- + "\nFor help, see the FAQ at www.jalview.org and/or join the jalview-discuss@jalview.org mailing list\n"
- + "\nIf you use Jalview, please cite:"
- + "\nWaterhouse, A.M., Procter, J.B., Martin, D.M.A, Clamp, M. and Barton, G. J. (2009)"
- + "\nJalview Version 2 - a multiple sequence alignment editor and analysis workbench"
- + "\nBioinformatics doi: 10.1093/bioinformatics/btp033");
+ message.append("\nAuthors: Andrew Waterhouse, Jim Procter, Michele Clamp, James Cuff, Steve Searle,\n David Martin & Geoff Barton."
+ + "\nDevelopment managed by The Barton Group, University of Dundee, Scotland, UK.\n"
+ + "\nFor help, see the FAQ at www.jalview.org and/or join the jalview-discuss@jalview.org mailing list\n"
+ + "\nIf you use Jalview, please cite:"
+ + "\nWaterhouse, A.M., Procter, J.B., Martin, D.M.A, Clamp, M. and Barton, G. J. (2009)"
+ + "\nJalview Version 2 - a multiple sequence alignment editor and analysis workbench"
+ + "\nBioinformatics doi: 10.1093/bioinformatics/btp033");
JOptionPane.showInternalMessageDialog(Desktop.desktop,
message.toString(), "About Jalview", JOptionPane.INFORMATION_MESSAGE);
*/
public void saveState_actionPerformed(ActionEvent e)
{
- JalviewFileChooser chooser = new JalviewFileChooser(jalview.bin.Cache
- .getProperty("LAST_DIRECTORY"), new String[]
- { "jar" }, new String[]
- { "Jalview Project" }, "Jalview Project");
+ JalviewFileChooser chooser = new JalviewFileChooser(
+ jalview.bin.Cache.getProperty("LAST_DIRECTORY"), new String[]
+ { "jar" }, new String[]
+ { "Jalview Project" }, "Jalview Project");
chooser.setFileView(new JalviewFileView());
chooser.setDialogTitle("Save State");
if (value == JalviewFileChooser.APPROVE_OPTION)
{
java.io.File choice = chooser.getSelectedFile();
- setProgressBar("Saving jalview project "
- + choice.getName(), choice.hashCode());
+ setProgressBar("Saving jalview project " + choice.getName(),
+ choice.hashCode());
jalview.bin.Cache.setProperty("LAST_DIRECTORY", choice.getParent());
// TODO catch and handle errors for savestate
- try {
+ try
+ {
new Jalview2XML().SaveState(choice);
} catch (OutOfMemoryError oom)
{
- new OOMWarning("Whilst saving current state to "+choice.getName(), oom);
- }
- catch (Exception ex)
+ new OOMWarning(
+ "Whilst saving current state to " + choice.getName(), oom);
+ } catch (Exception ex)
{
- Cache.log.error("Problems whilst trying to save to "+choice.getName(),ex);
- JOptionPane.showMessageDialog(this, "Error whilst saving current state to "+choice.getName(), "Couldn't save project", JOptionPane.WARNING_MESSAGE);
+ Cache.log
+ .error("Problems whilst trying to save to "
+ + choice.getName(), ex);
+ JOptionPane.showMessageDialog(this,
+ "Error whilst saving current state to " + choice.getName(),
+ "Couldn't save project", JOptionPane.WARNING_MESSAGE);
}
setProgressBar(null, choice.hashCode());
-
+
}
}
*/
public void loadState_actionPerformed(ActionEvent e)
{
- JalviewFileChooser chooser = new JalviewFileChooser(jalview.bin.Cache
- .getProperty("LAST_DIRECTORY"), new String[]
- { "jar" }, new String[]
- { "Jalview Project" }, "Jalview Project");
+ JalviewFileChooser chooser = new JalviewFileChooser(
+ jalview.bin.Cache.getProperty("LAST_DIRECTORY"), new String[]
+ { "jar" }, new String[]
+ { "Jalview Project" }, "Jalview Project");
chooser.setFileView(new JalviewFileView());
chooser.setDialogTitle("Restore state");
final String choice = chooser.getSelectedFile().getAbsolutePath();
jalview.bin.Cache.setProperty("LAST_DIRECTORY", chooser
.getSelectedFile().getParent());
- new Thread(new Runnable() {
- public void run() {
- setProgressBar("loading jalview project "
- + choice, choice.hashCode());
- try {
- new Jalview2XML().LoadJalviewAlign(choice); }
- catch (OutOfMemoryError oom)
+ new Thread(new Runnable()
{
- new OOMWarning("Whilst loading project from "+choice, oom);
- }
- catch (Exception ex)
- {
- Cache.log.error("Problems whilst loading project from "+choice,ex);
- JOptionPane.showMessageDialog(Desktop.desktop, "Error whilst loading project from "+choice, "Couldn't load project", JOptionPane.WARNING_MESSAGE);
- }
- setProgressBar(null, choice.hashCode());
+ public void run()
+ {
+ setProgressBar("loading jalview project " + choice,
+ choice.hashCode());
+ try
+ {
+ new Jalview2XML().LoadJalviewAlign(choice);
+ } catch (OutOfMemoryError oom)
+ {
+ new OOMWarning("Whilst loading project from " + choice, oom);
+ } catch (Exception ex)
+ {
+ Cache.log.error("Problems whilst loading project from "
+ + choice, ex);
+ JOptionPane.showMessageDialog(Desktop.desktop,
+ "Error whilst loading project from " + choice,
+ "Couldn't load project", JOptionPane.WARNING_MESSAGE);
+ }
+ setProgressBar(null, choice.hashCode());
}
}).start();
}
if (v_client == null)
{
// Load and try to start a session.
- JalviewFileChooser chooser = new JalviewFileChooser(jalview.bin.Cache
- .getProperty("LAST_DIRECTORY"));
+ JalviewFileChooser chooser = new JalviewFileChooser(
+ jalview.bin.Cache.getProperty("LAST_DIRECTORY"));
chooser.setFileView(new JalviewFileView());
chooser.setDialogTitle("Open a saved VAMSAS session");
- chooser
- .setToolTipText("select a vamsas session to be opened as a new vamsas session.");
+ chooser.setToolTipText("select a vamsas session to be opened as a new vamsas session.");
int value = chooser.showOpenDialog(this);
}
bis.close();
fos.close();
- v_client = new jalview.gui.VamsasApplication(this, file, url
- .toExternalForm());
+ v_client = new jalview.gui.VamsasApplication(this, file,
+ url.toExternalForm());
} catch (Exception ex)
{
jalview.bin.Cache.log.error(
return false;
}
- setProgressBar("Importing VAMSAS session from " + file.getName(), file
- .hashCode());
+ setProgressBar("Importing VAMSAS session from " + file.getName(),
+ file.hashCode());
try
{
v_client = new jalview.gui.VamsasApplication(this, file, null);
}
setupVamsasConnectedGui();
v_client.initial_update(); // TODO: thread ?
- setProgressBar("Importing VAMSAS session from " + file.getName(), file
- .hashCode());
+ setProgressBar("Importing VAMSAS session from " + file.getName(),
+ file.hashCode());
return v_client.inSession();
}
{
if (v_client != null)
{
- JalviewFileChooser chooser = new JalviewFileChooser(jalview.bin.Cache
- .getProperty("LAST_DIRECTORY"), new String[]
- { "vdj" }, // TODO: VAMSAS DOCUMENT EXTENSION is VDJ
+ JalviewFileChooser chooser = new JalviewFileChooser(
+ jalview.bin.Cache.getProperty("LAST_DIRECTORY"), new String[]
+ { "vdj" }, // TODO: VAMSAS DOCUMENT EXTENSION is VDJ
new String[]
{ "Vamsas Document" }, "Vamsas Document");
FontMetrics fm = g.getFontMetrics();
if (fm != null)
{
- g.drawString("Total Free Memory: " + df.format(totalFreeMemory)
- + "MB; Max Memory: " + df.format(maxMemory) + "MB; "
- + df.format(percentUsage) + "%", 10, getHeight()
- - fm.getHeight());
+ g.drawString(
+ "Total Free Memory: " + df.format(totalFreeMemory)
+ + "MB; Max Memory: " + df.format(maxMemory)
+ + "MB; " + df.format(percentUsage) + "%", 10,
+ getHeight() - fm.getHeight());
}
}
}
public void actionPerformed(ActionEvent e)
{
handler.cancelActivity(id);
- us.setProgressBar("Cancelled "
- + ((JLabel) progressPanel.getComponent(0)).getText(), id);
+ us.setProgressBar(
+ "Cancelled "
+ + ((JLabel) progressPanel.getComponent(0))
+ .getText(), id);
}
});
progressPanel.add(cancel, BorderLayout.EAST);
return v_client;
}
+
/**
* flag set if jalview GUI is being operated programmatically
*/
- private boolean inBatchMode=false;
+ private boolean inBatchMode = false;
/**
* check if jalview GUI is being operated programmatically
+ *
* @return inBatchMode
*/
public boolean isInBatchMode()
/**
* set flag if jalview GUI is being operated programmatically
- * @param inBatchMode
+ *
+ * @param inBatchMode
*/
public void setInBatchMode(boolean inBatchMode)
{
this.inBatchMode = inBatchMode;
}
-
public void startServiceDiscovery()
{
startServiceDiscovery(false);
} catch (Exception e)
{
Cache.log
- .info(
- "Exception when trying to launch Envision2 workflow discovery.",
+ .info("Exception when trying to launch Envision2 workflow discovery.",
e);
Cache.log.info(e.getStackTrace());
}
}
/**
- * start a thread to open a URL in the configured browser. Pops up a warning dialog to the user if there is an exception when calling out to the browser to open the URL.
+ * start a thread to open a URL in the configured browser. Pops up a warning
+ * dialog to the user if there is an exception when calling out to the browser
+ * to open the URL.
+ *
* @param url
*/
public static void showUrl(final String url)
{
- new Thread(new Runnable() {
- public void run() {
- try {
+ new Thread(new Runnable()
+ {
+ public void run()
+ {
+ try
+ {
jalview.util.BrowserLauncher.openURL(url);
} catch (Exception ex)
- {
+ {
JOptionPane
.showInternalMessageDialog(
Desktop.desktop,
"Unixers: Couldn't find default web browser."
+ "\nAdd the full path to your browser in Preferences.",
- "Web browser not found", JOptionPane.WARNING_MESSAGE);
+ "Web browser not found",
+ JOptionPane.WARNING_MESSAGE);
ex.printStackTrace();
}
}
- }).start();
+ }).start();
}
public static WsParamSetManager wsparamManager = null;
+
public static ParamManager getUserParameterStore()
{
- if (wsparamManager==null)
+ if (wsparamManager == null)
{
wsparamManager = new WsParamSetManager();
}
panel2.add(description, BorderLayout.CENTER);
panel.add(panel2, BorderLayout.SOUTH);
}
- int reply = JOptionPane.showInternalConfirmDialog(parent,
- panel, title, JOptionPane.OK_CANCEL_OPTION);
+ int reply = JOptionPane.showInternalConfirmDialog(parent, panel, title,
+ JOptionPane.OK_CANCEL_OPTION);
if (!parent.requestFocusInWindow())
{
System.err.println("Bad focus for dialog!");
else if (sequenceFeatures[sfindex].type.equals("disulfide bond"))
{
- renderFeature(g, seq, seq
- .findIndex(sequenceFeatures[sfindex].begin) - 1, seq
- .findIndex(sequenceFeatures[sfindex].begin) - 1,
+ renderFeature(g, seq,
+ seq.findIndex(sequenceFeatures[sfindex].begin) - 1,
+ seq.findIndex(sequenceFeatures[sfindex].begin) - 1,
getColour(sequenceFeatures[sfindex])
// new Color(((Integer) av.featuresDisplayed
// .get(sequenceFeatures[sfindex].type)).intValue())
, start, end, y1);
- renderFeature(g, seq, seq
- .findIndex(sequenceFeatures[sfindex].end) - 1, seq
- .findIndex(sequenceFeatures[sfindex].end) - 1,
+ renderFeature(g, seq,
+ seq.findIndex(sequenceFeatures[sfindex].end) - 1,
+ seq.findIndex(sequenceFeatures[sfindex].end) - 1,
getColour(sequenceFeatures[sfindex])
// new Color(((Integer) av.featuresDisplayed
// .get(sequenceFeatures[sfindex].type)).intValue())
if (av.showSeqFeaturesHeight
&& sequenceFeatures[sfindex].score != Float.NaN)
{
- renderScoreFeature(g, seq, seq
- .findIndex(sequenceFeatures[sfindex].begin) - 1, seq
- .findIndex(sequenceFeatures[sfindex].end) - 1,
+ renderScoreFeature(g, seq,
+ seq.findIndex(sequenceFeatures[sfindex].begin) - 1,
+ seq.findIndex(sequenceFeatures[sfindex].end) - 1,
getColour(sequenceFeatures[sfindex]), start, end, y1,
normaliseScore(sequenceFeatures[sfindex]));
}
else
{
- renderFeature(g, seq, seq
- .findIndex(sequenceFeatures[sfindex].begin) - 1, seq
- .findIndex(sequenceFeatures[sfindex].end) - 1,
+ renderFeature(g, seq,
+ seq.findIndex(sequenceFeatures[sfindex].begin) - 1,
+ seq.findIndex(sequenceFeatures[sfindex].end) - 1,
getColour(sequenceFeatures[sfindex]), start, end, y1);
}
}
frame.setContentPane(this);
if (new jalview.util.Platform().isAMac())
{
- Desktop.addInternalFrame(frame, "Sequence Feature Settings", 475, 480);
- } else {
- Desktop.addInternalFrame(frame, "Sequence Feature Settings", 400, 450);
+ Desktop.addInternalFrame(frame, "Sequence Feature Settings", 475, 480);
}
-
- frame
- .addInternalFrameListener(new javax.swing.event.InternalFrameAdapter()
- {
- public void internalFrameClosed(
- javax.swing.event.InternalFrameEvent evt)
- {
- fr.removePropertyChangeListener(change);
- dassourceBrowser.fs = null;
- };
- });
+ else
+ {
+ Desktop.addInternalFrame(frame, "Sequence Feature Settings", 400, 450);
+ }
+
+ frame.addInternalFrameListener(new javax.swing.event.InternalFrameAdapter()
+ {
+ public void internalFrameClosed(
+ javax.swing.event.InternalFrameEvent evt)
+ {
+ fr.removePropertyChangeListener(change);
+ dassourceBrowser.fs = null;
+ };
+ });
frame.setLayer(JLayeredPane.PALETTE_LAYER);
}
// probably the color chooser!
table.setValueAt(colorChooser.getColor(), selectedRow, 1);
table.validate();
- me.updateFeatureRenderer(((FeatureTableModel) table
- .getModel()).getData(), false);
+ me.updateFeatureRenderer(
+ ((FeatureTableModel) table.getModel()).getData(),
+ false);
}
}
}
{
public void itemStateChanged(ItemEvent evt)
{
- fr.featureGroups.put(check.getText(), new Boolean(check
- .isSelected()));
+ fr.featureGroups.put(check.getText(),
+ new Boolean(check.isSelected()));
af.alignPanel.seqPanel.seqCanvas.repaint();
if (af.alignPanel.overviewPanel != null)
{
data[dataIndex][0] = type;
data[dataIndex][1] = fr.getFeatureStyle(type);
- data[dataIndex][2] = new Boolean(af.getViewport().featuresDisplayed
- .containsKey(type));
+ data[dataIndex][2] = new Boolean(
+ af.getViewport().featuresDisplayed.containsKey(type));
dataIndex++;
visibleChecks.removeElement(type);
}
void load()
{
- JalviewFileChooser chooser = new JalviewFileChooser(jalview.bin.Cache
- .getProperty("LAST_DIRECTORY"), new String[]
- { "fc" }, new String[]
- { "Sequence Feature Colours" }, "Sequence Feature Colours");
+ JalviewFileChooser chooser = new JalviewFileChooser(
+ jalview.bin.Cache.getProperty("LAST_DIRECTORY"), new String[]
+ { "fc" }, new String[]
+ { "Sequence Feature Colours" }, "Sequence Feature Colours");
chooser.setFileView(new jalview.io.JalviewFileView());
chooser.setDialogTitle("Load Feature Colours");
chooser.setToolTipText("Load");
Cache.log.warn("Couldn't parse out graduated feature color.",
e);
}
- GraduatedColor gcol = new GraduatedColor(mincol, maxcol, newcol
- .getMin(), newcol.getMax());
+ GraduatedColor gcol = new GraduatedColor(mincol, maxcol,
+ newcol.getMin(), newcol.getMax());
if (newcol.hasAutoScale())
{
gcol.setAutoScaled(newcol.getAutoScale());
}
if (ttyp.equalsIgnoreCase("ABOVE"))
{
- gcol
- .setThreshType(AnnotationColourGradient.ABOVE_THRESHOLD);
+ gcol.setThreshType(AnnotationColourGradient.ABOVE_THRESHOLD);
}
if (ttyp.equalsIgnoreCase("BELOW"))
{
- gcol
- .setThreshType(AnnotationColourGradient.BELOW_THRESHOLD);
+ gcol.setThreshType(AnnotationColourGradient.BELOW_THRESHOLD);
}
}
fr.setColour(name = newcol.getName(), gcol);
void save()
{
- JalviewFileChooser chooser = new JalviewFileChooser(jalview.bin.Cache
- .getProperty("LAST_DIRECTORY"), new String[]
- { "fc" }, new String[]
- { "Sequence Feature Colours" }, "Sequence Feature Colours");
+ JalviewFileChooser chooser = new JalviewFileChooser(
+ jalview.bin.Cache.getProperty("LAST_DIRECTORY"), new String[]
+ { "fc" }, new String[]
+ { "Sequence Feature Colours" }, "Sequence Feature Colours");
chooser.setFileView(new jalview.io.JalviewFileView());
chooser.setDialogTitle("Save Feature Colour Scheme");
chooser.setToolTipText("Save");
fetchDAS.setEnabled(true);
cancelDAS.setEnabled(false);
dassourceBrowser.setGuiEnabled(true);
-
+
}
public void cancelDAS_actionPerformed(ActionEvent e)
Cache.setProperty("FONT_NAME", fontName.getSelectedItem().toString());
Cache.setProperty("FONT_STYLE", fontStyle.getSelectedIndex() + "");
Cache.setProperty("FONT_SIZE", fontSize.getSelectedItem().toString());
- Cache.setProperty("ANTI_ALIAS", Boolean.toString(smoothFont
- .isSelected()));
+ Cache.setProperty("ANTI_ALIAS",
+ Boolean.toString(smoothFont.isSelected()));
}
}
currentTextColor = Color.white;
}
else if ((av.getSelectionGroup() != null)
- && av.getSelectionGroup().getSequences(null).contains(
- sequence))
+ && av.getSelectionGroup().getSequences(null)
+ .contains(sequence))
{
currentColor = Color.lightGray;
currentTextColor = Color.black;
{
public void run()
{
- AppJmol sview=null;
- try {
- sview=new AppJmol(pdbf, id, sq, alf.alignPanel, fileloc,
-
- rect, vid);
- }
- catch (OutOfMemoryError ex)
+ AppJmol sview = null;
+ try
+ {
+ sview = new AppJmol(pdbf, id, sq, alf.alignPanel,
+ fileloc,
+
+ rect, vid);
+ } catch (OutOfMemoryError ex)
{
- new OOMWarning("restoring structure view for PDB id "+id,(OutOfMemoryError) ex.getCause());
- if (sview!=null && sview.isVisible())
+ new OOMWarning("restoring structure view for PDB id "
+ + id, (OutOfMemoryError) ex.getCause());
+ if (sview != null && sview.isVisible())
{
sview.closeViewer();
sview.setVisible(false);
});
} catch (InvocationTargetException ex)
{
- warn("Unexpected error when opening Jmol view.",ex);
-
+ warn("Unexpected error when opening Jmol view.", ex);
+
} catch (InterruptedException e)
{
// e.printStackTrace();
{\r
anot[ae[aa].getPosition()] = new jalview.datamodel.Annotation(\r
ae[aa].getDisplayCharacter(), ae[aa].getDescription(),\r
- ae[aa].getSecondaryStructure().charAt(0), ae[aa]\r
- .getValue());\r
+ ae[aa].getSecondaryStructure().charAt(0),\r
+ ae[aa].getValue());\r
}\r
\r
jalview.datamodel.AlignmentAnnotation jaa = null;\r
groups[i].getDisplayText(), groups[i].getColourText(),\r
groups[i].getStart(), groups[i].getEnd());\r
\r
- sg\r
- .setOutlineColour(new java.awt.Color(groups[i]\r
- .getOutlineColour()));\r
+ sg.setOutlineColour(new java.awt.Color(groups[i].getOutlineColour()));\r
\r
if (groups[i].getConsThreshold() != 0)\r
{\r
jalview.analysis.Conservation c = new jalview.analysis.Conservation(\r
- "All", ResidueProperties.propHash, 3, sg\r
- .getSequences(null), 0, sg.getWidth() - 1);\r
+ "All", ResidueProperties.propHash, 3,\r
+ sg.getSequences(null), 0, sg.getWidth() - 1);\r
c.calculate();\r
c.verdict(false, 25);\r
sg.cs.setConservation(c);\r
}\r
}\r
\r
- af.setBounds(view.getXpos(), view.getYpos(), view.getWidth(), view\r
- .getHeight());\r
+ af.setBounds(view.getXpos(), view.getYpos(), view.getWidth(),\r
+ view.getHeight());\r
af.viewport.setStartRes(view.getStartRes());\r
af.viewport.setStartSeq(view.getStartSeq());\r
af.viewport.setShowAnnotation(view.getShowAnnotation());\r
\r
af.setMenusFromViewport(af.viewport);\r
\r
- Desktop.addInternalFrame(af, view.getTitle(), view.getWidth(), view\r
- .getHeight());\r
+ Desktop.addInternalFrame(af, view.getTitle(), view.getWidth(),\r
+ view.getHeight());\r
\r
// LOAD TREES\r
// /////////////////////////////////////\r
\r
Tree tree = jms.getTree(t);\r
\r
- TreePanel tp = af.ShowNewickTree(new jalview.io.NewickFile(tree\r
- .getNewick()), tree.getTitle(), tree.getWidth(), tree\r
- .getHeight(), tree.getXpos(), tree.getYpos());\r
+ TreePanel tp = af.ShowNewickTree(\r
+ new jalview.io.NewickFile(tree.getNewick()),\r
+ tree.getTitle(), tree.getWidth(), tree.getHeight(),\r
+ tree.getXpos(), tree.getYpos());\r
\r
tp.fitToWindow.setState(tree.getFitToWindow());\r
tp.fitToWindow_actionPerformed(null);\r
/**
* useful functions for building Swing GUIs
+ *
* @author JimP
- *
+ *
*/
public final class JvSwingUtils
{
/**
- * wrap a bare html safe string to around 60 characters per line using a <table width=350><tr><td></td> field
+ * wrap a bare html safe string to around 60 characters per line using a
+ * <table width=350>
+ * <tr>
+ * <td></td> field
+ *
* @param ttext
* @return
*/
public static String wrapTooltip(String ttext)
{
- if (ttext.length()<60)
+ if (ttext.length() < 60)
{
return ttext;
- } else {
- return "<table width=350 border=0><tr><td>"+ttext+"</td></tr></table>";
+ }
+ else
+ {
+ return "<table width=350 border=0><tr><td>" + ttext
+ + "</td></tr></table>";
}
}
+
public static JButton makeButton(String label, String tooltip,
ActionListener action)
{
"Out of memory",\r
javax.swing.JOptionPane.WARNING_MESSAGE);\r
// hope that there's enough memory left that no more appear.\r
- oomInprogress=false;\r
+ oomInprogress = false;\r
}\r
\r
}\r
{
int fullsizeWidth = av.alignment.getWidth() * av.getCharWidth();
int fullsizeHeight = (av.alignment.getHeight() + av.alignment
- .getHiddenSequences().getSize())
- * av.getCharHeight();
+ .getHiddenSequences().getSize()) * av.getCharHeight();
int startRes = av.getStartRes();
int endRes = av.getEndRes();
return;
}
- Desktop
- .addInternalFrame(this, "Principal component analysis", 400,
- 400);
+ Desktop.addInternalFrame(this, "Principal component analysis", 400, 400);
PaintRefresher.Register(this, av.getSequenceSetId());
public void outputValues_actionPerformed(ActionEvent e)
{
CutAndPasteTransfer cap = new CutAndPasteTransfer();
- try {
+ try
+ {
cap.setText(pca.getDetails());
Desktop.addInternalFrame(cap, "PCA details", 500, 500);
} catch (OutOfMemoryError oom)
{
- new OOMWarning("opening PCA details",oom);
+ new OOMWarning("opening PCA details", oom);
cap.dispose();
}
}
else
{
im = new jalview.util.ImageMaker(this, jalview.util.ImageMaker.EPS,
- "Make EPS file from PCA", width, height, null, this
- .getTitle());
+ "Make EPS file from PCA", width, height, null,
+ this.getTitle());
}
if (im.getGraphics() != null)
associateViewsMenu.add(itemf);
}
- /* (non-Javadoc)
- * @see jalview.jbgui.GPCAPanel#outputPoints_actionPerformed(java.awt.event.ActionEvent)
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * jalview.jbgui.GPCAPanel#outputPoints_actionPerformed(java.awt.event.ActionEvent
+ * )
*/
protected void outputPoints_actionPerformed(ActionEvent e)
{
CutAndPasteTransfer cap = new CutAndPasteTransfer();
- try {
+ try
+ {
cap.setText(getPointsasCsv(false));
- Desktop.addInternalFrame(cap, "Points for "+getTitle(), 500, 500);
+ Desktop.addInternalFrame(cap, "Points for " + getTitle(), 500, 500);
} catch (OutOfMemoryError oom)
{
- new OOMWarning("exporting PCA points",oom);
+ new OOMWarning("exporting PCA points", oom);
cap.dispose();
}
}
{
StringBuffer csv = new StringBuffer();
csv.append("\"Sequence\"");
- if (transformed) {
+ if (transformed)
+ {
csv.append(",");
csv.append(xCombobox.getSelectedIndex());
csv.append(",");
csv.append(yCombobox.getSelectedIndex());
csv.append(",");
csv.append(zCombobox.getSelectedIndex());
- } else {
- for (int d=1,dmax=pca.component(1).length;d<=dmax;d++)
+ }
+ else
+ {
+ for (int d = 1, dmax = pca.component(1).length; d <= dmax; d++)
{
- csv.append(","+d);
+ csv.append("," + d);
}
}
csv.append("\n");
- for (int s=0;s<seqs.length;s++)
+ for (int s = 0; s < seqs.length; s++)
{
- csv.append("\""+seqs[s].getName()+"\"");
+ csv.append("\"" + seqs[s].getName() + "\"");
double fl[];
- if (!transformed) {
+ if (!transformed)
+ {
// output pca in correct order
fl = pca.component(s);
- for (int d=fl.length-1; d>=0;d--)
+ for (int d = fl.length - 1; d >= 0; d--)
{
csv.append(",");
csv.append(fl[d]);
}
- } else {
- // output current x,y,z coords for points
+ }
+ else
+ {
+ // output current x,y,z coords for points
fl = rc.getPointPosition(s);
- for (int d=0; d<fl.length;d++)
+ for (int d = 0; d < fl.length; d++)
{
csv.append(",");
csv.append(fl[d]);
return csv.toString();
}
- /* (non-Javadoc)
- * @see jalview.jbgui.GPCAPanel#outputProjPoints_actionPerformed(java.awt.event.ActionEvent)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * jalview.jbgui.GPCAPanel#outputProjPoints_actionPerformed(java.awt.event
+ * .ActionEvent)
*/
protected void outputProjPoints_actionPerformed(ActionEvent e)
{
CutAndPasteTransfer cap = new CutAndPasteTransfer();
- try {
+ try
+ {
cap.setText(getPointsasCsv(true));
- Desktop.addInternalFrame(cap, "Transformed points for "+getTitle(), 500, 500);
+ Desktop.addInternalFrame(cap, "Transformed points for " + getTitle(),
+ 500, 500);
} catch (OutOfMemoryError oom)
{
- new OOMWarning("exporting transformed PCA points",oom);
+ new OOMWarning("exporting transformed PCA points", oom);
cap.dispose();
}
}
{
// 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();
Object[] urlset = null;
try
{
- urlset = urlLink.makeUrlStubs(ids, seqstr, "FromJalview"
- + System.currentTimeMillis(), false);
+ urlset = urlLink.makeUrlStubs(ids, seqstr,
+ "FromJalview" + System.currentTimeMillis(), false);
} catch (UrlStringTooLongException e)
{
}
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", ap.alignFrame);
+ 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", ap.alignFrame);
+ 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();
- if (nala!=null) {
+ if (nala != null)
+ {
for (int i = 0; i < nala.length; i++)
{
AlignmentAnnotation na = nala[i];
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", ap.alignFrame);
+ 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);
public void ok_actionPerformed(ActionEvent e)
{
- Cache.applicationProperties.setProperty("SHOW_JVSUFFIX", Boolean
- .toString(seqLimit.isSelected()));
- Cache.applicationProperties.setProperty("RIGHT_ALIGN_IDS", Boolean
- .toString(rightAlign.isSelected()));
- Cache.applicationProperties.setProperty("SHOW_FULLSCREEN", Boolean
- .toString(fullScreen.isSelected()));
- Cache.applicationProperties.setProperty("SHOW_OVERVIEW", Boolean
- .toString(openoverv.isSelected()));
- Cache.applicationProperties.setProperty("SHOW_ANNOTATIONS", Boolean
- .toString(annotations.isSelected()));
- Cache.applicationProperties.setProperty("SHOW_CONSERVATION", Boolean
- .toString(conservation.isSelected()));
- Cache.applicationProperties.setProperty("SHOW_QUALITY", Boolean
- .toString(quality.isSelected()));
- Cache.applicationProperties.setProperty("SHOW_IDENTITY", Boolean
- .toString(identity.isSelected()));
+ Cache.applicationProperties.setProperty("SHOW_JVSUFFIX",
+ Boolean.toString(seqLimit.isSelected()));
+ Cache.applicationProperties.setProperty("RIGHT_ALIGN_IDS",
+ Boolean.toString(rightAlign.isSelected()));
+ Cache.applicationProperties.setProperty("SHOW_FULLSCREEN",
+ Boolean.toString(fullScreen.isSelected()));
+ Cache.applicationProperties.setProperty("SHOW_OVERVIEW",
+ Boolean.toString(openoverv.isSelected()));
+ Cache.applicationProperties.setProperty("SHOW_ANNOTATIONS",
+ Boolean.toString(annotations.isSelected()));
+ Cache.applicationProperties.setProperty("SHOW_CONSERVATION",
+ Boolean.toString(conservation.isSelected()));
+ Cache.applicationProperties.setProperty("SHOW_QUALITY",
+ Boolean.toString(quality.isSelected()));
+ Cache.applicationProperties.setProperty("SHOW_IDENTITY",
+ Boolean.toString(identity.isSelected()));
Cache.applicationProperties.setProperty("DEFAULT_COLOUR", colour
.getSelectedItem().toString());
Cache.applicationProperties.setProperty("FONT_SIZE", fontSizeCB
.getSelectedItem().toString());
- Cache.applicationProperties.setProperty("ID_ITALICS", Boolean
- .toString(idItalics.isSelected()));
- Cache.applicationProperties.setProperty("SHOW_UNCONSERVED", Boolean
- .toString(showUnconserved.isSelected()));
- Cache.applicationProperties.setProperty("SHOW_GROUP_CONSENSUS", Boolean
- .toString(showGroupConsensus.isSelected()));
+ Cache.applicationProperties.setProperty("ID_ITALICS",
+ Boolean.toString(idItalics.isSelected()));
+ Cache.applicationProperties.setProperty("SHOW_UNCONSERVED",
+ Boolean.toString(showUnconserved.isSelected()));
+ Cache.applicationProperties.setProperty("SHOW_GROUP_CONSENSUS",
+ Boolean.toString(showGroupConsensus.isSelected()));
Cache.applicationProperties.setProperty("SHOW_GROUP_CONSERVATION",
Boolean.toString(showGroupConservation.isSelected()));
Cache.applicationProperties.setProperty("SHOW_CONSENSUS_HISTOGRAM",
Boolean.toString(showConsensHistogram.isSelected()));
- Cache.applicationProperties.setProperty("SHOW_CONSENSUS_LOGO", Boolean
- .toString(showConsensLogo.isSelected()));
- Cache.applicationProperties.setProperty("ANTI_ALIAS", Boolean
- .toString(smoothFont.isSelected()));
- Cache.applicationProperties.setProperty("SHOW_NPFEATS_TOOLTIP", Boolean
- .toString(showNpTooltip.isSelected()));
- Cache.applicationProperties.setProperty("SHOW_DBREFS_TOOLTIP", Boolean
- .toString(showDbRefTooltip.isSelected()));
-
- Cache.applicationProperties.setProperty("WRAP_ALIGNMENT", Boolean
- .toString(wrap.isSelected()));
+ Cache.applicationProperties.setProperty("SHOW_CONSENSUS_LOGO",
+ Boolean.toString(showConsensLogo.isSelected()));
+ Cache.applicationProperties.setProperty("ANTI_ALIAS",
+ Boolean.toString(smoothFont.isSelected()));
+ Cache.applicationProperties.setProperty("SHOW_NPFEATS_TOOLTIP",
+ Boolean.toString(showNpTooltip.isSelected()));
+ Cache.applicationProperties.setProperty("SHOW_DBREFS_TOOLTIP",
+ Boolean.toString(showDbRefTooltip.isSelected()));
+
+ Cache.applicationProperties.setProperty("WRAP_ALIGNMENT",
+ Boolean.toString(wrap.isSelected()));
Cache.applicationProperties.setProperty("STARTUP_FILE",
startupFileTextfield.getText());
- Cache.applicationProperties.setProperty("SHOW_STARTUP_FILE", Boolean
- .toString(startupCheckbox.isSelected()));
+ Cache.applicationProperties.setProperty("SHOW_STARTUP_FILE",
+ Boolean.toString(startupCheckbox.isSelected()));
Cache.applicationProperties.setProperty("SORT_ALIGNMENT", sortby
.getSelectedItem().toString());
}
// remove last "|"
links.setLength(links.length() - 1);
- Cache.applicationProperties.setProperty("SEQUENCE_LINKS", links
- .toString());
+ Cache.applicationProperties.setProperty("SEQUENCE_LINKS",
+ links.toString());
}
else
{
Cache.applicationProperties.remove("SEQUENCE_LINKS");
}
- Cache.applicationProperties.setProperty("USE_PROXY", Boolean
- .toString(useProxy.isSelected()));
+ Cache.applicationProperties.setProperty("USE_PROXY",
+ Boolean.toString(useProxy.isSelected()));
if (proxyServerTB.getText().trim().length() < 1)
{
}
else
{
- Cache.applicationProperties.setProperty("PROXY_SERVER", proxyServerTB
- .getText());
+ Cache.applicationProperties.setProperty("PROXY_SERVER",
+ proxyServerTB.getText());
}
if (proxyPortTB.getText().trim().length() < 1)
}
else
{
- Cache.applicationProperties.setProperty("PROXY_PORT", proxyPortTB
- .getText());
+ Cache.applicationProperties.setProperty("PROXY_PORT",
+ proxyPortTB.getText());
}
if (useProxy.isSelected())
System.setProperty("http.proxyHost", "");
System.setProperty("http.proxyPort", "");
}
- Cache.setProperty("VERSION_CHECK", Boolean.toString(versioncheck
- .isSelected()));
+ Cache.setProperty("VERSION_CHECK",
+ Boolean.toString(versioncheck.isSelected()));
if (Cache.getProperty("USAGESTATS") != null || usagestats.isSelected())
{
// default is false - we only set this if the user has actively agreed
- Cache.setProperty("USAGESTATS", Boolean.toString(usagestats
- .isSelected()));
+ Cache.setProperty("USAGESTATS",
+ Boolean.toString(usagestats.isSelected()));
}
if (!questionnaire.isSelected())
{
// by just adding the given line
Cache.removeProperty("NOQUESTIONNAIRES");
}
- Cache.applicationProperties.setProperty("BLC_JVSUFFIX", Boolean
- .toString(blcjv.isSelected()));
- Cache.applicationProperties.setProperty("CLUSTAL_JVSUFFIX", Boolean
- .toString(clustaljv.isSelected()));
- Cache.applicationProperties.setProperty("FASTA_JVSUFFIX", Boolean
- .toString(fastajv.isSelected()));
- Cache.applicationProperties.setProperty("MSF_JVSUFFIX", Boolean
- .toString(msfjv.isSelected()));
- Cache.applicationProperties.setProperty("PFAM_JVSUFFIX", Boolean
- .toString(pfamjv.isSelected()));
- Cache.applicationProperties.setProperty("PILEUP_JVSUFFIX", Boolean
- .toString(pileupjv.isSelected()));
- Cache.applicationProperties.setProperty("PIR_JVSUFFIX", Boolean
- .toString(pirjv.isSelected()));
- Cache.applicationProperties.setProperty("PIR_MODELLER", Boolean
- .toString(modellerOutput.isSelected()));
+ Cache.applicationProperties.setProperty("BLC_JVSUFFIX",
+ Boolean.toString(blcjv.isSelected()));
+ Cache.applicationProperties.setProperty("CLUSTAL_JVSUFFIX",
+ Boolean.toString(clustaljv.isSelected()));
+ Cache.applicationProperties.setProperty("FASTA_JVSUFFIX",
+ Boolean.toString(fastajv.isSelected()));
+ Cache.applicationProperties.setProperty("MSF_JVSUFFIX",
+ Boolean.toString(msfjv.isSelected()));
+ Cache.applicationProperties.setProperty("PFAM_JVSUFFIX",
+ Boolean.toString(pfamjv.isSelected()));
+ Cache.applicationProperties.setProperty("PILEUP_JVSUFFIX",
+ Boolean.toString(pileupjv.isSelected()));
+ Cache.applicationProperties.setProperty("PIR_JVSUFFIX",
+ Boolean.toString(pirjv.isSelected()));
+ Cache.applicationProperties.setProperty("PIR_MODELLER",
+ Boolean.toString(modellerOutput.isSelected()));
jalview.io.PIRFile.useModellerOutput = modellerOutput.isSelected();
- Cache.applicationProperties.setProperty("AUTO_CALC_CONSENSUS", Boolean
- .toString(autoCalculateConsCheck.isSelected()));
- Cache.applicationProperties.setProperty("PAD_GAPS", Boolean
- .toString(padGaps.isSelected()));
+ Cache.applicationProperties.setProperty("AUTO_CALC_CONSENSUS",
+ Boolean.toString(autoCalculateConsCheck.isSelected()));
+ Cache.applicationProperties.setProperty("PAD_GAPS",
+ Boolean.toString(padGaps.isSelected()));
dasSource.saveProperties(Cache.applicationProperties);
wsPrefs.updateAndRefreshWsMenuConfig(false);
*/
public void startupFileTextfield_mouseClicked()
{
- JalviewFileChooser chooser = new JalviewFileChooser(jalview.bin.Cache
- .getProperty("LAST_DIRECTORY"), new String[]
- { "fa, fasta, fastq", "aln", "pfam", "msf", "pir", "blc", "jar" },
+ JalviewFileChooser chooser = new JalviewFileChooser(
+ jalview.bin.Cache.getProperty("LAST_DIRECTORY"),
+ new String[]
+ { "fa, fasta, fastq", "aln", "pfam", "msf", "pir", "blc", "jar" },
new String[]
{ "Fasta", "Clustal", "PFAM", "MSF", "PIR", "BLC", "Jalview" },
jalview.bin.Cache.getProperty("DEFAULT_FILE_FORMAT"));
if (av.getSelectionGroup() != null)
{
- if (av.getSelectionGroup().getSequences(null).contains(
- ((SequencePoint) points.elementAt(i)).sequence))
+ if (av.getSelectionGroup().getSequences(null)
+ .contains(((SequencePoint) points.elementAt(i)).sequence))
{
g.setColor(Color.gray);
}
if (showLabels)
{
g.setColor(Color.red);
- g.drawString(((SequencePoint) points.elementAt(i)).sequence
- .getName(), x - 3, y - 4);
+ g.drawString(
+ ((SequencePoint) points.elementAt(i)).sequence.getName(),
+ x - 3, y - 4);
}
}
{
if (av != null)
{
- if (!av.getSelectionGroup().getSequences(null).contains(
- sp.sequence))
+ if (!av.getSelectionGroup().getSequences(null)
+ .contains(sp.sequence))
{
av.getSelectionGroup().addSequence(sp.sequence, true);
}
/**
*
- * @return x,y,z positions of point s (index into points) under current transform.
+ * @return x,y,z positions of point s (index into points) under current
+ * transform.
*/
public double[] getPointPosition(int s)
{
double pts[] = new double[3];
- float[] p = ((SequencePoint)points.elementAt(s)).coord;
+ float[] p = ((SequencePoint) points.elementAt(s)).coord;
pts[0] = p[0];
pts[1] = p[1];
pts[2] = p[2];
if (x >= av.alignment.getWidth())
{
res = av.alignment.getWidth() - 1;
- } else {
+ }
+ else
+ {
res = x;
}
{
reveal = region;
ToolTipManager.sharedInstance().registerComponent(this);
- this
- .setToolTipText("Reveal Hidden Columns with Right Mouse Button");
+ this.setToolTipText("Reveal Hidden Columns with Right Mouse Button");
break;
}
else
maxX = (i - startx + 1) * av.charWidth + fm.stringWidth(string);
}
- gg
- .drawLine(
- (int) (((i - startx - 1) * av.charWidth) + (av.charWidth / 2)),
- y + 2,
- (int) (((i - startx - 1) * av.charWidth) + (av.charWidth / 2)),
- y + (fm.getDescent() * 2));
+ gg.drawLine(
+ (int) (((i - startx - 1) * av.charWidth) + (av.charWidth / 2)),
+ y + 2,
+ (int) (((i - startx - 1) * av.charWidth) + (av.charWidth / 2)),
+ y + (fm.getDescent() * 2));
}
else
{
- gg
- .drawLine(
- (int) (((i - startx - 1) * av.charWidth) + (av.charWidth / 2)),
- y + fm.getDescent(),
- (int) (((i - startx - 1) * av.charWidth) + (av.charWidth / 2)),
- y + (fm.getDescent() * 2));
+ gg.drawLine(
+ (int) (((i - startx - 1) * av.charWidth) + (av.charWidth / 2)),
+ y + fm.getDescent(),
+ (int) (((i - startx - 1) * av.charWidth) + (av.charWidth / 2)),
+ y + (fm.getDescent() * 2));
}
}
{
g1.setColor(Color.blue);
- g1
- .drawLine((blockEnd - blockStart + 1) * av.charWidth - 1,
- 0 + offset, (blockEnd - blockStart + 1)
- * av.charWidth - 1, (endSeq - startSeq)
- * av.charHeight + offset);
+ g1.drawLine((blockEnd - blockStart + 1) * av.charWidth - 1,
+ 0 + offset, (blockEnd - blockStart + 1) * av.charWidth
+ - 1, (endSeq - startSeq) * av.charHeight + offset);
}
g1.translate(-screenY * av.charWidth, 0);
y -= hgap;
- seq = Math.min((y % cHeight) / av.getCharHeight(), av.alignment
- .getHeight() - 1);
+ seq = Math.min((y % cHeight) / av.getCharHeight(),
+ av.alignment.getHeight() - 1);
}
else
{
if (av.showSequenceFeatures)
{
int rpos;
- SequenceFeature[] features = findFeaturesAtRes(sequence
- .getDatasetSequence(), rpos = sequence.findPosition(res));
+ SequenceFeature[] features = findFeaturesAtRes(
+ sequence.getDatasetSequence(),
+ rpos = sequence.findPosition(res));
appendFeatures(tooltipText, linkImageURL.toString(), rpos, features,
this.ap.seqPanel.seqCanvas.fr.minmax);
}
// Which is bigger, left-right or up-down?
if (Math.abs(evt.getY() - lastMousePress.getY()) > Math.abs(evt
- .getX()
- - lastMousePress.getX()))
+ .getX() - lastMousePress.getX()))
{
int fontSize = av.font.getSize();
fontSize = 1;
}
- av
- .setFont(new Font(av.font.getName(), av.font.getStyle(),
- fontSize));
+ av.setFont(new Font(av.font.getName(), av.font.getStyle(), fontSize));
av.charWidth = oldWidth;
ap.fontChanged();
}
av.setSelectionGroup(null);
}
- SequenceFeature[] features = findFeaturesAtRes(sequence
- .getDatasetSequence(), sequence.findPosition(findRes(evt)));
+ SequenceFeature[] features = findFeaturesAtRes(
+ sequence.getDatasetSequence(),
+ sequence.findPosition(findRes(evt)));
if (features != null && features.length > 0)
{
SearchResults highlight = new SearchResults();
- highlight.addResult(sequence, features[0].getBegin(), features[0]
- .getEnd());
+ highlight.addResult(sequence, features[0].getBegin(),
+ features[0].getEnd());
seqCanvas.highlightSearchResults(highlight);
}
if (features != null && features.length > 0)
if (javax.swing.SwingUtilities.isRightMouseButton(evt))
{
- SequenceFeature[] allFeatures = findFeaturesAtRes(sequence
- .getDatasetSequence(), sequence.findPosition(res));
+ SequenceFeature[] allFeatures = findFeaturesAtRes(
+ sequence.getDatasetSequence(), sequence.findPosition(res));
Vector links = new Vector();
for (int i = 0; i < allFeatures.length; i++)
{
{
if (stretchGroup.cs instanceof ClustalxColourScheme)
{
- ((ClustalxColourScheme) stretchGroup.cs).resetClustalX(stretchGroup
- .getSequences(av.hiddenRepSequences), stretchGroup
- .getWidth());
+ ((ClustalxColourScheme) stretchGroup.cs).resetClustalX(
+ stretchGroup.getSequences(av.hiddenRepSequences),
+ stretchGroup.getWidth());
}
if (stretchGroup.cs.conservationApplied())
{
- SliderPanel.setConservationSlider(ap, stretchGroup.cs, stretchGroup
- .getName());
+ SliderPanel.setConservationSlider(ap, stretchGroup.cs,
+ stretchGroup.getName());
}
else
{
- SliderPanel.setPIDSliderSource(ap, stretchGroup.cs, stretchGroup
- .getName());
+ SliderPanel.setPIDSliderSource(ap, stretchGroup.cs,
+ stretchGroup.getName());
}
}
PaintRefresher.Refresh(this, av.getSequenceSetId());
}
// do we want to thread this ? (contention with seqsel and colsel locks, I
// suspect)
- // rules are: colsel is copied if there is a real intersection between sequence selection
- boolean repaint = false,copycolsel=true;
+ // rules are: colsel is copied if there is a real intersection between
+ // sequence selection
+ boolean repaint = false, copycolsel = true;
if (av.selectionGroup == null || !av.isSelectionGroupChanged())
{
SequenceGroup sgroup = null;
}
sgroup = seqsel.intersect(av.alignment,
(av.hasHiddenRows) ? av.hiddenRepSequences : null);
- if ((sgroup==null || sgroup.getSize()==0) && (colsel==null || colsel.size()==0))
+ if ((sgroup == null || sgroup.getSize() == 0)
+ && (colsel == null || colsel.size() == 0))
{
// don't copy columns if the region didn't intersect.
- copycolsel=false;
+ copycolsel = false;
}
}
if (sgroup != null && sgroup.getSize() > 0)
}
charOffset = (av.charWidth - fm.charWidth(s)) / 2;
- graphics
- .drawString(String.valueOf(s), charOffset + x1
- + (av.charWidth * (i - start)),
- (y1 + av.charHeight) - pady);
+ graphics.drawString(String.valueOf(s), charOffset + x1
+ + (av.charWidth * (i - start)), (y1 + av.charHeight) - pady);
}
}
}
if (!conservationSlider.isVisible())
{
- Desktop.addInternalFrame(conservationSlider, conservationSlider
- .getTitle(), 420, 90, false);
+ Desktop.addInternalFrame(conservationSlider,
+ conservationSlider.getTitle(), 420, 90, false);
conservationSlider
.addInternalFrameListener(new javax.swing.event.InternalFrameAdapter()
{
int vwidth = fm.stringWidth("Jalview "
+ jalview.bin.Cache.getProperty("VERSION"));
g.setFont(new Font("Verdana", Font.BOLD, fontSize + 2));
- g.drawString("Last updated: "
- + jalview.bin.Cache.getDefault("BUILD_DATE", "unknown"),
+ g.drawString(
+ "Last updated: "
+ + jalview.bin.Cache.getDefault("BUILD_DATE", "unknown"),
50 + vwidth + 5, y);
if (jalview.bin.Cache.getDefault("LATEST_VERSION", "Checking").equals(
"Checking"))
else if (!jalview.bin.Cache.getDefault("LATEST_VERSION", "Checking")
.equals(jalview.bin.Cache.getProperty("VERSION")))
{
- if (jalview.bin.Cache.getProperty("VERSION").toLowerCase().indexOf(
- "automated build") == -1)
+ if (jalview.bin.Cache.getProperty("VERSION").toLowerCase()
+ .indexOf("automated build") == -1)
{
// Displayed when code version and jnlp version do not match and code
// version is not a development build
g.setColor(Color.red);
}
- g
- .drawString(
- "!! Jalview version "
- + jalview.bin.Cache.getDefault(
- "LATEST_VERSION", "..Checking..")
- + " is available for download from http://www.jalview.org !!",
- 50, y += fontSize + 10);
+ g.drawString(
+ "!! Jalview version "
+ + jalview.bin.Cache.getDefault("LATEST_VERSION",
+ "..Checking..")
+ + " is available for download from http://www.jalview.org !!",
+ 50, y += fontSize + 10);
y += 5;
g.setColor(Color.black);
}
g.setFont(new Font("Verdana", Font.BOLD, fontSize));
- g
- .drawString(
- "Authors: Andrew Waterhouse, Jim Procter, Michele Clamp, James Cuff, Steve Searle,",
- 50, y += fontSize + 4);
+ g.drawString(
+ "Authors: Andrew Waterhouse, Jim Procter, Michele Clamp, James Cuff, Steve Searle,",
+ 50, y += fontSize + 4);
g.drawString("David Martin & Geoff Barton.", 60, y += fontSize + 4);
- g
- .drawString(
- "Development managed by The Barton Group, University of Dundee.",
- 50, y += fontSize + 4);
+ g.drawString(
+ "Development managed by The Barton Group, University of Dundee.",
+ 50, y += fontSize + 4);
g.drawString("If you use Jalview, please cite: ", 50,
y += fontSize + 4);
- g
- .drawString(
- "Waterhouse, A.M., Procter, J.B., Martin, D.M.A, Clamp, M. and Barton, G. J. (2009)",
- 50, y += fontSize + 4);
- g
- .drawString(
- "Jalview Version 2 - a multiple sequence alignment editor and analysis workbench",
- 50, y += fontSize + 4);
+ g.drawString(
+ "Waterhouse, A.M., Procter, J.B., Martin, D.M.A, Clamp, M. and Barton, G. J. (2009)",
+ 50, y += fontSize + 4);
+ g.drawString(
+ "Jalview Version 2 - a multiple sequence alignment editor and analysis workbench",
+ 50, y += fontSize + 4);
g.drawString("Bioinformatics doi: 10.1093/bioinformatics/btp033", 50,
y += fontSize + 4);
}
final JPanel bigpanel = new JPanel(new BorderLayout());
JPanel panel = new JPanel();
bigpanel.add(panel, BorderLayout.CENTER);
- bigpanel
- .add(
- new JLabel(
- "<html><i>Select a dark and light text colour, then set the threshold to"
- + "<br>switch between colours, based on background colour</i></html>"),
- BorderLayout.NORTH);
+ bigpanel.add(
+ new JLabel(
+ "<html><i>Select a dark and light text colour, then set the threshold to"
+ + "<br>switch between colours, based on background colour</i></html>"),
+ BorderLayout.NORTH);
panel.add(col1);
panel.add(slider);
panel.add(col2);
buffer.append("PID");
}
-
- jalview.io.NewickFile fout = new jalview.io.NewickFile(tree
- .getTopNode());
- try {
+ jalview.io.NewickFile fout = new jalview.io.NewickFile(
+ tree.getTopNode());
+ try
+ {
cap.setText(fout.print(tree.isHasBootstrap(), tree.isHasDistances(),
- tree.isHasRootDistance()));
+ tree.isHasRootDistance()));
Desktop.addInternalFrame(cap, buffer.toString(), 500, 100);
} catch (OutOfMemoryError oom)
{
- new OOMWarning("generating newick tree file",oom);
+ new OOMWarning("generating newick tree file", oom);
cap.dispose();
}
*/
public void saveAsNewick_actionPerformed(ActionEvent e)
{
- JalviewFileChooser chooser = new JalviewFileChooser(jalview.bin.Cache
- .getProperty("LAST_DIRECTORY"));
+ JalviewFileChooser chooser = new JalviewFileChooser(
+ jalview.bin.Cache.getProperty("LAST_DIRECTORY"));
chooser.setFileView(new JalviewFileView());
chooser.setDialogTitle("Save tree as newick file");
chooser.setToolTipText("Save");
try
{
- jalview.io.NewickFile fout = new jalview.io.NewickFile(tree
- .getTopNode());
- String output = fout.print(tree.isHasBootstrap(), tree
- .isHasDistances(), tree.isHasRootDistance());
+ jalview.io.NewickFile fout = new jalview.io.NewickFile(
+ tree.getTopNode());
+ String output = fout.print(tree.isHasBootstrap(),
+ tree.isHasDistances(), tree.isHasRootDistance());
java.io.PrintWriter out = new java.io.PrintWriter(
new java.io.FileWriter(choice));
out.println(output);
if (sq != null)
{
// search dbrefs, features and annotation
- DBRefEntry[] refs = jalview.util.DBRefUtils.selectRefs(sq
- .getDBRef(), new String[]
- { labelClass.toUpperCase() });
+ DBRefEntry[] refs = jalview.util.DBRefUtils.selectRefs(
+ sq.getDBRef(), new String[]
+ { labelClass.toUpperCase() });
if (refs != null)
{
for (int i = 0; i < refs.length; i++)
JButton button = (JButton) buttonPanel.getComponent(b);
if (!selectedButtons.contains(button))
{
- button
- .setForeground(button.getBackground().brighter()
- .brighter());
+ button.setForeground(button.getBackground().brighter().brighter());
selectedButtons.add(button);
}
}
}
else
{
- pressed
- .setForeground(pressed.getBackground().brighter()
- .brighter());
+ pressed.setForeground(pressed.getBackground().brighter().brighter());
selectedButtons.addElement(pressed);
}
}
upperCaseButtons = new Vector();
lowerCaseButtons = new Vector();
- JalviewFileChooser chooser = new JalviewFileChooser(jalview.bin.Cache
- .getProperty("LAST_DIRECTORY"), new String[]
- { "jc" }, new String[]
- { "Jalview User Colours" }, "Jalview User Colours");
+ JalviewFileChooser chooser = new JalviewFileChooser(
+ jalview.bin.Cache.getProperty("LAST_DIRECTORY"), new String[]
+ { "jc" }, new String[]
+ { "Jalview User Colours" }, "Jalview User Colours");
chooser.setFileView(new jalview.io.JalviewFileView());
chooser.setDialogTitle("Load colour scheme");
chooser.setToolTipText("Load");
if (userColourSchemes != null
&& userColourSchemes.containsKey(schemeName.getText()))
{
- int reply = JOptionPane.showInternalConfirmDialog(Desktop.desktop,
+ int reply = JOptionPane.showInternalConfirmDialog(
+ Desktop.desktop,
"Colour scheme " + schemeName.getText() + " exists."
+ "\nContinue saving colour scheme as "
+ schemeName.getText() + "?",
userColourSchemes.remove(schemeName.getText());
}
- JalviewFileChooser chooser = new JalviewFileChooser(jalview.bin.Cache
- .getProperty("LAST_DIRECTORY"), new String[]
- { "jc" }, new String[]
- { "Jalview User Colours" }, "Jalview User Colours");
+ JalviewFileChooser chooser = new JalviewFileChooser(
+ jalview.bin.Cache.getProperty("LAST_DIRECTORY"), new String[]
+ { "jc" }, new String[]
+ { "Jalview User Colours" }, "Jalview User Colours");
chooser.setFileView(new jalview.io.JalviewFileView());
chooser.setDialogTitle("Save colour scheme");
{
if (coloursFound.toString().length() > 1)
{
- jalview.bin.Cache.setProperty("USER_DEFINED_COLOURS", coloursFound
- .toString());
+ jalview.bin.Cache.setProperty("USER_DEFINED_COLOURS",
+ coloursFound.toString());
}
else
{
userColourSchemes = new Hashtable();
StringBuffer coloursFound = new StringBuffer();
- StringTokenizer st = new StringTokenizer(jalview.bin.Cache
- .getProperty("USER_DEFINED_COLOURS"), "|");
+ StringTokenizer st = new StringTokenizer(
+ jalview.bin.Cache.getProperty("USER_DEFINED_COLOURS"), "|");
while (st.hasMoreElements())
{
if (coloursFound.toString().length() > 1)
{
- jalview.bin.Cache.setProperty("USER_DEFINED_COLOURS", coloursFound
- .toString());
+ jalview.bin.Cache.setProperty("USER_DEFINED_COLOURS",
+ coloursFound.toString());
}
else
{
boolean prompt = false;
// see if we have already responsed to this questionnaire or get a new
// qid/rid pair
- BufferedReader br = new BufferedReader(new InputStreamReader(qurl
- .openStream()));
+ BufferedReader br = new BufferedReader(new InputStreamReader(
+ qurl.openStream()));
String qresp;
while ((qresp = br.readLine()) != null)
{
String qurl = url + (url.indexOf('?') > -1 ? "&" : "?")
+ "checkresponse=1";
// query the server with the old qid/id pair
- String qqid = lastq.indexOf(':') > -1 ? lastq.substring(0, lastq
- .indexOf(':')) : null;
+ String qqid = lastq.indexOf(':') > -1 ? lastq.substring(0,
+ lastq.indexOf(':')) : null;
if (qqid != null && qqid != "null" && qqid.length() > 0)
{
qurl += "&qid=" + qqid;
} catch (Error e)
{
Cache.log
- .warn(
- "Probable SERIOUS VAMSAS client incompatibility - carrying on regardless",
+ .warn("Probable SERIOUS VAMSAS client incompatibility - carrying on regardless",
e);
} catch (Exception e)
{
Cache.log
- .warn(
- "Probable VAMSAS client incompatibility - carrying on regardless",
+ .warn("Probable VAMSAS client incompatibility - carrying on regardless",
e);
}
}
*/
private ClientHandle getJalviewHandle()
{
- return new ClientHandle("jalview.bin.Jalview", jalview.bin.Cache
- .getProperty("VERSION"));
+ return new ClientHandle("jalview.bin.Jalview",
+ jalview.bin.Cache.getProperty("VERSION"));
}
/**
} catch (Exception e)
{
Cache.log
- .warn(
- "Exception whilst refreshing jalview windows after a vamsas document update.",
+ .warn("Exception whilst refreshing jalview windows after a vamsas document update.",
e);
}
}
// Cache.log.debug("Handling Mouse over "+mm.getVorbaID()+"
// bound to "+jvobj+" at "+mm.getPosition());
// position is character position in aligned sequence
- ssm.mouseOverVamsasSequence((SequenceI) jvobj, mm
- .getPosition());
+ ssm.mouseOverVamsasSequence((SequenceI) jvobj,
+ mm.getPosition());
}
}
if (message instanceof uk.ac.vamsas.client.picking.SelectionMessage)
}
else
{
- int[] intervals = colsel.getVisibleContigs(seqsel
- .getStartRes(), seqsel.getEndRes() + 1);
+ int[] intervals = colsel.getVisibleContigs(
+ seqsel.getStartRes(), seqsel.getEndRes() + 1);
for (int iv = 0; iv < intervals.length; iv += 2)
{
Seg s = new Seg();
ActionListener, DocumentListener
{
URL linkImageURL = getClass().getResource("/images/link.gif");
+
private static final String SVC_DEF = "Defaults"; // this is the null
// parameter set as shown to
// user
JSplitPane settingsPanel = new JSplitPane();
JSplitPane jobPanel = new JSplitPane();
- boolean split=true;
- JTabbedPane tabpanels=new JTabbedPane();
+
+ boolean split = true;
+
+ JTabbedPane tabpanels = new JTabbedPane();
+
JPanel jobOptions = new JPanel();
JScrollPane jobOptionsPane = new JScrollPane();
(int) (deskr.getCenterY() - 250), 480, 500));
frame.setContentPane(this);
// should recover defaults from user prefs.
- //settingsPanel.setDividerLocation(0.4);
- //jobPanel.setDividerLocation(0.5);
+ // settingsPanel.setDividerLocation(0.4);
+ // jobPanel.setDividerLocation(0.5);
frame.validate();
- if (split) {
- javax.swing.SwingUtilities.invokeLater(new Runnable() {
- public void run() {
+ if (split)
+ {
+ javax.swing.SwingUtilities.invokeLater(new Runnable()
+ {
+ public void run()
+ {
settingsPanel.setDividerLocation(0.5);
- jobPanel.setDividerLocation(setDescr.getLineCount()>3 ? 0.35 : 0.16 );
+ jobPanel.setDividerLocation(setDescr.getLineCount() > 3 ? 0.35
+ : 0.16);
}
});
- } else {
+ }
+ else
+ {
tabpanels.setSelectedComponent(jobOptionsPane);
}
frame.setVisible(true);
return false;
}
-
private void jbInit()
{
- updatepref = JvSwingUtils.makeButton("Update", "Update this existing user parameter set.",
+ updatepref = JvSwingUtils.makeButton("Update",
+ "Update this existing user parameter set.",
new ActionListener()
{
update_actionPerformed(e);
}
});
- deletepref = JvSwingUtils.makeButton("Delete", "Delete the currently selected user parameter set.",
+ deletepref = JvSwingUtils.makeButton("Delete",
+ "Delete the currently selected user parameter set.",
new ActionListener()
{
delete_actionPerformed(e);
}
});
- createpref = JvSwingUtils.makeButton("Create", "Create a new parameter set with the current settings.",
+ createpref = JvSwingUtils.makeButton("Create",
+ "Create a new parameter set with the current settings.",
new ActionListener()
{
}
});
revertpref = JvSwingUtils.makeButton("Revert",
- "Undo all changes to the current parameter set", new ActionListener()
+ "Undo all changes to the current parameter set",
+ new ActionListener()
{
public void actionPerformed(ActionEvent e)
revert_actionPerformed(e);
}
});
- startjob = JvSwingUtils.makeButton("Start Job", "Start Job with current settings.",new ActionListener()
- {
- public void actionPerformed(ActionEvent e)
- {
- startjob_actionPerformed(e);
- }
- });
- canceljob = JvSwingUtils.makeButton("Cancel Job", "Close this dialog and cancel job.", new ActionListener()
- {
- public void actionPerformed(ActionEvent e)
- {
- canceljob_actionPerformed(e);
- }
- });
+ startjob = JvSwingUtils.makeButton("Start Job",
+ "Start Job with current settings.", new ActionListener()
+ {
+ public void actionPerformed(ActionEvent e)
+ {
+ startjob_actionPerformed(e);
+ }
+ });
+ canceljob = JvSwingUtils.makeButton("Cancel Job",
+ "Close this dialog and cancel job.", new ActionListener()
+ {
+ public void actionPerformed(ActionEvent e)
+ {
+ canceljob_actionPerformed(e);
+ }
+ });
setDetails.setBorder(new TitledBorder("Details"));
setDetails.setLayout(new BorderLayout());
SetNamePanel.add(setNameInfo);
SetNamePanel.add(buttonArea);
setDetails.add(setDescrView, BorderLayout.CENTER);
- //setDetails.setPreferredSize(new Dimension(360, 100));
+ // setDetails.setPreferredSize(new Dimension(360, 100));
jobParameters.setBorder(new TitledBorder("Parameters"));
jobParameters.setLayout(new BorderLayout());
paramPane.setPreferredSize(new Dimension(360, 300));
jobOptionsPanel.setBorder(new TitledBorder("Options"));
jobOptionsPane.getViewport().setView(jobOptions);
jobOptionsPanel.add(jobOptionsPane, BorderLayout.CENTER);
-
+
setLayout(new BorderLayout());
jobPanel.setLeftComponent(setDetails);
- if (split) {
+ if (split)
+ {
settingsPanel.setLeftComponent(jobOptionsPanel);
settingsPanel.setRightComponent(jobParameters);
settingsPanel.setOrientation(JSplitPane.VERTICAL_SPLIT);
jobPanel.setRightComponent(settingsPanel);
- } else {
- jobPanel.setRightComponent(tabpanels);
- jobOptionsPane.setName("Options");
- tabpanels.add(jobOptionsPane);
- paramPane.setName("Parameters");
- tabpanels.add(paramPane);
+ }
+ else
+ {
+ jobPanel.setRightComponent(tabpanels);
+ jobOptionsPane.setName("Options");
+ tabpanels.add(jobOptionsPane);
+ paramPane.setName("Parameters");
+ tabpanels.add(paramPane);
}
jobPanel.setOrientation(JSplitPane.VERTICAL_SPLIT);
- add(SetNamePanel, BorderLayout.NORTH);
+ add(SetNamePanel, BorderLayout.NORTH);
add(jobPanel, BorderLayout.CENTER);
JPanel dialogpanel = new JPanel();
dialogpanel.add(startjob);
finfo = parm.getFurtherDetails();
if (finfo != null)
{
- showDesc.setToolTipText("<html>"+JvSwingUtils.wrapTooltip("Click to show brief description<br><img src=\"" + linkImageURL + "\"/> Right click for further information.")+"</html>");
+ showDesc.setToolTipText("<html>"
+ + JvSwingUtils
+ .wrapTooltip("Click to show brief description<br><img src=\""
+ + linkImageURL
+ + "\"/> Right click for further information.")
+ + "</html>");
showDesc.addMouseListener(this);
}
else
{
- showDesc.setToolTipText("<html>"+JvSwingUtils.wrapTooltip("Click to show brief description.")+"</html>");
+ showDesc.setToolTipText("<html>"
+ + JvSwingUtils
+ .wrapTooltip("Click to show brief description.")
+ + "</html>");
}
showDesc.addActionListener(new ActionListener()
{
{
hasLink = true;
// optlabel.setToolTipText("<html><p>"+opt.getDescription()+"</p><img src=\""+linkImageURL+"\"/></html>");
- enabled.setToolTipText("<html>" + JvSwingUtils.wrapTooltip(opt.getDescription()+"<br><img src=\"" + linkImageURL + "\"/>")
+ enabled.setToolTipText("<html>"
+ + JvSwingUtils.wrapTooltip(opt.getDescription()
+ + "<br><img src=\"" + linkImageURL + "\"/>")
+ "</html>");
// optlabel.addMouseListener(this);
enabled.addMouseListener(this);
else
{
// optlabel.setToolTipText(opt.getDescription());
- enabled.setToolTipText("<html>"+JvSwingUtils.wrapTooltip(opt.getDescription())+"</html>");
+ enabled.setToolTipText("<html>"
+ + JvSwingUtils.wrapTooltip(opt.getDescription())
+ + "</html>");
}
add(enabled, BorderLayout.NORTH);
if (opt.getPossibleValues().size() > 1)
String msg = null;
if (isServicePreset(newname))
{
- final String oldname = curSetName!=null ? curSetName : lastParmSet;
- final Component ourframe=this;
- settingDialog=true;
+ final String oldname = curSetName != null ? curSetName
+ : lastParmSet;
+ final Component ourframe = this;
+ settingDialog = true;
setName.getEditor().setItem(oldname);
- settingDialog=false;
- javax.swing.SwingUtilities.invokeLater(new Runnable() {public void run() {
- JOptionPane.showMessageDialog(ourframe,
- "Invalid name - preset already exists.", "Invalid name",
- JOptionPane.WARNING_MESSAGE);
- }});
-
+ settingDialog = false;
+ javax.swing.SwingUtilities.invokeLater(new Runnable()
+ {
+ public void run()
+ {
+ JOptionPane.showMessageDialog(ourframe,
+ "Invalid name - preset already exists.",
+ "Invalid name", JOptionPane.WARNING_MESSAGE);
+ }
+ });
+
return;
}
curSetName = newname;
initFromPreferences();
}
- Vector<String> wsUrls,oldUrls;
+ Vector<String> wsUrls, oldUrls;
+
private boolean needWsMenuUpdate;
- private boolean oldJws1,oldJws2,oldIndexByHost,oldIndexByType,oldEnfin;
+
+ private boolean oldJws1, oldJws2, oldIndexByHost, oldIndexByType,
+ oldEnfin;
+
private void initFromPreferences()
{
wsUrls = jalview.ws.jws2.Jws2Discoverer.getServiceUrls();
- if (wsUrls!=null) {
+ if (wsUrls != null)
+ {
oldUrls = new Vector<String>(wsUrls);
- } else {
- oldUrls=null;
- wsUrls=new Vector<String>();
+ }
+ else
+ {
+ oldUrls = null;
+ wsUrls = new Vector<String>();
}
updateList();
- enableEnfinServices.setSelected(oldEnfin=Cache.getDefault(
+ enableEnfinServices.setSelected(oldEnfin = Cache.getDefault(
"SHOW_ENFIN_SERVICES", true));
- enableJws1Services.setSelected(oldJws1=Cache.getDefault("SHOW_JWS1_SERVICES",
- true));
- enableJws2Services.setSelected(oldJws2=Cache.getDefault("SHOW_JWS2_SERVICES",
- true));
- indexByHost.setSelected(oldIndexByHost=Cache.getDefault("WSMENU_BYHOST", true));
- indexByType.setSelected(oldIndexByType=Cache.getDefault("WSMENU_BYTYPE", true));
+ enableJws1Services.setSelected(oldJws1 = Cache.getDefault(
+ "SHOW_JWS1_SERVICES", true));
+ enableJws2Services.setSelected(oldJws2 = Cache.getDefault(
+ "SHOW_JWS2_SERVICES", true));
+ indexByHost.setSelected(oldIndexByHost = Cache.getDefault(
+ "WSMENU_BYHOST", true));
+ indexByType.setSelected(oldIndexByType = Cache.getDefault(
+ "WSMENU_BYTYPE", true));
}
- private void updateList() {
+
+ private void updateList()
+ {
wsList.setListData(wsUrls);
}
- private void updateServiceList() {
+
+ private void updateServiceList()
+ {
jalview.ws.jws2.Jws2Discoverer.setServiceUrls(wsUrls);
}
- /* (non-Javadoc)
- * @see jalview.jbgui.GWsPreferences#deleteWsUrl_actionPerformed(java.awt.event.ActionEvent)
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * jalview.jbgui.GWsPreferences#deleteWsUrl_actionPerformed(java.awt.event
+ * .ActionEvent)
*/
@Override
protected void deleteWsUrl_actionPerformed(ActionEvent e)
{
int sel = wsList.getSelectedIndex();
- if (sel>-1)
+ if (sel > -1)
{
wsUrls.removeElementAt(sel);
updateList();
}
}
- /* (non-Javadoc)
- * @see jalview.jbgui.GWsPreferences#editWsUrl_actionPerformed(java.awt.event.ActionEvent)
+ /*
+ * (non-Javadoc)
+ *
+ * @see jalview.jbgui.GWsPreferences#editWsUrl_actionPerformed(java.awt.event.
+ * ActionEvent)
*/
@Override
protected void editWsUrl_actionPerformed(ActionEvent e)
{
int sel = wsList.getSelectedIndex();
- if (sel>-1)
+ if (sel > -1)
{
- String url=editUrl(wsUrls.elementAt(sel),"Edit JWS2 URL");
- if (url!=null)
+ String url = editUrl(wsUrls.elementAt(sel), "Edit JWS2 URL");
+ if (url != null)
{
int present = wsUrls.indexOf(url);
- if (present==-1)
+ if (present == -1)
{
- wsUrls.setElementAt(url,sel);
+ wsUrls.setElementAt(url, sel);
updateList();
- } else {
- if (present!=sel)
+ }
+ else
+ {
+ if (present != sel)
{
wsUrls.removeElementAt(sel);
updateList();
}
}
}
-
- void updateWsMenuConfig(boolean old) {
- if (old) {
- wsUrls = (oldUrls==null) ? null : new Vector(oldUrls);
- } else {
-
+
+ void updateWsMenuConfig(boolean old)
+ {
+ if (old)
+ {
+ wsUrls = (oldUrls == null) ? null : new Vector(oldUrls);
+ }
+ else
+ {
+
}
- Cache.setProperty("SHOW_ENFIN_SERVICES", Boolean.valueOf(old ? oldEnfin : enableEnfinServices.isSelected()).toString());
- Cache.setProperty("SHOW_JWS1_SERVICES", Boolean.valueOf(old ? oldJws1 : enableJws1Services.isSelected()).toString());
- Cache.setProperty("SHOW_JWS2_SERVICES", Boolean.valueOf(old ? oldJws2 : enableJws2Services.isSelected()).toString());
- Cache.setProperty("WSMENU_BYHOST", Boolean.valueOf(old ? oldIndexByHost : indexByHost.isSelected()).toString());
- Cache.setProperty("WSMENU_BYTYPE", Boolean.valueOf(old ? oldIndexByType : indexByType.isSelected()).toString());
+ Cache.setProperty(
+ "SHOW_ENFIN_SERVICES",
+ Boolean.valueOf(
+ old ? oldEnfin : enableEnfinServices.isSelected())
+ .toString());
+ Cache.setProperty(
+ "SHOW_JWS1_SERVICES",
+ Boolean.valueOf(old ? oldJws1 : enableJws1Services.isSelected())
+ .toString());
+ Cache.setProperty(
+ "SHOW_JWS2_SERVICES",
+ Boolean.valueOf(old ? oldJws2 : enableJws2Services.isSelected())
+ .toString());
+ Cache.setProperty(
+ "WSMENU_BYHOST",
+ Boolean.valueOf(old ? oldIndexByHost : indexByHost.isSelected())
+ .toString());
+ Cache.setProperty(
+ "WSMENU_BYTYPE",
+ Boolean.valueOf(old ? oldIndexByType : indexByType.isSelected())
+ .toString());
updateServiceList();
}
-
- /* (non-Javadoc)
- * @see jalview.jbgui.GWsPreferences#moveWsUrlDown_actionPerformed(java.awt.event.ActionEvent)
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * jalview.jbgui.GWsPreferences#moveWsUrlDown_actionPerformed(java.awt.event
+ * .ActionEvent)
*/
@Override
protected void moveWsUrlDown_actionPerformed(ActionEvent e)
{
- int p=wsList.getSelectedIndex();
- if (p>-1 && p<wsUrls.size()-1)
+ int p = wsList.getSelectedIndex();
+ if (p > -1 && p < wsUrls.size() - 1)
{
- String t = wsUrls.get(p+1);
- wsUrls.setElementAt(wsUrls.elementAt(p), p+1);
+ String t = wsUrls.get(p + 1);
+ wsUrls.setElementAt(wsUrls.elementAt(p), p + 1);
wsUrls.setElementAt(t, p);
updateList();
- wsList.setSelectedIndex(p+1);
+ wsList.setSelectedIndex(p + 1);
}
}
- /* (non-Javadoc)
- * @see jalview.jbgui.GWsPreferences#moveWsUrlUp_actionPerformed(java.awt.event.ActionEvent)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * jalview.jbgui.GWsPreferences#moveWsUrlUp_actionPerformed(java.awt.event
+ * .ActionEvent)
*/
@Override
protected void moveWsUrlUp_actionPerformed(ActionEvent e)
{
- int p=wsList.getSelectedIndex();
- if (p>0)
+ int p = wsList.getSelectedIndex();
+ if (p > 0)
{
- String t = wsUrls.get(p-1);
- wsUrls.setElementAt(wsUrls.elementAt(p), p-1);
+ String t = wsUrls.get(p - 1);
+ wsUrls.setElementAt(wsUrls.elementAt(p), p - 1);
wsUrls.setElementAt(t, p);
updateList();
- wsList.setSelectedIndex(p-1);
+ wsList.setSelectedIndex(p - 1);
}
}
private String editUrl(String initUrl, String title)
{
- String url=initUrl;
- URL foo=null;
- if (url==null)
+ String url = initUrl;
+ URL foo = null;
+ if (url == null)
{
url = "";
}
pane12.add(new JLabel("URL: "), BorderLayout.CENTER);
pane12.add(urltf, BorderLayout.EAST);
panel.add(pane12, BorderLayout.NORTH);
- boolean valid=false;
- int resp=JOptionPane.CANCEL_OPTION;
- while (!valid && (resp=JOptionPane.showInternalConfirmDialog(Desktop.desktop, panel, title, JOptionPane.OK_CANCEL_OPTION))==JOptionPane.OK_OPTION)
+ boolean valid = false;
+ int resp = JOptionPane.CANCEL_OPTION;
+ while (!valid
+ && (resp = JOptionPane.showInternalConfirmDialog(
+ Desktop.desktop, panel, title,
+ JOptionPane.OK_CANCEL_OPTION)) == JOptionPane.OK_OPTION)
{
- try {
- // TODO: do a better job of checking that the url is a valid discovery URL for web services.
+ try
+ {
+ // TODO: do a better job of checking that the url is a valid discovery
+ // URL for web services.
foo = new URL(urltf.getText().trim());
valid = true;
} catch (Exception e)
{
valid = false;
- JOptionPane.showInternalMessageDialog(Desktop.desktop, "Invalid URL !");
+ JOptionPane.showInternalMessageDialog(Desktop.desktop,
+ "Invalid URL !");
}
}
- if (valid && resp==JOptionPane.OK_OPTION)
+ if (valid && resp == JOptionPane.OK_OPTION)
{
- int validate = JOptionPane.showInternalConfirmDialog(Desktop.desktop, "Validate JabaWS Server ?\n(Look in console output for results)", "Test Server?", JOptionPane.YES_NO_OPTION);
+ int validate = JOptionPane
+ .showInternalConfirmDialog(
+ Desktop.desktop,
+ "Validate JabaWS Server ?\n(Look in console output for results)",
+ "Test Server?", JOptionPane.YES_NO_OPTION);
if (validate == JOptionPane.OK_OPTION)
{
- if (jalview.ws.jws2.Jws2Discoverer.testServiceUrl(foo))
+ if (jalview.ws.jws2.Jws2Discoverer.testServiceUrl(foo))
{
return foo.toString();
- } else {
- JOptionPane.showInternalMessageDialog(Desktop.desktop, "Service did not pass validation.\nCheck the Jalview Console for more details.");
}
- } else {
+ else
+ {
+ JOptionPane
+ .showInternalMessageDialog(
+ Desktop.desktop,
+ "Service did not pass validation.\nCheck the Jalview Console for more details.");
+ }
+ }
+ else
+ {
// just return the URL anyway
return foo.toString();
}
}
- return initUrl;
+ return initUrl;
}
- /* (non-Javadoc)
- * @see jalview.jbgui.GWsPreferences#newWsUrl_actionPerformed(java.awt.event.ActionEvent)
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see jalview.jbgui.GWsPreferences#newWsUrl_actionPerformed(java.awt.event.
+ * ActionEvent)
*/
@Override
protected void newWsUrl_actionPerformed(ActionEvent e)
{
- String url=editUrl(null,"Add new JWS2 URL");
- if (url!=null)
+ String url = editUrl(null, "Add new JWS2 URL");
+ if (url != null)
{
if (!wsUrls.contains(url))
{
int selind = wsList.getSelectedIndex();
- if (selind>-1)
+ if (selind > -1)
{
wsUrls.insertElementAt(url, selind);
- } else {
+ }
+ else
+ {
wsUrls.addElement(url);
}
updateList();
}
}
- /* (non-Javadoc)
- * @see jalview.jbgui.GWsPreferences#refreshWs_actionPerformed(java.awt.event.ActionEvent)
+ /*
+ * (non-Javadoc)
+ *
+ * @see jalview.jbgui.GWsPreferences#refreshWs_actionPerformed(java.awt.event.
+ * ActionEvent)
*/
@Override
protected void refreshWs_actionPerformed(ActionEvent e)
{
- new Thread(new Runnable() {
+ new Thread(new Runnable()
+ {
public void run()
{
updateWsMenuConfig(false);
refreshWsMenu(true);
- }
+ }
}).start();
-
+
}
+
/**
*
- * @param showProgress show progress in dialog or on desktop
+ * @param showProgress
+ * show progress in dialog or on desktop
*/
protected void refreshWsMenu(boolean showProgress)
{
if (showProgress)
{
- new Thread(new Runnable() {
+ new Thread(new Runnable()
+ {
public void run()
{
progressBar.setVisible(true);
validate();
progressBar.setIndeterminate(true);
- Desktop.instance.startServiceDiscovery(true); // wait around for all threads to complete
+ Desktop.instance.startServiceDiscovery(true); // wait around for all
+ // threads to complete
progressBar.setIndeterminate(false);
progressBar.setVisible(false);
validate();
- }
+ }
}).start();
-
- } else {
- new Thread(new Runnable() {
+
+ }
+ else
+ {
+ new Thread(new Runnable()
+ {
public void run()
{
long ct = System.currentTimeMillis();
- Desktop.instance.setProgressBar("Refreshing Web Service Menus", ct);
+ Desktop.instance.setProgressBar("Refreshing Web Service Menus",
+ ct);
Desktop.instance.startServiceDiscovery(true);
- Desktop.instance.setProgressBar("Refreshing Web Service Menus", ct);
+ Desktop.instance.setProgressBar("Refreshing Web Service Menus",
+ ct);
}
-
+
}).start();
}
}
- /* (non-Javadoc)
- * @see jalview.jbgui.GWsPreferences#resetWs_actionPerformed(java.awt.event.ActionEvent)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * jalview.jbgui.GWsPreferences#resetWs_actionPerformed(java.awt.event.ActionEvent
+ * )
*/
@Override
protected void resetWs_actionPerformed(ActionEvent e)
{
jalview.ws.jws2.Jws2Discoverer.setServiceUrls(null);
- wsUrls = jalview.ws.jws2.Jws2Discoverer.getServiceUrls();
+ wsUrls = jalview.ws.jws2.Jws2Discoverer.getServiceUrls();
updateList();
}
- protected void ok_ActionPerformed(ActionEvent e) {
+
+ protected void ok_ActionPerformed(ActionEvent e)
+ {
// update everything regardless.
updateAndRefreshWsMenuConfig(false);
}
- public void updateAndRefreshWsMenuConfig(final boolean showProgressInDialog)
+
+ public void updateAndRefreshWsMenuConfig(
+ final boolean showProgressInDialog)
{
- new Thread(new Runnable() {
+ new Thread(new Runnable()
+ {
public void run()
{
updateWsMenuConfig(false);
refreshWsMenu(showProgressInDialog);
- }
+ }
}).start();
-
+
}
}
if (aa[aai].autoCalculated)\r
{\r
// make a note of the name and description\r
- autoAnnots.put(aa[aai].graph\r
- + "\t"\r
- + aa[aai].label\r
- + "\t"\r
- + aa[aai].description\r
- + "\t"\r
- + (aa[aai].sequenceRef != null ? aa[aai].sequenceRef\r
- .getDisplayId(true) : ""), new Integer(1));\r
+ autoAnnots\r
+ .put(aa[aai].graph\r
+ + "\t"\r
+ + aa[aai].label\r
+ + "\t"\r
+ + aa[aai].description\r
+ + "\t"\r
+ + (aa[aai].sequenceRef != null ? aa[aai].sequenceRef\r
+ .getDisplayId(true) : ""),\r
+ new Integer(1));\r
}\r
}\r
}\r
}\r
else\r
{\r
- sg\r
- .addSequence(al.getSequenceAt(Integer.parseInt(tmp) - 1),\r
- false);\r
+ sg.addSequence(al.getSequenceAt(Integer.parseInt(tmp) - 1), false);\r
}\r
}\r
}\r
{\r
sg.cs.setConservationInc(Integer.parseInt(value));\r
Conservation c = new Conservation("Group",\r
- ResidueProperties.propHash, 3, sg.getSequences(null), sg\r
- .getStartRes(), sg.getEndRes() + 1);\r
+ ResidueProperties.propHash, 3, sg.getSequences(null),\r
+ sg.getStartRes(), sg.getEndRes() + 1);\r
\r
c.calculate();\r
c.verdict(false, 25);\r
token = st.nextToken();\r
if (ala == null)\r
{\r
- System.err.print(" "+token);\r
+ System.err.print(" " + token);\r
}\r
else\r
{\r
}\r
}\r
}\r
- if (ala==null)\r
+ if (ala == null)\r
{\r
System.err.print("\n");\r
}\r
if (!fp.isValid())
{
fp = null;
- } else {
- if (debug)
+ }
+ else
{
- System.out.println("Successful.");
- }}
+ if (debug)
+ {
+ System.out.println("Successful.");
+ }
+ }
} catch (Exception e)
{
if (debug)
while ((j < s.length) && (s[j] != null))
{
- out
- .append(new Format("%-" + maxid + "s").form(printId(s[j])
- + " "));
+ out.append(new Format("%-" + maxid + "s").form(printId(s[j]) + " "));
int start = i * len;
int end = start + len;
// fifth is either 'above','below', or 'none'.\r
// sixth is a float value and only required when fifth is either\r
// 'above' or 'below'.\r
- StringTokenizer gcol = new StringTokenizer(colscheme, "|", true);\r
+ StringTokenizer gcol = new StringTokenizer(colscheme, "|",\r
+ true);\r
// set defaults\r
int threshtype = AnnotationColourGradient.NO_THRESHOLD;\r
float min = Float.MIN_VALUE, max = Float.MAX_VALUE, threshval = Float.NaN;\r
boolean labelCol = false;\r
// Parse spec line\r
String mincol = gcol.nextToken();\r
- if (mincol=="|")\r
+ if (mincol == "|")\r
{\r
System.err\r
- .println("Expected either 'label' or a colour specification in the line: "+line );\r
+ .println("Expected either 'label' or a colour specification in the line: "\r
+ + line);\r
continue;\r
}\r
String maxcol = null;\r
if (mincol.toLowerCase().indexOf("label") == 0)\r
{\r
labelCol = true;\r
- mincol = (gcol.hasMoreTokens() ? gcol.nextToken() : null); // skip '|'\r
+ mincol = (gcol.hasMoreTokens() ? gcol.nextToken() : null); // skip\r
+ // '|'\r
mincol = (gcol.hasMoreTokens() ? gcol.nextToken() : null);\r
}\r
String abso = null, minval, maxval;\r
// at least four more tokens\r
if (mincol.equals("|"))\r
{\r
- mincol="";\r
- } else {\r
+ mincol = "";\r
+ }\r
+ else\r
+ {\r
gcol.nextToken(); // skip next '|'\r
}\r
// continue parsing rest of line\r
maxcol = gcol.nextToken();\r
if (maxcol.equals("|"))\r
{\r
- maxcol="";\r
- } else {\r
+ maxcol = "";\r
+ }\r
+ else\r
+ {\r
gcol.nextToken(); // skip next '|'\r
}\r
abso = gcol.nextToken();\r
gcol.nextToken(); // skip next '|'\r
}\r
maxval = gcol.nextToken();\r
- if (gcol.hasMoreTokens()) {\r
+ if (gcol.hasMoreTokens())\r
+ {\r
gcol.nextToken(); // skip next '|'\r
}\r
try\r
{
if (omitHidden != null)
{
- //
- Alignment alv = new Alignment(replaceStrings(alignment
- .getSequencesArray(), omitHidden));
+ //
+ Alignment alv = new Alignment(replaceStrings(
+ alignment.getSequencesArray(), omitHidden));
AlignmentAnnotation[] ala = alignment.getAlignmentAnnotation();
if (ala != null)
{
AlignmentAnnotation na = new AlignmentAnnotation(ala[i]);
if (selgp != null)
{
- colSel.makeVisibleAnnotation(selgp.getStartRes(), selgp
- .getEndRes(), na);
+ colSel.makeVisibleAnnotation(selgp.getStartRes(),
+ selgp.getEndRes(), na);
}
else
{
fr = new FeatureRenderer(ap);
fr.transferSettings(fr1);
- JalviewFileChooser chooser = new JalviewFileChooser(jalview.bin.Cache
- .getProperty("LAST_DIRECTORY"), new String[]
- { "html" }, new String[]
- { "HTML files" }, "HTML files");
+ JalviewFileChooser chooser = new JalviewFileChooser(
+ jalview.bin.Cache.getProperty("LAST_DIRECTORY"), new String[]
+ { "html" }, new String[]
+ { "HTML files" }, "HTML files");
chooser.setFileView(new JalviewFileView());
chooser.setDialogTitle("Save as HTML");
void drawUnwrappedAlignment(PrintWriter out)
{
out.println("<table border=\"1\"><tr><td>\n");
- out
- .println("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n");
+ out.println("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n");
// ////////////
SequenceI seq;
String b;
out.println("<table border=\"1\"><tr><td>\n");
- out
- .println("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n");
+ out.println("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n");
for (int startRes = 0; startRes < al.getWidth(); startRes += av
.getWrappedWidth())
for (int j = 0; j < i; j++)
{
- scores.setElementAt((Object) ((Float) scores.elementAt(j))
- .toString(), j);
+ scores.setElementAt(
+ (Object) ((Float) scores.elementAt(j)).toString(), j);
}
scores.addElement((Object) ascore);
}
if ((newSeq.getName().startsWith("QUERY") || newSeq.getName()
- .startsWith("align;"))
- && (QuerySeqPosition == -1))
+ .startsWith("align;")) && (QuerySeqPosition == -1))
{
QuerySeqPosition = seqs.size();
}
}
});
- this
- .setBorder(new javax.swing.border.TitledBorder(
- "Recently Opened"));
+ this.setBorder(new javax.swing.border.TitledBorder("Recently Opened"));
final JScrollPane scroller = new JScrollPane(list);
scroller.setPreferredSize(new Dimension(130, 200));
{
for (int j = 0; j < width; j++)
{
- annotations[gapmap[j]] = new Annotation("", "", preds[i]
- .getCharAt(j), 0);
+ annotations[gapmap[j]] = new Annotation("", "",
+ preds[i].getCharAt(j), 0);
}
}
else
{
float value = new Float(preds[i].getCharAt(j) + "")
.floatValue();
- annotations[gapmap[delMap[j]]] = new Annotation(preds[i]
- .getCharAt(j)
- + "", "", preds[i].getCharAt(j), value);
+ annotations[gapmap[delMap[j]]] = new Annotation(
+ preds[i].getCharAt(j) + "", "",
+ preds[i].getCharAt(j), value);
}
}
}
{
for (int j = 0; j < width; j++)
{
- annotations[gapmap[delMap[j]]] = new Annotation(preds[i]
- .getCharAt(j)
- + "", "", ' ', 0);
+ annotations[gapmap[delMap[j]]] = new Annotation(
+ preds[i].getCharAt(j) + "", "", ' ', 0);
}
}
}
+ " at position "
+ p
+ " ( "
- + s.substring(((p - r) < 0) ? 0 : (p - r), ((p + r) > s
- .length()) ? s.length() : (p + r)) + " )\n";
+ + s.substring(((p - r) < 0) ? 0 : (p - r),
+ ((p + r) > s.length()) ? s.length() : (p + r)) + " )\n";
}
// @tree annotations
} catch (Exception e)
{
Error = ErrorStringrange(Error,
- "Can't parse bootstrap value", 4, ncp
- + nbootstrap.matchedFrom(), nf);
+ "Can't parse bootstrap value", 4,
+ ncp + nbootstrap.matchedFrom(), nf);
}
}
}
} catch (Exception e)
{
Error = ErrorStringrange(Error,
- "Can't parse node distance value", 7, ncp
- + ndist.matchedFrom(), nf);
+ "Can't parse node distance value", 7,
+ ncp + ndist.matchedFrom(), nf);
}
}
}
else
{
- out
- .append(s[i].getName() + " "
- + (s[i].getEnd() - s[i].getStart() + 1)
- + " residues\n");
+ out.append(s[i].getName() + " "
+ + (s[i].getEnd() - s[i].getStart() + 1) + " residues\n");
}
}
}
if (x.search(annContent))\r
{\r
// parse out and create alignment annotation directly.\r
- parseAnnotationRow(annotations, x.stringMatched(1), x\r
- .stringMatched(2));\r
+ parseAnnotationRow(annotations, x.stringMatched(1),\r
+ x.stringMatched(2));\r
}\r
}\r
else if (annType.equals("GR"))\r
{
boolean modified = false;
// check existing sequences in local and in document.
- Vector docseqs = new Vector(alignment
- .getAlignmentSequenceAsReference());
+ Vector docseqs = new Vector(
+ alignment.getAlignmentSequenceAsReference());
for (int i = 0; i < jal.getHeight(); i++)
{
modified |= syncToAlignmentSequence(jal.getSequenceAt(i),
if (aa[i].annotations[a].secondaryStructure != ' ')
{
Glyph ss = new Glyph();
- ss
- .setDict(uk.ac.vamsas.objects.utils.GlyphDictionary.PROTEIN_SS_3STATE);
- ss
- .setContent(String
- .valueOf(aa[i].annotations[a].secondaryStructure));
+ ss.setDict(uk.ac.vamsas.objects.utils.GlyphDictionary.PROTEIN_SS_3STATE);
+ ss.setContent(String
+ .valueOf(aa[i].annotations[a].secondaryStructure));
ae.addGlyph(ss);
}
an.addAnnotationElement(ae);
an.setGroup(Integer.toString(aa[i].graphGroup));
if (aa[i].threshold != null && aa[i].threshold.displayed)
{
- an
- .addProperty(Properties.newProperty(THRESHOLD,
- Properties.FLOATTYPE, ""
- + aa[i].threshold.value));
+ an.addProperty(Properties.newProperty(THRESHOLD,
+ Properties.FLOATTYPE, "" + aa[i].threshold.value));
if (aa[i].threshold.label != null)
{
an.addProperty(Properties.newProperty(THRESHOLD
{
TreePanel tp = (TreePanel) frames[t];
- if (tp.getViewPort().getSequenceSetId().equals(
- av.getSequenceSetId()))
+ if (tp.getViewPort().getSequenceSetId()
+ .equals(av.getSequenceSetId()))
{
DatastoreItem vtree = new jalview.io.vamsas.Tree(this, tp,
jal, alignment);
else
{
alseq = new jalview.datamodel.Sequence(valseq.getName(), valseq
- .getSequence().replace(valGapchar, gapChar), (int) valseq
- .getStart(), (int) valseq.getEnd());
+ .getSequence().replace(valGapchar, gapChar),
+ (int) valseq.getStart(), (int) valseq.getEnd());
Vobject datsetseq = (Vobject) valseq.getRefid();
if (datsetseq != null)
{
// we only write an annotation where it really exists.
Glyph ss = new Glyph();
- ss
- .setDict(uk.ac.vamsas.objects.utils.GlyphDictionary.PROTEIN_SS_3STATE);
+ ss.setDict(uk.ac.vamsas.objects.utils.GlyphDictionary.PROTEIN_SS_3STATE);
ss.setContent(String
.valueOf(alan.annotations[a].secondaryStructure));
ae.addGlyph(ss);
{
// TODO raise GUI warning if user requests it.
jalview.bin.Cache.log
- .error(
- "Couldn't update jalview client application data. Giving up - local settings probably lost.",
+ .error("Couldn't update jalview client application data. Giving up - local settings probably lost.",
e);
}
}
AlignmentSequence valseq = alignment.getAlignmentSequence(i);
jalview.datamodel.Sequence alseq = (jalview.datamodel.Sequence) getvObj2jv(valseq);
if (syncFromAlignmentSequence(valseq, valGapchar, gapChar,
- dsseqs)
- && alseq != null)
+ dsseqs) && alseq != null)
{
// updated to sequence from the document
.toString());
av = alignFrame.getViewport();
newAlignmentViews.addElement(av);
- String title = alignment.getProvenance().getEntry(
- alignment.getProvenance().getEntryCount() - 1)
+ String title = alignment
+ .getProvenance()
+ .getEntry(
+ alignment.getProvenance().getEntryCount() - 1)
.getAction();
if (alignment.getPropertyCount() > 0)
{
{
if (glyphs[g]
.getDict()
- .equals(
- uk.ac.vamsas.objects.utils.GlyphDictionary.PROTEIN_SS_3STATE))
+ .equals(uk.ac.vamsas.objects.utils.GlyphDictionary.PROTEIN_SS_3STATE))
{
ss = glyphs[g].getContent();
AeContent[HASSECSTR] = true;
}
else if (glyphs[g]
.getDict()
- .equals(
- uk.ac.vamsas.objects.utils.GlyphDictionary.PROTEIN_HD_HYDRO))
+ .equals(uk.ac.vamsas.objects.utils.GlyphDictionary.PROTEIN_HD_HYDRO))
{
Cache.log.debug("ignoring hydrophobicity glyph marker.");
AeContent[HASHPHOB] = true;
if (colour == null)
{
anot[row][pos] = new jalview.datamodel.Annotation(
- (dc != null) ? dc : "", desc, (ss != null) ? ss
- .charAt(0) : ' ', val);
+ (dc != null) ? dc : "", desc,
+ (ss != null) ? ss.charAt(0) : ' ', val);
}
else
{
anot[row][pos] = new jalview.datamodel.Annotation(
- (dc != null) ? dc : "", desc, (ss != null) ? ss
- .charAt(0) : ' ', val, colour);
+ (dc != null) ? dc : "", desc,
+ (ss != null) ? ss.charAt(0) : ' ', val, colour);
}
}
else
{
this.ap = ap;
this.al = al;
- output
- .setText("To display sequence features an exact Uniprot id with 100% sequence identity match must be entered."
- + "\nIn order to display these features, try changing the names of your sequences to the ids suggested below."
- + "\n\nRunning WSWUBlast at EBI."
- + "\nPlease quote Pillai S., Silventoinen V., Kallio K., Senger M., Sobhany S., Tate J., Velankar S., Golovin A., Henrick K., Rice P., Stoehr P., Lopez R."
- + "\nSOAP-based services provided by the European Bioinformatics Institute."
- + "\nNucleic Acids Res. 33(1):W25-W28 (2005));");
+ output.setText("To display sequence features an exact Uniprot id with 100% sequence identity match must be entered."
+ + "\nIn order to display these features, try changing the names of your sequences to the ids suggested below."
+ + "\n\nRunning WSWUBlast at EBI."
+ + "\nPlease quote Pillai S., Silventoinen V., Kallio K., Senger M., Sobhany S., Tate J., Velankar S., Golovin A., Henrick K., Rice P., Stoehr P., Lopez R."
+ + "\nSOAP-based services provided by the European Bioinformatics Institute."
+ + "\nNucleic Acids Res. 33(1):W25-W28 (2005));");
Desktop.addInternalFrame(output,
"BLASTing for unidentified sequences ", 800, 300);
Data inputs[] = new Data[1];
Data input = new Data();
input.setType("sequence");
- input.setContent(AlignSeq.extractGaps("-. ", sequence
- .getSequenceAsString()));
+ input.setContent(AlignSeq.extractGaps("-. ",
+ sequence.getSequenceAsString()));
inputs[0] = input;
WSWUBlastService service = new WSWUBlastServiceLocator();
public void addFromDocument()\r
{\r
Sequence vseq = (Sequence) vobj;\r
- SequenceI dsseq = new jalview.datamodel.Sequence(vseq.getName(), vseq\r
- .getSequence(), (int) vseq.getStart(), (int) vseq.getEnd());\r
+ SequenceI dsseq = new jalview.datamodel.Sequence(vseq.getName(),\r
+ vseq.getSequence(), (int) vseq.getStart(), (int) vseq.getEnd());\r
dsseq.setDescription(vseq.getDescription());\r
bindjvvobj(dsseq, vseq);\r
dsseq.setVamsasId(vseq.getVorbaId().getId());\r
SequenceI sequence = (SequenceI) jvobj;\r
if (!sequence.getSequenceAsString().equals(sq.getSequence()))\r
{\r
- log\r
- .warn("Potential Client Error ! - mismatch of dataset sequence: and jalview internal dataset sequence.");\r
+ log.warn("Potential Client Error ! - mismatch of dataset sequence: and jalview internal dataset sequence.");\r
}\r
else\r
{\r
\r
public void conflict()\r
{\r
- log\r
- .warn("Conflict in dataset sequence update to document. Overwriting document");\r
+ log.warn("Conflict in dataset sequence update to document. Overwriting document");\r
// TODO: could try to import from document data to jalview first. and then\r
updateToDoc();\r
}\r
{
datastore = ds;
dsReg = ds.getDatastoreRegisty();
- initDatastoreItem(ds.getProvEntry(), ds.getClientDocument(), ds
- .getVamsasObjectBinding(), ds.getJvObjectBinding());
+ initDatastoreItem(ds.getProvEntry(), ds.getClientDocument(),
+ ds.getVamsasObjectBinding(), ds.getJvObjectBinding());
}
private void initDatastoreItem(Entry provEntry, IClientDocument cdoc,
*/
private void updateMapTo(jalview.datamodel.Mapping mp)
{
- log
- .info("Performing updateMapTo remove this message when we know what we're doing.");
+ log.info("Performing updateMapTo remove this message when we know what we're doing.");
// TODO determine how sequences associated with database mappings are stored
// in the document
if (mp != null && mp.getTo() != null)
: uk.ac.vamsas.objects.utils.SymbolDictionary.STANDARD_AA),
ds);
}
- //
+ //
// TODO: NOW add a mapping between new dataset sequence and sequence
// associated with the database reference
else if (vlu instanceof Integer)\r
{\r
valid = true;\r
- nprop\r
- .setType(uk.ac.vamsas.objects.utils.Properties.INTEGERTYPE);\r
+ nprop.setType(uk.ac.vamsas.objects.utils.Properties.INTEGERTYPE);\r
}\r
else if (vlu instanceof Float)\r
{\r
private SequenceFeature getJalviewSeqFeature(RangeAnnotation dseta)\r
{\r
int[] se = getBounds(dseta);\r
- SequenceFeature sf = new jalview.datamodel.SequenceFeature(dseta\r
- .getType(), dseta.getDescription(), dseta.getStatus(), se[0],\r
- se[1], dseta.getGroup());\r
+ SequenceFeature sf = new jalview.datamodel.SequenceFeature(\r
+ dseta.getType(), dseta.getDescription(), dseta.getStatus(),\r
+ se[0], se[1], dseta.getGroup());\r
if (dseta.getLinkCount() > 0)\r
{\r
Link[] links = dseta.getLink();\r
if (!sense)
{
mapping = this.parsemapType(sequenceMapping, 1, 3); // invert sense
- mapping = new jalview.util.MapList(mapping.getToRanges(), mapping
- .getFromRanges(), mapping.getToRatio(), mapping
- .getFromRatio());
+ mapping = new jalview.util.MapList(mapping.getToRanges(),
+ mapping.getFromRanges(), mapping.getToRatio(),
+ mapping.getFromRatio());
afc.addMap(to, from, mapping);
}
else
else
{
// handle conflict
- log
- .info("TODO: Add the locally modified tree in Jalview as a new tree in document, leaving locked tree unchanged.");
+ log.info("TODO: Add the locally modified tree in Jalview as a new tree in document, leaving locked tree unchanged.");
}
}
// or just correctly resolve the tree's seqData to the correct alignment
// in
// the document.
- Vector alsqrefs = getjv2vObjs(findAlignmentSequences(jal, tp
- .getTree().seqData.getSequences()));
+ Vector alsqrefs = getjv2vObjs(findAlignmentSequences(jal,
+ tp.getTree().seqData.getSequences()));
Object[] alsqs = new Object[alsqrefs.size()];
alsqrefs.copyInto(alsqs);
vInput.setObjRef(alsqs);
else
{
leaf.setPlaceholder(true);
- leaf
- .setElement(new Sequence(leaf.getName(),
- "THISISAPLACEHLDER"));
+ leaf.setElement(new Sequence(leaf.getName(), "THISISAPLACEHLDER"));
}
}
}
if (evt.isControlDown()
|| SwingUtilities.isRightMouseButton(evt))
{
- radioItem
- .removeActionListener(radioItem.getActionListeners()[0]);
+ radioItem.removeActionListener(radioItem.getActionListeners()[0]);
int option = JOptionPane.showInternalConfirmDialog(
jalview.gui.Desktop.desktop,
default:
noColourmenuItem.setSelected(true);
break;
-
+
}
}
JMenuItem print = new JMenuItem();
JMenuItem outputValues = new JMenuItem();
-
+
JMenuItem outputPoints = new JMenuItem();
+
JMenuItem outputProjPoints = new JMenuItem();
protected JMenu viewMenu = new JMenu();
protected void outputPoints_actionPerformed(ActionEvent e)
{
// TODO Auto-generated method stub
-
+
}
protected void outputProjPoints_actionPerformed(ActionEvent e)
{
// TODO Auto-generated method stub
-
+
}
protected void xCombobox_actionPerformed(ActionEvent e)
protected JCheckBox modellerOutput = new JCheckBox();
protected JPanel dasPanel = new JPanel();
-
+
BorderLayout borderLayout4 = new BorderLayout();
protected JPanel wsPanel = new JPanel();
protected JCheckBox shareSelections = new JCheckBox();
protected JCheckBox followHighlight = new JCheckBox();
-
-
-
/**
* Creates a new GPreferences object.
colourButtons.add(turnColour);
colourButtons.add(buriedColour);
colourButtons.add(userColour);
-
+
helpMenu.add(jmolHelp);
jmolActionMenu.add(alignStructs);
}
label.setFont(new java.awt.Font("Verdana", Font.ITALIC, 10));
label.setOpaque(false);
label.setPreferredSize(new Dimension(260, 34));
- label
- .setText("<html>Save your colour scheme with a unique name and it will be added "
- + "to the Colour menu.</html>");
+ label.setText("<html>Save your colour scheme with a unique name and it will be added "
+ + "to the Colour menu.</html>");
caseSensitive.setText("Case Sensitive");
caseSensitive.addActionListener(new ActionListener()
{
protected JCheckBox enableEnfinServices = new JCheckBox();
protected JButton refreshWs = new JButton();
+
protected JButton resetWs = new JButton();
-
+
protected JProgressBar progressBar = new JProgressBar();
JScrollPane wsListPane = new JScrollPane();
-
+
JPanel wsListUrlPanel = new JPanel();
-
+
JPanel wsListPanel = new JPanel();
JPanel wsListButtons = new JPanel();
-
+
JPanel wsListNavButs = new JPanel();
BorderLayout myBorderlayout = new BorderLayout();
GridBagLayout wsMenuLayout = new GridBagLayout();
JPanel wsMenuButtons = new JPanel();
+
JPanel wsMenuRefreshButs = new JPanel();
+
public GWsPreferences()
{
jbInit();
});
resetWs.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
resetWs.setText("Reset Services");
-
+
resetWs.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
});
setLayout(myBorderlayout);
- setPreferredSize(new Dimension(500,400));
+ setPreferredSize(new Dimension(500, 400));
progressBar.setPreferredSize(new Dimension(450, 20));
progressBar.setString("");
wsListUrlPanel.setBorder(BorderFactory.createEtchedBorder());
wsListUrlPanel.setLayout(new BorderLayout());
-// wsListUrlPanel.setPreferredSize(new Dimension(482,202));
+ // wsListUrlPanel.setPreferredSize(new Dimension(482,202));
wsListPane.setBorder(BorderFactory.createEtchedBorder());
wsListPane.getViewport().add(wsList);
wsListPane.setPreferredSize(new Dimension(380, 200));
wsList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
- wsList.addMouseListener(new MouseListener() {
+ wsList.addMouseListener(new MouseListener()
+ {
public void mouseClicked(MouseEvent e)
{
- if (e.getClickCount()>1)
+ if (e.getClickCount() > 1)
{
editWsUrl_actionPerformed(null);
}
-
+
}
public void mouseEntered(MouseEvent e)
{
-
+
}
public void mouseExited(MouseEvent e)
public void mousePressed(MouseEvent e)
{
-
+
}
public void mouseReleased(MouseEvent e)
{
-
+
}
-
+
});
-// wsListButtons.setPreferredSize(new Dimension(480, 60));
+ // wsListButtons.setPreferredSize(new Dimension(480, 60));
wsListButtons.setLayout(new FlowLayout());
- //wsListButtons.add(moveWsUrlUp);
- //wsListButtons.add(moveWsUrlDown);
+ // wsListButtons.add(moveWsUrlUp);
+ // wsListButtons.add(moveWsUrlDown);
wsListButtons.add(newWsUrl);
wsListButtons.add(editWsUrl);
wsListButtons.add(deleteWsUrl);
- wsListNavButs.setSize(new Dimension(80,80));
- wsListNavButs.setPreferredSize(new Dimension(80,80));
+ wsListNavButs.setSize(new Dimension(80, 80));
+ wsListNavButs.setPreferredSize(new Dimension(80, 80));
wsListNavButs.setLayout(new FlowLayout());
wsListNavButs.add(moveWsUrlUp);
wsListNavButs.add(moveWsUrlDown);
- wsListUrlPanel.add(wsListPane,BorderLayout.EAST);
- wsListUrlPanel.add(wsListNavButs,BorderLayout.WEST);
+ wsListUrlPanel.add(wsListPane, BorderLayout.EAST);
+ wsListUrlPanel.add(wsListNavButs, BorderLayout.WEST);
wsListPanel.setBorder(wsListTitleBorder);
wsListPanel.setLayout(new BorderLayout());
wsListPanel.add(wsListUrlPanel, BorderLayout.NORTH);
wsListPanel.add(wsListButtons, BorderLayout.SOUTH);
- wsMenuButtons.setLayout(new GridLayout(2,3));
+ wsMenuButtons.setLayout(new GridLayout(2, 3));
wsMenuButtons.add(indexByHost);
wsMenuButtons.add(indexByType);
wsMenuButtons.add(enableJws1Services);
wsMenuButtons.add(enableJws2Services);
wsMenuButtons.add(enableEnfinServices);
wsMenuRefreshButs.setLayout(new FlowLayout());
- wsMenuRefreshButs.setPreferredSize(new Dimension(480,30));
- wsMenuRefreshButs.setSize(new Dimension(480,30));
- wsMenuRefreshButs.add(refreshWs,null);
- wsMenuRefreshButs.add(resetWs,null);
- wsMenuRefreshButs.add(progressBar,null);
+ wsMenuRefreshButs.setPreferredSize(new Dimension(480, 30));
+ wsMenuRefreshButs.setSize(new Dimension(480, 30));
+ wsMenuRefreshButs.add(refreshWs, null);
+ wsMenuRefreshButs.add(resetWs, null);
+ wsMenuRefreshButs.add(progressBar, null);
myBorderlayout.setHgap(3);
- add(wsListPanel,BorderLayout.NORTH);
- add(wsMenuButtons,BorderLayout.CENTER);
+ add(wsListPanel, BorderLayout.NORTH);
+ add(wsMenuButtons, BorderLayout.CENTER);
add(wsMenuRefreshButs, BorderLayout.SOUTH);
}
protected void resetWs_actionPerformed(ActionEvent e)
{
-
+
}
protected void indexByType_actionPerformed(ActionEvent e)
*/
package jalview.schemabinding.version2;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import org.exolab.castor.xml.Marshaller;
*
* @version $Revision$ $Date$
*/
-public class WebServiceParameterSet implements java.io.Serializable {
-
-
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
-
- /**
- * The short name for the parameter set. This will be shown
- * amongst the
- * other presets for the web service.
- *
- */
- private java.lang.String _name;
-
- /**
- * A Jalview Web Service Parameter Set container
- * version number.
- * Version 1 created for storing Jaba user presets.
- *
- */
- private java.lang.String _version;
-
- /**
- * Short description - as utf8 encoded text. This is
- * usually displayed
- * in the body of an HTML capable tooltip, so HTML tags may be
- * embedded
- * using standard UTF8 encoding.
- *
- */
- private java.lang.String _description;
-
- /**
- * URL for which the parameter set is valid. Jalview will use
- * it to
- * match up parameter sets to service instances that can parse
- * the
- * parameter set payload.
- *
- */
- private java.util.Vector _serviceURLList;
-
- /**
- * UTF8 encoded string to be processed into a specific web
- * services'
- * parameter set. Note - newlines may be important to the
- * structure
- * of this file.
- *
- */
- private java.lang.String _parameters;
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public WebServiceParameterSet() {
- super();
- this._serviceURLList = new java.util.Vector();
- }
-
-
- //-----------/
- //- Methods -/
- //-----------/
-
- /**
- *
- *
- * @param vServiceURL
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addServiceURL(
- final java.lang.String vServiceURL)
- throws java.lang.IndexOutOfBoundsException {
- this._serviceURLList.addElement(vServiceURL);
+public class WebServiceParameterSet implements java.io.Serializable
+{
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * The short name for the parameter set. This will be shown amongst the other
+ * presets for the web service.
+ *
+ */
+ private java.lang.String _name;
+
+ /**
+ * A Jalview Web Service Parameter Set container version number. Version 1
+ * created for storing Jaba user presets.
+ *
+ */
+ private java.lang.String _version;
+
+ /**
+ * Short description - as utf8 encoded text. This is usually displayed in the
+ * body of an HTML capable tooltip, so HTML tags may be embedded using
+ * standard UTF8 encoding.
+ *
+ */
+ private java.lang.String _description;
+
+ /**
+ * URL for which the parameter set is valid. Jalview will use it to match up
+ * parameter sets to service instances that can parse the parameter set
+ * payload.
+ *
+ */
+ private java.util.Vector _serviceURLList;
+
+ /**
+ * UTF8 encoded string to be processed into a specific web services' parameter
+ * set. Note - newlines may be important to the structure of this file.
+ *
+ */
+ private java.lang.String _parameters;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public WebServiceParameterSet()
+ {
+ super();
+ this._serviceURLList = new java.util.Vector();
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ *
+ *
+ * @param vServiceURL
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addServiceURL(final java.lang.String vServiceURL)
+ throws java.lang.IndexOutOfBoundsException
+ {
+ this._serviceURLList.addElement(vServiceURL);
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vServiceURL
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void addServiceURL(final int index,
+ final java.lang.String vServiceURL)
+ throws java.lang.IndexOutOfBoundsException
+ {
+ this._serviceURLList.add(index, vServiceURL);
+ }
+
+ /**
+ * Method enumerateServiceURL.
+ *
+ * @return an Enumeration over all java.lang.String elements
+ */
+ public java.util.Enumeration enumerateServiceURL()
+ {
+ return this._serviceURLList.elements();
+ }
+
+ /**
+ * Returns the value of field 'description'. The field 'description' has the
+ * following description: Short description - as utf8 encoded text. This is
+ * usually displayed in the body of an HTML capable tooltip, so HTML tags may
+ * be embedded using standard UTF8 encoding.
+ *
+ *
+ * @return the value of field 'Description'.
+ */
+ public java.lang.String getDescription()
+ {
+ return this._description;
+ }
+
+ /**
+ * Returns the value of field 'name'. The field 'name' has the following
+ * description: The short name for the parameter set. This will be shown
+ * amongst the other presets for the web service.
+ *
+ *
+ * @return the value of field 'Name'.
+ */
+ public java.lang.String getName()
+ {
+ return this._name;
+ }
+
+ /**
+ * Returns the value of field 'parameters'. The field 'parameters' has the
+ * following description: UTF8 encoded string to be processed into a specific
+ * web services' parameter set. Note - newlines may be important to the
+ * structure of this file.
+ *
+ *
+ * @return the value of field 'Parameters'.
+ */
+ public java.lang.String getParameters()
+ {
+ return this._parameters;
+ }
+
+ /**
+ * Method getServiceURL.
+ *
+ * @param index
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ * @return the value of the java.lang.String at the given index
+ */
+ public java.lang.String getServiceURL(final int index)
+ throws java.lang.IndexOutOfBoundsException
+ {
+ // check bounds for index
+ if (index < 0 || index >= this._serviceURLList.size())
+ {
+ throw new IndexOutOfBoundsException("getServiceURL: Index value '"
+ + index + "' not in range [0.."
+ + (this._serviceURLList.size() - 1) + "]");
}
- /**
- *
- *
- * @param index
- * @param vServiceURL
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void addServiceURL(
- final int index,
- final java.lang.String vServiceURL)
- throws java.lang.IndexOutOfBoundsException {
- this._serviceURLList.add(index, vServiceURL);
+ return (java.lang.String) _serviceURLList.get(index);
+ }
+
+ /**
+ * Method getServiceURL.Returns the contents of the collection in an Array.
+ * <p>
+ * Note: Just in case the collection contents are changing in another thread,
+ * we pass a 0-length Array of the correct type into the API call. This way we
+ * <i>know</i> that the Array returned is of exactly the correct length.
+ *
+ * @return this collection as an Array
+ */
+ public java.lang.String[] getServiceURL()
+ {
+ java.lang.String[] array = new java.lang.String[0];
+ return (java.lang.String[]) this._serviceURLList.toArray(array);
+ }
+
+ /**
+ * Method getServiceURLCount.
+ *
+ * @return the size of this collection
+ */
+ public int getServiceURLCount()
+ {
+ return this._serviceURLList.size();
+ }
+
+ /**
+ * Returns the value of field 'version'. The field 'version' has the following
+ * description: A Jalview Web Service Parameter Set container version number.
+ * Version 1 created for storing Jaba user presets.
+ *
+ *
+ * @return the value of field 'Version'.
+ */
+ public java.lang.String getVersion()
+ {
+ return this._version;
+ }
+
+ /**
+ * Method isValid.
+ *
+ * @return true if this object is valid according to the schema
+ */
+ public boolean isValid()
+ {
+ try
+ {
+ validate();
+ } catch (org.exolab.castor.xml.ValidationException vex)
+ {
+ return false;
}
-
- /**
- * Method enumerateServiceURL.
- *
- * @return an Enumeration over all java.lang.String elements
- */
- public java.util.Enumeration enumerateServiceURL(
- ) {
- return this._serviceURLList.elements();
- }
-
- /**
- * Returns the value of field 'description'. The field
- * 'description' has the following description: Short
- * description - as utf8 encoded text. This is
- * usually displayed
- * in the body of an HTML capable tooltip, so HTML tags may be
- * embedded
- * using standard UTF8 encoding.
- *
- *
- * @return the value of field 'Description'.
- */
- public java.lang.String getDescription(
- ) {
- return this._description;
- }
-
- /**
- * Returns the value of field 'name'. The field 'name' has the
- * following description: The short name for the parameter set.
- * This will be shown amongst the
- * other presets for the web service.
- *
- *
- * @return the value of field 'Name'.
- */
- public java.lang.String getName(
- ) {
- return this._name;
- }
-
- /**
- * Returns the value of field 'parameters'. The field
- * 'parameters' has the following description: UTF8 encoded
- * string to be processed into a specific web services'
- * parameter set. Note - newlines may be important to the
- * structure
- * of this file.
- *
- *
- * @return the value of field 'Parameters'.
- */
- public java.lang.String getParameters(
- ) {
- return this._parameters;
- }
-
- /**
- * Method getServiceURL.
- *
- * @param index
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- * @return the value of the java.lang.String at the given index
- */
- public java.lang.String getServiceURL(
- final int index)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._serviceURLList.size()) {
- throw new IndexOutOfBoundsException("getServiceURL: Index value '" + index + "' not in range [0.." + (this._serviceURLList.size() - 1) + "]");
- }
-
- return (java.lang.String) _serviceURLList.get(index);
- }
-
- /**
- * Method getServiceURL.Returns the contents of the collection
- * in an Array. <p>Note: Just in case the collection contents
- * are changing in another thread, we pass a 0-length Array of
- * the correct type into the API call. This way we <i>know</i>
- * that the Array returned is of exactly the correct length.
- *
- * @return this collection as an Array
- */
- public java.lang.String[] getServiceURL(
- ) {
- java.lang.String[] array = new java.lang.String[0];
- return (java.lang.String[]) this._serviceURLList.toArray(array);
- }
-
- /**
- * Method getServiceURLCount.
- *
- * @return the size of this collection
- */
- public int getServiceURLCount(
- ) {
- return this._serviceURLList.size();
- }
-
- /**
- * Returns the value of field 'version'. The field 'version'
- * has the following description: A Jalview Web Service
- * Parameter Set container
- * version number.
- * Version 1 created for storing Jaba user presets.
- *
- *
- * @return the value of field 'Version'.
+ return true;
+ }
+
+ /**
+ *
+ *
+ * @param out
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void marshal(final java.io.Writer out)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException
+ {
+ Marshaller.marshal(this, out);
+ }
+
+ /**
+ *
+ *
+ * @param handler
+ * @throws java.io.IOException
+ * if an IOException occurs during marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ */
+ public void marshal(final org.xml.sax.ContentHandler handler)
+ throws java.io.IOException,
+ org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException
+ {
+ Marshaller.marshal(this, handler);
+ }
+
+ /**
*/
- public java.lang.String getVersion(
- ) {
- return this._version;
+ public void removeAllServiceURL()
+ {
+ this._serviceURLList.clear();
+ }
+
+ /**
+ * Method removeServiceURL.
+ *
+ * @param vServiceURL
+ * @return true if the object was removed from the collection.
+ */
+ public boolean removeServiceURL(final java.lang.String vServiceURL)
+ {
+ boolean removed = _serviceURLList.remove(vServiceURL);
+ return removed;
+ }
+
+ /**
+ * Method removeServiceURLAt.
+ *
+ * @param index
+ * @return the element removed from the collection
+ */
+ public java.lang.String removeServiceURLAt(final int index)
+ {
+ java.lang.Object obj = this._serviceURLList.remove(index);
+ return (java.lang.String) obj;
+ }
+
+ /**
+ * Sets the value of field 'description'. The field 'description' has the
+ * following description: Short description - as utf8 encoded text. This is
+ * usually displayed in the body of an HTML capable tooltip, so HTML tags may
+ * be embedded using standard UTF8 encoding.
+ *
+ *
+ * @param description
+ * the value of field 'description'.
+ */
+ public void setDescription(final java.lang.String description)
+ {
+ this._description = description;
+ }
+
+ /**
+ * Sets the value of field 'name'. The field 'name' has the following
+ * description: The short name for the parameter set. This will be shown
+ * amongst the other presets for the web service.
+ *
+ *
+ * @param name
+ * the value of field 'name'.
+ */
+ public void setName(final java.lang.String name)
+ {
+ this._name = name;
+ }
+
+ /**
+ * Sets the value of field 'parameters'. The field 'parameters' has the
+ * following description: UTF8 encoded string to be processed into a specific
+ * web services' parameter set. Note - newlines may be important to the
+ * structure of this file.
+ *
+ *
+ * @param parameters
+ * the value of field 'parameters'.
+ */
+ public void setParameters(final java.lang.String parameters)
+ {
+ this._parameters = parameters;
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vServiceURL
+ * @throws java.lang.IndexOutOfBoundsException
+ * if the index given is outside the bounds of the collection
+ */
+ public void setServiceURL(final int index,
+ final java.lang.String vServiceURL)
+ throws java.lang.IndexOutOfBoundsException
+ {
+ // check bounds for index
+ if (index < 0 || index >= this._serviceURLList.size())
+ {
+ throw new IndexOutOfBoundsException("setServiceURL: Index value '"
+ + index + "' not in range [0.."
+ + (this._serviceURLList.size() - 1) + "]");
}
- /**
- * Method isValid.
- *
- * @return true if this object is valid according to the schema
- */
- public boolean isValid(
- ) {
- try {
- validate();
- } catch (org.exolab.castor.xml.ValidationException vex) {
- return false;
- }
- return true;
- }
-
- /**
- *
- *
- * @param out
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void marshal(
- final java.io.Writer out)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, out);
- }
-
- /**
- *
- *
- * @param handler
- * @throws java.io.IOException if an IOException occurs during
- * marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- */
- public void marshal(
- final org.xml.sax.ContentHandler handler)
- throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- Marshaller.marshal(this, handler);
- }
-
- /**
- */
- public void removeAllServiceURL(
- ) {
- this._serviceURLList.clear();
- }
-
- /**
- * Method removeServiceURL.
- *
- * @param vServiceURL
- * @return true if the object was removed from the collection.
- */
- public boolean removeServiceURL(
- final java.lang.String vServiceURL) {
- boolean removed = _serviceURLList.remove(vServiceURL);
- return removed;
- }
-
- /**
- * Method removeServiceURLAt.
- *
- * @param index
- * @return the element removed from the collection
- */
- public java.lang.String removeServiceURLAt(
- final int index) {
- java.lang.Object obj = this._serviceURLList.remove(index);
- return (java.lang.String) obj;
- }
-
- /**
- * Sets the value of field 'description'. The field
- * 'description' has the following description: Short
- * description - as utf8 encoded text. This is
- * usually displayed
- * in the body of an HTML capable tooltip, so HTML tags may be
- * embedded
- * using standard UTF8 encoding.
- *
- *
- * @param description the value of field 'description'.
- */
- public void setDescription(
- final java.lang.String description) {
- this._description = description;
- }
-
- /**
- * Sets the value of field 'name'. The field 'name' has the
- * following description: The short name for the parameter set.
- * This will be shown amongst the
- * other presets for the web service.
- *
- *
- * @param name the value of field 'name'.
- */
- public void setName(
- final java.lang.String name) {
- this._name = name;
- }
-
- /**
- * Sets the value of field 'parameters'. The field 'parameters'
- * has the following description: UTF8 encoded string to be
- * processed into a specific web services'
- * parameter set. Note - newlines may be important to the
- * structure
- * of this file.
- *
- *
- * @param parameters the value of field 'parameters'.
- */
- public void setParameters(
- final java.lang.String parameters) {
- this._parameters = parameters;
- }
-
- /**
- *
- *
- * @param index
- * @param vServiceURL
- * @throws java.lang.IndexOutOfBoundsException if the index
- * given is outside the bounds of the collection
- */
- public void setServiceURL(
- final int index,
- final java.lang.String vServiceURL)
- throws java.lang.IndexOutOfBoundsException {
- // check bounds for index
- if (index < 0 || index >= this._serviceURLList.size()) {
- throw new IndexOutOfBoundsException("setServiceURL: Index value '" + index + "' not in range [0.." + (this._serviceURLList.size() - 1) + "]");
- }
-
- this._serviceURLList.set(index, vServiceURL);
- }
-
- /**
- *
- *
- * @param vServiceURLArray
- */
- public void setServiceURL(
- final java.lang.String[] vServiceURLArray) {
- //-- copy array
- _serviceURLList.clear();
-
- for (int i = 0; i < vServiceURLArray.length; i++) {
- this._serviceURLList.add(vServiceURLArray[i]);
- }
- }
-
- /**
- * Sets the value of field 'version'. The field 'version' has
- * the following description: A Jalview Web Service Parameter
- * Set container
- * version number.
- * Version 1 created for storing Jaba user presets.
- *
- *
- * @param version the value of field 'version'.
- */
- public void setVersion(
- final java.lang.String version) {
- this._version = version;
- }
-
- /**
- * Method unmarshal.
- *
- * @param reader
- * @throws org.exolab.castor.xml.MarshalException if object is
- * null or if any SAXException is thrown during marshaling
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- * @return the unmarshaled
- * jalview.schemabinding.version2.WebServiceParameterSet
- */
- public static jalview.schemabinding.version2.WebServiceParameterSet unmarshal(
- final java.io.Reader reader)
- throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
- return (jalview.schemabinding.version2.WebServiceParameterSet) Unmarshaller.unmarshal(jalview.schemabinding.version2.WebServiceParameterSet.class, reader);
- }
-
- /**
- *
- *
- * @throws org.exolab.castor.xml.ValidationException if this
- * object is an invalid instance according to the schema
- */
- public void validate(
- )
- throws org.exolab.castor.xml.ValidationException {
- org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
- validator.validate(this);
+ this._serviceURLList.set(index, vServiceURL);
+ }
+
+ /**
+ *
+ *
+ * @param vServiceURLArray
+ */
+ public void setServiceURL(final java.lang.String[] vServiceURLArray)
+ {
+ // -- copy array
+ _serviceURLList.clear();
+
+ for (int i = 0; i < vServiceURLArray.length; i++)
+ {
+ this._serviceURLList.add(vServiceURLArray[i]);
}
+ }
+
+ /**
+ * Sets the value of field 'version'. The field 'version' has the following
+ * description: A Jalview Web Service Parameter Set container version number.
+ * Version 1 created for storing Jaba user presets.
+ *
+ *
+ * @param version
+ * the value of field 'version'.
+ */
+ public void setVersion(final java.lang.String version)
+ {
+ this._version = version;
+ }
+
+ /**
+ * Method unmarshal.
+ *
+ * @param reader
+ * @throws org.exolab.castor.xml.MarshalException
+ * if object is null or if any SAXException is thrown during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ * @return the unmarshaled
+ * jalview.schemabinding.version2.WebServiceParameterSet
+ */
+ public static jalview.schemabinding.version2.WebServiceParameterSet unmarshal(
+ final java.io.Reader reader)
+ throws org.exolab.castor.xml.MarshalException,
+ org.exolab.castor.xml.ValidationException
+ {
+ return (jalview.schemabinding.version2.WebServiceParameterSet) Unmarshaller
+ .unmarshal(
+ jalview.schemabinding.version2.WebServiceParameterSet.class,
+ reader);
+ }
+
+ /**
+ *
+ *
+ * @throws org.exolab.castor.xml.ValidationException
+ * if this object is an invalid instance according to the schema
+ */
+ public void validate() throws org.exolab.castor.xml.ValidationException
+ {
+ org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
+ validator.validate(this);
+ }
}
try\r
{\r
AlcodonFrame target = (AlcodonFrame) object;\r
- target\r
- .addAlcodMap((jalview.schemabinding.version2.AlcodMap) value);\r
+ target.addAlcodMap((jalview.schemabinding.version2.AlcodMap) value);\r
} catch (java.lang.Exception ex)\r
{\r
throw new IllegalStateException(ex.toString());\r
try\r
{\r
Annotation target = (Annotation) object;\r
- target\r
- .addAnnotationElement((jalview.schemabinding.version2.AnnotationElement) value);\r
+ target.addAnnotationElement((jalview.schemabinding.version2.AnnotationElement) value);\r
} catch (java.lang.Exception ex)\r
{\r
throw new IllegalStateException(ex.toString());\r
try\r
{\r
Annotation target = (Annotation) object;\r
- target\r
- .setThresholdLine((jalview.schemabinding.version2.ThresholdLine) value);\r
+ target.setThresholdLine((jalview.schemabinding.version2.ThresholdLine) value);\r
} catch (java.lang.Exception ex)\r
{\r
throw new IllegalStateException(ex.toString());\r
try\r
{\r
Feature target = (Feature) object;\r
- target\r
- .addOtherData((jalview.schemabinding.version2.OtherData) value);\r
+ target.addOtherData((jalview.schemabinding.version2.OtherData) value);\r
} catch (java.lang.Exception ex)\r
{\r
throw new IllegalStateException(ex.toString());\r
target.deleteDisplayBoxes();\r
return;\r
}\r
- target\r
- .setDisplayBoxes(((java.lang.Boolean) value)\r
- .booleanValue());\r
+ target.setDisplayBoxes(((java.lang.Boolean) value).booleanValue());\r
} catch (java.lang.Exception ex)\r
{\r
throw new IllegalStateException(ex.toString());\r
target.deleteTextColThreshold();\r
return;\r
}\r
- target\r
- .setTextColThreshold(((java.lang.Integer) value)\r
- .intValue());\r
+ target.setTextColThreshold(((java.lang.Integer) value).intValue());\r
} catch (java.lang.Exception ex)\r
{\r
throw new IllegalStateException(ex.toString());\r
try\r
{\r
JSeq target = (JSeq) object;\r
- target\r
- .addFeatures((jalview.schemabinding.version2.Features) value);\r
+ target.addFeatures((jalview.schemabinding.version2.Features) value);\r
} catch (java.lang.Exception ex)\r
{\r
throw new IllegalStateException(ex.toString());\r
try\r
{\r
JalviewModel target = (JalviewModel) object;\r
- target\r
- .setVamsasModel((jalview.schemabinding.version2.VamsasModel) value);\r
+ target.setVamsasModel((jalview.schemabinding.version2.VamsasModel) value);\r
} catch (java.lang.Exception ex)\r
{\r
throw new IllegalStateException(ex.toString());\r
try\r
{\r
JalviewModel target = (JalviewModel) object;\r
- target\r
- .setJalviewModelSequence((jalview.schemabinding.version2.JalviewModelSequence) value);\r
+ target.setJalviewModelSequence((jalview.schemabinding.version2.JalviewModelSequence) value);\r
} catch (java.lang.Exception ex)\r
{\r
throw new IllegalStateException(ex.toString());\r
};\r
desc.setHandler(handler);\r
desc.setContainer(true);\r
- desc\r
- .setClassDescriptor(new jalview.schemabinding.version2.descriptors.JalviewModelSequenceDescriptor());\r
+ desc.setClassDescriptor(new jalview.schemabinding.version2.descriptors.JalviewModelSequenceDescriptor());\r
desc.setNameSpaceURI("www.jalview.org");\r
desc.setRequired(true);\r
desc.setMultivalued(false);\r
try\r
{\r
JalviewModelSequence target = (JalviewModelSequence) object;\r
- target\r
- .addViewport((jalview.schemabinding.version2.Viewport) value);\r
+ target.addViewport((jalview.schemabinding.version2.Viewport) value);\r
} catch (java.lang.Exception ex)\r
{\r
throw new IllegalStateException(ex.toString());\r
try\r
{\r
JalviewModelSequence target = (JalviewModelSequence) object;\r
- target\r
- .addUserColours((jalview.schemabinding.version2.UserColours) value);\r
+ target.addUserColours((jalview.schemabinding.version2.UserColours) value);\r
} catch (java.lang.Exception ex)\r
{\r
throw new IllegalStateException(ex.toString());\r
try\r
{\r
JalviewModelSequence target = (JalviewModelSequence) object;\r
- target\r
- .setFeatureSettings((jalview.schemabinding.version2.FeatureSettings) value);\r
+ target.setFeatureSettings((jalview.schemabinding.version2.FeatureSettings) value);\r
} catch (java.lang.Exception ex)\r
{\r
throw new IllegalStateException(ex.toString());\r
try\r
{\r
MapListType target = (MapListType) object;\r
- target\r
- .addMapListFrom((jalview.schemabinding.version2.MapListFrom) value);\r
+ target.addMapListFrom((jalview.schemabinding.version2.MapListFrom) value);\r
} catch (java.lang.Exception ex)\r
{\r
throw new IllegalStateException(ex.toString());\r
try\r
{\r
MapListType target = (MapListType) object;\r
- target\r
- .addMapListTo((jalview.schemabinding.version2.MapListTo) value);\r
+ target.addMapListTo((jalview.schemabinding.version2.MapListTo) value);\r
} catch (java.lang.Exception ex)\r
{\r
throw new IllegalStateException(ex.toString());\r
try\r
{\r
MappingChoice target = (MappingChoice) object;\r
- target\r
- .setSequence((jalview.schemabinding.version2.Sequence) value);\r
+ target.setSequence((jalview.schemabinding.version2.Sequence) value);\r
} catch (java.lang.Exception ex)\r
{\r
throw new IllegalStateException(ex.toString());\r
try\r
{\r
Mapping target = (Mapping) object;\r
- target\r
- .setMappingChoice((jalview.schemabinding.version2.MappingChoice) value);\r
+ target.setMappingChoice((jalview.schemabinding.version2.MappingChoice) value);\r
} catch (java.lang.Exception ex)\r
{\r
throw new IllegalStateException(ex.toString());\r
};\r
desc.setHandler(handler);\r
desc.setContainer(true);\r
- desc\r
- .setClassDescriptor(new jalview.schemabinding.version2.descriptors.MappingChoiceDescriptor());\r
+ desc.setClassDescriptor(new jalview.schemabinding.version2.descriptors.MappingChoiceDescriptor());\r
desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2");\r
desc.setMultivalued(false);\r
addFieldDescriptor(desc);\r
try\r
{\r
Pdbentry target = (Pdbentry) object;\r
- target\r
- .addPdbentryItem((jalview.schemabinding.version2.PdbentryItem) value);\r
+ target.addPdbentryItem((jalview.schemabinding.version2.PdbentryItem) value);\r
} catch (java.lang.Exception ex)\r
{\r
throw new IllegalStateException(ex.toString());\r
};\r
desc.setHandler(handler);\r
desc.setContainer(true);\r
- desc\r
- .setClassDescriptor(new jalview.schemabinding.version2.descriptors.PdbentryItemDescriptor());\r
+ desc.setClassDescriptor(new jalview.schemabinding.version2.descriptors.PdbentryItemDescriptor());\r
desc.setMultivalued(true);\r
addFieldDescriptor(desc);\r
\r
try\r
{\r
PdbentryItem target = (PdbentryItem) object;\r
- target\r
- .addProperty((jalview.schemabinding.version2.Property) value);\r
+ target.addProperty((jalview.schemabinding.version2.Property) value);\r
} catch (java.lang.Exception ex)\r
{\r
throw new IllegalStateException(ex.toString());\r
try\r
{\r
Pdbids target = (Pdbids) object;\r
- target\r
- .addStructureState((jalview.schemabinding.version2.StructureState) value);\r
+ target.addStructureState((jalview.schemabinding.version2.StructureState) value);\r
} catch (java.lang.Exception ex)\r
{\r
throw new IllegalStateException(ex.toString());\r
try\r
{\r
SequenceSet target = (SequenceSet) object;\r
- target\r
- .addSequence((jalview.schemabinding.version2.Sequence) value);\r
+ target.addSequence((jalview.schemabinding.version2.Sequence) value);\r
} catch (java.lang.Exception ex)\r
{\r
throw new IllegalStateException(ex.toString());\r
try\r
{\r
SequenceSet target = (SequenceSet) object;\r
- target\r
- .addAnnotation((jalview.schemabinding.version2.Annotation) value);\r
+ target.addAnnotation((jalview.schemabinding.version2.Annotation) value);\r
} catch (java.lang.Exception ex)\r
{\r
throw new IllegalStateException(ex.toString());\r
try\r
{\r
SequenceSet target = (SequenceSet) object;\r
- target\r
- .addSequenceSetProperties((jalview.schemabinding.version2.SequenceSetProperties) value);\r
+ target.addSequenceSetProperties((jalview.schemabinding.version2.SequenceSetProperties) value);\r
} catch (java.lang.Exception ex)\r
{\r
throw new IllegalStateException(ex.toString());\r
try\r
{\r
SequenceSet target = (SequenceSet) object;\r
- target\r
- .addAlcodonFrame((jalview.schemabinding.version2.AlcodonFrame) value);\r
+ target.addAlcodonFrame((jalview.schemabinding.version2.AlcodonFrame) value);\r
} catch (java.lang.Exception ex)\r
{\r
throw new IllegalStateException(ex.toString());\r
target.deleteMarkUnlinked();\r
return;\r
}\r
- target\r
- .setMarkUnlinked(((java.lang.Boolean) value)\r
- .booleanValue());\r
+ target.setMarkUnlinked(((java.lang.Boolean) value).booleanValue());\r
} catch (java.lang.Exception ex)\r
{\r
throw new IllegalStateException(ex.toString());\r
try\r
{\r
UserColours target = (UserColours) object;\r
- target\r
- .setUserColourScheme((jalview.schemabinding.version2.UserColourScheme) value);\r
+ target.setUserColourScheme((jalview.schemabinding.version2.UserColourScheme) value);\r
} catch (java.lang.Exception ex)\r
{\r
throw new IllegalStateException(ex.toString());\r
try\r
{\r
VAMSAS target = (VAMSAS) object;\r
- target\r
- .addSequenceSet((jalview.schemabinding.version2.SequenceSet) value);\r
+ target.addSequenceSet((jalview.schemabinding.version2.SequenceSet) value);\r
} catch (java.lang.Exception ex)\r
{\r
throw new IllegalStateException(ex.toString());\r
target.deleteTextColThreshold();\r
return;\r
}\r
- target\r
- .setTextColThreshold(((java.lang.Integer) value)\r
- .intValue());\r
+ target.setTextColThreshold(((java.lang.Integer) value).intValue());\r
} catch (java.lang.Exception ex)\r
{\r
throw new IllegalStateException(ex.toString());\r
try\r
{\r
Viewport target = (Viewport) object;\r
- target\r
- .setAnnotationColours((jalview.schemabinding.version2.AnnotationColours) value);\r
+ target.setAnnotationColours((jalview.schemabinding.version2.AnnotationColours) value);\r
} catch (java.lang.Exception ex)\r
{\r
throw new IllegalStateException(ex.toString());\r
try\r
{\r
Viewport target = (Viewport) object;\r
- target\r
- .addHiddenColumns((jalview.schemabinding.version2.HiddenColumns) value);\r
+ target.addHiddenColumns((jalview.schemabinding.version2.HiddenColumns) value);\r
} catch (java.lang.Exception ex)\r
{\r
throw new IllegalStateException(ex.toString());\r
*/
package jalview.schemabinding.version2.descriptors;
- //---------------------------------/
- //- Imported classes and packages -/
+//---------------------------------/
+//- Imported classes and packages -/
//---------------------------------/
import jalview.schemabinding.version2.WebServiceParameterSet;
*
* @version $Revision$ $Date$
*/
-public class WebServiceParameterSetDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl {
-
-
- //--------------------------/
- //- Class/Member Variables -/
- //--------------------------/
-
- /**
- * Field _elementDefinition.
- */
- private boolean _elementDefinition;
-
- /**
- * Field _nsPrefix.
- */
- private java.lang.String _nsPrefix;
-
- /**
- * Field _nsURI.
- */
- private java.lang.String _nsURI;
-
- /**
- * Field _xmlName.
- */
- private java.lang.String _xmlName;
-
-
- //----------------/
- //- Constructors -/
- //----------------/
-
- public WebServiceParameterSetDescriptor() {
- super();
- _nsURI = "www.jalview.org/xml/wsparamset";
- _xmlName = "WebServiceParameterSet";
- _elementDefinition = false;
-
- //-- set grouping compositor
- setCompositorAsSequence();
- org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
- org.exolab.castor.mapping.FieldHandler handler = null;
- org.exolab.castor.xml.FieldValidator fieldValidator = null;
- //-- initialize attribute descriptors
-
- //-- _name
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_name", "name", org.exolab.castor.xml.NodeType.Attribute);
- desc.setImmutable(true);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- WebServiceParameterSet target = (WebServiceParameterSet) object;
- return target.getName();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- WebServiceParameterSet target = (WebServiceParameterSet) object;
- target.setName( (java.lang.String) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setRequired(true);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _name
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(1);
- { //-- local scope
- org.exolab.castor.xml.validators.StringValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.StringValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setWhiteSpace("preserve");
- }
- desc.setValidator(fieldValidator);
- //-- initialize element descriptors
-
- //-- _version
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_version", "Version", org.exolab.castor.xml.NodeType.Element);
- desc.setImmutable(true);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- WebServiceParameterSet target = (WebServiceParameterSet) object;
- return target.getVersion();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- WebServiceParameterSet target = (WebServiceParameterSet) object;
- target.setVersion( (java.lang.String) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _version
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { //-- local scope
- org.exolab.castor.xml.validators.StringValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.StringValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setWhiteSpace("preserve");
- }
- desc.setValidator(fieldValidator);
- //-- _description
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_description", "description", org.exolab.castor.xml.NodeType.Element);
- desc.setImmutable(true);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- WebServiceParameterSet target = (WebServiceParameterSet) object;
- return target.getDescription();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- WebServiceParameterSet target = (WebServiceParameterSet) object;
- target.setDescription( (java.lang.String) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _description
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { //-- local scope
- org.exolab.castor.xml.validators.StringValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.StringValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setWhiteSpace("preserve");
- }
- desc.setValidator(fieldValidator);
- //-- _serviceURLList
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_serviceURLList", "serviceURL", org.exolab.castor.xml.NodeType.Element);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- WebServiceParameterSet target = (WebServiceParameterSet) object;
- return target.getServiceURL();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- WebServiceParameterSet target = (WebServiceParameterSet) object;
- target.addServiceURL( (java.lang.String) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException {
- try {
- WebServiceParameterSet target = (WebServiceParameterSet) object;
- target.removeAllServiceURL();
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return new java.lang.String();
- }
- };
- desc.setHandler(handler);
- desc.setRequired(true);
- desc.setMultivalued(true);
- addFieldDescriptor(desc);
-
- //-- validation code for: _serviceURLList
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(1);
- { //-- local scope
- }
- desc.setValidator(fieldValidator);
- //-- _parameters
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_parameters", "parameters", org.exolab.castor.xml.NodeType.Element);
- desc.setImmutable(true);
- handler = new org.exolab.castor.xml.XMLFieldHandler() {
- public java.lang.Object getValue( java.lang.Object object )
- throws IllegalStateException
- {
- WebServiceParameterSet target = (WebServiceParameterSet) object;
- return target.getParameters();
- }
- public void setValue( java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try {
- WebServiceParameterSet target = (WebServiceParameterSet) object;
- target.setParameters( (java.lang.String) value);
- } catch (java.lang.Exception ex) {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent) {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setRequired(true);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- //-- validation code for: _parameters
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(1);
- { //-- local scope
- org.exolab.castor.xml.validators.StringValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.StringValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setWhiteSpace("preserve");
+public class WebServiceParameterSetDescriptor extends
+ org.exolab.castor.xml.util.XMLClassDescriptorImpl
+{
+
+ // --------------------------/
+ // - Class/Member Variables -/
+ // --------------------------/
+
+ /**
+ * Field _elementDefinition.
+ */
+ private boolean _elementDefinition;
+
+ /**
+ * Field _nsPrefix.
+ */
+ private java.lang.String _nsPrefix;
+
+ /**
+ * Field _nsURI.
+ */
+ private java.lang.String _nsURI;
+
+ /**
+ * Field _xmlName.
+ */
+ private java.lang.String _xmlName;
+
+ // ----------------/
+ // - Constructors -/
+ // ----------------/
+
+ public WebServiceParameterSetDescriptor()
+ {
+ super();
+ _nsURI = "www.jalview.org/xml/wsparamset";
+ _xmlName = "WebServiceParameterSet";
+ _elementDefinition = false;
+
+ // -- set grouping compositor
+ setCompositorAsSequence();
+ org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
+ org.exolab.castor.mapping.FieldHandler handler = null;
+ org.exolab.castor.xml.FieldValidator fieldValidator = null;
+ // -- initialize attribute descriptors
+
+ // -- _name
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.String.class, "_name", "name",
+ org.exolab.castor.xml.NodeType.Attribute);
+ desc.setImmutable(true);
+ handler = new org.exolab.castor.xml.XMLFieldHandler()
+ {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException
+ {
+ WebServiceParameterSet target = (WebServiceParameterSet) object;
+ return target.getName();
+ }
+
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException
+ {
+ try
+ {
+ WebServiceParameterSet target = (WebServiceParameterSet) object;
+ target.setName((java.lang.String) value);
+ } catch (java.lang.Exception ex)
+ {
+ throw new IllegalStateException(ex.toString());
}
- desc.setValidator(fieldValidator);
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent)
+ {
+ return null;
+ }
+ };
+ desc.setHandler(handler);
+ desc.setRequired(true);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _name
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(1);
+ { // -- local scope
+ org.exolab.castor.xml.validators.StringValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.StringValidator();
+ fieldValidator.setValidator(typeValidator);
+ typeValidator.setWhiteSpace("preserve");
}
+ desc.setValidator(fieldValidator);
+ // -- initialize element descriptors
+ // -- _version
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.String.class, "_version", "Version",
+ org.exolab.castor.xml.NodeType.Element);
+ desc.setImmutable(true);
+ handler = new org.exolab.castor.xml.XMLFieldHandler()
+ {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException
+ {
+ WebServiceParameterSet target = (WebServiceParameterSet) object;
+ return target.getVersion();
+ }
- //-----------/
- //- Methods -/
- //-----------/
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException
+ {
+ try
+ {
+ WebServiceParameterSet target = (WebServiceParameterSet) object;
+ target.setVersion((java.lang.String) value);
+ } catch (java.lang.Exception ex)
+ {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
- /**
- * Method getAccessMode.
- *
- * @return the access mode specified for this class.
- */
- public org.exolab.castor.mapping.AccessMode getAccessMode(
- ) {
+ public java.lang.Object newInstance(java.lang.Object parent)
+ {
return null;
- }
+ }
+ };
+ desc.setHandler(handler);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
- /**
- * Method getIdentity.
- *
- * @return the identity field, null if this class has no
- * identity.
- */
- public org.exolab.castor.mapping.FieldDescriptor getIdentity(
- ) {
- return super.getIdentity();
+ // -- validation code for: _version
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ { // -- local scope
+ org.exolab.castor.xml.validators.StringValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.StringValidator();
+ fieldValidator.setValidator(typeValidator);
+ typeValidator.setWhiteSpace("preserve");
}
+ desc.setValidator(fieldValidator);
+ // -- _description
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.String.class, "_description", "description",
+ org.exolab.castor.xml.NodeType.Element);
+ desc.setImmutable(true);
+ handler = new org.exolab.castor.xml.XMLFieldHandler()
+ {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException
+ {
+ WebServiceParameterSet target = (WebServiceParameterSet) object;
+ return target.getDescription();
+ }
- /**
- * Method getJavaClass.
- *
- * @return the Java class represented by this descriptor.
- */
- public java.lang.Class getJavaClass(
- ) {
- return jalview.schemabinding.version2.WebServiceParameterSet.class;
- }
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException
+ {
+ try
+ {
+ WebServiceParameterSet target = (WebServiceParameterSet) object;
+ target.setDescription((java.lang.String) value);
+ } catch (java.lang.Exception ex)
+ {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
- /**
- * Method getNameSpacePrefix.
- *
- * @return the namespace prefix to use when marshaling as XML.
- */
- public java.lang.String getNameSpacePrefix(
- ) {
- return _nsPrefix;
- }
+ public java.lang.Object newInstance(java.lang.Object parent)
+ {
+ return null;
+ }
+ };
+ desc.setHandler(handler);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
- /**
- * Method getNameSpaceURI.
- *
- * @return the namespace URI used when marshaling and
- * unmarshaling as XML.
- */
- public java.lang.String getNameSpaceURI(
- ) {
- return _nsURI;
+ // -- validation code for: _description
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ { // -- local scope
+ org.exolab.castor.xml.validators.StringValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.StringValidator();
+ fieldValidator.setValidator(typeValidator);
+ typeValidator.setWhiteSpace("preserve");
}
+ desc.setValidator(fieldValidator);
+ // -- _serviceURLList
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.String.class, "_serviceURLList", "serviceURL",
+ org.exolab.castor.xml.NodeType.Element);
+ handler = new org.exolab.castor.xml.XMLFieldHandler()
+ {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException
+ {
+ WebServiceParameterSet target = (WebServiceParameterSet) object;
+ return target.getServiceURL();
+ }
- /**
- * Method getValidator.
- *
- * @return a specific validator for the class described by this
- * ClassDescriptor.
- */
- public org.exolab.castor.xml.TypeValidator getValidator(
- ) {
- return this;
- }
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException
+ {
+ try
+ {
+ WebServiceParameterSet target = (WebServiceParameterSet) object;
+ target.addServiceURL((java.lang.String) value);
+ } catch (java.lang.Exception ex)
+ {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
- /**
- * Method getXMLName.
- *
- * @return the XML Name for the Class being described.
- */
- public java.lang.String getXMLName(
- ) {
- return _xmlName;
+ public void resetValue(Object object) throws IllegalStateException,
+ IllegalArgumentException
+ {
+ try
+ {
+ WebServiceParameterSet target = (WebServiceParameterSet) object;
+ target.removeAllServiceURL();
+ } catch (java.lang.Exception ex)
+ {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent)
+ {
+ return new java.lang.String();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setRequired(true);
+ desc.setMultivalued(true);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _serviceURLList
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(1);
+ { // -- local scope
}
+ desc.setValidator(fieldValidator);
+ // -- _parameters
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
+ java.lang.String.class, "_parameters", "parameters",
+ org.exolab.castor.xml.NodeType.Element);
+ desc.setImmutable(true);
+ handler = new org.exolab.castor.xml.XMLFieldHandler()
+ {
+ public java.lang.Object getValue(java.lang.Object object)
+ throws IllegalStateException
+ {
+ WebServiceParameterSet target = (WebServiceParameterSet) object;
+ return target.getParameters();
+ }
- /**
- * Method isElementDefinition.
- *
- * @return true if XML schema definition of this Class is that
- * of a global
- * element or element with anonymous type definition.
- */
- public boolean isElementDefinition(
- ) {
- return _elementDefinition;
+ public void setValue(java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException
+ {
+ try
+ {
+ WebServiceParameterSet target = (WebServiceParameterSet) object;
+ target.setParameters((java.lang.String) value);
+ } catch (java.lang.Exception ex)
+ {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
+
+ public java.lang.Object newInstance(java.lang.Object parent)
+ {
+ return null;
+ }
+ };
+ desc.setHandler(handler);
+ desc.setRequired(true);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ // -- validation code for: _parameters
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(1);
+ { // -- local scope
+ org.exolab.castor.xml.validators.StringValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.StringValidator();
+ fieldValidator.setValidator(typeValidator);
+ typeValidator.setWhiteSpace("preserve");
}
+ desc.setValidator(fieldValidator);
+ }
+
+ // -----------/
+ // - Methods -/
+ // -----------/
+
+ /**
+ * Method getAccessMode.
+ *
+ * @return the access mode specified for this class.
+ */
+ public org.exolab.castor.mapping.AccessMode getAccessMode()
+ {
+ return null;
+ }
+
+ /**
+ * Method getIdentity.
+ *
+ * @return the identity field, null if this class has no identity.
+ */
+ public org.exolab.castor.mapping.FieldDescriptor getIdentity()
+ {
+ return super.getIdentity();
+ }
+
+ /**
+ * Method getJavaClass.
+ *
+ * @return the Java class represented by this descriptor.
+ */
+ public java.lang.Class getJavaClass()
+ {
+ return jalview.schemabinding.version2.WebServiceParameterSet.class;
+ }
+
+ /**
+ * Method getNameSpacePrefix.
+ *
+ * @return the namespace prefix to use when marshaling as XML.
+ */
+ public java.lang.String getNameSpacePrefix()
+ {
+ return _nsPrefix;
+ }
+
+ /**
+ * Method getNameSpaceURI.
+ *
+ * @return the namespace URI used when marshaling and unmarshaling as XML.
+ */
+ public java.lang.String getNameSpaceURI()
+ {
+ return _nsURI;
+ }
+
+ /**
+ * Method getValidator.
+ *
+ * @return a specific validator for the class described by this
+ * ClassDescriptor.
+ */
+ public org.exolab.castor.xml.TypeValidator getValidator()
+ {
+ return this;
+ }
+
+ /**
+ * Method getXMLName.
+ *
+ * @return the XML Name for the Class being described.
+ */
+ public java.lang.String getXMLName()
+ {
+ return _xmlName;
+ }
+
+ /**
+ * Method isElementDefinition.
+ *
+ * @return true if XML schema definition of this Class is that of a global
+ * element or element with anonymous type definition.
+ */
+ public boolean isElementDefinition()
+ {
+ return _elementDefinition;
+ }
}
colhash.put("ORANGE", new Color((float) 0.9, (float) 0.6, (float) 0.3));
colhash.put("CYAN", new Color((float) 0.1, (float) 0.7, (float) 0.7));
colhash.put("PINK", new Color((float) 0.9, (float) 0.5, (float) 0.5));
- colhash
- .put("MAGENTA",
- new Color((float) 0.8, (float) 0.3, (float) 0.8));
+ colhash.put("MAGENTA", new Color((float) 0.8, (float) 0.3, (float) 0.8));
colhash.put("YELLOW", new Color((float) 0.8, (float) 0.8, (float) 0.0));
}
tmp6[0] = conses[3]; // -
tmp6[1] = conses[29]; // D
tmp6[2] = conses[10]; // E
- tmp6[3] = conses[6]; // QE
+ tmp6[3] = conses[6]; // QE
tmp6[4] = conses[19]; // Q
tmp6[5] = conses[2]; // DE
colours[5] = new ConsensusColour((Color) colhash.get("MAGENTA"), tmp6);
public static final Color[] pidColours =
{ midBlue, new Color(153, 153, 255),
- // Color.lightGray,
+ // Color.lightGray,
new Color(204, 204, 255), };
public static final float[] pidThresholds =
// testing part
// you may omit this part for your application
- //
+ //
System.out.println("Hello World 2");
System.out.println("All fonts available to Graphic2D:\n");
GraphicsEnvironment ge = GraphicsEnvironment
if ((refb.getMap().getMap() == null && refa.getMap().getMap() == null)
|| (refb.getMap().getMap() != null
&& refa.getMap().getMap() != null && refb
- .getMap().getMap().getInverse().equals(
- refa.getMap().getMap())))
+ .getMap().getMap().getInverse()
+ .equals(refa.getMap().getMap())))
{
return true;
}
}
}
-/**
+ /**
* Formats the number following printf conventions. Main limitation: Can only
* handle one format parameter at a time Use multiple Format objects to format
* more than one number
*
* @param s
- * the format string following printf conventions The string
- * has a prefix, a format code and a suffix. The prefix and
- * suffix become part of the formatted output. The format code
- * directs the formatting of the (single) parameter to be
- * formatted. The code has the following structure
- * <ul>
- * <li> a % (required)
- * <li> a modifier (optional)
- * <dl>
- * <dt> +
- * <dd> forces display of + for positive numbers
- * <dt> 0
- * <dd> show leading zeroes
- * <dt> -
- * <dd> align left in the field
- * <dt> space
- * <dd> prepend a space in front of positive numbers
- * <dt> #
- * <dd> use "alternate" format. Add 0 or 0x for octal or
- * hexadecimal numbers. Don't suppress trailing zeroes in
- * general floating point format.
- * </dl>
- * <li> an integer denoting field width (optional)
- * <li> a period followed by an integer denoting precision
- * (optional)
- * <li> a format descriptor (required)
- * <dl>
- * <dt>f
- * <dd> floating point number in fixed format
- * <dt>e, E
- * <dd> floating point number in exponential notation
- * (scientific format). The E format results in an uppercase E
- * for the exponent (1.14130E+003), the e format in a lowercase
- * e.
- * <dt>g, G
- * <dd> floating point number in general format (fixed format
- * for small numbers, exponential format for large numbers).
- * Trailing zeroes are suppressed. The G format results in an
- * uppercase E for the exponent (if any), the g format in a
- * lowercase e.
- * <dt>d, i
- * <dd> integer in decimal
- * <dt>x
- * <dd> integer in hexadecimal
- * <dt>o
- * <dd> integer in octal
- * <dt>s
- * <dd> string
- * <dt>c
- * <dd> character
- * </dl>
- * </ul>
+ * the format string following printf conventions The string has a
+ * prefix, a format code and a suffix. The prefix and suffix become
+ * part of the formatted output. The format code directs the
+ * formatting of the (single) parameter to be formatted. The code has
+ * the following structure
+ * <ul>
+ * <li>a % (required)
+ * <li>a modifier (optional)
+ * <dl>
+ * <dt>+
+ * <dd>forces display of + for positive numbers
+ * <dt>0
+ * <dd>show leading zeroes
+ * <dt>-
+ * <dd>align left in the field
+ * <dt>space
+ * <dd>prepend a space in front of positive numbers
+ * <dt>#
+ * <dd>use "alternate" format. Add 0 or 0x for octal or hexadecimal
+ * numbers. Don't suppress trailing zeroes in general floating point
+ * format.
+ * </dl>
+ * <li>an integer denoting field width (optional)
+ * <li>a period followed by an integer denoting precision (optional)
+ * <li>a format descriptor (required)
+ * <dl>
+ * <dt>f
+ * <dd>floating point number in fixed format
+ * <dt>e, E
+ * <dd>floating point number in exponential notation (scientific
+ * format). The E format results in an uppercase E for the exponent
+ * (1.14130E+003), the e format in a lowercase e.
+ * <dt>g, G
+ * <dd>floating point number in general format (fixed format for
+ * small numbers, exponential format for large numbers). Trailing
+ * zeroes are suppressed. The G format results in an uppercase E for
+ * the exponent (if any), the g format in a lowercase e.
+ * <dt>d, i
+ * <dd>integer in decimal
+ * <dt>x
+ * <dd>integer in hexadecimal
+ * <dt>o
+ * <dd>integer in octal
+ * <dt>s
+ * <dd>string
+ * <dt>c
+ * <dd>character
+ * </dl>
+ * </ul>
* @exception IllegalArgumentException
- * if bad format
+ * if bad format
*
*/
public static String getHexString(java.awt.Color color)
JalviewFileChooser getPNGChooser()
{
- return new jalview.io.JalviewFileChooser(jalview.bin.Cache
- .getProperty("LAST_DIRECTORY"), new String[]
- { "png" }, new String[]
- { "Portable network graphics" }, "Portable network graphics");
+ return new jalview.io.JalviewFileChooser(
+ jalview.bin.Cache.getProperty("LAST_DIRECTORY"), new String[]
+ { "png" }, new String[]
+ { "Portable network graphics" }, "Portable network graphics");
}
JalviewFileChooser getEPSChooser()
{
- return new jalview.io.JalviewFileChooser(jalview.bin.Cache
- .getProperty("LAST_DIRECTORY"), new String[]
- { "eps" }, new String[]
- { "Encapsulated Postscript" }, "Encapsulated Postscript");
+ return new jalview.io.JalviewFileChooser(
+ jalview.bin.Cache.getProperty("LAST_DIRECTORY"), new String[]
+ { "eps" }, new String[]
+ { "Encapsulated Postscript" }, "Encapsulated Postscript");
}
}
JLabel l = (JLabel) c;\r
l.setHorizontalTextPosition(JLabel.LEFT);\r
int modelColumn = table.convertColumnIndexToModel(column);\r
- l\r
- .setIcon(getHeaderRendererIcon(modelColumn, l.getFont()\r
- .getSize()));\r
+ l.setIcon(getHeaderRendererIcon(modelColumn, l.getFont().getSize()));\r
}\r
return c;\r
}\r
* view that this job was associated with
*/
protected AlignmentI currentView = null;
+
/**
* feature settings from view that job was associated with
*/
protected FeatureRendererSettings featureSettings = null;
+
/**
* metadata about this web service
*/
protected WebserviceInfo wsInfo = null;
+
/**
* original input data for this job
*/
protected AlignmentView input = null;
+
/**
* dataset sequence relationships to be propagated onto new results
*/
protected AlignedCodonFrame[] codonframe = null;
+
/**
* are there jobs still running in this thread.
*/
protected boolean jobComplete = false;
+
/**
* one or more jobs being managed by this thread.
*/
protected AWsJob jobs[] = null;
+
/**
* full name of service
*/
protected String WebServiceName = null;
+
protected char defGapChar = '-';
+
/**
* header prepended to all output from job
*/
protected String OutputHeader;
/**
- * only used when reporting a web service out of memory error - the job ID will be concatenated to the URL
+ * only used when reporting a web service out of memory error - the job ID
+ * will be concatenated to the URL
*/
protected String WsUrl = null;
/**
- * generic web service job/subjob poll loop
+ * generic web service job/subjob poll loop
*/
public void run()
{
}
}
-
public AWSThread()
{
super();
/**
* helper function to conserve dataset references to sequence objects returned
* from web services 1. Propagates AlCodonFrame data from
- * <code>codonframe</code> to <code>al</code>
- * TODO: refactor to datamodel
+ * <code>codonframe</code> to <code>al</code> TODO: refactor to datamodel
+ *
* @param al
*/
public void propagateDatasetMappings(Alignment al)
protected String jobId;
/**
- * @param jobId the jobId to set
+ * @param jobId
+ * the jobId to set
*/
public void setJobId(String jobId)
{
int allowedServerExceptions = 3;
/**
- * @param allowedServerExceptions the allowedServerExceptions to set
+ * @param allowedServerExceptions
+ * the allowedServerExceptions to set
*/
public void setAllowedServerExceptions(int allowedServerExceptions)
{
protected boolean submitted = false;
/**
- * @param jobnum the jobnum to set
+ * @param jobnum
+ * the jobnum to set
*/
public void setJobnum(int jobnum)
{
}
/**
- * @param submitted the submitted to set
+ * @param submitted
+ * the submitted to set
*/
public void setSubmitted(boolean submitted)
{
}
/**
- * @param subjobComplete the subjobComplete to set
+ * @param subjobComplete
+ * the subjobComplete to set
*/
public void setSubjobComplete(boolean subjobComplete)
{
abstract public String getStatus();
abstract public boolean hasResponse();
+
abstract public void clearResponse();
+
abstract public String getState();
+
/**
* generates response using the abstract service flags.
- * @return a standard state response
+ *
+ * @return a standard state response
*/
- protected String _defaultState() {
-
+ protected String _defaultState()
+ {
+
String state = "";
return state;
}
String[] defdb = null, otherdb = sfetcher\r
.getDbInstances(jalview.ws.dbsources.DasSequenceSource.class);\r
Vector selsources = new Vector(), dasselsrc = (af.featureSettings != null) ? af.featureSettings\r
- .getSelectedSources()\r
- : new jalview.gui.DasSourceBrowser().getSelectedSources();\r
+ .getSelectedSources() : new jalview.gui.DasSourceBrowser()\r
+ .getSelectedSources();\r
Enumeration en = dasselsrc.elements();\r
while (en.hasMoreElements())\r
{\r
{\r
String[] newsrc = new String[dbSources.length + otherdb.length];\r
System.arraycopy(dbSources, 0, newsrc, 0, dbSources.length);\r
- System\r
- .arraycopy(otherdb, 0, newsrc, dbSources.length,\r
- otherdb.length);\r
+ System.arraycopy(otherdb, 0, newsrc, dbSources.length, otherdb.length);\r
dbSources = newsrc;\r
}\r
}\r
for (int j = 0; j < uprefs.length; j++)\r
{\r
addSeqId(sequence, uprefs[j].getAccessionId());\r
- queries\r
- .addElement(uprefs[j].getAccessionId()\r
- .toUpperCase());\r
+ queries.addElement(uprefs[j].getAccessionId().toUpperCase());\r
}\r
}\r
else\r
try\r
{\r
presp = picrClient\r
- .getUPIForAccession(token, null, picrClient\r
- .getMappedDatabaseNames(), null, true);\r
+ .getUPIForAccession(token, null,\r
+ picrClient.getMappedDatabaseNames(),\r
+ null, true);\r
} catch (Exception e)\r
{\r
System.err.println("Exception with Picr for '" + token\r
} // all databases have been queries.\r
if (sbuffer.length() > 0)\r
{\r
- output\r
- .setText("Your sequences have been verified against known sequence databases. Some of the ids have been\n"\r
- + "altered, most likely the start/end residue will have been updated.\n"\r
- + "Save your alignment to maintain the updated id.\n\n"\r
- + sbuffer.toString());\r
+ output.setText("Your sequences have been verified against known sequence databases. Some of the ids have been\n"\r
+ + "altered, most likely the start/end residue will have been updated.\n"\r
+ + "Save your alignment to maintain the updated id.\n\n"\r
+ + sbuffer.toString());\r
Desktop.addInternalFrame(output, "Sequence names updated ", 600, 300);\r
// The above is the dataset, we must now find out the index\r
// of the viewed sequence\r
// taking into account all accessionIds and names in the file\r
Vector sequenceMatches = new Vector();\r
// look for corresponding accession ids\r
- DBRefEntry[] entryRefs = jalview.util.DBRefUtils.selectRefs(entry\r
- .getDBRef(), new String[]\r
- { dbSource });\r
+ DBRefEntry[] entryRefs = jalview.util.DBRefUtils.selectRefs(\r
+ entry.getDBRef(), new String[]\r
+ { dbSource });\r
if (entryRefs == null)\r
{\r
System.err\r
}\r
} catch (Exception ex)\r
{\r
- debug(\r
- "Exception whilst setting default feature sources from registry and local preferences.",\r
+ debug("Exception whilst setting default feature sources from registry and local preferences.",\r
ex);\r
}\r
}\r
for (int i = 0; i < features.length; i++)\r
{\r
// standard DAS feature-> jalview sequence feature transformation\r
- SequenceFeature f = newSequenceFeature(features[i], source\r
- .getNickname());\r
+ SequenceFeature f = newSequenceFeature(features[i],\r
+ source.getNickname());\r
if (!parseSeqFeature(seq, f, features[i], source))\r
{\r
if (dbref.getMap() != null && f.getBegin() > 0\r
for (int i = 0; i < features.length; i++)\r
{\r
// standard DAS feature-> jalview sequence feature transformation\r
- SequenceFeature f = newSequenceFeature(features[i], source\r
- .getNickname());\r
+ SequenceFeature f = newSequenceFeature(features[i],\r
+ source.getNickname());\r
if (!parseSeqFeature(seq, f, features[i], source))\r
{\r
// just add as a simple sequence feature\r
{\r
}\r
\r
- SequenceFeature f = new SequenceFeature((String) dasfeature\r
- .get("TYPE"), desc, start, end, score, nickname);\r
+ SequenceFeature f = new SequenceFeature(\r
+ (String) dasfeature.get("TYPE"), desc, start, end, score,\r
+ nickname);\r
\r
if (dasfeature.containsKey("LINK"))\r
{\r
* Object array returned from the makeUrlStubs function.
*/
private void addshowLink(JMenu linkMenu, String label, String descr,
- String dbname, final GroupUrlLink urlgenerator, final Object[] urlstub)
+ String dbname, final GroupUrlLink urlgenerator,
+ final Object[] urlstub)
{
Component[] jmi = linkMenu.getMenuComponents();
for (int i = 0; i < jmi.length; i++)
boolean seqsorids = (urlgenerator.getGroupURLType() & urlgenerator.SEQUENCEIDS) == 0;
int i = urlgenerator.getNumberInvolved(urlstub);
JMenuItem item = new JMenuItem(label);
- //
- if (dbname==null || dbname.trim().length()==0)
+ //
+ if (dbname == null || dbname.trim().length() == 0)
{
dbname = "";
}
item.setToolTipText("<html>"
- + JvSwingUtils.wrapTooltip("Submit " + i + " " +
- dbname +" "
- + (seqsorids ? "sequence" : "sequence id") + (i > 1 ? "s" : "")
-
- + " to<br/>" + descr) + "</html>");
+ + JvSwingUtils.wrapTooltip("Submit " + i + " " + dbname + " "
+ + (seqsorids ? "sequence" : "sequence id")
+ + (i > 1 ? "s" : "")
+
+ + " to<br/>" + descr) + "</html>");
item.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(ActionEvent e)
public void run()
{
- try {
+ try
+ {
showLink(urlgenerator.constructFrom(urlstub));
} catch (UrlStringTooLongException ex)
{
*/
private JMenu buildGroupURLMenu(SequenceI[] seqs, SequenceGroup sg)
{
- if (groupURLdescr==null || groupURLLinks==null)
+ if (groupURLdescr == null || groupURLLinks == null)
return null;
// TODO: usability: thread off the generation of group url content so root
// menu appears asap
/**
* last number of sequences where URL generation failed
*/
- int[] nsqtype = new int[] { 0,0,0,0,0,0,0,0,0,0};
+ int[] nsqtype = new int[]
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
for (int i = 0; i < groupURLLinks.size(); i++)
{
String link = (String) groupURLLinks.elementAt(i);
String[] allids = ((String[]) idset[1]);
seqstr = new String[numinput];
ids = new String[numinput];
- if (nsqtype[urlLink.getGroupURLType()]>0 && numinput>=nsqtype[urlLink.getGroupURLType()])
+ if (nsqtype[urlLink.getGroupURLType()] > 0
+ && numinput >= nsqtype[urlLink.getGroupURLType()])
{
continue;
}
seqstr[idcount++] = idandseqs[1][sq];
}
}
- try {createAndAddLinks(wflinkMenus, false, urlLink, ltarget, null,
- descr, ids, seqstr);
+ try
+ {
+ createAndAddLinks(wflinkMenus, false, urlLink, ltarget, null,
+ descr, ids, seqstr);
} catch (UrlStringTooLongException ex)
{
nsqtype[urlLink.getGroupURLType()] = numinput;
// also do names only.
seqstr = idandseqs[1];
ids = idandseqs[0];
- if (nsqtype[urlLink.getGroupURLType()]>0 && idandseqs[0].length>=nsqtype[urlLink.getGroupURLType()])
+ if (nsqtype[urlLink.getGroupURLType()] > 0
+ && idandseqs[0].length >= nsqtype[urlLink.getGroupURLType()])
{
continue;
}
-
- try {createAndAddLinks(wflinkMenus, true, urlLink, "Any", null, descr,
- ids, seqstr);
- }catch (UrlStringTooLongException ex)
+
+ try
+ {
+ createAndAddLinks(wflinkMenus, true, urlLink, "Any", null, descr,
+ ids, seqstr);
+ } catch (UrlStringTooLongException ex)
{
nsqtype[urlLink.getGroupURLType()] = idandseqs[0].length;
}
GroupUrlLink urlLink, String label, String ltarget, String descr,
String[] ids, String[] seqstr) throws UrlStringTooLongException
{
- Object[] urlset= urlLink.makeUrlStubs(ids, seqstr, "FromJalview"
+ Object[] urlset = urlLink.makeUrlStubs(ids, seqstr, "FromJalview"
+ System.currentTimeMillis(), false);
if (urlset != null)
}
return false;
}
+
// / end of stuff copied from popupmenu
public void attachWSMenuEntry(final JMenu wsmenu,
final AlignFrame alignFrame)
{
if (refresh && !isRunning())
{
- new Thread(new Runnable() {
- public void run() {
- try
- {
- buildGroupLinkMenu(enfinServiceMenu, alignFrame);
- } catch (OutOfMemoryError ex)
+ new Thread(new Runnable()
{
- Cache.log.error(
- "Out of memory when calculating the Envision2 links.",
- ex);
- enfinServiceMenu.setEnabled(false);
- }
- }}).start();
+ public void run()
+ {
+ try
+ {
+ buildGroupLinkMenu(enfinServiceMenu, alignFrame);
+ } catch (OutOfMemoryError ex)
+ {
+ Cache.log
+ .error("Out of memory when calculating the Envision2 links.",
+ ex);
+ enfinServiceMenu.setEnabled(false);
+ }
+ }
+ }).start();
refresh = false;
}
}
{
serror++;
j.subjobComplete = true;
- wsInfo
- .setStatus(j.jobnum,
- WebserviceInfo.STATE_STOPPED_SERVERERROR);
+ wsInfo.setStatus(j.jobnum, WebserviceInfo.STATE_STOPPED_SERVERERROR);
}
else if (j.isBroken())
{
wsInfo.appendProgressText(j.jobnum, progheader);
if (j.hasStatus())
{
- // Could try to squash OOMs here, but it usually doesn't help - there probably won't be
+ // Could try to squash OOMs here, but it usually doesn't help - there
+ // probably won't be
// enough memory to handle the results later on anyway.
// try {
wsInfo.appendProgressText(j.jobnum, j.getStatus());
*/
package jalview.ws;
-
import jalview.gui.*;
public abstract class WSClient // implements WSMenuEntryProviderI
File reply;\r
try\r
{\r
- reply = dbFetch.fetchDataAsFile(emprefx.toLowerCase() + ":"\r
- + query.trim(), "emblxml", null);\r
+ reply = dbFetch.fetchDataAsFile(\r
+ emprefx.toLowerCase() + ":" + query.trim(), "emblxml", null);\r
} catch (Exception e)\r
{\r
stopQuery();\r
{\r
// query of form\r
// http://www.genedb.org/genedb/ArtemisFormHandler?id=&dest=EMBL\r
- // \r
+ //\r
return getEmblSequenceRecords(DBRefSource.GENEDB, queries);\r
}\r
\r
}\r
Sequence sq = new Sequence(e.getAccessionCode(), e.getSequence());\r
sq.addDBRef(new DBRefEntry(oursource.getDbSource(), oursource\r
- .getDbVersion()\r
- + ":" + e.getVersion(), e.getAccessionCode()));\r
+ .getDbVersion() + ":" + e.getVersion(), e.getAccessionCode()));\r
seqs.addElement(sq);\r
called = true;\r
}\r
{\r
try\r
{\r
- call\r
- .setOperationName(new QName("urn:Dbfetch",\r
- "getSupportedFormats"));\r
+ call.setOperationName(new QName("urn:Dbfetch", "getSupportedFormats"));\r
call.setReturnType(XMLType.SOAP_ARRAY);\r
\r
return (String[]) call.invoke(new Object[]\r
private java.beans.PropertyChangeSupport changeSupport = new java.beans.PropertyChangeSupport(
this);
+
/**
* change listeners are notified of "services" property changes
*
} catch (Exception ex)
{
jalview.bin.Cache.log
- .warn(
- "Error parsing comma separated list of urls in DISCOVERY_URLS.",
+ .warn("Error parsing comma separated list of urls in DISCOVERY_URLS.",
ex);
}
if (urls.size() > 0)
String altitle = "JNet prediction on " + seq.getName()
+ " using alignment from " + title;
- wsInfo
- .setProgressText("Job details for MSA based prediction ("
- + title
- + ") on sequence :\n>"
- + seq.getName()
- + "\n"
- + AlignSeq
- .extractGaps("-. ", seq.getSequenceAsString())
- + "\n");
+ wsInfo.setProgressText("Job details for MSA based prediction (" + title
+ + ") on sequence :\n>" + seq.getName() + "\n"
+ + AlignSeq.extractGaps("-. ", seq.getSequenceAsString()) + "\n");
SequenceI aln[] = new SequenceI[msf.length];
for (int i = 0, j = msf.length; i < j; i++)
{
{
wsInfo = setWebService();
}
- wsInfo
- .setProgressText("Job details for prediction on sequence :\n>"
- + seq.getName()
- + "\n"
- + AlignSeq
- .extractGaps("-. ", seq.getSequenceAsString())
- + "\n");
+ wsInfo.setProgressText("Job details for prediction on sequence :\n>"
+ + seq.getName() + "\n"
+ + AlignSeq.extractGaps("-. ", seq.getSequenceAsString()) + "\n");
String altitle = "JNet prediction for sequence " + seq.getName()
+ " from " + title;
if (msa.getSequences().length == 1)
{
// Single Sequence prediction
- new jalview.ws.jws1.JPredClient(sh, af.getTitle(), false, msa, af,
- true);
+ new jalview.ws.jws1.JPredClient(sh, af.getTitle(), false, msa,
+ af, true);
}
else
{
if (msa.getSequences().length > 1)
{
// Sequence profile based prediction
- new jalview.ws.jws1.JPredClient(sh, af.getTitle(), true, msa, af,
- true);
+ new jalview.ws.jws1.JPredClient(sh, af.getTitle(), true, msa,
+ af, true);
}
}
}
jalview.bin.Cache.log.debug("Parsing output from JNet job.");
// JPredFile prediction = new JPredFile("C:/JalviewX/files/jpred.txt",
// "File");
- jalview.io.JPredFile prediction = new jalview.io.JPredFile(result
- .getPredfile(), "Paste");
+ jalview.io.JPredFile prediction = new jalview.io.JPredFile(
+ result.getPredfile(), "Paste");
SequenceI[] preds = prediction.getSeqsAsArray();
jalview.bin.Cache.log.debug("Got prediction profile.");
jalview.bin.Cache.log.debug("Getting associated alignment.");
// we ignore the returned alignment if we only predicted on a single
// sequence
- String format = new jalview.io.IdentifyFile().Identify(result
- .getAligfile(), "Paste");
+ String format = new jalview.io.IdentifyFile().Identify(
+ result.getAligfile(), "Paste");
if (jalview.io.FormatAdapter.isValidFormat(format))
{
profileseq.setSequence(sqs[msaIndex].getSequenceAsString());
}
- if (!jalview.analysis.SeqsetUtils.SeqCharacterUnhash(al
- .getSequenceAt(FirstSeq), SequenceInfo))
+ if (!jalview.analysis.SeqsetUtils.SeqCharacterUnhash(
+ al.getSequenceAt(FirstSeq), SequenceInfo))
{
throw (new Exception(
"Couldn't recover sequence properties for JNet Query sequence!"));
{
super();
this.predMap = delMap;
- String sq = AlignSeq.extractGaps(Comparison.GapChars, seq
- .getSequenceAsString());
+ String sq = AlignSeq.extractGaps(Comparison.GapChars,
+ seq.getSequenceAsString());
if (sq.length() >= 20)
{
this.SequenceInfo = SequenceInfo;
wsInfo.setStatus(WebserviceInfo.STATE_STOPPED_SERVERERROR);
if (e.getMessage().indexOf("Exception") > -1)
{
- wsInfo
- .setStatus(j.getJobnum(),
- WebserviceInfo.STATE_STOPPED_SERVERERROR);
- wsInfo
- .setProgressText(
- j.getJobnum(),
- "Failed to submit the prediction. (Just close the window)\n"
- + "It is most likely that there is a problem with the server.\n");
+ wsInfo.setStatus(j.getJobnum(),
+ WebserviceInfo.STATE_STOPPED_SERVERERROR);
+ wsInfo.setProgressText(
+ j.getJobnum(),
+ "Failed to submit the prediction. (Just close the window)\n"
+ + "It is most likely that there is a problem with the server.\n");
System.err
.println("JPredWS Client: Failed to submit the prediction. Quite possibly because of a server error - see below)\n"
+ e.getMessage() + "\n");
"Failed to submit the prediction:\n" + e.getMessage()
+ wsInfo.getProgressText());
- jalview.bin.Cache.log.debug("Failed Submission of job " + j.getJobnum(),
- e);
+ jalview.bin.Cache.log.debug(
+ "Failed Submission of job " + j.getJobnum(), e);
}
j.setAllowedServerExceptions(-1);
{
jalview.bin.Cache.log.error(
"JNet Client: JPred Annotation Parse Error", e);
- wsInfo.setStatus(j.getJobnum(), WebserviceInfo.STATE_STOPPED_ERROR);
+ wsInfo.setStatus(j.getJobnum(),
+ WebserviceInfo.STATE_STOPPED_ERROR);
wsInfo.appendProgressText(j.getJobnum(), OutputHeader + "\n"
+ j.result.getStatus()
+ "\nInvalid JNet job result data!\n" + e.getMessage());
public void pollJob(AWsJob job) throws Exception
{
- ((JPredJob)job).result = server.getresult(job.getJobId());
+ ((JPredJob) job).result = server.getresult(job.getJobId());
}
public boolean isCancellable()
import jalview.ws.AWSThread;
/**
- * specific methods for Jalview WS1 web service jobs
- * (will probably disappear)
+ * specific methods for Jalview WS1 web service jobs (will probably disappear)
+ *
* @author JimP
- *
+ *
*/
public abstract class JWS1Thread extends AWSThread
{
if ((wsInfo = setWebService(sh)) == null)
{
- JOptionPane.showMessageDialog(Desktop.desktop,
+ JOptionPane.showMessageDialog(
+ Desktop.desktop,
"The Multiple Sequence Alignment Service named "
+ sh.getName() + " is unknown",
"Internal Jalview Error", JOptionPane.WARNING_MESSAGE);
public void actionPerformed(ActionEvent e)
{
AlignmentView msa = alignFrame.gatherSequencesForAlignment();
- new jalview.ws.jws1.MsaWSClient(serviceHandle, alignFrame.getTitle(),
- msa, false, true, alignFrame.getViewport().getAlignment()
- .getDataset(), alignFrame);
+ new jalview.ws.jws1.MsaWSClient(serviceHandle, alignFrame
+ .getTitle(), msa, false, true, alignFrame.getViewport()
+ .getAlignment().getDataset(), alignFrame);
}
public void actionPerformed(ActionEvent e)
{
AlignmentView msa = alignFrame.gatherSequencesForAlignment();
- new jalview.ws.jws1.MsaWSClient(serviceHandle, alignFrame.getTitle(),
- msa, true, true, alignFrame.getViewport().getAlignment()
- .getDataset(), alignFrame);
+ new jalview.ws.jws1.MsaWSClient(serviceHandle, alignFrame
+ .getTitle(), msa, true, true, alignFrame.getViewport()
+ .getAlignment().getDataset(), alignFrame);
}
// for
// any
// subjob
- SeqNames.put(newname, jalview.analysis.SeqsetUtils
- .SeqCharacterHash(seqs[i]));
+ SeqNames.put(newname,
+ jalview.analysis.SeqsetUtils.SeqCharacterHash(seqs[i]));
if (valid && seqs[i].getEnd() - seqs[i].getStart() > minlen - 1)
{
seqarray[n] = new vamsas.objects.simple.Sequence();
if (seqs[i].getEnd() >= seqs[i].getStart())
{
empty = (submitGaps) ? seqs[i].getSequenceAsString() : AlignSeq
- .extractGaps(jalview.util.Comparison.GapChars, seqs[i]
- .getSequenceAsString());
+ .extractGaps(jalview.util.Comparison.GapChars,
+ seqs[i].getSequenceAsString());
}
emptySeqs.add(new String[]
{ newname, empty });
}
if (njobs > 0)
{
- wsinfo
- .setProgressName("region " + jobs[j].getJobnum(),
- jobs[j].getJobnum());
+ wsinfo.setProgressName("region " + jobs[j].getJobnum(),
+ jobs[j].getJobnum());
}
wsinfo.setProgressText(jobs[j].getJobnum(), OutputHeader);
}
cancelledMessage += ("\nProblems cancelling the job : Exception received...\n"
+ exc + "\n");
Cache.log.warn(
- "Exception whilst cancelling " + jobs[job].getJobId(), exc);
+ "Exception whilst cancelling " + jobs[job].getJobId(),
+ exc);
}
wsInfo.setProgressText(jobs[job].getJobnum(), OutputHeader
+ cancelledMessage + "\n");
{
if (!jobComplete)
{
- wsInfo
- .setProgressText(OutputHeader
- + "Server cannot cancel this job because it has not been submitted properly. just close the window.\n");
+ wsInfo.setProgressText(OutputHeader
+ + "Server cannot cancel this job because it has not been submitted properly. just close the window.\n");
}
}
}
+ e.toString() + "\n");
j.setAllowedServerExceptions(0);
wsInfo.setStatus(WebserviceInfo.STATE_STOPPED_SERVERERROR);
- wsInfo.setStatus(j.getJobnum(), 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");
+ wsInfo.setStatus(j.getJobnum(),
+ 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");
// e.printStackTrace(); // TODO: JBPNote DEBUG
}
for (int i = 0, j = seqs.length; i < j; i++)
{
- msa[i] = new jalview.datamodel.Sequence(seqs[i].getId(), seqs[i]
- .getSeq());
+ msa[i] = new jalview.datamodel.Sequence(seqs[i].getId(),
+ seqs[i].getSeq());
}
return msa;
&& jobs[j].hasResults())
{
results++;
- //if (Cache.log.isDebugEnabled())
- // {
- // System.out.println("Job lob for job "+jobs[j].getJobId()+":"+jobs[j].getJobnum());
- // System.out.println(jobs[j].getStatus());
- // }
+ // if (Cache.log.isDebugEnabled())
+ // {
+ // System.out.println("Job lob for job "+jobs[j].getJobId()+":"+jobs[j].getJobnum());
+ // System.out.println(jobs[j].getStatus());
+ // }
- vamsas.objects.simple.Alignment valign = ((MsaResult)((MsaWSJob) jobs[j]).result)
+ vamsas.objects.simple.Alignment valign = ((MsaResult) ((MsaWSJob) jobs[j]).result)
.getMsa();
if (valign != null)
{
String[] lines = valign.getMethod();
for (int line = 0; line < lines.length; line++)
{
- wsInfo.appendProgressText(jobs[j].getJobnum(), lines[line] + "\n");
+ wsInfo.appendProgressText(jobs[j].getJobnum(), lines[line]
+ + "\n");
}
// JBPNote The returned files from a webservice could be
// hidden behind icons in the monitor window that,
// when clicked, pop up their corresponding data
-
+
}
}
}
}
for (int i = 0, l = alorders.size(); i < l; i++)
{
- af.addSortByOrderMenuItem(WebServiceName
- + ((String) names.get(i)) + " Ordering",
+ af.addSortByOrderMenuItem(
+ WebServiceName + ((String) names.get(i)) + " Ordering",
(AlignmentOrder) alorders.get(i));
}
}
String dbs[] = null;
try
{
- dbs = new jalview.ws.jws1.SeqSearchWSClient(sh).getSupportedDatabases();
+ dbs = new jalview.ws.jws1.SeqSearchWSClient(sh)
+ .getSupportedDatabases();
} catch (Exception e)
{
jalview.bin.Cache.log.warn(
// use same input gatherer as for secondary structure prediction
// we could actually parameterise the gatherer method here...
AlignmentView msa = af.gatherSeqOrMsaForSecStrPrediction();
- new jalview.ws.jws1.SeqSearchWSClient(sh, af.getTitle(), msa, null, af
- .getViewport().getAlignment().getDataset(), af);
+ new jalview.ws.jws1.SeqSearchWSClient(sh, af.getTitle(), msa, null,
+ af.getViewport().getAlignment().getDataset(), af);
}
});
// add entry for each database the service supports
// for
// any
// subjob
- SeqNames.put(newname, jalview.analysis.SeqsetUtils
- .SeqCharacterHash(seqs[i]));
+ SeqNames.put(newname,
+ jalview.analysis.SeqsetUtils.SeqCharacterHash(seqs[i]));
if (valid && seqs[i].getEnd() - seqs[i].getStart() > minlen - 1)
{
seqarray[n] = new vamsas.objects.simple.Sequence();
if (seqs[i].getEnd() >= seqs[i].getStart())
{
empty = (submitGaps) ? seqs[i].getSequenceAsString() : AlignSeq
- .extractGaps(jalview.util.Comparison.GapChars, seqs[i]
- .getSequenceAsString());
+ .extractGaps(jalview.util.Comparison.GapChars,
+ seqs[i].getSequenceAsString());
}
emptySeqs.add(new String[]
{ newname, empty });
}
if (njobs > 0)
{
- wsinfo
- .setProgressName("region " + jobs[j].getJobnum(),
- jobs[j].getJobnum());
+ wsinfo.setProgressName("region " + jobs[j].getJobnum(),
+ jobs[j].getJobnum());
}
wsinfo.setProgressText(jobs[j].getJobnum(), OutputHeader);
}
cancelledMessage += ("\nProblems cancelling the job : Exception received...\n"
+ exc + "\n");
Cache.log.warn(
- "Exception whilst cancelling " + jobs[job].getJobId(), exc);
+ "Exception whilst cancelling " + jobs[job].getJobId(),
+ exc);
}
wsInfo.setProgressText(jobs[job].getJobnum(), OutputHeader
+ cancelledMessage + "\n");
{
if (!jobComplete)
{
- wsInfo
- .setProgressText(OutputHeader
- + "Server cannot cancel this job because it has not been submitted properly. just close the window.\n");
+ wsInfo.setProgressText(OutputHeader
+ + "Server cannot cancel this job because it has not been submitted properly. just close the window.\n");
}
}
}
public void pollJob(AWsJob job) throws Exception
{
- ((SeqSearchWSJob) job).result = server
- .getResult(((SeqSearchWSJob) job).getJobId());
+ ((SeqSearchWSJob) job).result = server.getResult(((SeqSearchWSJob) job)
+ .getJobId());
}
public void StartJob(AWsJob job)
}
try
{
- vamsas.objects.simple.WsJobId jobsubmit = server.search(j.seqs
- .getSeqs()[0], dbArg);
+ vamsas.objects.simple.WsJobId jobsubmit = server.search(
+ j.seqs.getSeqs()[0], dbArg);
if ((jobsubmit != null) && (jobsubmit.getStatus() == 1))
{
+ e.toString() + "\n");
j.setAllowedServerExceptions(0);
wsInfo.setStatus(WebserviceInfo.STATE_STOPPED_SERVERERROR);
- wsInfo.setStatus(j.getJobnum(), 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");
+ wsInfo.setStatus(j.getJobnum(),
+ 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");
// e.printStackTrace(); // TODO: JBPNote DEBUG
}
for (int i = 0, j = seqs.length; i < j; i++)
{
- msa[i] = new jalview.datamodel.Sequence(seqs[i].getId(), seqs[i]
- .getSeq());
+ msa[i] = new jalview.datamodel.Sequence(seqs[i].getId(),
+ seqs[i].getSeq());
}
return msa;
&& jobs[j].hasResults())
{
results++;
- vamsas.objects.simple.Alignment valign = ((SeqSearchResult) ((SeqSearchWSJob)jobs[j]).result)
+ vamsas.objects.simple.Alignment valign = ((SeqSearchResult) ((SeqSearchWSJob) jobs[j]).result)
.getAlignment();
if (valign != null)
{
String[] lines = valign.getMethod();
for (int line = 0; line < lines.length; line++)
{
- wsInfo.appendProgressText(jobs[j].getJobnum(), lines[line] + "\n");
+ wsInfo.appendProgressText(jobs[j].getJobnum(), lines[line]
+ + "\n");
}
// JBPNote The returned files from a webservice could be
// hidden behind icons in the monitor window that,
import ext.vamsas.ServiceHandle;
/**
- * JWS1 Specific UI attributes and methods
+ * JWS1 Specific UI attributes and methods
+ *
* @author JimP
- *
+ *
*/
-public abstract class WS1Client extends WSClient implements WSMenuEntryProviderI
+public abstract class WS1Client extends WSClient implements
+ WSMenuEntryProviderI
{
/**
else
{
WebServiceJobTitle = sh.getAbstractName() + " using " + sh.getName();
-
+
}
WebServiceReference = sh.getDescription();
WsURL = sh.getEndpointURL();
}
/**
- * method implemented by each concrete WS1Client implementation that creates menu
- * entries that enact their service using data from alignFrame.
+ * method implemented by each concrete WS1Client implementation that creates
+ * menu entries that enact their service using data from alignFrame.
*
* @param wsmenu
* where new menu entries (and submenus) are to be attached
* created for
* @param alignFrame
*/
- public abstract void attachWSMenuEntry(JMenu wsmenu, final ServiceHandle serviceHandle,
- final AlignFrame alignFrame);
+ public abstract void attachWSMenuEntry(JMenu wsmenu,
+ final ServiceHandle serviceHandle, final AlignFrame alignFrame);
}
abstract class WSJob extends AWsJob
{
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see jalview.ws.AWsJob#clearResponse()
*/
@Override
result = null;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see jalview.ws.AWsJob#hasResponse()
*/
@Override
public boolean hasResponse()
{
- return result!=null;
+ return result != null;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see jalview.ws.AWsJob#hasStatus()
*/
@Override
public boolean hasStatus()
{
- return result!=null && result.getStatus()!=null;
+ return result != null && result.getStatus() != null;
}
/**
*/
public String getStatus()
{
- return result==null ? null : result.getStatus();
+ return result == null ? null : result.getStatus();
}
- public String getState() {
- return result==null ? "NULL result" : ""+result.getState();
+ public String getState()
+ {
+ return result == null ? "NULL result" : "" + result.getState();
}
+
/**
* @return
* @see vamsas.objects.simple.Result#isBroken()
*/
public boolean isBroken()
{
- return result!=null && result.isBroken();
+ return result != null && result.isBroken();
}
/**
*/
public boolean isFailed()
{
- return result!=null && result.isFailed();
+ return result != null && result.isFailed();
}
/**
*/
public boolean isFinished()
{
- return result!=null && result.isFinished();
+ return result != null && result.isFinished();
}
/**
*/
public boolean isInvalid()
{
- return result!=null && result.isInvalid();
+ return result != null && result.isInvalid();
}
/**
*/
public boolean isJobFailed()
{
- return result!=null && result.isJobFailed();
+ return result != null && result.isJobFailed();
}
/**
*/
public boolean isQueued()
{
- return result!=null && result.isQueued();
+ return result != null && result.isQueued();
}
/**
*/
public boolean isRunning()
{
- return result!=null && result.isRunning();
+ return result != null && result.isRunning();
}
/**
*/
public boolean isServerError()
{
- return result!=null && result.isServerError();
+ return result != null && result.isServerError();
}
}
import jalview.ws.AWsJob;
/**
- * job status processing for JWS2 jobs.
+ * job status processing for JWS2 jobs.
+ *
* @author JimP
- *
+ *
*/
public abstract class JWs2Job extends AWsJob
{
- JobStatus status=null;
+ JobStatus status = null;
+
public void setjobStatus(JobStatus jobStatus)
{
status = jobStatus;
// update flags
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see jalview.ws.AWsJob#clearResponse()
*/
@Override
status = null;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see jalview.ws.AWsJob#getState()
*/
@Override
public String getState()
{
- return status==null ? ("Unknown") : status.toString();
+ return status == null ? ("Unknown") : status.toString();
}
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
+ *
* @see jalview.ws.AWsJob#hasResponse()
*/
@Override
public boolean hasResponse()
{
// TODO Auto-generated method stub
- return status!=null;
+ return status != null;
}
+
/*
- StringBuffer statusBuffer = null;
- * (non-Javadoc)
- * @see jalview.ws.AWsJob#getStatus()
- *
- @Override
- public String getStatus()
- {
- return statusBuffer.toString();
- }
- * (non-Javadoc)
+ * StringBuffer statusBuffer = null; (non-Javadoc)
+ *
+ * @see jalview.ws.AWsJob#getStatus()
+ *
+ * @Override public String getStatus() { return statusBuffer.toString(); }
+ * (non-Javadoc)
+ *
* @see jalview.ws.AWsJob#hasStatus()
- *
- @Override
- public boolean hasStatus()
- {
- return statusBuffer!=null;
- }
-*/
+ *
+ * @Override public boolean hasStatus() { return statusBuffer!=null; }
+ */
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see jalview.ws.AWsJob#isBroken()
*/
@Override
public boolean isBroken()
{
- return status==null ? false : status.equals(status.UNDEFINED);
+ return status == null ? false : status.equals(status.UNDEFINED);
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see jalview.ws.AWsJob#isFailed()
*/
@Override
public boolean isFailed()
{
- return status==null ? false : status.equals(status.FAILED);
+ return status == null ? false : status.equals(status.FAILED);
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see jalview.ws.AWsJob#isFinished()
*/
@Override
public boolean isFinished()
{
- return status==null ? false : status.equals(status.FINISHED);
+ return status == null ? false : status.equals(status.FINISHED);
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see jalview.ws.AWsJob#isQueued()
*/
@Override
public boolean isQueued()
{
- return status==null ? false : status.equals(status.SUBMITTED) || status.equals(status.PENDING);
+ return status == null ? false : status.equals(status.SUBMITTED)
+ || status.equals(status.PENDING);
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see jalview.ws.AWsJob#isRunning()
*/
@Override
public boolean isRunning()
{
// TODO Auto-generated method stub
- return status!=null && (status.equals(status.RUNNING) || status.equals(status.STARTED));
+ return status != null
+ && (status.equals(status.RUNNING) || status
+ .equals(status.STARTED));
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see jalview.ws.AWsJob#isServerError()
*/
@Override
public boolean isServerError()
{
- // server errors are raised as exceptions on the service method calls.
- return status==null ? false : false; // status.equals(status.FAILED);
+ // server errors are raised as exceptions on the service method calls.
+ return status == null ? false : false; // status.equals(status.FAILED);
}
}
import compbio.metadata.Preset;
-public class JabaPreset implements WsParamSetI {
- Preset p=null;
+public class JabaPreset implements WsParamSetI
+{
+ Preset p = null;
+
Jws2Instance service;
- public JabaPreset(Jws2Instance svc, Preset preset) {
- service=svc;
- p=preset;
+
+ public JabaPreset(Jws2Instance svc, Preset preset)
+ {
+ service = svc;
+ p = preset;
}
+
@Override
public String getName()
{
return p.getName();
}
+
@Override
public String getDescription()
{
return p.getDescription();
}
+
@Override
public String[] getApplicableUrls()
{
- return new String[] { service.getUri()};
+ return new String[]
+ { service.getUri() };
}
+
@Override
public String getSourceFile()
{
return null;
}
+
@Override
public boolean isModifiable()
{
return false;
}
+
@Override
public void setSourceFile(String newfile)
{
- throw new Error("Cannot set source file for "+getClass());
+ throw new Error("Cannot set source file for " + getClass());
}
+
@Override
public List<ArgumentI> getArguments()
{
- try {
- return JabaParamStore.getJwsArgsfromJaba(p.getArguments(service.getRunnerConfig()));
- }
- catch (Exception e)
+ try
+ {
+ return JabaParamStore.getJwsArgsfromJaba(p.getArguments(service
+ .getRunnerConfig()));
+ } catch (Exception e)
{
e.printStackTrace();
- throw new Error("Probable mismatch between service instance and preset!");
+ throw new Error(
+ "Probable mismatch between service instance and preset!");
}
}
+
@Override
public void setArguments(List<ArgumentI> args)
{
- throw new Error("Cannot set Parameters for a Jaba Web service's preset");
+ throw new Error("Cannot set Parameters for a Jaba Web service's preset");
}
}
}
return null;
}
+
/*
- Jws2Instance serviceHandle;
- * (non-Javadoc)
- * @see jalview.ws.WSMenuEntryProviderI#attachWSMenuEntry(javax.swing.JMenu, jalview.gui.AlignFrame)
- *
- @Override
- public void attachWSMenuEntry(JMenu wsmenu, AlignFrame alignFrame)
- {
- if (serviceHandle==null)
- {
- throw new Error("Implementation error: No service handle for this Jws2 service.");
- }
- attachWSMenuEntry(wsmenu, serviceHandle, alignFrame);
- }*/
+ * Jws2Instance serviceHandle; (non-Javadoc)
+ *
+ * @see jalview.ws.WSMenuEntryProviderI#attachWSMenuEntry(javax.swing.JMenu,
+ * jalview.gui.AlignFrame)
+ *
+ * @Override public void attachWSMenuEntry(JMenu wsmenu, AlignFrame
+ * alignFrame) { if (serviceHandle==null) { throw new
+ * Error("Implementation error: No service handle for this Jws2 service."); }
+ * attachWSMenuEntry(wsmenu, serviceHandle, alignFrame); }
+ */
/**
* add the menu item for a particular jws2 service instance
+ *
* @param wsmenu
* @param service
* @param alignFrame
*/
- abstract void attachWSMenuEntry(JMenu wsmenu,
- final Jws2Instance service, final AlignFrame alignFrame);
+ abstract void attachWSMenuEntry(JMenu wsmenu, final Jws2Instance service,
+ final AlignFrame alignFrame);
}
}
System.out.println("Discovered service: " + jwsservers + " "
+ srv.toString());
- Jws2Instance service = new Jws2Instance(jwsservers, srv.toString(), service2);
+ Jws2Instance service = new Jws2Instance(jwsservers, srv.toString(),
+ service2);
- services.add(service);
+ services.add(service);
// retrieve the presets and parameter set and cache now
service.getParamStore().getPresets();
service.hasParameters();
public String getUri()
{
// this is only valid for Jaba 1.0 - this formula might have to change!
- return hosturl+(hosturl.lastIndexOf("/")==(hosturl.length()-1) ? "/" : "") +serviceType;
+ return hosturl
+ + (hosturl.lastIndexOf("/") == (hosturl.length() - 1) ? "/"
+ : "") + serviceType;
}
- private boolean hasParams=false,lookedForParams=false;
+
+ private boolean hasParams = false, lookedForParams = false;
public boolean hasParameters()
{
if (!lookedForParams)
{
- lookedForParams=true;
- try
- {
- hasParams = (getRunnerConfig().getArguments().size() > 0);
- } catch (Exception e)
- {
+ lookedForParams = true;
+ try
+ {
+ hasParams = (getRunnerConfig().getArguments().size() > 0);
+ } catch (Exception e)
+ {
- }
+ }
}
return hasParams;
}
});
wsmenu.add(jws2al);
-
+
}
private void populateWSMenuEntry(JMenu jws2al, final AlignFrame alignFrame)
MsaWSClient msacl = new MsaWSClient();
Vector hostLabels = new Vector();
jws2al.removeAll();
- String lasthost=null;
+ String lasthost = null;
for (final Jws2Instance service : services)
{
atpoint = jws2al;
atpoint.setToolTipText(service.getActionText());
}
}
- if (!byhost && !hostLabels.contains(host + service.serviceType+service.getActionText()))
- //!hostLabels.contains(host + (bytype ? service.serviceType+service.getActionText() : "")))
+ if (!byhost
+ && !hostLabels.contains(host + service.serviceType
+ + service.getActionText()))
+ // !hostLabels.contains(host + (bytype ?
+ // service.serviceType+service.getActionText() : "")))
{
// add a marker indicating where this service is hosted
// relies on services from the same host being listed in a contiguous
// group
JMenuItem hitm;
atpoint.addSeparator();
- if (lasthost==null || !lasthost.equals(host))
+ if (lasthost == null || !lasthost.equals(host))
{
atpoint.add(hitm = new JMenuItem(host));
hitm.setForeground(Color.blue);
lasthost = host;
}
- hostLabels.addElement(host + service.serviceType+service.getActionText() );
- // hostLabels.addElement(host + (bytype ? service.serviceType+service.getActionText() : ""));
+ hostLabels.addElement(host + service.serviceType
+ + service.getActionText());
+ // hostLabels.addElement(host + (bytype ?
+ // service.serviceType+service.getActionText() : ""));
}
msacl.attachWSMenuEntry(atpoint, service, alignFrame);
/*
boolean hasparams = service.hasParameters();
do
{
- String action="Align ";
+ String action = "Align ";
if (submitGaps == true)
{
- action="Realign ";
+ action = "Realign ";
msawsmenu = new JMenu("Realign with " + svcname);
- msawsmenu.setToolTipText("Align sequences to an existing alignment");
+ msawsmenu
+ .setToolTipText("Align sequences to an existing alignment");
rmsawsmenu.add(msawsmenu);
}
final boolean withGaps = submitGaps;
JMenuItem method = new JMenuItem(calcName + "Defaults");
- method.setToolTipText(action+"with default settings");
+ method.setToolTipText(action + "with default settings");
method.addActionListener(new ActionListener()
{
msawsmenu.add(method);
if (hasparams)
{
- // only add these menu options if the service has user-modifiable arguments
+ // only add these menu options if the service has user-modifiable
+ // arguments
method = new JMenuItem(calcName + "Edit and run ...");
method.setToolTipText("View and change the parameters before alignment.");
public class ParameterUtils
{
- public static List<String> writeParameterSet(List<Option> optSet, String pseparator)
+ public static List<String> writeParameterSet(List<Option> optSet,
+ String pseparator)
{
List<String> pset = new ArrayList<String>();
- for (Option o:optSet)
+ for (Option o : optSet)
{
pset.add(o.toCommand(pseparator));
}
return pset;
}
+
/**
* Converts options supplied via parameters file into {@code Option} objects
* (Refactored from compbio.ws.client.Jws2Client)
* @return List of Options of type T
*
*/
-/* @SuppressWarnings(value =
- { "true" })
- public static <T> List<Option<T>> processParameters(List<String> params,
- RunnerConfig<T> options, String pseparator)
- */
+ /*
+ * @SuppressWarnings(value = { "true" }) public static <T> List<Option<T>>
+ * processParameters(List<String> params, RunnerConfig<T> options, String
+ * pseparator)
+ */
public static List<Option> processParameters(List<String> params,
RunnerConfig options, String pseparator)
{
{
try
{
- o.setDefaultValue(isParameter(param, pseparator) ? getParamValue(param, pseparator) : param);
+ o.setDefaultValue(isParameter(param, pseparator) ? getParamValue(
+ param, pseparator) : param);
} catch (WrongParameterException e)
{
System.out.println("Problem setting value for the parameter: "
}
return chosenOptions;
}
-
static String getParamName(String fullName, String pseparator)
{
@Override
public void setDefaultValue(String selectedItem)
{
- try {
+ try
+ {
opt.setDefaultValue(selectedItem);
} catch (Exception e)
{
e.printStackTrace();
- throw new Error("Implementation error: cannot set Jaba Option to a value outside its allowed value range!");
+ throw new Error(
+ "Implementation error: cannot set Jaba Option to a value outside its allowed value range!");
}
}
}
/**
- * get the underlying Jaba option or parameter object. Note - use copy first if you want to modify the value of the option.
+ * get the underlying Jaba option or parameter object. Note - use copy first
+ * if you want to modify the value of the option.
+ *
* @return
*/
public Option getOption()
{
return opt;
}
-
+
}
public JabaParameter(Parameter rg)
{
super(rg);
-
+
}
@Override
public ValueConstrainI getValidValue()
{
- ValueConstrain vc =((Parameter) opt).getValidValue();
- if (vc==null){
+ ValueConstrain vc = ((Parameter) opt).getValidValue();
+ if (vc == null)
+ {
return null;
- } else {
+ }
+ else
+ {
return new JabaValueConstrain(vc);
}
}
@Override
public ParameterI copy()
{
- return new JabaParameter(ParameterUtils.copyParameter((Parameter)opt));
+ return new JabaParameter(ParameterUtils.copyParameter((Parameter) opt));
}
}
public class JabaValueConstrain implements ValueConstrainI
{
- ValueConstrain vc=null;
+ ValueConstrain vc = null;
+
public JabaValueConstrain(ValueConstrain vc)
{
this.vc = vc;
public interface ArgumentI
{
String getName();
- // TODO: rename setDefaultValue to setValue - to make it more semantically obvious what it means!
+
+ // TODO: rename setDefaultValue to setValue - to make it more semantically
+ // obvious what it means!
String getDefaultValue();
+
void setDefaultValue(String selectedItem);
}
public void deletePreset(String name);
/**
- * writes or overwrites the record for a modifiable WsParamSetI entry with a given name in the
- * datastore.
+ * writes or overwrites the record for a modifiable WsParamSetI entry with a
+ * given name in the datastore.
*
* @param presetName
* @param text
List<ArgumentI> jobParams);
/**
- * update an existing instance with a new name, descriptive text and parameters.
+ * update an existing instance with a new name, descriptive text and
+ * parameters.
+ *
* @param oldName
* @param presetName
* @param text
* @param jobParams
*/
public void updatePreset(String oldName, String presetName, String text,
- List<ArgumentI> jobParams);
+ List<ArgumentI> jobParams);
/**
* factory method - builds a service specific parameter object using the given
import jalview.ws.jws2.dm.JabaWsParamSet;
/**
- * Interface implemented by classes for maintaining user's parameters in a Jalview session
+ * Interface implemented by classes for maintaining user's parameters in a
+ * Jalview session
+ *
* @author JimP
- *
+ *
*/
public interface ParamManager
{
/**
*
- * @param name (may be null) select parameter sets with given name
- * @param serviceUrl (may be null) select parameter sets that are applicable for the given URL
- * @param modifiable - if true, return modifiable parameter sets
- * @param unmodifiable - if true, return server presets
+ * @param name
+ * (may be null) select parameter sets with given name
+ * @param serviceUrl
+ * (may be null) select parameter sets that are applicable for the
+ * given URL
+ * @param modifiable
+ * - if true, return modifiable parameter sets
+ * @param unmodifiable
+ * - if true, return server presets
* @return null if no parameters found, or one or more parameter sets
*/
- public WsParamSetI[] getParameterSet(String name, String serviceUrl, boolean modifiable,boolean unmodifiable);
+ public WsParamSetI[] getParameterSet(String name, String serviceUrl,
+ boolean modifiable, boolean unmodifiable);
+
/**
- * save the given parameter set in the user's parameter set database.
- * Note: this may result in a modal dialog box being raised.
+ * save the given parameter set in the user's parameter set database. Note:
+ * this may result in a modal dialog box being raised.
+ *
* @param parameterSet
*/
public void storeParameterSet(WsParamSetI parameterSet);
+
/**
- * delete the specified parameter set from the database.
- * Note: this may result in a modal dialog box being raised.
+ * delete the specified parameter set from the database. Note: this may result
+ * in a modal dialog box being raised.
+ *
* @param parameterSet
*/
public void deleteParameterSet(WsParamSetI parameterSet);
+
/**
* register a parser for the given host url
+ *
* @param hosturl
* @param jabaParamStore
*/
public void registerParser(String hosturl, ParamDatastoreI paramdataStore);
-
}
/**
* @author JimP
- *
+ *
*/
public interface ValueConstrainI
{
/**
* A web service parameter set
- *
+ *
*/
public interface WsParamSetI
{
/**
* Human readable name for parameter set
+ *
* @return unique string (given applicable URLs)
*/
public String getName();
+
/**
* @return notes about this parameter set
*/
public String getDescription();
+
/**
* the service endpoints for which this parameter set is valid
+ *
* @return one or more URLs
*/
public String[] getApplicableUrls();
+
/**
*
* @return null, or the file used to store this parameter set.
*/
public String getSourceFile();
-
+
/**
* set the filename used to store this parameter set.
- * @newfile
+ *
+ * @newfile
*/
public void setSourceFile(String newfile);
+
/**
* is this a preset or a user modifiable parameter set
+ *
* @return true if set can be modified
*/
public boolean isModifiable();
+
/**
*
* @return arguments in preset
*/
- List<ArgumentI> getArguments();
+ List<ArgumentI> getArguments();
+
/**
- * set the arguments for the preset. Should this preset instance be unmodifiable, an Error should be thrown.
+ * set the arguments for the preset. Should this preset instance be
+ * unmodifiable, an Error should be thrown.
+ *
* @param args
*/
public void setArguments(List<ArgumentI> args);
.equals(other.getUPI())))\r
&& ((this.identicalCrossReferences == null && other\r
.getIdenticalCrossReferences() == null) || (this.identicalCrossReferences != null && java.util.Arrays\r
- .equals(this.identicalCrossReferences, other\r
- .getIdenticalCrossReferences())))\r
+ .equals(this.identicalCrossReferences,\r
+ other.getIdenticalCrossReferences())))\r
&& ((this.logicalCrossReferences == null && other\r
.getLogicalCrossReferences() == null) || (this.logicalCrossReferences != null && java.util.Arrays\r
- .equals(this.logicalCrossReferences, other\r
- .getLogicalCrossReferences())))\r
+ .equals(this.logicalCrossReferences,\r
+ other.getLogicalCrossReferences())))\r
&& ((this.sequence == null && other.getSequence() == null) || (this.sequence != null && this.sequence\r
.equals(other.getSequence())))\r
&& ((this.timestamp == null && other.getTimestamp() == null) || (this.timestamp != null && this.timestamp\r
Boolean.FALSE);\r
_call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS,\r
Boolean.FALSE);\r
- _call\r
- .setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);\r
+ _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);\r
_call.setOperationName(new javax.xml.namespace.QName(\r
"http://www.ebi.ac.uk/picr/AccessionMappingService",\r
"getUPIForSequence"));\r
Boolean.FALSE);\r
_call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS,\r
Boolean.FALSE);\r
- _call\r
- .setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);\r
+ _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);\r
_call.setOperationName(new javax.xml.namespace.QName(\r
"http://www.ebi.ac.uk/picr/AccessionMappingService",\r
"getUPIForAccession"));\r
Boolean.FALSE);\r
_call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS,\r
Boolean.FALSE);\r
- _call\r
- .setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);\r
+ _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);\r
_call.setOperationName(new javax.xml.namespace.QName(\r
"http://www.ebi.ac.uk/picr/AccessionMappingService",\r
"getMappedDatabaseNames"));\r