{
if (sequences[row] == null)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"WARNING: Consensus skipping null sequence - possible race condition.");
continue;
}
}
return new Profiles(result);
// long elapsed = System.currentTimeMillis() - now;
- // System.out.println(elapsed);
+ // jalview.bin.Console.outPrintln(elapsed);
}
/**
' ', value);
}
// long elapsed = System.currentTimeMillis() - now;
- // System.out.println(-elapsed);
+ // jalview.bin.Console.outPrintln(-elapsed);
}
/**
}
}
- System.out.println(max + " " + min);
+ jalview.bin.Console.outPrintln(max + " " + min);
for (int i = 0; i < n; i++)
{
int x = psize * i;
int y = psize * j;
- // System.out.println(mat[i][j]);
+ // jalview.bin.Console.outPrintln(mat[i][j]);
float score = (float) (mat[i][j] - min) / (float) (max - min);
g.setColor(new Color(score, 0, 0));
g.fillRect(x, y, psize, psize);
- // System.out.println(x + " " + y + " " + score);
+ // jalview.bin.Console.outPrintln(x + " " + y + " " + score);
}
}
}
bestm = msq;
}
}
- // System.out.println("Best Score for " + (matches.size() + 1) + " :"
+ // jalview.bin.Console.outPrintln("Best Score for " + (matches.size() + 1) + " :"
// + bestscore);
matches.add(bestm);
aligns.add(bestaseq);
if (tmp.size() != nSeq)
{
- System.err.println("WARNING: tmp.size()=" + tmp.size() + " != nseq="
+ jalview.bin.Console.errPrintln("WARNING: tmp.size()=" + tmp.size() + " != nseq="
+ nSeq
+ " in getOrderByTree - tree contains sequences not in alignment");
}
String msg = String.format(
"Implementation Error - sortByFeature method must be either '%s' or '%s'",
FEATURE_SCORE, FEATURE_DENSITY);
- System.err.println(msg);
+ jalview.bin.Console.errPrintln(msg);
return;
}
{
// int nf = (feats[i] == null) ? 0
// : ((SequenceFeature[]) feats[i]).length;
- // // System.err.println("Sorting on Score: seq " +
+ // // jalview.bin.Console.errPrintln("Sorting on Score: seq " +
// seqs[i].getName()
// + " Feats: " + nf + " Score : " + scores[i]);
}
int featureCount = feats[i] == null ? 0
: ((SequenceFeature[]) feats[i]).length;
scores[i] = featureCount;
- // System.err.println("Sorting on Density: seq "+seqs[i].getName()+
+ // jalview.bin.Console.errPrintln("Sorting on Density: seq "+seqs[i].getName()+
// " Feats: "+featureCount+" Score : "+scores[i]);
}
QuickSort.sortByDouble(scores, seqs, sortByFeatureAscending);
if (translated == null || !(aaRes == translated.charAt(0)))
{
// debug
- // System.out.println(("Mismatch at " + i + "/" + aaResidue + ": "
+ // jalview.bin.Console.outPrintln(("Mismatch at " + i + "/" + aaResidue + ": "
// + codon + "(" + translated + ") != " + aaRes));
return false;
}
* unmapped position; treat like a gap
*/
sourceGapMappedLength += ratio;
- // System.err.println("Can't align: no codon mapping to residue "
+ // jalview.bin.Console.errPrintln("Can't align: no codon mapping to residue "
// + sourceDsPos + "(" + sourceChar + ")");
// return;
continue;
{
if (protein.isNucleotide() || !dna.isNucleotide())
{
- System.err.println("Wrong alignment type in alignProteinAsDna");
+ jalview.bin.Console.errPrintln("Wrong alignment type in alignProteinAsDna");
return 0;
}
List<SequenceI> unmappedProtein = new ArrayList<>();
{
if (protein.isNucleotide() || !dna.isNucleotide())
{
- System.err.println("Wrong alignment type in alignProteinAsDna");
+ jalview.bin.Console.errPrintln("Wrong alignment type in alignProteinAsDna");
return 0;
}
// todo: implement this
.getLength() == mappedFromLength - 1);
if (cdsLength != mappedToLength && !addStopCodon)
{
- System.err.println(String.format(
+ jalview.bin.Console.errPrintln(String.format(
"Can't align cds as protein (length mismatch %d/%d): %s",
cdsLength, mappedToLength, cdsSeq.getName()));
}
AlignedCodon codon = sequenceCodon.getValue();
if (codon.peptideCol > 1)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Problem mapping protein with >1 unmapped start positions: "
+ seq.getName());
}
fromRange[i + 1]);
if (range == null)
{
- System.err.println("Error in mapping " + seqMap + " from "
+ jalview.bin.Console.errPrintln("Error in mapping " + seqMap + " from "
+ fromSeq.getName());
return false;
}
}
else
{
- System.out.println("SEQUENCE HAS BEEN DELETED!!!");
+ jalview.bin.Console.outPrintln("SEQUENCE HAS BEEN DELETED!!!");
}
}
else
{
// JBPNote INFO level debug
- System.err.println(
+ jalview.bin.Console.errPrintln(
"ERROR: calcSeqNum called with out of range sequence index for Alignment\n");
}
}
// tmp = ((max - tmp) * (size - cons2[j][23])) / size;
tmp = ((max - tmp) * (size - cons2GapCounts[j])) / size;
- // System.out.println(tmp+ " " + j);
+ // jalview.bin.Console.outPrintln(tmp+ " " + j);
quality.setElementAt(Double.valueOf(tmp), j);
if (tmp > newmax)
if (matchInDataset != null && xref.getMap().getTo() != null
&& matchInDataset != xref.getMap().getTo())
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Implementation problem (reopen JAL-2154): CrossRef.findInDataset seems to have recovered a different sequence than the one explicitly mapped for xref."
+ "Found:" + matchInDataset + "\nExpected:"
+ xref.getMap().getTo() + "\nFor xref:"
retrieved = sftch.getSequences(sourceRefs, !fromDna);
} catch (Exception e)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Problem whilst retrieving cross references for Sequence : "
+ seq.getName());
e.printStackTrace();
String msg = "Mapping updated from " + ms.getName()
+ " to retrieved crossreference "
+ matched.getName();
- System.out.println(msg);
+ jalview.bin.Console.outPrintln(msg);
List<DBRefEntry> toRefs = map.getTo().getDBRefs();
if (toRefs != null)
cf.addMap(retrievedSequence, map.getTo(), map.getMap());
} catch (Exception e)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Exception when consolidating Mapped sequence set...");
e.printStackTrace(System.err);
}
}
if (dataset.getSequences() == null)
{
- System.err.println("Empty dataset sequence set - NO VECTOR");
+ jalview.bin.Console.errPrintln("Empty dataset sequence set - NO VECTOR");
return false;
}
List<SequenceI> ds = dataset.getSequences();
{
if (nxt.getDatasetSequence() != null)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Implementation warning: CrossRef initialised with a dataset alignment with non-dataset sequences in it! ("
+ nxt.getDisplayId(true) + " has ds reference "
+ nxt.getDatasetSequence().getDisplayId(true)
if (rf != 0)
{
final String errMsg = "trimming contigs for incomplete terminal codon.";
- System.err.println(errMsg);
+ jalview.bin.Console.errPrintln(errMsg);
// map and trim contigs to ORF region
vc = scontigs.length - 1;
lastnpos = vismapping.shift(lastnpos); // place npos in context of
InputStream is = getClass().getResourceAsStream(fileName);
if (is == null)
{
- System.err.println("Resource file not found: " + fileName);
+ jalview.bin.Console.errPrintln("Resource file not found: " + fileName);
return;
}
BufferedReader dataIn = new BufferedReader(new InputStreamReader(is));
}
if (codeTables.isEmpty())
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"No genetic code tables loaded, check format of file "
+ fileName);
}
InputStream is = getClass().getResourceAsStream(fileName);
if (is == null)
{
- System.err.println("Resource file not found: " + fileName);
+ jalview.bin.Console.errPrintln("Resource file not found: " + fileName);
return;
}
BufferedReader dataIn = new BufferedReader(new InputStreamReader(is));
}
else
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Unexpected data in " + fileName + ": " + line);
}
}
* seqs.length) { for (int i = 0; i < seqs.length; i++) { if (!hasScore[i])
* { scores[i] = (max + i); } else { int nf=(feats[i]==null) ? 0
* :((SequenceFeature[]) feats[i]).length;
- * System.err.println("Sorting on Score: seq "+seqs[i].getName()+
+ * jalview.bin.Console.errPrintln("Sorting on Score: seq "+seqs[i].getName()+
* " Feats: "+nf+" Score : "+scores[i]); } } }
*
* jalview.util.QuickSort.sort(scores, seqs); } else if
* (int i=0;i<seqs.length; i++) { double nf; scores[i] =
* (0.05+fr*i)+(nf=((feats[i]==null) ? 0.0 :1.0*((SequenceFeature[])
* feats[i]).length));
- * System.err.println("Sorting on Density: seq "+seqs[i].getName()+
+ * jalview.bin.Console.errPrintln("Sorting on Density: seq "+seqs[i].getName()+
* " Feats: "+nf+" Score : "+scores[i]); }
* jalview.util.QuickSort.sort(scores, seqs); } else { if
* (method==FEATURE_LABEL) { throw new Error("Not yet implemented."); } } if
ScoreNames[cols] + ((reps > 0) ? "_" + reps : ""),
ScoreDescriptions[cols], null);
an.setScore(score);
- System.out.println(seqs[i].getName() + " score: '"
+ jalview.bin.Console.outPrintln(seqs[i].getName() + " score: '"
+ ScoreNames[cols] + "' = " + score); // DEBUG
an.setSequenceRef(seqs[i]);
seqs[i].addAlignmentAnnotation(an);
final int open = basePair.getBP5();
final int close = basePair.getBP3();
- // System.out.println("open " + open + " close " + close);
- // System.out.println("lastclose " + lastclose + " lastopen " + lastopen);
+ // jalview.bin.Console.outPrintln("open " + open + " close " + close);
+ // jalview.bin.Console.outPrintln("lastclose " + lastclose + " lastopen " + lastopen);
// we're moving from right to left based on closing pair
/*
{
int popen = bps.get(j).getBP5();
- // System.out.println("j " + j + " popen " + popen + " lastopen "
+ // jalview.bin.Console.outPrintln("j " + j + " popen " + popen + " lastopen "
// +lastopen + " open " + open);
if ((popen < lastopen) && (popen > open))
{
{
if (sfeatures != null)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Implementation error: setting dataset sequence for a sequence which has sequence features.\n\tDataset sequence features will not be visible.");
}
sq.setDatasetSequence(seqds);
{
if (!quiet)
{
- System.err.println("Can't find '" + ((String) key)
+ jalview.bin.Console.errPrintln("Can't find '" + ((String) key)
+ "' in uniquified alignment");
}
}
}
if (unmatched.size() > 0 && !quiet)
{
- System.err.println("Did not find matches for :");
+ jalview.bin.Console.errPrintln("Did not find matches for :");
for (Enumeration i = unmatched.elements(); i
.hasMoreElements(); System.out
.println(((SequenceI) i.nextElement()).getName()))
{
if (sequences[j] == null)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"WARNING: Consensus skipping null sequence - possible race condition.");
continue;
}
{
// if (_lycount<_lylimit)
// {
- // System.err.println("Warning: depth of _recount greater than number of
+ // jalview.bin.Console.errPrintln("Warning: depth of _recount greater than number of
// nodes.");
// }
if (nd == null)
if ((nd.left() == null) && (nd.right() == null))
{
- System.out.println("Leaf = " + ((SequenceI) nd.element()).getName());
- System.out.println("Dist " + nd.dist);
- System.out.println("Boot " + nd.getBootstrap());
+ jalview.bin.Console.outPrintln("Leaf = " + ((SequenceI) nd.element()).getName());
+ jalview.bin.Console.outPrintln("Dist " + nd.dist);
+ jalview.bin.Console.outPrintln("Boot " + nd.getBootstrap());
}
else
{
- System.out.println("Dist " + nd.dist);
+ jalview.bin.Console.outPrintln("Dist " + nd.dist);
printNode((BinaryNode) nd.left());
printNode((BinaryNode) nd.right());
}
}
else
{
- System.out.println(" name = " + ((SequenceI) nd.element()).getName());
+ jalview.bin.Console.outPrintln(" name = " + ((SequenceI) nd.element()).getName());
}
- System.out.println(
+ jalview.bin.Console.outPrintln(
" dist = " + nd.dist + " " + nd.count + " " + nd.height);
}
{
// if (_lycount<_lylimit)
// {
- // System.err.println("Warning: depth of _recount greater than number of
+ // jalview.bin.Console.errPrintln("Warning: depth of _recount greater than number of
// nodes.");
// }
if (nd == null)
return instance;
} catch (InstantiationException | IllegalAccessException e)
{
- System.err.println("Error in " + getClass().getName()
+ jalview.bin.Console.errPrintln("Error in " + getClass().getName()
+ ".getInstance(): " + e.getMessage());
return null;
} catch (ReflectiveOperationException roe)
{
if (c >= symbolIndex.length)
{
- System.err.println(String.format(BAD_ASCII_ERROR, c));
+ jalview.bin.Console.errPrintln(String.format(BAD_ASCII_ERROR, c));
return 0;
}
if (d >= symbolIndex.length)
{
- System.err.println(String.format(BAD_ASCII_ERROR, d));
+ jalview.bin.Console.errPrintln(String.format(BAD_ASCII_ERROR, d));
return 0;
}
return sm;
} catch (IOException e)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Error reading " + resourcePath + ": " + e.getMessage());
}
return null;
ScoreModelI sm2 = models.get(sm.getName());
if (sm2 != null)
{
- System.err.println("Warning: replacing score model " + sm2.getName());
+ jalview.bin.Console.errPrintln("Warning: replacing score model " + sm2.getName());
}
models.put(sm.getName(), sm);
}
urlLink = new UrlLink(link);
} catch (Exception foo)
{
- System.err.println("Exception for URLLink '" + link + "': "
+ jalview.bin.Console.errPrintln("Exception for URLLink '" + link + "': "
+ foo.getMessage());
continue;
}
if (!urlLink.isValid())
{
- System.err.println(urlLink.getInvalidMessage());
+ jalview.bin.Console.errPrintln(urlLink.getInvalidMessage());
continue;
}
/*
* When we finally deprecate 1.1 compatibility, we can start to use
* URLEncoder.encode(url,"UTF-8") and then we'll need this catch: catch
- * (UnsupportedEncodingException ex) { System.err.println("WARNING -
+ * (UnsupportedEncodingException ex) { jalview.bin.Console.errPrintln("WARNING -
* IMPLEMENTATION ERROR - UNSUPPORTED ENCODING EXCEPTION FOR "+url);
* ex.printStackTrace(); }
*/
url = viewport.applet.getCodeBase() + url;
} catch (UnsupportedEncodingException ex)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"WARNING = IMPLEMENTATION ERROR - UNSUPPORTED ENCODING EXCEPTION FOR "
+ url);
ex.printStackTrace();
SequenceI[] oldOrder = viewport.getAlignment().getSequencesArray();
if (viewport.applet.debug)
{
- System.err.println("Sorting " + alorder.getOrder().size()
+ jalview.bin.Console.errPrintln("Sorting " + alorder.getOrder().size()
+ " in alignment '" + getTitle() + "'");
}
AlignmentSorter.sortBy(viewport.getAlignment(), alorder);
{
if (viewport.applet == null)
{
- System.out.println("Not running as applet - no browser available.");
+ jalview.bin.Console.outPrintln("Not running as applet - no browser available.");
}
else
{
viewer = (Viewer) jmolviewer;
} catch (ClassCastException ex)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Unsupported viewer object :" + jmolviewer.getClass());
}
if (viewer == null)
{
- System.err.println("Can't use this object as a structure viewer:"
+ jalview.bin.Console.errPrintln("Can't use this object as a structure viewer:"
+ jmolviewer.getClass());
return null;
}
chains = (String[]) sqch[1];
if (seqs == null || seqs.length == 0)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"JalviewLite.AlignFrame:newStructureView: No sequence to bind structure to.");
}
if (protocol == null)
}
if (protocol == null)
{
- System.err.println("Couldn't work out protocol to open structure: "
+ jalview.bin.Console.errPrintln("Couldn't work out protocol to open structure: "
+ pdb.getId());
return;
}
.setMapping(seqs, chains, pdb.getFile(), protocol,
null) == null)
{
- System.err.println("Failed to map " + pdb.getFile() + " ("
+ jalview.bin.Console.errPrintln("Failed to map " + pdb.getFile() + " ("
+ protocol + ") to any sequences");
}
return;
}
if (ajm != null)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Incremental adding and aligning structure to existing Jmol view not yet implemented.");
// try and add the pdb structure
// ajm.addS
SequenceI[][] seqs, String[][] chains, String[] protocols)
{
// TODO Auto-generated method stub
- System.err.println("Aligned Structure View: Not yet implemented.");
+ jalview.bin.Console.errPrintln("Aligned Structure View: Not yet implemented.");
}
/**
if (!file.isValid())
{
// TODO: raise dialog for gui
- System.err.println("Problems parsing T-Coffee scores: "
+ jalview.bin.Console.errPrintln("Problems parsing T-Coffee scores: "
+ file.getWarningMessage());
- System.err.println("Origin was:\n" + source);
+ jalview.bin.Console.errPrintln("Origin was:\n" + source);
return false;
}
|| aln.getWidth() != file.getWidth()))
{
// TODO: raise a dialog box here rather than bomb out.
- System.err.println(
+ jalview.bin.Console.errPrintln(
"The scores matrix does not match the alignment dimensions");
}
}
else
{
- System.err.println("Problems resolving T-Coffee scores:");
+ jalview.bin.Console.errPrintln("Problems resolving T-Coffee scores:");
if (file.getWarningMessage() != null)
{
- System.err.println(file.getWarningMessage());
+ jalview.bin.Console.errPrintln(file.getWarningMessage());
}
}
return false;
}
if (widthScale <= 1.0)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Invalid alignment character width scaling factor ("
+ widthScale + "). Ignoring.");
widthScale = 1;
}
if (JalviewLite.debug)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Alignment character width scaling factor is now "
+ widthScale);
}
}
if (heightScale <= 1.0)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Invalid alignment character height scaling factor ("
+ heightScale + "). Ignoring.");
heightScale = 1;
}
if (JalviewLite.debug)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Alignment character height scaling factor is now "
+ heightScale);
}
{
if (JalviewLite.debug)
{// DEBUG
- System.out.println(
+ jalview.bin.Console.outPrintln(
"DEBUG: scroll didn't happen - results not within alignment : "
+ seq.getStart() + "," + seq.getEnd());
}
{
// DEBUG
/*
- * System.out.println("DEBUG: scroll: start=" + r[0] +
+ * jalview.bin.Console.outPrintln("DEBUG: scroll: start=" + r[0] +
* " av.getStartRes()=" + av.getStartRes() + " end=" + r[1] +
* " seq.end=" + seq.getEnd() + " av.getEndRes()=" + av.getEndRes() +
* " hextent=" + hextent);
// this is called after loading new annotation onto alignment
if (alignFrame.getSize().height == 0)
{
- System.out.println(
+ jalview.bin.Console.outPrintln(
"adjustAnnotationHeight frame size zero NEEDS FIXING");
}
fontChanged();
if ((hextent + x) > width)
{
- System.err.println("hextent was " + hextent + " and x was " + x);
+ jalview.bin.Console.errPrintln("hextent was " + hextent + " and x was " + x);
x = width - hextent;
}
if (x < 0)
{
- System.err.println("x was " + x);
+ jalview.bin.Console.errPrintln("x was " + x);
x = 0;
}
public void raiseOOMWarning(String string, OutOfMemoryError error)
{
// TODO: JAL-960
- System.err.println("Out of memory whilst '" + string + "'");
+ jalview.bin.Console.errPrintln("Out of memory whilst '" + string + "'");
error.printStackTrace();
}
"-applet", scriptWindow, null);
} catch (Exception e)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Couldn't create a jmol viewer. Args to allocate viewer were:\nDocumentBase="
+ ap.av.applet.getDocumentBase() + "\nCodebase="
+ ap.av.applet.getCodeBase());
{
if (jalview.bin.JalviewLite.debug)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"AppletJmol:Trying to reuse existing PDBfile IO parser.");
}
// re-use the one we opened earlier
{
if (jalview.bin.JalviewLite.debug)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"AppletJmol:Creating new PDBfile IO parser.");
}
FileParse fp = new FileParse(pdbentry.getFile(), protocol);
} catch (Exception e)
{
// give up!
- System.err.println("Couldn't access pdbentry id="
+ jalview.bin.Console.errPrintln("Couldn't access pdbentry id="
+ pdbentry.getId() + " and file=" + pdbentry.getFile()
+ " using protocol=" + protocol);
e.printStackTrace();
} catch (OutOfMemoryError ex)
{
frame.dispose();
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Out of memory when trying to create dialog box with sequence-structure mapping.");
return;
}
{
// This never gets called because we haven't overriden the associated Jmol's
// console
- System.err.println(
+ jalview.bin.Console.errPrintln(
"WARNING: unexpected call to ExtJmol's showConsole method. (showConsole="
+ show);
}
top = pcaModel.getTop();
} catch (OutOfMemoryError x)
{
- System.err.println("Out of memory when calculating PCA.");
+ jalview.bin.Console.errPrintln("Out of memory when calculating PCA.");
return;
}
calcSettings.setEnabled(true);
if (count > 2)
{
- System.out.println(
+ jalview.bin.Console.outPrintln(
"Pairwise alignment scaled similarity score matrix\n");
for (int i = 0; i < count; i++)
("" + i) + " " + seqs[i].getName());
}
- System.out.println("\n");
+ jalview.bin.Console.outPrintln("\n");
for (int i = 0; i < count; i++)
{
}
}
- System.out.println("\n");
+ jalview.bin.Console.outPrintln("\n");
}
}
validate();
sliderValueChanged();
- // System.out.println("blob done "+ (System.currentTimeMillis()-start));
+ // jalview.bin.Console.outPrintln("blob done "+ (System.currentTimeMillis()-start));
}
void sliderValueChanged()
scale = findScale();
- // System.out.println("Scale factor = " + scale);
+ // jalview.bin.Console.outPrintln("Scale factor = " + scale);
addMouseListener(this);
addKeyListener(this);
scale = findScale();
- // System.out.println("New scale = " + scale);
+ // jalview.bin.Console.outPrintln("New scale = " + scale);
img = createImage(getSize().width, getSize().height);
ig = img.getGraphics();
}
else if (evt.getKeyChar() == 's')
{
- System.err.println("DEBUG: Rectangle selection"); // log.debug
+ jalview.bin.Console.errPrintln("DEBUG: Rectangle selection"); // log.debug
if (rectx2 != -1 && recty2 != -1)
{
rectSelect(rectx1, recty1, rectx2, recty2);
@Override
public void updateColours(SequenceI seq, int index)
{
- System.out.println("update the seqPanel colours");
+ jalview.bin.Console.outPrintln("update the seqPanel colours");
// repaint();
}
{
if (av.getAlignment() == null)
{
- System.out.println("Selection message: alignviewport av SeqSetId="
+ jalview.bin.Console.outPrintln("Selection message: alignviewport av SeqSetId="
+ av.getSequenceSetId() + " ViewId=" + av.getViewId()
+ " 's alignment is NULL! returning immediatly.");
return;
if (copycolsel && av.hasHiddenColumns()
&& (av.getColumnSelection() == null))
{
- System.err.println("Bad things");
+ jalview.bin.Console.errPrintln("Bad things");
}
if (repaint)
{
}
else
{
- System.out.println("Original Tree Data not available");
+ jalview.bin.Console.outPrintln("Original Tree Data not available");
}
}
fis = new URL(propertiesFile).openStream();
if (!Jalview.quiet())
{
- System.out.println(
+ jalview.bin.Console.outPrintln(
"Loading jalview properties from : " + propertiesFile);
- System.out.println(
+ jalview.bin.Console.outPrintln(
"Disabling Jalview writing to user's local properties file.");
}
propsAreReadOnly = true;
} catch (Exception ex)
{
if (!Jalview.quiet())
- System.out.println("Error reading properties file: " + ex);
+ jalview.bin.Console
+ .outPrintln("Error reading properties file: " + ex);
}
}
} catch (Exception ex)
{
if (!Jalview.quiet())
- System.out.println("Error reading author details: " + ex);
+ jalview.bin.Console
+ .outPrintln("Error reading author details: " + ex);
authorDetails = null;
}
if (authorDetails == null)
{
if (!Jalview.quiet())
{
- System.out.println(
+ jalview.bin.Console.outPrintln(
"Non-fatal exception when checking version at "
+ remoteBuildPropertiesUrl + ":");
- System.out.println(ex);
+ jalview.bin.Console.printStackTrace(ex);
}
remoteVersion = getProperty("VERSION");
}
url = Cache.class.getResource(resourcePath).toString();
} catch (Exception ex)
{
- System.err.println("Failed to resolve resource " + resourcePath
+ jalview.bin.Console.errPrintln("Failed to resolve resource " + resourcePath
+ ": " + ex.getMessage());
}
}
} catch (Exception ex)
{
if (!Jalview.quiet())
- System.out.println("Error reading build details: " + ex);
+ jalview.bin.Console
+ .outPrintln("Error reading build details: " + ex);
applicationProperties.remove("VERSION");
}
String codeVersion = getProperty("VERSION");
new BuildDetails(codeVersion, null, codeInstallation);
if (printVersion && reportVersion)
{
- System.out.println(ChannelProperties.getProperty("app_name")
- + " version: " + codeVersion + codeInstallation);
+ jalview.bin.Console
+ .outPrintln(ChannelProperties.getProperty("app_name")
+ + " version: " + codeVersion + codeInstallation);
}
}
} catch (NumberFormatException e)
{
if (!Jalview.quiet())
- System.out.println("Error parsing int property '" + property
- + "' with value '" + string + "'");
+ jalview.bin.Console.outPrintln("Error parsing int property '"
+ + property + "' with value '" + string + "'");
}
}
} catch (Exception ex)
{
if (!Jalview.quiet())
- System.out.println(
+ jalview.bin.Console.outPrintln(
"Error setting property: " + key + " " + obj + "\n" + ex);
}
return oldValue;
} catch (Exception ex)
{
if (!Jalview.quiet())
- System.out.println("Error saving properties: " + ex);
+ jalview.bin.Console.outPrintln("Error saving properties: " + ex);
}
}
}
return date_format.parse(val);
} catch (Exception ex)
{
- System.err.println("Invalid or corrupt date in property '"
+ jalview.bin.Console.errPrintln("Invalid or corrupt date in property '"
+ propertyName + "' : value was '" + val + "'");
}
}
return Integer.valueOf(val);
} catch (NumberFormatException x)
{
- System.err.println("Invalid integer in property '" + property
+ jalview.bin.Console.errPrintln("Invalid integer in property '" + property
+ "' (value was '" + val + "')");
}
}
} catch (Exception ex)
{
if (!Jalview.quiet())
- System.out.println("Error loading User ColourFile\n" + ex);
+ jalview.bin.Console
+ .outPrintln("Error loading User ColourFile\n" + ex);
}
}
if (!files.equals(coloursFound.toString()))
return null;
if (!file.exists())
{
- System.err.println("Could not load bootstrap preferences file '"
+ jalview.bin.Console.errPrintln("Could not load bootstrap preferences file '"
+ filename + "'");
return null;
}
}
} catch (FileNotFoundException e)
{
- System.err.println("Could not find bootstrap preferences file '"
+ jalview.bin.Console.errPrintln("Could not find bootstrap preferences file '"
+ file.getAbsolutePath() + "'");
} catch (IOException e)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"IOException when loading bootstrap preferences file '"
+ file.getAbsolutePath() + "'");
}
*/
package jalview.bin;
+import java.io.PrintStream;
import java.util.Locale;
import jalview.log.JLogger;
}
else
{
- outputMessage(message);
- t.printStackTrace();
+ outPrintln(message);
+ Console.printStackTrace(t);
}
}
}
else
{
- outputMessage(message);
+ outPrintln(message);
}
}
}
else
{
- outputMessage(message);
- t.printStackTrace();
+ outPrintln(message);
+ Console.printStackTrace(t);
}
}
}
else
{
- outputMessage(message);
+ outPrintln(message);
}
}
}
else
{
- outputMessage(message);
- t.printStackTrace();
+ outPrintln(message);
+ Console.printStackTrace(t);
}
}
}
else
{
- outputMessage(message);
+ outPrintln(message);
}
}
}
else
{
- outputMessage(message);
+ outPrintln(message);
}
}
}
else
{
- outputMessage(message);
- t.printStackTrace();
+ outPrintln(message);
+ Console.printStackTrace(t);
}
}
}
else
{
- System.err.println(message);
+ jalview.bin.Console.errPrintln(message);
}
}
}
else
{
- System.err.println(message);
- t.printStackTrace(System.err);
+ jalview.bin.Console.errPrintln(message);
+ Console.printStackTrace(t);
}
}
}
else
{
- System.err.println(message);
+ jalview.bin.Console.errPrintln(message);
}
}
}
else
{
- System.err.println(message);
- t.printStackTrace(System.err);
+ jalview.bin.Console.errPrintln(message);
+ Console.printStackTrace(t);
}
}
{
if (!Jalview.quiet())
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Setting initial log level to " + logLevel.name());
}
Log4j.init(logLevel);
log = JLoggerLog4j.getLogger(Cache.JALVIEW_LOGGER_NAME, logLevel);
} catch (NoClassDefFoundError e)
{
- System.err.println("Could not initialise the logger framework");
- e.printStackTrace();
+ jalview.bin.Console
+ .errPrintln("Could not initialise the logger framework");
+ Console.printStackTrace(e);
}
// Test message
}
}
- public static void outputMessage(String message)
+ public static void outPrint()
{
- // send message to stderr if output to stdout is expected
- if (Jalview.getInstance() != null
+ outPrint("");
+ }
+
+ public static void outPrintln()
+ {
+ outPrintln("");
+ }
+
+ public static void outPrint(Object message)
+ {
+ outPrintMessage(message, false, false);
+ }
+
+ public static void outPrint(Object message, boolean forceStdout)
+ {
+ outPrintMessage(message, false, forceStdout);
+ }
+
+ public static void outPrintln(Object message)
+ {
+ outPrintMessage(message, true, false);
+ }
+
+ public static PrintStream outputStream(boolean forceStdout)
+ {
+ // send message to stderr if an output file to stdout is expected
+ if (!forceStdout && Jalview.getInstance() != null
&& Jalview.getInstance().bootstrapArgs != null
&& Jalview.getInstance().bootstrapArgs.outputToStdout())
{
- System.err.println(message);
+ return System.err;
+ }
+ else
+ {
+ return System.out;
+ }
+ }
+
+ public static void outPrintMessage(Object message, boolean newline,
+ boolean forceStdout)
+ {
+ PrintStream ps = outputStream(forceStdout);
+ if (newline)
+ {
+ ps.println(message);
}
else
{
- System.out.println(message);
+ ps.print(message);
}
}
- public static void printStackTrace(Exception e)
+ public static void errPrint()
+ {
+ errPrint("");
+ }
+
+ public static void errPrintln()
+ {
+ errPrintln("");
+ }
+
+ public static void errPrint(Object message)
+ {
+ System.err.print(message);
+ }
+
+ public static void errPrintln(Object message)
+ {
+ System.err.println(message);
+ }
+
+ public static void printStackTrace(Throwable t)
{
// send message to stderr if output to stdout is expected
- e.printStackTrace(System.err);
+ t.printStackTrace(System.err);
}
public final static String LOGGING_TEST_MESSAGE = "Logging to STDERR";
-}
+}
\ No newline at end of file
} catch (NoClassDefFoundError e)
{
// com.sun.management.OperatingSystemMXBean doesn't exist in this JVM
- System.err.println(
+ jalview.bin.Console.errPrintln(
"No com.sun.management.OperatingSystemMXBean: cannot get total physical memory size");
}
}
} catch (NumberFormatException e)
{
- System.err.println(setHiDPIScalePropertyName + " property give ("
+ jalview.bin.Console.errPrintln(setHiDPIScalePropertyName + " property give ("
+ setHiDPIScaleProperty + ") but not parseable as integer");
}
}
try
{
int existingPropertyVal = Integer.parseInt(existingProperty);
- System.out.println("Existing " + scalePropertyName + " is "
+ jalview.bin.Console.outPrintln("Existing " + scalePropertyName + " is "
+ existingPropertyVal);
if (existingPropertyVal > 1)
{
}
} catch (NumberFormatException e)
{
- System.out.println("Could not convert property " + scalePropertyName
+ jalview.bin.Console.outPrintln("Could not convert property " + scalePropertyName
+ " vale '" + existingProperty + "' to number");
}
}
dpi = screenInfo.getScreenResolution();
} catch (HeadlessException e)
{
- System.err.println("Cannot get screen resolution: " + e.getMessage());
+ jalview.bin.Console.errPrintln("Cannot get screen resolution: " + e.getMessage());
}
// try and get screen size height and width
mindimension = Math.min(height, width);
} catch (HeadlessException e)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Cannot get screen size height and width:" + e.getMessage());
}
*
*/
{
- Console.outputMessage("not in js");
+ Console.outPrintln("not in js");
}
// BH - for event debugging in JavaScript (Java mode only)
if (!quiet() || !bootstrapArgs.outputToStdout()
|| bootstrapArgs.contains(Arg.VERSION))
{
- Console.outputMessage(
+ Console.outPrintln(
"Java version: " + System.getProperty("java.version"));
- Console.outputMessage(
- "Java home: " + System.getProperty("java.home"));
- Console.outputMessage("Java arch: " + System.getProperty("os.arch")
- + " " + System.getProperty("os.name") + " "
+ Console.outPrintln("Java home: " + System.getProperty("java.home"));
+ Console.outPrintln("Java arch: " + System.getProperty("os.arch") + " "
+ + System.getProperty("os.name") + " "
+ System.getProperty("os.version"));
String val = System.getProperty("sys.install4jVersion");
if (val != null)
{
- Console.outputMessage("Install4j version: " + val);
+ Console.outPrintln("Install4j version: " + val);
}
val = System.getProperty("installer_template_version");
if (val != null)
{
- Console.outputMessage("Install4j template version: " + val);
+ Console.outPrintln("Install4j template version: " + val);
}
val = System.getProperty("launcher_version");
if (val != null)
{
- Console.outputMessage("Launcher version: " + val);
+ Console.outPrintln("Launcher version: " + val);
}
}
Cache.loadProperties(usrPropsFile);
if (usrPropsFile != null)
{
- Console.outputMessage(
+ Console.outPrintln(
"CMD [-props " + usrPropsFile + "] executed successfully!");
testoutput(bootstrapArgs, Arg.PROPS,
"test/jalview/bin/testProps.jvprops", usrPropsFile);
{
List<Map.Entry<Type, String>> helpArgs = bootstrapArgs
.getList(Arg.HELP);
- Console.outputMessage(Arg.usage(helpArgs.stream()
- .map(e -> e.getKey()).collect(Collectors.toList())));
+ Console.outPrintln(Arg.usage(helpArgs.stream().map(e -> e.getKey())
+ .collect(Collectors.toList())));
Jalview.exit(null, 0);
}
if (aparser.contains("help") || aparser.contains("h"))
* Now using new usage statement.
showUsage();
*/
- Console.outputMessage(Arg.usage());
+ Console.outPrintln(Arg.usage());
Jalview.exit(null, 0);
}
try
{
Jws2Discoverer.getDiscoverer().setPreferredUrl(jabawsUrl);
- Console.outputMessage(
+ Console.outPrintln(
"CMD [-jabaws " + jabawsUrl + "] executed successfully!");
testoutput(bootstrapArgs, Arg.JABAWS,
"http://www.compbio.dundee.ac.uk/jabaws", jabawsUrl);
} catch (MalformedURLException e)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Invalid jabaws parameter: " + jabawsUrl + " ignored");
}
}
}
else
{
- System.err.println("Executing setprop argument: " + setprop);
+ jalview.bin.Console
+ .errPrintln("Executing setprop argument: " + setprop);
if (Platform.isJS())
{
Cache.setProperty(setprop.substring(0, p),
}
else
{
- Console.outputMessage(
- "CMD [-nousagestats] executed successfully!");
+ Console.outPrintln("CMD [-nousagestats] executed successfully!");
testoutput(argparser, Arg.NOUSAGESTATS);
}
// questionnaire
Console.debug("Starting questionnaire url at " + url);
desktop.checkForQuestionnaire(url);
- Console.outputMessage("CMD questionnaire[-" + url
+ Console.outPrintln("CMD questionnaire[-" + url
+ "] executed successfully!");
}
else
}
else
{
- Console.outputMessage(
+ Console.outPrintln(
"CMD [-noquestionnaire] executed successfully!");
testoutput(argparser, Arg.QUESTIONNAIRE);
}
.getString("status.processing_commandline_args"),
progress = System.currentTimeMillis());
}
- Console.outputMessage(
- "CMD [-open " + file + "] executed successfully!");
+ Console.outPrintln("CMD [-open " + file + "] executed successfully!");
if (!Platform.isJS())
/**
format);
if (af == null)
{
- Console.outputMessage("error");
+ Console.outPrintln("error");
}
else
{
if (cs != null)
{
- Console.outputMessage(
+ Console.outPrintln(
"CMD [-colour " + data + "] executed successfully!");
}
af.changeColour(cs);
{
af.parseFeaturesFile(data,
AppletFormatAdapter.checkProtocol(data));
- // Console.outputMessage("Added " + data);
- Console.outputMessage(
+ // Console.outPrintln("Added " + data);
+ Console.outPrintln(
"CMD groups[-" + data + "] executed successfully!");
}
data = aparser.getValue("features", true);
{
af.parseFeaturesFile(data,
AppletFormatAdapter.checkProtocol(data));
- // Console.outputMessage("Added " + data);
- Console.outputMessage(
+ // Console.outPrintln("Added " + data);
+ Console.outPrintln(
"CMD [-features " + data + "] executed successfully!");
}
if (data != null)
{
af.loadJalviewDataFile(data, null, null, null);
- // Console.outputMessage("Added " + data);
- Console.outputMessage(
+ // Console.outPrintln("Added " + data);
+ Console.outPrintln(
"CMD [-annotations " + data + "] executed successfully!");
}
// set or clear the sortbytree flag.
af.getViewport().setSortByTree(true);
if (af.getViewport().getSortByTree())
{
- Console.outputMessage(
- "CMD [-sortbytree] executed successfully!");
+ Console.outPrintln("CMD [-sortbytree] executed successfully!");
}
}
if (aparser.contains("no-annotation"))
af.getViewport().setShowAnnotation(false);
if (!af.getViewport().isShowAnnotation())
{
- Console.outputMessage(
- "CMD no-annotation executed successfully!");
+ Console.outPrintln("CMD no-annotation executed successfully!");
}
}
if (aparser.contains("nosortbytree"))
af.getViewport().setSortByTree(false);
if (!af.getViewport().getSortByTree())
{
- Console.outputMessage(
+ Console.outPrintln(
"CMD [-nosortbytree] executed successfully!");
}
}
{
try
{
- Console.outputMessage(
+ Console.outPrintln(
"CMD [-tree " + data + "] executed successfully!");
NewickFile nf = new NewickFile(data,
AppletFormatAdapter.checkProtocol(data));
.setCurrentTree(af.showNewickTree(nf, data).getTree());
} catch (IOException ex)
{
- System.err.println("Couldn't add tree " + data);
+ jalview.bin.Console.errPrintln("Couldn't add tree " + data);
ex.printStackTrace(System.err);
}
}
{
// Execute the groovy script after we've done all the rendering stuff
// and before any images or figures are generated.
- Console.outputMessage("Executing script " + groovyscript);
+ Console.outPrintln("Executing script " + groovyscript);
executeGroovyScript(groovyscript, af);
- Console.outputMessage("CMD groovy[" + groovyscript
+ Console.outPrintln("CMD groovy[" + groovyscript
+ "] executed successfully!");
groovyscript = null;
}
if (outputFormat.equalsIgnoreCase("png"))
{
- Console.outputMessage("Creating PNG image: " + file);
+ Console.outPrintln("Creating PNG image: " + file);
af.createPNG(new File(file));
imageName = (new File(file)).getName();
continue;
}
else if (outputFormat.equalsIgnoreCase("svg"))
{
- Console.outputMessage("Creating SVG image: " + file);
+ Console.outPrintln("Creating SVG image: " + file);
File imageFile = new File(file);
imageName = imageFile.getName();
af.createSVG(imageFile);
imageName = imageFile.getName();
HtmlSvgOutput htmlSVG = new HtmlSvgOutput(af.alignPanel);
- Console.outputMessage("Creating HTML image: " + file);
+ Console.outPrintln("Creating HTML image: " + file);
htmlSVG.exportHTML(file);
continue;
}
{
if (file == null)
{
- System.err.println("The output html file must not be null");
+ jalview.bin.Console.errPrintln(
+ "The output html file must not be null");
return;
}
try
e.printStackTrace();
}
BioJsHTMLOutput bjs = new BioJsHTMLOutput(af.alignPanel);
- Console.outputMessage(
+ Console.outPrintln(
"Creating BioJS MSA Viwer HTML file: " + file);
bjs.exportHTML(file);
continue;
}
else if (outputFormat.equalsIgnoreCase("imgMap"))
{
- Console.outputMessage("Creating image map: " + file);
+ Console.outPrintln("Creating image map: " + file);
af.createImageMap(new File(file), imageName);
continue;
}
else if (outputFormat.equalsIgnoreCase("eps"))
{
File outputFile = new File(file);
- Console.outputMessage(
+ Console.outPrintln(
"Creating EPS file: " + outputFile.getAbsolutePath());
af.createEPS(outputFile);
continue;
outFormat = FileFormats.getInstance().forName(outputFormat);
} catch (Exception formatP)
{
- Console.outputMessage("Couldn't parse " + outFormat
+ Console.outPrintln("Couldn't parse " + outFormat
+ " as a valid Jalview format string.");
}
if (outFormat != null)
{
if (!outFormat.isWritable())
{
- Console.outputMessage(
+ Console.outPrintln(
"This version of Jalview does not support alignment export as "
+ outputFormat);
}
af.saveAlignment(file, outFormat);
if (af.isSaveAlignmentSuccessful())
{
- Console.outputMessage("Written alignment in "
+ Console.outPrintln("Written alignment in "
+ outFormat.getName() + " format to " + file);
}
else
{
- Console.outputMessage("Error writing file " + file
- + " in " + outFormat.getName() + " format!!");
+ Console.outPrintln("Error writing file " + file + " in "
+ + outFormat.getName() + " format!!");
}
}
}
} catch (ImageOutputException ioexc)
{
- Console.outputMessage(
+ Console.outPrintln(
"Unexpected error whilst exporting image to " + file);
ioexc.printStackTrace();
}
while (aparser.getSize() > 0)
{
- Console.outputMessage("Unknown arg: " + aparser.nextValue());
+ Console.outPrintln("Unknown arg: " + aparser.nextValue());
}
}
}
{
if (Cache.groovyJarsPresent())
{
- Console.outputMessage("Executing script " + groovyscript);
+ Console.outPrintln("Executing script " + groovyscript);
executeGroovyScript(groovyscript, startUpAlframe);
}
else
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Sorry. Groovy Support is not available, so ignoring the provided groovy script "
+ groovyscript);
}
/*
private static void showUsage()
{
- System.out.println(
+ jalview.bin.Console.outPrintln(
"Usage: jalview -open [FILE] [OUTPUT_FORMAT] [OUTPUT_FILE]\n\n"
+ "-nodisplay\tRun Jalview without User Interface.\n"
+ "-props FILE\tUse the given Jalview properties file instead of users default.\n"
} catch (Exception ex)
{
- System.err.println("Failed to read from STDIN into tempfile "
- + ((tfile == null) ? "(tempfile wasn't created)"
- : tfile.toString()));
+ jalview.bin.Console
+ .errPrintln("Failed to read from STDIN into tempfile "
+ + ((tfile == null) ? "(tempfile wasn't created)"
+ : tfile.toString()));
ex.printStackTrace();
return;
}
sfile = tfile.toURI().toURL();
} catch (Exception x)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Unexpected Malformed URL Exception for temporary file created from STDIN: "
+ tfile.toURI());
x.printStackTrace();
tfile = new File(groovyscript);
if (!tfile.exists())
{
- System.err.println("File '" + groovyscript + "' does not exist.");
+ jalview.bin.Console.errPrintln(
+ "File '" + groovyscript + "' does not exist.");
return;
}
if (!tfile.canRead())
{
- System.err.println("File '" + groovyscript + "' cannot be read.");
+ jalview.bin.Console.errPrintln(
+ "File '" + groovyscript + "' cannot be read.");
return;
}
if (tfile.length() < 1)
{
- System.err.println("File '" + groovyscript + "' is empty.");
+ jalview.bin.Console
+ .errPrintln("File '" + groovyscript + "' is empty.");
return;
}
try
sfile = tfile.getAbsoluteFile().toURI().toURL();
} catch (Exception ex)
{
- System.err.println("Failed to create a file URL for "
+ jalview.bin.Console.errPrintln("Failed to create a file URL for "
+ tfile.getAbsoluteFile());
return;
}
}
} catch (Exception e)
{
- System.err.println("Exception Whilst trying to execute file " + sfile
- + " as a groovy script.");
+ jalview.bin.Console
+ .errPrintln("Exception Whilst trying to execute file " + sfile
+ + " as a groovy script.");
e.printStackTrace(System.err);
}
{
if (exitcode == 0)
{
- Console.outputMessage(message);
+ Console.outPrintln(message);
}
else
{
- System.err.println(message);
+ jalview.bin.Console.errPrintln(message);
}
}
}
if (yes && ((s1 == null && s2 == null)
|| (s1 != null && s1.equals(s2))))
{
- Console.outputMessage("[TESTOUTPUT] arg " + a.argString() + "='" + s1
+ Console.outPrintln("[TESTOUTPUT] arg " + a.argString() + "='" + s1
+ "' was set");
}
}
{
message = a.argString() + (yes ? " was set" : " was not set");
}
- Console.outputMessage("[TESTOUTPUT] arg " + message);
+ Console.outPrintln("[TESTOUTPUT] arg " + message);
}
}
{
if (debug)
{
- System.err.println("Selecting region using separator string '"
+ jalview.bin.Console.errPrintln("Selecting region using separator string '"
+ separator + "'");
}
}
from--;
} catch (NumberFormatException ex)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"ERROR: Couldn't parse first integer in range element column selection string '"
+ cl + "' - format is 'from-to'");
return;
to--;
} catch (NumberFormatException ex)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"ERROR: Couldn't parse second integer in range element column selection string '"
+ cl + "' - format is 'from-to'");
return;
}
if (debug)
{
- System.err.println("Range '" + cl + "' deparsed as [" + from
+ jalview.bin.Console.errPrintln("Range '" + cl + "' deparsed as [" + from
+ "," + to + "]");
}
}
else
{
- System.err.println("ERROR: Invalid Range '" + cl
+ jalview.bin.Console.errPrintln("ERROR: Invalid Range '" + cl
+ "' deparsed as [" + from + "," + to + "]");
}
}
}
else
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"ERROR: Couldn't parse integer from point selection element of column selection string '"
+ cl + "'");
return;
csel.addElement(r);
if (debug)
{
- System.err.println("Point selection '" + cl
+ jalview.bin.Console.errPrintln("Point selection '" + cl
+ "' deparsed as [" + r + "]");
}
}
else
{
- System.err.println("ERROR: Invalid Point selection '" + cl
+ jalview.bin.Console.errPrintln("ERROR: Invalid Point selection '" + cl
+ "' deparsed as [" + r + "]");
}
}
listener = listener.trim();
if (listener.length() == 0)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"jalview Javascript error: Ignoring empty function for mouseover listener.");
return;
}
.addStructureViewerListener(mol);
if (debug)
{
- System.err.println("Added a mouseover listener for "
+ jalview.bin.Console.errPrintln("Added a mouseover listener for "
+ ((af == null) ? "All frames"
: "Just views for "
+ af.getAlignViewport().getSequenceSetId()));
- System.err.println("There are now " + javascriptListeners.size()
+ jalview.bin.Console.errPrintln("There are now " + javascriptListeners.size()
+ " listeners in total.");
}
}
listener = listener.trim();
if (listener.length() == 0)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"jalview Javascript error: Ignoring empty function for selection listener.");
return;
}
.addSelectionListener(mol);
if (debug)
{
- System.err.println("Added a selection listener for "
+ jalview.bin.Console.errPrintln("Added a selection listener for "
+ ((af == null) ? "All frames"
: "Just views for "
+ af.getAlignViewport().getSequenceSetId()));
- System.err.println("There are now " + javascriptListeners.size()
+ jalview.bin.Console.errPrintln("There are now " + javascriptListeners.size()
+ " listeners in total.");
}
}
listener = listener.trim();
if (listener.length() == 0)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"jalview Javascript error: Ignoring empty function for selection listener.");
return;
}
.addStructureViewerListener(mol);
if (debug)
{
- System.err.println("Added a javascript structure viewer listener '"
+ jalview.bin.Console.errPrintln("Added a javascript structure viewer listener '"
+ listener + "'");
- System.err.println("There are now " + javascriptListeners.size()
+ jalview.bin.Console.errPrintln("There are now " + javascriptListeners.size()
+ " listeners in total.");
}
}
rprt = debug;
if (debug)
{
- System.err.println("Removed listener '" + listener + "'");
+ jalview.bin.Console.errPrintln("Removed listener '" + listener + "'");
}
}
else
}
if (rprt)
{
- System.err.println("There are now " + javascriptListeners.size()
+ jalview.bin.Console.errPrintln("There are now " + javascriptListeners.size()
+ " listeners in total.");
}
}
@Override
public void stop()
{
- System.err.println("Applet " + getName() + " stop().");
+ jalview.bin.Console.errPrintln("Applet " + getName() + " stop().");
tidyUp();
}
@Override
public void destroy()
{
- System.err.println("Applet " + getName() + " destroy().");
+ jalview.bin.Console.errPrintln("Applet " + getName() + " destroy().");
tidyUp();
}
}
} catch (NumberFormatException e)
{
- System.err.println("Ignoring invalid residue number string '"
+ jalview.bin.Console.errPrintln("Ignoring invalid residue number string '"
+ pdbResNum + "'");
}
} catch (Exception ex)
{
- System.err.println("Couldn't parse integer arguments (topRow='"
+ jalview.bin.Console.errPrintln("Couldn't parse integer arguments (topRow='"
+ topRow + "' and leftHandColumn='" + leftHandColumn
+ "')");
ex.printStackTrace();
} catch (Exception ex)
{
- System.err.println("Couldn't parse integer arguments (topRow='"
+ jalview.bin.Console.errPrintln("Couldn't parse integer arguments (topRow='"
+ topRow + "')");
ex.printStackTrace();
}
} catch (Exception ex)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Couldn't parse integer arguments (leftHandColumn='"
+ leftHandColumn + "')");
ex.printStackTrace();
{
if (debug)
{
- System.err.println("Applet context is '"
+ jalview.bin.Console.errPrintln("Applet context is '"
+ getAppletContext().getClass().toString() + "'");
}
JSObject scriptObject = JSObject.getWindow(this);
if (debug && scriptObject != null)
{
- System.err.println("Applet has Javascript callback support.");
+ jalview.bin.Console.errPrintln("Applet has Javascript callback support.");
}
} catch (Exception ex)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Warning: No JalviewLite javascript callbacks available.");
if (debug)
{
if (debug)
{
- System.err.println("JalviewLite Version " + getVersion());
- System.err.println("Build Date : " + getBuildDate());
- System.err.println("Installation : " + getInstallation());
+ jalview.bin.Console.errPrintln("JalviewLite Version " + getVersion());
+ jalview.bin.Console.errPrintln("Build Date : " + getBuildDate());
+ jalview.bin.Console.errPrintln("Installation : " + getInstallation());
}
String externalsviewer = getParameter("externalstructureviewer");
if (externalsviewer != null)
separator = sep;
if (debug)
{
- System.err.println("Separator set to '" + separator + "'");
+ jalview.bin.Console.errPrintln("Separator set to '" + separator + "'");
}
}
else
{
if (tries > 0)
{
- System.err.println("LiveConnect request thread going to sleep.");
+ jalview.bin.Console.errPrintln("LiveConnect request thread going to sleep.");
}
try
{
;
if (tries++ > 0)
{
- System.err.println("LiveConnect request thread woken up.");
+ jalview.bin.Console.errPrintln("LiveConnect request thread woken up.");
}
try
{
}
} catch (Exception jsex)
{
- System.err.println("Attempt " + tries
+ jalview.bin.Console.errPrintln("Attempt " + tries
+ " to access LiveConnect javascript failed.");
}
}
"Calling oninit callback '" + initjscallback + "'.");
} catch (Exception e)
{
- System.err.println("Exception when executing _oninit callback '"
+ jalview.bin.Console.errPrintln("Exception when executing _oninit callback '"
+ initjscallback + "'.");
e.printStackTrace();
}
}
else
{
- System.err.println("Not executing _oninit callback '"
+ jalview.bin.Console.errPrintln("Not executing _oninit callback '"
+ initjscallback + "' - no scripting allowed.");
}
}
((AlignFrame) frame).viewport.applet.currentAlignFrame = (AlignFrame) frame;
if (debug)
{
- System.err.println("Activated window " + frame);
+ jalview.bin.Console.errPrintln("Activated window " + frame);
}
}
// be good.
*
* public void windowDeactivated(WindowEvent e) { if (currentAlignFrame ==
* frame) { currentAlignFrame = null; if (debug) {
- * System.err.println("Deactivated window "+frame); } }
+ * jalview.bin.Console.errPrintln("Deactivated window "+frame); } }
* super.windowDeactivated(e); }
*/
});
}
if (!jmolAvailable)
{
- System.out.println(
+ jalview.bin.Console.outPrintln(
"Jmol not available - Using mc_view for structures");
}
} catch (java.lang.ClassNotFoundException ex)
jmolAvailable = false;
if (debug)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Skipping Jmol check. Will use mc_view (probably)");
}
}
{
if (JalviewLite.debug)
{
- System.err.println(msg);
+ jalview.bin.Console.errPrintln(msg);
}
}
{
if (debug)
{
- System.err.println("Prepended document base '" + documentBase
+ jalview.bin.Console.errPrintln("Prepended document base '" + documentBase
+ "' to make: '" + withDocBase + "'");
}
protocol = DataSourceType.URL;
protocol = DataSourceType.URL;
if (debug)
{
- System.err.println("Prepended codebase '" + codeBase
+ jalview.bin.Console.errPrintln("Prepended codebase '" + codeBase
+ "' to make: '" + withCodeBase + "'");
}
return withCodeBase;
+ " as "
+ (al1.isNucleotide() ? "protein product" : "cDNA")
+ " for " + af.getTitle();
- System.err.println(msg);
+ jalview.bin.Console.errPrintln(msg);
}
}
dbgMsg(">>>Dump finished.");
} catch (Exception e)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Exception when trying to dump the content of the file parameter.");
e.printStackTrace();
}
{
// this may not really be a problem but we give a warning
// anyway
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Warning: Possible input parsing error: Null sequence for attachment of PDB (sequence "
+ i + ")");
}
}
else
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Annotations were not added from annotation file '"
+ param + "'");
}
{
if (debug)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Attempting to load T-COFFEE score file from the scoreFile parameter");
}
result = alignFrame.loadScoreFile(sScoreFile);
if (!result)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Failed to parse T-COFFEE parameter as a valid score file ('"
+ sScoreFile + "')");
}
boolean rtn = (getClass().getResourceAsStream("/" + f) != null);
if (debug)
{
- System.err.println("Resource '" + f + "' was "
+ jalview.bin.Console.errPrintln("Resource '" + f + "' was "
+ (rtn ? "" : "not ") + "located by classloader.");
}
return rtn;
} catch (Exception ex)
{
- System.out.println("Exception checking resources: " + f + " " + ex);
+ jalview.bin.Console.outPrintln("Exception checking resources: " + f + " " + ex);
return false;
}
}
{
return initialAlignFrame;
}
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Implementation error: Jalview Applet API cannot work out which AlignFrame to use.");
return null;
}
jv.removeAllElements();
if (debug)
{
- System.err.println("Array from '" + separator
+ jalview.bin.Console.errPrintln("Array from '" + separator
+ "' separated List:\n" + v.length);
for (int i = 0; i < v.length; i++)
{
- System.err.println("item " + i + " '" + v[i] + "'");
+ jalview.bin.Console.errPrintln("item " + i + " '" + v[i] + "'");
}
}
return v;
}
if (debug)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Empty Array from '" + separator + "' separated List");
}
return null;
{
System.err
.println("Returning '" + separator + "' separated List:\n");
- System.err.println(v);
+ jalview.bin.Console.errPrintln(v);
}
return v.toString();
}
if (debug)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Returning empty '" + separator + "' separated List\n");
}
return "" + separator;
this.separator = separator;
if (debug)
{
- System.err.println("Default Separator now: '" + separator + "'");
+ jalview.bin.Console.errPrintln("Default Separator now: '" + separator + "'");
}
}
Color col = ColorUtils.parseColourString(colprop);
if (col == null)
{
- System.err.println("Couldn't parse '" + colprop + "' as a colour for "
+ jalview.bin.Console.errPrintln("Couldn't parse '" + colprop + "' as a colour for "
+ colparam);
}
return (col == null) ? defcolour : col;
}
if (debug)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"resolveUrlForLocalOrAbsolute returning " + resolvedPath);
}
return resolvedPath;
: getDocumentBase());
if (debug)
{
- System.err.println("Show url (prepended " + prepend
+ jalview.bin.Console.errPrintln("Show url (prepended " + prepend
+ " - toggle resolvetocodebase if code/docbase resolution is wrong): "
+ url);
}
{
if (debug)
{
- System.err.println("Show url: " + url);
+ jalview.bin.Console.errPrintln("Show url: " + url);
}
}
if (url.indexOf("javascript:") == 0)
DataSourceType protocol = null;
try
{
- System.out.println("Loading thread started with:\n>>file\n" + file
+ jalview.bin.Console.outPrintln("Loading thread started with:\n>>file\n" + file
+ ">>endfile");
// This might throw a security exception in certain browsers
// Netscape Communicator for instance.
rtn = true;
is.close();
}
- System.err.println("Resource '" + file + "' was "
+ jalview.bin.Console.errPrintln("Resource '" + file + "' was "
+ (rtn ? "" : "not") + " located by classloader.");
if (rtn)
{
} catch (Exception ex)
{
- System.out.println(
+ jalview.bin.Console.outPrintln(
"Exception checking resources: " + file + " " + ex);
}
if (file.indexOf("://") > -1)
protocol = DataSourceType.FILE;
}
- System.out.println("Trying to get contents of resource:");
+ jalview.bin.Console.outPrintln("Trying to get contents of resource:");
FileParse fp = new FileParse(file, protocol);
if (fp.isValid())
{
}
else
{
- System.out.println("Resource at " + file
+ jalview.bin.Console.outPrintln("Resource at " + file
+ " cannot be read with protocol==" + protocol);
return;
}
if (format == null)
{
format = new IdentifyFile().identify(file, protocol);
- System.out.println("Format is " + format);
+ jalview.bin.Console.outPrintln("Format is " + format);
}
else
{
- System.out.println("User specified Format is " + format);
+ jalview.bin.Console.outPrintln("User specified Format is " + format);
}
AlignmentI al = null;
try
al = new AppletFormatAdapter().readFile(file, protocol, format);
} catch (java.io.IOException ex)
{
- System.err.println("Failed to open the file.");
+ jalview.bin.Console.errPrintln("Failed to open the file.");
ex.printStackTrace();
}
if (al != null)
{
- System.out.println(new AppletFormatAdapter()
+ jalview.bin.Console.outPrintln(new AppletFormatAdapter()
.formatSequences(FileFormat.Fasta, al, false));
}
} catch (Exception e)
{
- System.err.println("bailing out : Unexpected exception:");
+ jalview.bin.Console.errPrintln("bailing out : Unexpected exception:");
e.printStackTrace();
}
}
}
else
{
- System.out.println("Unable to setIconImage()");
+ Console.outPrintln("Unable to setIconImage()");
}
}
}
{
if (!LaunchUtils.checkJavaVersion())
{
- System.err.println("WARNING - The Java version being used (Java "
+ jalview.bin.Console.errPrintln("WARNING - The Java version being used (Java "
+ LaunchUtils.getJavaVersion()
+ ") may lead to problems. This installation of Jalview should be used with Java "
+ LaunchUtils.getJavaCompileVersion() + ".");
{
if (e.getMessage().toLowerCase(Locale.ROOT).contains("memory"))
{
- System.err.println("Caught a memory exception: " + e.getMessage());
+ jalview.bin.Console.errPrintln("Caught a memory exception: " + e.getMessage());
// Probably the "Cannot allocate memory" error, try without the memory
// setting
ArrayList<String> commandNoMem = new ArrayList<>();
}
final ProcessBuilder builderNoMem = new ProcessBuilder(
commandNoMem);
- System.err.println("Command without memory setting: "
+ jalview.bin.Console.errPrintln("Command without memory setting: "
+ String.join(" ", builderNoMem.command()));
try
{
{
if (debug && !quiet)
{
- System.err.println("LAUNCHERDEBUG - " + message);
+ jalview.bin.Console.errPrintln("LAUNCHERDEBUG - " + message);
}
}
else
{
// number too big for a Long. Limit to Long.MAX_VALUE
- System.out.println("Memory parsing of '" + memString
+ jalview.bin.Console.outPrintln("Memory parsing of '" + memString
+ "' produces number too big. Limiting to Long.MAX_VALUE="
+ Long.MAX_VALUE);
return Long.MAX_VALUE;
ADJUSTMENT_MESSAGE = reason;
if (!quiet)
{
- System.out.println(reason);
+ jalview.bin.Console.outPrintln(reason);
}
}
{
if (argFiles.contains(inArgFile))
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Looped argfiles detected: '" + inArgFile.getPath() + "'");
return;
}
// make a check for an output going to stdout
if (a != null && a.hasOption(Opt.OUTPUTFILE))
{
- System.err.println("###### Found an output");
- System.err.println("###### val='" + val + "'");
- System.err
- .println("###### next arg='" + args.get(i + 1) + "'");
if ((val == null && i + 1 < args.size()
&& ArgParser.STDOUTFILENAME.equals(args.get(i + 1)))
|| ArgParser.STDOUTFILENAME.equals(val))
{
this.outputToStdout = true;
- System.err.println("###### Expecting output to stdout");
}
}
{
command.seqs[s].insertCharAt(command.position, command.number,
command.gapChar);
- // System.out.println("pos: "+command.position+" number:
+ // jalview.bin.Console.outPrintln("pos: "+command.position+" number:
// "+command.number);
}
//
// for (int s = 0; s < command.seqs.length; s++)
// {
- // System.out.println("pos: "+command.position+" number: "+command.number);
+ // jalview.bin.Console.outPrintln("pos: "+command.position+" number: "+command.number);
// command.seqs[s].insertCharAt(command.position, command.number,'A');
// }
//
}
else
{
- System.err.println("Can't undo edit action " + action);
+ jalview.bin.Console.errPrintln("Can't undo edit action " + action);
// throw new IllegalStateException("Can't undo edit action " +
// action);
}
ds.setSequenceFeatures(dna.getSequenceFeatures());
// dnaSeqs[i] = ds;
ssm.fromSeq = ds;
- System.out.println("Realised mapped sequence " + ds.getName());
+ jalview.bin.Console.outPrintln("Realised mapped sequence " + ds.getName());
}
}
}
invalidrnastruc = -1;
} catch (WUSSParseException px)
{
- // DEBUG System.out.println(px);
+ // DEBUG jalview.bin.Console.outPrintln(px);
invalidrnastruc = px.getProblemPos();
}
if (invalidrnastruc > -1)
scaleColLabel = true;
_markRnaHelices();
}
- // System.out.println("featuregroup " + _rnasecstr[0].getFeatureGroup());
+ // jalview.bin.Console.outPrintln("featuregroup " + _rnasecstr[0].getFeatureGroup());
}
{
/*
- * System.out.println(this.annotation._rnasecstr[x] + " Begin" +
+ * jalview.bin.Console.outPrintln(this.annotation._rnasecstr[x] + " Begin" +
* this.annotation._rnasecstr[x].getBegin());
*/
- // System.out.println(this.annotation._rnasecstr[x].getFeatureGroup());
+ // jalview.bin.Console.outPrintln(this.annotation._rnasecstr[x].getFeatureGroup());
int val = 0;
try
{
char firstChar = 0;
for (int i = 0; i < annotations.length; i++)
{
- // DEBUG System.out.println(i + ": " + annotations[i]);
+ // DEBUG jalview.bin.Console.outPrintln(i + ": " + annotations[i]);
if (annotations[i] == null)
{
continue;
if (annotations[i].secondaryStructure == 'H'
|| annotations[i].secondaryStructure == 'E')
{
- // DEBUG System.out.println( "/H|E/ '" +
+ // DEBUG jalview.bin.Console.outPrintln( "/H|E/ '" +
// annotations[i].secondaryStructure + "'");
hasIcons |= true;
}
else
// Check for RNA secondary structure
{
- // DEBUG System.out.println( "/else/ '" +
+ // DEBUG jalview.bin.Console.outPrintln( "/else/ '" +
// annotations[i].secondaryStructure + "'");
// TODO: 2.8.2 should this ss symbol validation check be a function in
// RNA/ResidueProperties ?
}
}
- // System.out.println("displaychar " + annotations[i].displayCharacter);
+ // jalview.bin.Console.outPrintln("displaychar " + annotations[i].displayCharacter);
if (annotations[i].displayCharacter == null
|| annotations[i].displayCharacter.length() == 0)
public static void testSelectionViews(AlignmentI alignment,
HiddenColumns hidden, SequenceGroup selection)
{
- System.out.println("Testing standard view creation:\n");
+ jalview.bin.Console.outPrintln("Testing standard view creation:\n");
AlignmentView view = null;
try
{
- System.out.println(
+ jalview.bin.Console.outPrintln(
"View with no hidden columns, no limit to selection, no groups to be collected:");
view = new AlignmentView(alignment, hidden, selection, false, false,
false);
} catch (Exception e)
{
e.printStackTrace();
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Failed to generate alignment with selection but no groups marked.");
}
try
{
- System.out.println(
+ jalview.bin.Console.outPrintln(
"View with no hidden columns, no limit to selection, and all groups to be collected:");
view = new AlignmentView(alignment, hidden, selection, false, false,
true);
} catch (Exception e)
{
e.printStackTrace();
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Failed to generate alignment with selection marked but no groups marked.");
}
try
{
- System.out.println(
+ jalview.bin.Console.outPrintln(
"View with no hidden columns, limited to selection and no groups to be collected:");
view = new AlignmentView(alignment, hidden, selection, false, true,
false);
} catch (Exception e)
{
e.printStackTrace();
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Failed to generate alignment with selection restricted but no groups marked.");
}
try
{
- System.out.println(
+ jalview.bin.Console.outPrintln(
"View with no hidden columns, limited to selection, and all groups to be collected:");
view = new AlignmentView(alignment, hidden, selection, false, true,
true);
} catch (Exception e)
{
e.printStackTrace();
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Failed to generate alignment with selection restricted and groups marked.");
}
try
{
- System.out.println(
+ jalview.bin.Console.outPrintln(
"View *with* hidden columns, no limit to selection, no groups to be collected:");
view = new AlignmentView(alignment, hidden, selection, true, false,
false);
} catch (Exception e)
{
e.printStackTrace();
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Failed to generate alignment with selection but no groups marked.");
}
try
{
- System.out.println(
+ jalview.bin.Console.outPrintln(
"View *with* hidden columns, no limit to selection, and all groups to be collected:");
view = new AlignmentView(alignment, hidden, selection, true, false,
true);
} catch (Exception e)
{
e.printStackTrace();
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Failed to generate alignment with selection marked but no groups marked.");
}
try
{
- System.out.println(
+ jalview.bin.Console.outPrintln(
"View *with* hidden columns, limited to selection and no groups to be collected:");
view = new AlignmentView(alignment, hidden, selection, true, true,
false);
} catch (Exception e)
{
e.printStackTrace();
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Failed to generate alignment with selection restricted but no groups marked.");
}
try
{
- System.out.println(
+ jalview.bin.Console.outPrintln(
"View *with* hidden columns, limited to selection, and all groups to be collected:");
view = new AlignmentView(alignment, hidden, selection, true, true,
true);
} catch (Exception e)
{
e.printStackTrace();
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Failed to generate alignment with selection restricted and groups marked.");
}
if (alignmentIndex < 0 || hiddenSequences[alignmentIndex] != null)
{
- System.out.println("ERROR!!!!!!!!!!!");
+ jalview.bin.Console.outPrintln("ERROR!!!!!!!!!!!");
return;
}
}
else
{
- System.out.println(
+ jalview.bin.Console.outPrintln(
seq.getName() + " has been deleted whilst hidden");
}
}
else
{
// debug
- // System.err.println("Outwith bounds!" + matchStart+">"+end +" or "
+ // jalview.bin.Console.errPrintln("Outwith bounds!" + matchStart+">"+end +" or "
// + matchEnd+"<"+start);
}
}
{
if (name == null)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"POSSIBLE IMPLEMENTATION ERROR: null sequence name passed to constructor.");
name = "";
}
{
if (sf.getType() == null)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"SequenceFeature type may not be null: " + sf.toString());
return false;
}
} catch (java.lang.OutOfMemoryError err)
{
// TODO: catch OOM
- System.out.println("Out of memory loading groups: " + err);
+ jalview.bin.Console.outPrintln("Out of memory loading groups: " + err);
}
return upd;
}
int nextQuotePos = descriptor.indexOf(QUOTE, 1);
if (nextQuotePos == -1)
{
- System.err.println(invalidFormat);
+ jalview.bin.Console.errPrintln(invalidFormat);
return null;
}
firstField = descriptor.substring(1, nextQuotePos);
int nextSpacePos = descriptor.indexOf(SPACE);
if (nextSpacePos == -1)
{
- System.err.println(invalidFormat);
+ jalview.bin.Console.errPrintln(invalidFormat);
return null;
}
firstField = descriptor.substring(0, nextSpacePos);
cond = Condition.fromString(leftToParse);
if (cond == null || cond.needsAPattern())
{
- System.err.println(invalidFormat);
+ jalview.bin.Console.errPrintln(invalidFormat);
return null;
}
}
else
{
// unbalanced quote
- System.err.println(invalidFormat);
+ jalview.bin.Console.errPrintln(invalidFormat);
return null;
}
}
if (spacePos == -1)
{
// trailing junk after a match condition
- System.err.println(invalid);
+ jalview.bin.Console.errPrintln(invalid);
return null;
}
String conjunction = leftToParse.substring(0, spacePos);
else
{
// not an AND or an OR - invalid
- System.err.println(invalid);
+ jalview.bin.Console.errPrintln(invalid);
return null;
}
}
int closePos = leftToParse.indexOf(CLOSE_BRACKET);
if (closePos == -1)
{
- System.err.println(invalid);
+ jalview.bin.Console.errPrintln(invalid);
return null;
}
nextCondition = leftToParse.substring(1, closePos);
FeatureMatcher fm = FeatureMatcher.fromString(nextCondition);
if (fm == null)
{
- System.err.println(invalid);
+ jalview.bin.Console.errPrintln(invalid);
return null;
}
try
} catch (IllegalStateException e)
{
// thrown if OR and AND are mixed
- System.err.println(invalid);
+ jalview.bin.Console.errPrintln(invalid);
return null;
}
SequenceFeature sf = contactFeatureEnds.get(index);
if (!sf.isContactFeature())
{
- System.err.println("Error! non-contact feature type " + sf.getType()
+ jalview.bin.Console.errPrintln("Error! non-contact feature type " + sf.getType()
+ " in contact features list");
index++;
continue;
SequenceFeature sf = contactFeatureStarts.get(index);
if (!sf.isContactFeature())
{
- System.err.println("Error! non-contact feature " + sf.toString()
+ jalview.bin.Console.errPrintln("Error! non-contact feature " + sf.toString()
+ " in contact features list");
index++;
continue;
String type = sf.getType();
if (type == null)
{
- System.err.println("Feature type may not be null: " + sf.toString());
+ jalview.bin.Console.errPrintln("Feature type may not be null: " + sf.toString());
return false;
}
return true;
} catch (NumberFormatException e)
{
- System.err.println("Bad integers in description " + description);
+ jalview.bin.Console.errPrintln("Bad integers in description " + description);
}
}
return false;
ids, -1, MODE_MAP, null);
} catch (IOException | ParseException e)
{
- System.err.println("Error parsing " + identifier + " lookup response "
+ jalview.bin.Console.errPrintln("Error parsing " + identifier + " lookup response "
+ e.getMessage());
return null;
}
return (parseAssemblyMappingResponse(url));
} catch (Throwable t)
{
- System.out.println("Error calling " + url + ": " + t.getMessage());
+ jalview.bin.Console.outPrintln("Error calling " + url + ": " + t.getMessage());
return null;
}
}
return null;
} catch (Throwable t)
{
- System.out.println("Error calling " + url + ": " + t.getMessage());
+ jalview.bin.Console.outPrintln("Error calling " + url + ": " + t.getMessage());
return null;
}
}
String ass = mapped.get("assembly_name").toString();
if (assembly != null && !assembly.equals(ass))
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"EnsemblMap found multiple assemblies - can't resolve");
return null;
}
String chr = mapped.get("seq_region_name").toString();
if (chromosome != null && !chromosome.equals(chr))
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"EnsemblMap found multiple chromosomes - can't resolve");
return null;
}
return pingString != null;
} catch (Throwable t)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Error connecting to " + pingUrl + ": " + t.getMessage());
} finally
{
* note: a GET request for an invalid id returns an error code e.g. 415
* but POST request returns 200 and an empty Fasta response
*/
- System.err.println("Response code " + responseCode);// + " for " + url);
+ jalview.bin.Console.errPrintln("Response code " + responseCode);// + " for " + url);
return null;
}
protected HttpURLConnection tryConnection(URL url, List<String> ids,
int readTimeout) throws IOException, ProtocolException
{
- // System.out.println(System.currentTimeMillis() + " " + url);
+ // jalview.bin.Console.outPrintln(System.currentTimeMillis() + " " + url);
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
int retrySecs = Integer.valueOf(retryDelay);
if (retrySecs > 0 && retrySecs < 10)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Ensembl REST service rate limit exceeded, waiting "
+ retryDelay + " seconds before retrying");
Thread.sleep(1000 * retrySecs);
}
} catch (NumberFormatException | InterruptedException e)
{
- System.err.println("Error handling Retry-After: " + e.getMessage());
+ jalview.bin.Console.errPrintln("Error handling Retry-After: " + e.getMessage());
}
}
}
}
} catch (NumberFormatException e)
{
- System.err.println("Error in REST version: " + e.toString());
+ jalview.bin.Console.errPrintln("Error in REST version: " + e.toString());
}
/*
expected) == 1;
if (laterVersion)
{
- System.err.println(String.format(
+ jalview.bin.Console.errPrintln(String.format(
"EnsemblRestClient expected %s REST version %s but found %s, see %s",
getDbSource(), expected, version, REST_CHANGE_LOG));
}
info.restVersion = version;
} catch (Throwable t)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Error checking Ensembl REST version: " + t.getMessage());
}
}
domainData.get(getDomain()).dataVersion = versions.get(0).toString();
} catch (Throwable e)
{// could be IOException | ParseException e) {
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Error checking Ensembl data version: " + e.getMessage());
}
}
String msg = "Aborting ID retrieval after " + v
+ " chunks. Unexpected problem (" + r.getLocalizedMessage()
+ ")";
- System.err.println(msg);
+ jalview.bin.Console.errPrintln(msg);
r.printStackTrace();
break;
}
}
} catch (IOException e)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Error transferring Ensembl features: " + e.getMessage());
}
// Platform.timeCheck("ESP.addfeat done", Platform.TIME_MARK);
String accId = querySeq.getName();
try
{
- System.out.println("Adding protein product for " + accId);
+ jalview.bin.Console.outPrintln("Adding protein product for " + accId);
AlignmentI protein = new EnsemblProtein(getDomain())
.getSequenceRecords(accId);
if (protein == null || protein.getHeight() == 0)
{
- System.out.println("No protein product found for " + accId);
+ jalview.bin.Console.outPrintln("No protein product found for " + accId);
return;
}
SequenceI proteinSeq = protein.getSequenceAt(0);
seq.addDBRef(xrefs.get(i));
}
- // System.out.println("primaries are " + seq.getPrimaryDBRefs().toString());
+ // jalview.bin.Console.outPrintln("primaries are " + seq.getPrimaryDBRefs().toString());
/*
* and add a reference to itself
*/
if (seqs.size() != ids.size())
{
- System.out.println(String.format(
+ jalview.bin.Console.outPrintln(String.format(
"Only retrieved %d sequences for %d query strings",
seqs.size(), ids.size()));
}
result.add(sequence);
} catch (ParseException | IOException e)
{
- System.err.println("Error processing JSON response: " + e.toString());
+ jalview.bin.Console.errPrintln("Error processing JSON response: " + e.toString());
// ignore
}
// Platform.timeCheck("ENS seqproxy2", Platform.TIME_MARK);
if (regions.isEmpty())
{
- System.out.println("Failed to identify target sequence for " + accId
+ jalview.bin.Console.outPrintln("Failed to identify target sequence for " + accId
+ " from genomic features");
return null;
}
boolean result = transferFeatures(sfs, targetSequence, mapping,
accessionId);
- // System.out.println("transferFeatures (" + (sfs.size()) + " --> "
+ // jalview.bin.Console.outPrintln("transferFeatures (" + (sfs.size()) + " --> "
// + targetSequence.getFeatures().getFeatureCount(true) + ") to "
// + targetSequence.getName() + " took "
// + (System.currentTimeMillis() - start) + "ms");
{
if (!isValid() || !refFile.isIndexed())
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Cannot read contig as file is invalid or not indexed");
return null;
}
public void createImage(String file, String type, int quality)
{
- System.out.println("JMOL CREATE IMAGE");
+ jalview.bin.Console.outPrintln("JMOL CREATE IMAGE");
}
@Override
public String createImage(String fileName, String type,
Object textOrBytes, int quality)
{
- System.out.println("JMOL CREATE IMAGE");
+ jalview.bin.Console.outPrintln("JMOL CREATE IMAGE");
return null;
}
@Override
public String eval(String strEval)
{
- // System.out.println(strEval);
+ // jalview.bin.Console.outPrintln(strEval);
// "# 'eval' is implemented only for the applet.";
return null;
}
lastMessage = strInfo;
if (data != null)
{
- System.err.println("Ignoring additional hover info: " + data
+ jalview.bin.Console.errPrintln("Ignoring additional hover info: " + data
+ " (other info: '" + strInfo + "' pos " + atomIndex + ")");
}
mouseOverStructure(atomIndex, strInfo);
*/
if (strData != null)
{
- System.err.println("Ignoring additional pick data string " + strData);
+ jalview.bin.Console.errPrintln("Ignoring additional pick data string " + strData);
}
int chainSeparator = strInfo.indexOf(":");
int p = 0;
(data == null) ? ((String) null) : (String) data[1]);
break;
case ERROR:
- // System.err.println("Ignoring error callback.");
+ // jalview.bin.Console.errPrintln("Ignoring error callback.");
break;
case SYNC:
case RESIZE:
case CLICK:
default:
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Unhandled callback " + type + " " + data[1].toString());
break;
}
} catch (Exception e)
{
- System.err.println("Squashed Jmol callback handler error:");
+ jalview.bin.Console.errPrintln("Squashed Jmol callback handler error:");
e.printStackTrace();
}
}
public void setCallbackFunction(String callbackType,
String callbackFunction)
{
- System.err.println("Ignoring set-callback request to associate "
+ jalview.bin.Console.errPrintln("Ignoring set-callback request to associate "
+ callbackType + " with function " + callbackFunction);
}
String buttonsToShow)
{
- System.err.println("Allocating Jmol Viewer: " + commandOptions);
+ jalview.bin.Console.errPrintln("Allocating Jmol Viewer: " + commandOptions);
if (commandOptions == null)
{
console = createJmolConsole(consolePanel, buttonsToShow);
} catch (Throwable e)
{
- System.err.println("Could not create Jmol application console. "
+ jalview.bin.Console.errPrintln("Could not create Jmol application console. "
+ e.getMessage());
e.printStackTrace();
}
}
} catch (OutOfMemoryError er)
{
- System.out.println(
+ jalview.bin.Console.outPrintln(
"OUT OF MEMORY LOADING TRANSFORMING JMOL MODEL TO JALVIEW MODEL");
throw new IOException(MessageManager
.getString("exception.outofmemory_loading_mmcif_file"));
org.jmol.modelset.Atom prevAtom,
HashMap<String, org.jmol.modelset.Atom> chainTerMap)
{
- // System.out.println("Atom: " + curAtom.getAtomNumber()
+ // jalview.bin.Console.outPrintln("Atom: " + curAtom.getAtomNumber()
// + " Last atom index " + curAtom.group.lastAtomIndex);
if (chainTerMap == null || prevAtom == null)
{
if (sval == null)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"DEVELOPER WARNING: Annotate3d didn't return a '2D' tag in its response. Consider checking output of server. Response was :"
+ val.toString());
boolean getReply)
{
String postBody = getPostRequest(command);
- // System.out.println(postBody);// debug
+ // jalview.bin.Console.outPrintln(postBody);// debug
String rpcUrl = "http://127.0.0.1:" + this.pymolXmlRpcPort;
PrintWriter out = null;
BufferedReader in = null;
}
else if (message.startsWith(MODEL_CHANGED))
{
- System.err.println(message);
+ jalview.bin.Console.errPrintln(message);
processModelChanged(message.substring(MODEL_CHANGED.length()));
}
else
{
- System.err.println("Unexpected chimeraNotification: " + message);
+ jalview.bin.Console.errPrintln("Unexpected chimeraNotification: " + message);
}
}
}
*/
protected void processModelChanged(String message)
{
- // System.out.println(message + " (not implemented in Jalview)");
+ // jalview.bin.Console.outPrintln(message + " (not implemented in Jalview)");
}
/**
startListening(chimeraListener.getUri());
} catch (BindException e)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Failed to start Chimera listener: " + e.getMessage());
}
}
private void log(String message)
{
- System.err.println("## Chimera log: " + message);
+ jalview.bin.Console.errPrintln("## Chimera log: " + message);
}
/**
executeCommand(false, null, command);
} catch (IOException e)
{
- System.err.println("Sending commands to Chimera via file failed with "
+ jalview.bin.Console.errPrintln("Sending commands to Chimera via file failed with "
+ e.getMessage());
}
}
int x = 0;
for (FTSDataColumnI field : allFTSDataColumns)
{
- // System.out.println("allFTSDataColumns==" + allFTSDataColumns);
+ // jalview.bin.Console.outPrintln("allFTSDataColumns==" + allFTSDataColumns);
if (field.getName().equalsIgnoreCase("all"))
{
continue;
data[x++] = new Object[] { ftsRestClient
.getAllDefaultDisplayedFTSDataColumns().contains(field),
field.getName(), field.getGroup() };
- // System.out.println(" PUIS " + field.getName() + " ET AUSSI " +
+ // jalview.bin.Console.outPrintln(" PUIS " + field.getName() + " ET AUSSI " +
// field.getGroup() + "X = " + x);
break;
case STRUCTURE_CHOOSER:
} catch (Exception e)
{
e.printStackTrace();
- System.out.println("offending value:" + fieldData);
+ jalview.bin.Console.outPrintln("offending value:" + fieldData);
}
}
}
URI uri = webResource.getURI();
- System.out.println(uri);
+ jalview.bin.Console.outPrintln(uri);
ClientResponse clientResponse = null;
int responseStatus = -1;
// Get the JSON string from the response object or directly from the
Map<String, Object> jsonObj = null;
String responseString = null;
- System.out.println("query >>>>>>> " + pdbRestRequest.toString());
+ jalview.bin.Console.outPrintln("query >>>>>>> " + pdbRestRequest.toString());
if (!isMocked())
{
for (FTSDataColumnI field : diplayFields)
{
- // System.out.println("Field " + field);
+ // jalview.bin.Console.outPrintln("Field " + field);
String fieldData = (pdbJsonDoc.get(field.getCode()) == null) ? ""
: pdbJsonDoc.get(field.getCode()).toString();
- // System.out.println("Field Data : " + fieldData);
+ // jalview.bin.Console.outPrintln("Field Data : " + fieldData);
if (field.isPrimaryKeyColumn())
{
primaryKey = fieldData;
} catch (Exception e)
{
e.printStackTrace();
- System.out.println("offending value:" + fieldData);
+ jalview.bin.Console.outPrintln("offending value:" + fieldData);
}
}
}
@Override
protected void showHelp()
{
- System.out.println("No help implemented yet.");
+ jalview.bin.Console.outPrintln("No help implemented yet.");
}
webResource = client.resource(DEFAULT_THREEDBEACONS_DOMAIN + query);
URI uri = webResource.getURI();
- System.out.println(uri.toString());
+ jalview.bin.Console.outPrintln(uri.toString());
// Execute the REST request
ClientResponse clientResponse;
String fieldData = (tdbJsonStructure.get(field.getCode()) == null)
? " "
: tdbJsonStructure.get(field.getCode()).toString();
- // System.out.println("Field : " + field + " Data : " + fieldData);
+ // jalview.bin.Console.outPrintln("Field : " + field + " Data : " + fieldData);
if (field.isPrimaryKeyColumn())
{
primaryKey = fieldData;
} catch (Exception e)
{
// e.printStackTrace();
- System.out.println("offending value:" + fieldData + fieldData);
+ jalview.bin.Console.outPrintln("offending value:" + fieldData + fieldData);
}
}
}
.getEntity(String.class);
// Make redundant objects eligible for garbage collection to conserve
// memory
- // System.out.println(">>>>> response : "
+ // jalview.bin.Console.outPrintln(">>>>> response : "
// + uniProtTabDelimittedResponseString);
if (clientResponse.getStatus() != 200)
{
firstRow = false;
continue;
}
- // System.out.println(dataRow);
+ // jalview.bin.Console.outPrintln(dataRow);
result.add(getFTSData(dataRow, uniprotRestRequest));
}
searchResult.setNumberOfItemsFound(xTotalResults);
} catch (Exception e)
{
e.printStackTrace();
- System.out.println("offending value:" + fieldData);
+ jalview.bin.Console.outPrintln("offending value:" + fieldData);
}
}
} catch (Exception e)
// if (viewport.cursorMode)
// {
// alignPanel.seqPanel.insertNucAtCursor(false,"A");
- // //System.out.println("A");
+ // //jalview.bin.Console.outPrintln("A");
// }
// break;
/*
* case KeyEvent.VK_CLOSE_BRACKET: if (viewport.cursorMode) {
- * System.out.println("closing bracket"); } break;
+ * jalview.bin.Console.outPrintln("closing bracket"); } break;
*/
case KeyEvent.VK_DELETE:
case KeyEvent.VK_BACK_SPACE:
@Override
public void propertyChange(PropertyChangeEvent evt)
{
- // // System.out.println("Discoverer property change.");
+ // // jalview.bin.Console.outPrintln("Discoverer property change.");
// if (evt.getPropertyName().equals("services"))
{
SwingUtilities.invokeLater(new Runnable()
@Override
public void run()
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Rebuild WS Menu for service change");
BuildWebServiceMenu();
}
public void internalFrameClosed(
javax.swing.event.InternalFrameEvent evt)
{
- // System.out.println("deregistering discoverer listener");
+ // jalview.bin.Console.outPrintln("deregistering discoverer listener");
Desktop.instance.removeJalviewPropertyChangeListener("services",
thisListener);
closeMenuItem_actionPerformed(true);
} catch (Exception ex)
{
ex.printStackTrace();
- System.out.println("Exception whilst pasting: " + ex);
+ jalview.bin.Console.outPrintln("Exception whilst pasting: " + ex);
// could be anything being pasted in here
}
} catch (Exception ex)
{
ex.printStackTrace();
- System.out.println("Exception whilst pasting: " + ex);
+ jalview.bin.Console.outPrintln("Exception whilst pasting: " + ex);
// could be anything being pasted in here
} catch (OutOfMemoryError oom)
{
{
try
{
- System.err.println("Waiting for building menu to finish.");
+ jalview.bin.Console.errPrintln("Waiting for building menu to finish.");
Thread.sleep(10);
} catch (Exception e)
{
final List<JMenuItem> legacyItems = new ArrayList<>();
try
{
- // System.err.println("Building ws menu again "
+ // jalview.bin.Console.errPrintln("Building ws menu again "
// + Thread.currentThread());
// TODO: add support for context dependent disabling of services based
// on
Desktop.instance);
if (pe != null)
{
- System.err.println("Associated file : "
+ jalview.bin.Console.errPrintln("Associated file : "
+ (fm[0].toString()) + " with "
+ toassoc.getDisplayId(true));
assocfiles++;
viewport.getAlignment()));
} catch (Exception ex)
{
- System.err.println(ex.getMessage());
+ jalview.bin.Console.errPrintln(ex.getMessage());
return;
}
}
console.runScript();
} catch (Exception ex)
{
- System.err.println((ex.toString()));
+ jalview.bin.Console.errPrintln((ex.toString()));
JvOptionPane.showInternalMessageDialog(Desktop.desktop,
MessageManager.getString("label.couldnt_run_groovy_script"),
MessageManager.getString("label.groovy_support_failed"),
}
else
{
- System.err.println("Can't run Groovy script as console not found");
+ jalview.bin.Console.errPrintln("Can't run Groovy script as console not found");
}
}
// this is called after loading new annotation onto alignment
if (alignFrame.getHeight() == 0)
{
- System.out.println("NEEDS FIXING");
+ jalview.bin.Console.outPrintln("NEEDS FIXING");
}
validateAnnotationDimensions(true);
addNotify();
{
if (debugRedraw)
{
- System.out.println("before vis: " + i);
+ jalview.bin.Console.outPrintln("before vis: " + i);
}
before = true;
}
{
if (debugRedraw)
{
- System.out.println(
+ jalview.bin.Console.outPrintln(
"Scroll offset: " + sOffset + " after vis: " + i);
}
after = true;
tried = true;
} catch (IllegalArgumentException exc)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Serious issue with viewport geometry imgWidth requested was "
+ imgWidth);
return;
&& (fadedImage == null || fadedImage.getWidth() != imgWidth
|| fadedImage.getHeight() != image.getHeight()))
{
- // System.err.println("redraw faded image ("+(fadedImage==null ?
+ // jalview.bin.Console.errPrintln("redraw faded image ("+(fadedImage==null ?
// "null image" : "") + " lastGood="+lastImageGood+")");
fadedImage = new BufferedImage(imgWidth, image.getHeight(),
BufferedImage.TYPE_INT_RGB);
}
if (waitTotal > waitMax)
{
- System.err.println("Timed out waiting for Jmol to load files after "
+ jalview.bin.Console.errPrintln("Timed out waiting for Jmol to load files after "
+ waitTotal + "ms");
- // System.err.println("finished: " + jmb.isFinishedInit()
+ // jalview.bin.Console.errPrintln("finished: " + jmb.isFinishedInit()
// + "; loaded: " + Arrays.toString(jmb.getPdbFile())
// + "; files: " + files.toString());
jmb.getStructureFiles();
.openURL("http://wiki.jmol.org");// http://jmol.sourceforge.net/docs/JmolUserGuide/");
} catch (Exception ex)
{
- System.err.println("Show Jmol help failed with: " + ex.getMessage());
+ jalview.bin.Console.errPrintln("Show Jmol help failed with: " + ex.getMessage());
}
}
if (shift != null)
{
int i = shift.shift(newBase.getIndex());
- // System.err.println("shifted "+(arg1.getIndex())+" to "+i);
+ // jalview.bin.Console.errPrintln("shifted "+(arg1.getIndex())+" to "+i);
ssm.mouseOverVamsasSequence(seq, i, this);
}
else
} catch (ExceptionNAViewAlgorithm e)
{
// only throwable for draw mode = 3 NAView
- System.err.println("Error drawing RNA: " + e.getMessage());
+ jalview.bin.Console.errPrintln("Error drawing RNA: " + e.getMessage());
}
}
}
String formattedDate = Cache.setDateProperty(
"JALVIEW_NEWS_RSS_LASTMODIFIED", lastread.getTime());
BlogReader me = new BlogReader();
- System.out.println("Set last date to " + formattedDate);
+ jalview.bin.Console.outPrintln("Set last date to " + formattedDate);
if (me.isNewsNew())
{
Console.debug("There is news to read.");
boolean opened = jmb.openSession(chimeraSessionFile);
if (!opened)
{
- System.err.println("An error occurred opening Chimera session file "
+ jalview.bin.Console.errPrintln("An error occurred opening Chimera session file "
+ chimeraSessionFile);
}
}
}
} catch (Exception ex)
{
- System.out.println("Error loading User ColourFile\n" + ex);
+ jalview.bin.Console.outPrintln("Error loading User ColourFile\n" + ex);
}
}
// you may omit this part for your application
//
- System.out.println("Hello World 2");
- System.out.println("All fonts available to Graphic2D:\n");
+ jalview.bin.Console.outPrintln("Hello World 2");
+ jalview.bin.Console.outPrintln("All fonts available to Graphic2D:\n");
GraphicsEnvironment ge = GraphicsEnvironment
.getLocalGraphicsEnvironment();
String[] fontNames = ge.getAvailableFontFamilyNames();
for (int n = 0; n < fontNames.length; n++)
{
- System.out.println(fontNames[n]);
+ jalview.bin.Console.outPrintln(fontNames[n]);
}
// Testing part: simple an error thrown anywhere in this JVM will be printed
// on the Console
// We do it with a seperate Thread becasue we don't wan't to break a Thread
// used by the Console.
- System.out.println("\nLets throw an error on this console");
+ jalview.bin.Console.outPrintln("\nLets throw an error on this console");
errorThrower = new Thread(this);
errorThrower.setDaemon(true);
errorThrower.start();
MessageManager.getString("label.cant_map_cds"),
MessageManager.getString("label.operation_failed"),
JvOptionPane.OK_OPTION);
- System.err.println("Failed to make CDS alignment");
+ jalview.bin.Console.errPrintln("Failed to make CDS alignment");
return null;
}
if (copyAlignment.getHeight() <= 0)
{
- System.err.println("No Sequences generated for xRef type " + source);
+ jalview.bin.Console.errPrintln("No Sequences generated for xRef type " + source);
return null;
}
* Send this message to stderr as the warning that follows (due to
* reflection) also goes to stderr.
*/
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Linux platform only! You may have the following warning next: \"WARNING: An illegal reflective access operation has occurred\"\nThis is expected and cannot be avoided, sorry about that.");
}
final String awtAppClassName = "awtAppClassName";
}
} catch (Exception ex)
{
- System.out.println(
+ jalview.bin.Console.outPrintln(
"Unable to paste alignment from system clipboard:\n" + ex);
}
}
}
} catch (Exception ex)
{
- System.err.println("Error opening help: " + ex.getMessage());
+ jalview.bin.Console.errPrintln("Error opening help: " + ex.getMessage());
}
}
boolean autoSave = projectFile != null && !saveAs
&& BackupFiles.getEnabled();
- // System.out.println("autoSave="+autoSave+", projectFile='"+projectFile+"',
+ // jalview.bin.Console.outPrintln("autoSave="+autoSave+", projectFile='"+projectFile+"',
// saveAs="+saveAs+", Backups
// "+(BackupFiles.getEnabled()?"enabled":"disabled"));
{
if (Platform.isAMacAndNotJS())
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Please ignore plist error - occurs due to problem with java 8 on OSX");
}
}
}
} catch (Exception ex)
{
- System.out.println("Error loading User Colour File\n" + ex);
+ jalview.bin.Console.outPrintln("Error loading User Colour File\n" + ex);
}
}
{
Color newColor = gcol.getMaxColour();
comp.setBackground(newColor);
- // System.err.println("Width is " + w / 2);
+ // jalview.bin.Console.errPrintln("Width is " + w / 2);
Icon ficon = new FeatureIcon(gcol, comp.getBackground(), w, h, thr);
comp.setIcon(ficon);
// tt+="RGB value: Max (" + newColor.getRed() + ", "
{
if (featureSettings != null)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"IMPLEMENTATION ISSUE: overwriting action listener for FeatureColourChooser");
}
featureSettings = listener;
hb.setCurrentID(id.getId());
} catch (BadIDException bad)
{
- System.out.println("Bad help link: " + id.getId()
+ jalview.bin.Console.outPrintln("Bad help link: " + id.getId()
+ ": must match a target in help.jhm");
throw bad;
}
}
else
{
- System.err.println("dupe ig for : " + dbs[i] + " \t"
+ jalview.bin.Console.errPrintln("dupe ig for : " + dbs[i] + " \t"
+ dbp.getDbName() + " (" + dbp.getDbSource() + ")");
source.remove(tn);
}
@Override
public void setVisible(boolean arg0)
{
- System.out.println("setVisible: " + arg0);
+ jalview.bin.Console.outPrintln("setVisible: " + arg0);
super.setVisible(arg0);
}
}
private static void outputMessage(Object message)
{
- System.out.println(">>> JOption Message : " + message.toString());
+ jalview.bin.Console.outPrintln(">>> JOption Message : " + message.toString());
}
public static Object getMockResponse()
}
} catch (NumberFormatException e)
{
- System.err.println(e.toString());
+ jalview.bin.Console.errPrintln(e.toString());
}
if (minValue != null || maxValue != null)
{
}
} catch (NumberFormatException e)
{
- System.err.println(e.toString());
+ jalview.bin.Console.errPrintln(e.toString());
}
if (minValue != null && maxValue != null)
{
{
// raise an implementation warning here - not sure if this situation
// will ever occur
- System.err.println(
+ jalview.bin.Console.errPrintln(
"IMPLEMENTATION PROBLEM: DATASET out of sync due to an insert whilst calling PaintRefresher.validateSequences(AlignmentI, ALignmentI)");
}
List<SequenceI> alsq = comp.getSequences();
if (!first)
{
- System.out.println(DASHES);
+ jalview.bin.Console.outPrintln(DASHES);
textarea.append(DASHES);
}
first = false;
for (int i = 0; i < seqs.length; i++)
{
- System.out.println(
+ jalview.bin.Console.outPrintln(
String.format("%3d %s", i + 1, seqs[i].getDisplayId(true)));
}
{
System.out.print(String.format("%7d", i + 1));
}
- System.out.println();
+ jalview.bin.Console.outPrintln();
for (int i = 0; i < seqs.length; i++)
{
*/
System.out.print(String.format("%7.3f", scores[i][j] / totscore));
}
- System.out.println();
+ jalview.bin.Console.outPrintln();
}
- System.out.println("\n");
+ jalview.bin.Console.outPrintln("\n");
}
/**
String[] omitHidden = null;
- System.out.println("PROMPT USER HERE"); // TODO: decide if a prompt happens
+ jalview.bin.Console.outPrintln("PROMPT USER HERE"); // TODO: decide if a prompt happens
// or we simply trust the user wants
// wysiwig behaviour
final JPanel progressPanel = progressBars.get(id);
if (progressPanel == null)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"call setProgressBar before registering the progress bar's handler.");
return;
}
protected List<String> executeCommand(StructureCommandI command,
boolean getReply)
{
- // System.out.println(command.toString()); // debug
+ // jalview.bin.Console.outPrintln(command.toString()); // debug
return pymolManager.sendCommand(command, getReply);
}
validate();
sliderValueChanged();
- // System.out.println((System.currentTimeMillis()-start));
+ // jalview.bin.Console.outPrintln((System.currentTimeMillis()-start));
}
void sliderValueChanged()
.newInstance());
} catch (Throwable x)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Unexpected exception when instantiating rest input type.");
x.printStackTrace();
}
updated = true;
} catch (InvalidArgumentException ex)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"IMPLEMENTATION ERROR: Invalid argument for type : "
+ typeList.getSelectedValue() + "\n");
ex.printStackTrace();
types.add(jtype.getURLtokenPrefix());
} catch (Throwable x)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Unexpected exception when instantiating rest input type.");
x.printStackTrace();
}
mtch.group(2) + ":" + mtch.group(3), mtch.group(1),
mtch.group(2), mtch.group(3), inputTypes, warnings))
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"IMPLEMENTATION PROBLEM: Cannot parse RestService input parameter string '"
+ its + "'" + "\n" + warnings);
}
} catch (Throwable x)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"IMPLEMENTATION PROBLEM: Cannot parse RestService output parameter string '"
+ its + "'" + "\n" + warnings);
}
}
else
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"IMPLEMENTATION PROBLEM: Restservice generated from GUI is invalid\n"
+ warnings);
}
}
- // System.err.println(">>> FastPaint to " + transX + " " + transY + " "
+ // jalview.bin.Console.errPrintln(">>> FastPaint to " + transX + " " + transY + " "
// + horizontal + " " + vertical + " " + startRes + " " + endRes
// + " " + startSeq + " " + endSeq);
// Call repaint on alignment panel so that repaints from other alignment
// panel components can be aggregated. Otherwise performance of the
// overview window and others may be adversely affected.
- // System.out.println("SeqCanvas fastPaint() repaint() request...");
+ // jalview.bin.Console.outPrintln("SeqCanvas fastPaint() repaint() request...");
av.getAlignPanel().repaint();
} finally
{
public void propertyChange(PropertyChangeEvent evt)
{
String eventName = evt.getPropertyName();
- // System.err.println(">>SeqCanvas propertyChange " + eventName);
+ // jalview.bin.Console.errPrintln(">>SeqCanvas propertyChange " + eventName);
if (eventName.equals(SequenceGroup.SEQ_GROUP_CHANGED))
{
fastPaint = true;
else if (eventName.equals(ViewportRanges.MOVE_VIEWPORT))
{
fastPaint = false;
- // System.err.println("!!!! fastPaint false from MOVE_VIEWPORT");
+ // jalview.bin.Console.errPrintln("!!!! fastPaint false from MOVE_VIEWPORT");
repaint();
return;
}
} catch (OutOfMemoryError er)
{
System.gc();
- System.err.println("SeqCanvas OutOfMemory Redraw Error.\n" + er);
+ jalview.bin.Console.errPrintln("SeqCanvas OutOfMemory Redraw Error.\n" + er);
new OOMWarning("Creating alignment image for display", er);
return;
MousePos o = (MousePos) obj;
boolean b = (column == o.column && seqIndex == o.seqIndex
&& annotationIndex == o.annotationIndex);
- // System.out.println(obj + (b ? "= " : "!= ") + this);
+ // jalview.bin.Console.outPrintln(obj + (b ? "= " : "!= ") + this);
return b;
}
if (lastMessage == null || !lastMessage.equals(tmp))
{
- // System.err.println("mouseOver Sequence: "+tmp);
+ // jalview.bin.Console.errPrintln("mouseOver Sequence: "+tmp);
ssm.mouseOverSequence(sequence, index, pos, av);
}
lastMessage = tmp;
@Override
public void updateColours(SequenceI seq, int index)
{
- System.out.println("update the seqPanel colours");
+ jalview.bin.Console.outPrintln("update the seqPanel colours");
// repaint();
}
if (copycolsel && av.hasHiddenColumns()
&& (av.getAlignment().getHiddenColumns() == null))
{
- System.err.println("Bad things");
+ jalview.bin.Console.errPrintln("Bad things");
}
if (repaint) // always true!
{
+ ((StringPair) database.getSelectedItem()).getDisplay());
// error
// +="Couldn't retrieve sequences from "+database.getSelectedItem();
- System.err.println("Retrieval failed for source ='"
+ jalview.bin.Console.errPrintln("Retrieval failed for source ='"
+ ((StringPair) database.getSelectedItem()).getDisplay()
+ "' and query\n'" + textArea.getText() + "'\n");
e.printStackTrace();
}
if (mt.isErrorAny())
{
- System.err.println("Error when loading images!");
+ jalview.bin.Console.errPrintln("Error when loading images!");
}
} while (!mt.checkAll());
Desktop.instance.setIconImages(ChannelProperties.getIconList());
protected boolean refreshText()
{
String newtext = Desktop.instance.getAboutMessage();
- // System.err.println("Text found: \n"+newtext+"\nEnd of newtext.");
+ // jalview.bin.Console.errPrintln("Text found: \n"+newtext+"\nEnd of newtext.");
if (oldTextLength != newtext.length())
{
iframe.setVisible(false);
// for moment, it will work fine as is because it is self-contained
String searchTerm = text.toLowerCase(Locale.ROOT);
searchTerm = searchTerm.split(":")[0];
- // System.out.println(">>>>> search term : " + searchTerm);
+ // jalview.bin.Console.outPrintln(">>>>> search term : " + searchTerm);
List<FTSDataColumnI> wantedFields = new ArrayList<>();
FTSRestRequest pdbRequest = new FTSRestRequest();
pdbRequest.setAllowEmptySeq(false);
}
} catch (Exception e)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Error retrieving PDB id " + pdbid + ": " + e.getMessage());
} finally
{
{
if (tree == null)
{
- System.out.println("tree is null");
+ jalview.bin.Console.outPrintln("tree is null");
// TODO: deal with case when a change event is received whilst a
// tree is still being calculated - should save reference for
// processing message later.
}
if (evt.getNewValue() == null)
{
- System.out.println(
+ jalview.bin.Console.outPrintln(
"new alignment sequences vector value is null");
}
pg.close();
} catch (Exception ex)
{
- System.err.println("Error writing tree as EPS");
+ jalview.bin.Console.errPrintln("Error writing tree as EPS");
ex.printStackTrace();
}
}
cdoc = null;
} catch (Exception ee)
{
- System.err.println("Exception whilst updating :");
+ jalview.bin.Console.errPrintln("Exception whilst updating :");
ee.printStackTrace(System.err);
// recover object map backup, since its probably corrupted with references
// to Vobjects that don't exist anymore.
// we only care about AlignmentSequence selections
SelectionMessage sm = (SelectionMessage) message;
sm.validate();
- System.err.println("Received\n" + sm.getRawMessage());
+ jalview.bin.Console.errPrintln("Received\n" + sm.getRawMessage());
Object[] jvobjs = sm.getVorbaIDs() == null ? null
: new Object[sm.getVorbaIDs().length];
if (jvobjs == null)
@Override
public void internalFrameClosed(InternalFrameEvent evt)
{
- // System.out.println("Shutting down webservice client");
+ // jalview.bin.Console.outPrintln("Shutting down webservice client");
WSClientI service = thisinfo.getthisService();
if (service != null && service.isCancellable())
{
else
{
// TODO: show warning
- System.err.println("Invalid name. Not saved.");
+ jalview.bin.Console.errPrintln("Invalid name. Not saved.");
}
}
}
else
{
- System.err.println("Ignoring unknown service argument type "
+ jalview.bin.Console.errPrintln("Ignoring unknown service argument type "
+ myarg.getClass().getName());
}
}
{
if (arg instanceof OptionI)
{
- // System.out.println("Setting option "
+ // jalview.bin.Console.outPrintln("Setting option "
// + System.identityHashCode(arg) + ":" + arg.getName()
// + " with " + arg.getDefaultValue());
opanp.selectOption((OptionI) arg, arg.getValue());
if (cw + 120 > panewidth)
{
jobOptions.add(pbox, "wrap");
- // System.out.println("Wrap on "+pbox.option.getName());
+ // jalview.bin.Console.outPrintln("Wrap on "+pbox.option.getName());
cw = hgap + pbox.getSize().width;
fh = true;
}
}
// TODO: waste some time trying to eliminate any unnecessary .validate calls
// here
- // System.out.println("Size will be : "+w+","+os);
+ // jalview.bin.Console.outPrintln("Size will be : "+w+","+os);
// optsAndparams.setPreferredSize(null);
// paramPane.getViewport().setView(optsAndparams);
paramPane.getViewport().setAutoscrolls(true);
disc.run();
} catch (Exception e)
{
- System.err.println("Aborting. Problem discovering services.");
+ jalview.bin.Console.errPrintln("Aborting. Problem discovering services.");
e.printStackTrace();
return;
}
pr = en.next();
}
{
- System.out.println("Testing opts dupes for "
+ jalview.bin.Console.outPrintln("Testing opts dupes for "
+ lastserv.getUri() + " : " + lastserv.getActionText()
+ ":" + pr.getName());
List<Option> rg = lastserv.getRunnerConfig().getOptions();
Option cpy = jalview.ws.jws2.ParameterUtils.copyOption(o);
} catch (Exception e)
{
- System.err.println("Failed to copy " + o.getName());
+ jalview.bin.Console.errPrintln("Failed to copy " + o.getName());
e.printStackTrace();
} catch (Error e)
{
- System.err.println("Failed to copy " + o.getName());
+ jalview.bin.Console.errPrintln("Failed to copy " + o.getName());
e.printStackTrace();
}
}
}
{
- System.out.println("Testing param dupes:");
+ jalview.bin.Console.outPrintln("Testing param dupes:");
List<Parameter> rg = lastserv.getRunnerConfig()
.getParameters();
for (Parameter o : rg)
.copyParameter(o);
} catch (Exception e)
{
- System.err.println("Failed to copy " + o.getName());
+ jalview.bin.Console.errPrintln("Failed to copy " + o.getName());
e.printStackTrace();
} catch (Error e)
{
- System.err.println("Failed to copy " + o.getName());
+ jalview.bin.Console.errPrintln("Failed to copy " + o.getName());
e.printStackTrace();
}
}
}
{
- System.out.println("Testing param write:");
+ jalview.bin.Console.outPrintln("Testing param write:");
List<String> writeparam = null, readparam = null;
try
{
.writeParameterSet(
pr.getArguments(lastserv.getRunnerConfig()),
" ");
- System.out.println("Testing param read :");
+ jalview.bin.Console.outPrintln("Testing param read :");
List<Option> pset = jalview.ws.jws2.ParameterUtils
.processParameters(writeparam,
lastserv.getRunnerConfig(), " ");
String on = o.next(), sn = s.next(), st = t.next();
if (!sn.equals(st))
{
- System.out.println(
+ jalview.bin.Console.outPrintln(
"Original was " + on + " Phase 1 wrote " + sn
+ "\tPhase 2 wrote " + st);
failed = true;
}
if (failed)
{
- System.out.println(
+ jalview.bin.Console.outPrintln(
"Original parameters:\n" + pr.getOptions());
- System.out.println(
+ jalview.bin.Console.outPrintln(
"Wrote parameters in first set:\n" + writeparam);
- System.out.println(
+ jalview.bin.Console.outPrintln(
"Wrote parameters in second set:\n" + readparam);
}
* + storeSetName + ": ", jobParams); }
*
* private void writeParam(String nm, List<ArgumentI> params) { for (ArgumentI
- * p : params) { System.out.println(nm + ":" + System.identityHashCode(p) +
+ * p : params) { jalview.bin.Console.outPrintln(nm + ":" + System.identityHashCode(p) +
* " Name: " + p.getName() + " Value: " + p.getDefaultValue()); } }
*
* private Object[] _getUserPreset(String setName) { Object[] pset =
return;
}
settingDialog = true;
- System.out.println("Prompting to save " + lsetname);
+ jalview.bin.Console.outPrintln("Prompting to save " + lsetname);
if (JvOptionPane.showConfirmDialog(this, "Parameter set '" + lsetname
+ "' is modifed, and your changes will be lost.\nReally change preset ?",
"Warning: Unsaved Changes",
settingDialog = false;
// and leave.
return;
- // System.out.println("Saving for " + lsetname);
+ // jalview.bin.Console.outPrintln("Saving for " + lsetname);
// _storeCurrentPreset(lsetname);
}
return;
}
curSetName = newname;
- System.err.println("New name for user setting " + curSetName
+ jalview.bin.Console.errPrintln("New name for user setting " + curSetName
+ " (was " + setName.getSelectedItem() + ")");
if (curSetName.equals(setName.getSelectedItem()))
{
String[] names = seqName.toLowerCase(Locale.ROOT).split("\\|");
for (String name : names)
{
- // System.out.println("Found name : " + name);
+ // jalview.bin.Console.outPrintln("Found name : " + name);
name.trim();
if (isValidSeqName(name))
{
*/
static boolean isValidSeqName(String seqName)
{
- // System.out.println("seqName : " + seqName);
+ // jalview.bin.Console.outPrintln("seqName : " + seqName);
String ignoreList = "pdb,uniprot,swiss-prot";
if (seqName.length() < 3)
{
*/
static boolean isValidSeqName(String seqName)
{
- // System.out.println("seqName : " + seqName);
+ // jalview.bin.Console.outPrintln("seqName : " + seqName);
String ignoreList = "pdb,uniprot,swiss-prot";
if (seqName.length() < 3)
{
int idx = EXP_CATEGORIES.indexOf(upper_cat);
if (idx == -1)
{
- System.out.println("Unknown category: '" + cat + "'");
+ jalview.bin.Console.outPrintln("Unknown category: '" + cat + "'");
EXP_CATEGORIES.add(upper_cat);
idx = EXP_CATEGORIES.size() - 1;
}
{
if (!hasPdbResp)
{
- System.out.println(
+ jalview.bin.Console.outPrintln(
"Warning: seems like we couldn't get to the PDBe search interface.");
}
else
/*
* Set server error status on response
*/
- System.err.println("Exception handling request "
+ jalview.bin.Console.errPrintln("Exception handling request "
+ request.getRequestURI() + " : " + t.getMessage());
if (response.isCommitted())
{
/*
* Can't write an HTTP header once any response content has been written
*/
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Unable to return HTTP 500 as response already committed");
}
else
*/
protected void dumpRequest(HttpServletRequest request)
{
- System.out.println(request.getMethod());
- System.out.println(request.getRequestURL());
+ jalview.bin.Console.outPrintln(request.getMethod());
+ jalview.bin.Console.outPrintln(request.getRequestURL());
for (String hdr : Collections.list(request.getHeaderNames()))
{
for (String val : Collections.list(request.getHeaders(hdr)))
{
- System.out.println(hdr + ": " + val);
+ jalview.bin.Console.outPrintln(hdr + ": " + val);
}
}
for (String param : Collections.list(request.getParameterNames()))
{
for (String val : request.getParameterValues(param))
{
- System.out.println(param + "=" + val);
+ jalview.bin.Console.outPrintln(param + "=" + val);
}
}
}
stop();
} catch (Exception e)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Error stopping " + getName() + ": " + e.getMessage());
}
}
contextHandlers = new HandlerCollection(true);
server.setHandler(contextHandlers);
server.start();
- // System.out.println(String.format(
+ // jalview.bin.Console.outPrintln(String.format(
// "HttpServer started with %d threads", server.getThreadPool()
// .getThreads()));
contextRoot = server.getURI();
} catch (Exception e)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Error trying to start HttpServer: " + e.getMessage());
try
{
{
for (String val : Collections.list(request.getHeaders(hdr)))
{
- System.out.println(hdr + ": " + val);
+ jalview.bin.Console.outPrintln(hdr + ": " + val);
}
}
for (String param : Collections.list(request.getParameterNames()))
{
for (String val : request.getParameterValues(param))
{
- System.out.println(param + "=" + val);
+ jalview.bin.Console.outPrintln(param + "=" + val);
}
}
}
server.stop();
} catch (Exception e)
{
- System.err.println("Error stopping Http Server on "
+ jalview.bin.Console.errPrintln("Error stopping Http Server on "
+ server.getURI() + ": " + e.getMessage());
}
}
ch.start();
} catch (Exception e)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Error starting handler for " + path + ": " + e.getMessage());
}
handler.setUri(this.contextRoot + ch.getContextPath().substring(1));
- System.out.println("Jalview " + handler.getName()
+ jalview.bin.Console.outPrintln("Jalview " + handler.getName()
+ " handler started on " + handler.getUri());
}
{
contextHandlers.removeHandler(ch);
myHandlers.remove(handler);
- System.out.println("Stopped Jalview " + handler.getName()
+ jalview.bin.Console.outPrintln("Stopped Jalview " + handler.getName()
+ " handler on " + handler.getUri());
}
}
}
else
{
- // System.err.println("Skipping NaN - not valid value.");
+ // jalview.bin.Console.errPrintln("Skipping NaN - not valid value.");
text.append(comma + 0f);// row.annotations[j].value);
}
comma = ",";
} catch (Exception ex)
{
ex.printStackTrace();
- System.out.println("Problem reading annotation file: " + ex);
+ jalview.bin.Console.outPrintln("Problem reading annotation file: " + ex);
if (nlinesread > 0)
{
- System.out.println("Last read line " + nlinesread + ": '" + lastread
+ jalview.bin.Console.outPrintln("Last read line " + nlinesread + ": '" + lastread
+ "' (first 80 chars) ...");
}
return false;
if (refSeqIndex < 1)
{
refSeqIndex = 1;
- System.out.println(
+ jalview.bin.Console.outPrintln(
"WARNING: SEQUENCE_REF index must be > 0 in AnnotationFile");
}
} catch (Exception ex)
{
if (hidden == null)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Cannot process HIDE_INSERTIONS without an alignment view: Ignoring line: "
+ line);
}
{
// TODO: specify and implement duplication of alignment annotation
// for multiple group references.
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Ignoring 1:many group reference mappings for group name '"
+ groupRef + "'");
}
}
else
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Couldn't combine annotations. None are added to alignment yet!");
}
}
value = Float.valueOf(nextToken);
} catch (NumberFormatException e)
{
- System.err.println("line " + nlinesread + ": Threshold '" + nextToken
+ jalview.bin.Console.errPrintln("line " + nlinesread + ": Threshold '" + nextToken
+ "' invalid, setting to zero");
}
String label = st.hasMoreTokens() ? st.nextToken() : null;
}
} catch (Exception e)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Couldn't parse Group Start or End Field as '*' or a valid column or sequence index: '"
+ rng + "' - assuming alignment width for group.");
// assume group is full width
} catch (Exception e)
{
e.printStackTrace();
- System.err.println("Failed to read alignment using the '" + fileFormat
+ jalview.bin.Console.errPrintln("Failed to read alignment using the '" + fileFormat
+ "' reader.\n" + e);
if (e.getMessage() != null
} catch (Exception e)
{
e.printStackTrace();
- System.err.println("Failed to read alignment using the '" + format
+ jalview.bin.Console.errPrintln("Failed to read alignment using the '" + format
+ "' reader.\n" + e);
if (e.getMessage() != null
String afileresp = afile.print(seqs, jvsuffix);
if (afile.hasWarningMessage())
{
- System.err.println("Warning raised when writing as " + format
+ jalview.bin.Console.errPrintln("Warning raised when writing as " + format
+ " : " + afile.getWarningMessage());
}
return afileresp;
} catch (Exception e)
{
- System.err.println("Failed to write alignment as a '"
+ jalview.bin.Console.errPrintln("Failed to write alignment as a '"
+ format.getName() + "' file\n");
e.printStackTrace();
}
{
try
{
- System.out.println("Reading file: " + f);
+ jalview.bin.Console.outPrintln("Reading file: " + f);
AppletFormatAdapter afa = new AppletFormatAdapter();
Runtime r = Runtime.getRuntime();
System.gc();
memf += r.totalMemory() - r.freeMemory();
if (al != null)
{
- System.out.println("Alignment contains " + al.getHeight()
+ jalview.bin.Console.outPrintln("Alignment contains " + al.getHeight()
+ " sequences and " + al.getWidth() + " columns.");
try
{
- System.out.println(new AppletFormatAdapter()
+ jalview.bin.Console.outPrintln(new AppletFormatAdapter()
.formatSequences(FileFormat.Fasta, al, true));
} catch (Exception e)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Couln't format the alignment for output as a FASTA file.");
e.printStackTrace(System.err);
}
}
else
{
- System.out.println("Couldn't read alignment");
+ jalview.bin.Console.outPrintln("Couldn't read alignment");
}
- System.out.println("Read took " + (t1 / 1000.0) + " seconds.");
- System.out.println(
+ jalview.bin.Console.outPrintln("Read took " + (t1 / 1000.0) + " seconds.");
+ jalview.bin.Console.outPrintln(
"Difference between free memory now and before is "
+ (memf / (1024.0 * 1024.0) * 1.0) + " MB");
} catch (Exception e)
{
- System.err.println("Exception when dealing with " + i
+ jalview.bin.Console.errPrintln("Exception when dealing with " + i
+ "'th argument: " + args[i] + "\n" + e);
}
}
else
{
- System.err.println("Ignoring argument '" + args[i] + "' (" + i
+ jalview.bin.Console.errPrintln("Ignoring argument '" + args[i] + "' (" + i
+ "'th)- not a readable file.");
}
i++;
DataSourceType protocol = null;
if (debug)
{
- System.out.println("resolving datasource started with:\n>>file\n"
+ jalview.bin.Console.outPrintln("resolving datasource started with:\n>>file\n"
+ file + ">>endfile");
}
}
if (debug)
{
- System.err.println("Resource '" + file + "' was "
+ jalview.bin.Console.errPrintln("Resource '" + file + "' was "
+ (rtn ? "" : "not") + " located by classloader.");
}
if (rtn)
{
if (debug)
{
- System.out.println(
+ jalview.bin.Console.outPrintln(
"Trying to get contents of resource as " + protocol + ":");
}
fp = new FileParse(file, protocol);
{
if (debug)
{
- System.out.println("Successful.");
+ jalview.bin.Console.outPrintln("Successful.");
}
}
} catch (Exception e)
{
if (debug)
{
- System.err.println("Exception when accessing content: " + e);
+ jalview.bin.Console.errPrintln("Exception when accessing content: " + e);
}
fp = null;
}
{
if (debug)
{
- System.out.println("Accessing as paste.");
+ jalview.bin.Console.outPrintln("Accessing as paste.");
}
protocol = DataSourceType.PASTE;
fp = null;
}
} catch (Exception e)
{
- System.err.println("Failed to access content as paste!");
+ jalview.bin.Console.errPrintln("Failed to access content as paste!");
e.printStackTrace();
fp = null;
}
{
if (debug)
{
- System.out.println("Format not identified. Inaccessible file.");
+ jalview.bin.Console.outPrintln("Format not identified. Inaccessible file.");
}
return null;
}
if (debug)
{
- System.out.println("Format identified as " + idformat
+ jalview.bin.Console.outPrintln("Format identified as " + idformat
+ "and expected as " + format);
}
if (idformat.equals(format))
{
if (debug)
{
- System.out.println("Protocol identified as " + protocol);
+ jalview.bin.Console.outPrintln("Protocol identified as " + protocol);
}
return protocol;
}
{
if (debug)
{
- System.err.println("File deemed not accessible via " + protocol);
+ jalview.bin.Console.errPrintln("File deemed not accessible via " + protocol);
e.printStackTrace();
}
}
}
} catch (IOException e)
{
- System.out.println("IOException when checking file '" + filename
+ jalview.bin.Console.outPrintln("IOException when checking file '" + filename
+ "' is a backupfile");
}
{
if (!biojsDirectory.mkdirs())
{
- System.out.println("Couldn't create local directory : "
+ jalview.bin.Console.outPrintln("Couldn't create local directory : "
+ BJS_TEMPLATES_LOCAL_DIRECTORY);
return;
}
} catch (OutOfMemoryError err)
{
- System.out.println("########################\n" + "OUT OF MEMORY "
+ jalview.bin.Console.outPrintln("########################\n" + "OUT OF MEMORY "
+ generatedFile + "\n" + "########################");
new OOMWarning("Creating Image for " + generatedFile, err);
} catch (Exception e)
}
} catch (IOException e)
{
- System.err.println("Exception parsing clustal file " + e);
+ jalview.bin.Console.errPrintln("Exception parsing clustal file " + e);
e.printStackTrace();
}
}
else
{
- System.err.println("Clustal File Reader: Can't find sequence for "
+ jalview.bin.Console.errPrintln("Clustal File Reader: Can't find sequence for "
+ headers.elementAt(i));
}
}
// should report somewhere useful for UI if necessary
warningMessage = ((warningMessage == null) ? "" : warningMessage)
+ "Parsing error at\n" + line;
- System.out.println("Error parsing feature file: " + ex + "\n" + line);
+ jalview.bin.Console.outPrintln("Error parsing feature file: " + ex + "\n" + line);
ex.printStackTrace(System.err);
resetMatcher();
return false;
String[] tokens = line.split(TAB_REGEX);
if (tokens.length != 2)
{
- System.err.println(String.format("Invalid token count %d for %d",
+ jalview.bin.Console.errPrintln(String.format("Invalid token count %d for %d",
tokens.length, line));
}
else
*/
if (gffColumns.length < 6)
{
- System.err.println("Ignoring feature line '" + line
+ jalview.bin.Console.errPrintln("Ignoring feature line '" + line
+ "' with too few columns (" + gffColumns.length + ")");
return false;
}
seq = alignment.getSequenceAt(idx);
} catch (NumberFormatException ex)
{
- System.err.println("Invalid sequence index: " + seqIndex);
+ jalview.bin.Console.errPrintln("Invalid sequence index: " + seqIndex);
}
}
if (seq == null)
{
- System.out.println("Sequence not found: " + line);
+ jalview.bin.Console.outPrintln("Sequence not found: " + line);
return false;
}
@Override
public String print(SequenceI[] sqs, boolean jvsuffix)
{
- System.out.println("Use printGffFormat() or printJalviewFormat()");
+ jalview.bin.Console.outPrintln("Use printGffFormat() or printJalviewFormat()");
return null;
}
*/
if (gffColumns.length < 5)
{
- System.err.println("Ignoring GFF feature line with too few columns ("
+ jalview.bin.Console.errPrintln("Ignoring GFF feature line with too few columns ("
+ gffColumns.length + ")");
return null;
}
}
} catch (IOException e)
{
- System.err.println("GFF parsing failed with: " + e.getMessage());
+ jalview.bin.Console.errPrintln("GFF parsing failed with: " + e.getMessage());
return null;
}
}
}
else
{
- System.err.println("Ignoring unknown pragma: " + line);
+ jalview.bin.Console.errPrintln("Ignoring unknown pragma: " + line);
}
}
}
String name = format.getName().toUpperCase(Locale.ROOT);
if (formats.containsKey(name))
{
- System.err.println("Overwriting file format: " + format.getName());
+ jalview.bin.Console.errPrintln("Overwriting file format: " + format.getName());
}
formats.put(name, format);
if (isIdentifiable)
if (format == null)
{
Desktop.instance.stopLoading();
- System.err.println("The input file \"" + file
+ jalview.bin.Console.errPrintln("The input file \"" + file
+ "\" has null or unidentifiable data content!");
if (!Jalview.isHeadlessMode())
{
if (source != null)
{
// Tell the user (developer?) that this is going to cause a problem
- System.err.println(
+ jalview.bin.Console.errPrintln(
"IMPLEMENTATION ERROR: Cannot read consecutive Jalview XML projects from a stream.");
// We read the data anyway - it might make sense.
}
}
else
{
- System.err.println(errorMessage);
+ jalview.bin.Console.errPrintln(errorMessage);
}
}
}
} catch (Exception er)
{
- System.err.println("Exception whilst opening file '" + file);
+ jalview.bin.Console.errPrintln("Exception whilst opening file '" + file);
er.printStackTrace();
if (raiseGUI)
{
}
});
}
- System.err.println("Out of memory loading file " + file + "!!");
+ jalview.bin.Console.errPrintln("Out of memory loading file " + file + "!!");
}
loadtime += System.currentTimeMillis();
{
AlignmentI al = alignFrame.getViewport().getAlignment();
- System.out.println("Loaded '" + title + "' in "
+ jalview.bin.Console.outPrintln("Loaded '" + title + "' in "
+ (loadtime / 1000.0) + "s, took an additional "
+ (1.0 * memused / (1024.0 * 1024.0)) + " MB ("
+ al.getHeight() + " seqs by " + al.getWidth() + " cols)");
{
// report that we didn't load anything probably due to an out of memory
// error
- System.out.println("Failed to load '" + title + "' in "
+ jalview.bin.Console.outPrintln("Failed to load '" + title + "' in "
+ (loadtime / 1000.0) + "s, took an additional "
+ (1.0 * memused / (1024.0 * 1024.0))
+ " MB (alignment is null)");
if (sfpos > -1 && sfpos < fileStr.length() - 1)
{
suffix = fileStr.substring(sfpos + 1);
- // System.err.println("DEBUG: Found Suffix:"+suffix);
+ // jalview.bin.Console.errPrintln("DEBUG: Found Suffix:"+suffix);
return fileStr.substring(0, sfpos);
}
return null;
{
if (bytesRead >= READAHEAD_LIMIT)
{
- System.err.println(String.format(
+ jalview.bin.Console.errPrintln(String.format(
"File reset error: read %d bytes but reset limit is %d",
bytesRead, READAHEAD_LIMIT));
}
}
else
{
- System.out.println(message);
+ jalview.bin.Console.outPrintln(message);
}
}
}
} catch (OutOfMemoryError err)
{
- System.out.println("########################\n" + "OUT OF MEMORY "
+ jalview.bin.Console.outPrintln("########################\n" + "OUT OF MEMORY "
+ generatedFile + "\n" + "########################");
new OOMWarning("Creating Image for " + generatedFile, err);
} catch (Exception e)
@Override
public void parse() throws IOException
{
- // JBPNote log.System.out.println("all read in ");
+ // JBPNote log.jalview.bin.Console.outPrintln("all read in ");
String line;
QuerySeqPosition = -1;
noSeqs = 0;
}
else if (id.equals("jnetconf"))
{
- // log.debug System.out.println("here");
+ // log.debug jalview.bin.Console.outPrintln("here");
id = "Prediction Confidence";
this.conf = new Vector(numSymbols);
for (int i = 0; i < jpred.seqs.size(); i++)
{
- System.out.println(((Sequence) jpred.seqs.elementAt(i)).getName()
+ jalview.bin.Console.outPrintln(((Sequence) jpred.seqs.elementAt(i)).getName()
+ "\n"
+ ((Sequence) jpred.seqs.elementAt(i)).getSequenceAsString()
+ "\n");
}
} catch (java.io.IOException e)
{
- System.err.println("Exception " + e);
+ jalview.bin.Console.errPrintln("Exception " + e);
// e.printStackTrace(); not java 1.1 compatible!
}
}
* out = BLCFile.print(s);
*
* AlignFrame af = new AlignFrame(null, s); af.resize(700, 500); af.show();
- * System.out.println(out); } catch (java.io.IOException e) {
- * System.out.println("Exception " + e); } } }
+ * jalview.bin.Console.outPrintln(out); } catch (java.io.IOException e) {
+ * jalview.bin.Console.outPrintln("Exception " + e); } } }
*/
.setSecondaryStructure(annotation.secondaryStructure);
String displayChar = annotation.displayCharacter == null ? null
: annotation.displayCharacter;
- // System.out.println("--------------------->[" + displayChar + "]");
+ // jalview.bin.Console.outPrintln("--------------------->[" + displayChar + "]");
annotationPojo.setDisplayCharacter(displayChar);
if (annotation.colour != null)
{
}
else
{
- System.err.println("JalviewFileChooser arguments mismatch: "
+ jalview.bin.Console.errPrintln("JalviewFileChooser arguments mismatch: "
+ extensions + ", " + descs);
}
}
return FileFormats.getInstance().forName(format);
} catch (IllegalArgumentException e)
{
- System.err.println("Unexpected format: " + format);
+ jalview.bin.Console.errPrintln("Unexpected format: " + format);
}
}
return null;
}
} catch (Throwable x)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Unexpected exception when trying to get filename.");
x.printStackTrace();
}
}
else
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"JalviewFileView.createImageIcon: Couldn't find file: "
+ filePath);
}
}
} catch (IOException e)
{
- System.err.println("Exception parsing MSFFile " + e);
+ jalview.bin.Console.errPrintln("Exception parsing MSFFile " + e);
e.printStackTrace();
}
}
else
{
- System.err.println("MSFFile Parser: Can't find sequence for "
+ jalview.bin.Console.errPrintln("MSFFile Parser: Can't find sequence for "
+ headers.get(i));
}
}
}
} catch (Exception e)
{
- System.err.println("Exception during MSF Checksum calculation");
+ jalview.bin.Console.errPrintln("Exception during MSF Checksum calculation");
e.printStackTrace();
}
}
// node string contains Comment or structured/extended NH format info
/*
* if ((fcp-cp>1 && nf.substring(cp,fcp).trim().length()>1)) { // will
- * process in remains System.err.println("skipped text:
+ * process in remains jalview.bin.Console.errPrintln("skipped text:
* '"+nf.substring(cp,fcp)+"'"); }
*/
// verify termination.
// more codes here.
} catch (Exception e)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Couldn't parse code '" + code + "' = '" + value + "'");
e.printStackTrace(System.err);
}
}
treefile.close();
- System.out.println("Read file :\n");
+ jalview.bin.Console.outPrintln("Read file :\n");
NewickFile trf = new NewickFile(args[0], DataSourceType.FILE);
trf.parse();
- System.out.println("Original file :\n");
+ jalview.bin.Console.outPrintln("Original file :\n");
Regex nonl = new Regex("\n+", "");
- System.out.println(nonl.replaceAll(newickfile.toString()) + "\n");
-
- System.out.println("Parsed file.\n");
- System.out.println("Default output type for original input.\n");
- System.out.println(trf.print());
- System.out.println("Without bootstraps.\n");
- System.out.println(trf.print(false));
- System.out.println("Without distances.\n");
- System.out.println(trf.print(true, false));
- System.out.println("Without bootstraps but with distanecs.\n");
- System.out.println(trf.print(false, true));
- System.out.println("Without bootstraps or distanecs.\n");
- System.out.println(trf.print(false, false));
- System.out.println("With bootstraps and with distances.\n");
- System.out.println(trf.print(true, true));
+ jalview.bin.Console.outPrintln(nonl.replaceAll(newickfile.toString()) + "\n");
+
+ jalview.bin.Console.outPrintln("Parsed file.\n");
+ jalview.bin.Console.outPrintln("Default output type for original input.\n");
+ jalview.bin.Console.outPrintln(trf.print());
+ jalview.bin.Console.outPrintln("Without bootstraps.\n");
+ jalview.bin.Console.outPrintln(trf.print(false));
+ jalview.bin.Console.outPrintln("Without distances.\n");
+ jalview.bin.Console.outPrintln(trf.print(true, false));
+ jalview.bin.Console.outPrintln("Without bootstraps but with distanecs.\n");
+ jalview.bin.Console.outPrintln(trf.print(false, true));
+ jalview.bin.Console.outPrintln("Without bootstraps or distanecs.\n");
+ jalview.bin.Console.outPrintln(trf.print(false, false));
+ jalview.bin.Console.outPrintln("With bootstraps and with distances.\n");
+ jalview.bin.Console.outPrintln(trf.print(true, true));
} catch (java.io.IOException e)
{
- System.err.println("Exception\n" + e);
+ jalview.bin.Console.errPrintln("Exception\n" + e);
e.printStackTrace();
}
}
{
if (line.length() == 0)
{
- // System.out.println("blank line");
+ // jalview.bin.Console.outPrintln("blank line");
continue;
}
if (line.indexOf("C;") == 0 || line.indexOf("#") == 0)
}
else
{
- System.err.println("PFAM File reader: Can't find sequence for "
+ jalview.bin.Console.errPrintln("PFAM File reader: Can't find sequence for "
+ headers.get(i));
}
}
} catch (IOException e)
{
- System.err.println("Exception parsing PHYLIP file " + e);
+ jalview.bin.Console.errPrintln("Exception parsing PHYLIP file " + e);
e.printStackTrace(System.err);
throw e;
}
// public static void main(String[] args) {
// Pattern p= Pattern.compile("(.+)[.][^.]+");
// Matcher m = p.matcher("toto.xml.zip");
- // System.out.println(m.matches());
- // System.out.println(m.group(1));
+ // jalview.bin.Console.outPrintln(m.matches());
+ // jalview.bin.Console.outPrintln(m.group(1));
// }
/**
* make a friendly ID string.
}
} catch (Exception x)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"problem when creating links from " + urlstring);
x.printStackTrace();
}
UrlLink urlLink = new UrlLink(link);
if (!urlLink.isValid())
{
- System.err.println(urlLink.getInvalidMessage());
+ jalview.bin.Console.errPrintln(urlLink.getInvalidMessage());
return null;
}
rstart = Long.parseLong(stindx);
} catch (Exception e)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Couldn't parse '" + stindx + "' as start of row");
// inAlignments = false;
// warn for this line
rend = Long.parseLong(endindx);
} catch (Exception e)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Couldn't parse '" + endindx + "' as end of row");
// inAlignments = false;
+ umcp.getMessage() + ")";
throw new IOException(umcp);
}
- // DEBUG System.out.println("this is the secondary scructure:"
+ // DEBUG jalview.bin.Console.outPrintln("this is the secondary scructure:"
// +result.size());
SequenceI[] seqs = new SequenceI[result.size()];
String id = null;
for (int i = 0; i < result.size(); i++)
{
- // DEBUG System.err.println("Processing i'th sequence in Stockholm file")
+ // DEBUG jalview.bin.Console.errPrintln("Processing i'th sequence in Stockholm file")
RNA current = result.get(i);
String seq = current.getSeq();
String rna = current.getStructDBN(true);
- // DEBUG System.out.println(seq);
- // DEBUG System.err.println(rna);
+ // DEBUG jalview.bin.Console.outPrintln(seq);
+ // DEBUG jalview.bin.Console.errPrintln(rna);
int begin = 0;
int end = seq.length() - 1;
id = safeName(getDataName());
}
else if (!r.search(line))
{
- // System.err.println("Found sequence line: " + line);
+ // jalview.bin.Console.errPrintln("Found sequence line: " + line);
// Split sequence in sequence and accession parts
if (!x.search(line))
String annType = r.stringMatched(1);
String annContent = r.stringMatched(2);
- // System.err.println("type:" + annType + " content: " + annContent);
+ // jalview.bin.Console.errPrintln("type:" + annType + " content: " + annContent);
if (annType.equals("GF"))
{
else
{
// throw new IOException("Error parsing " + line);
- System.err.println(">> missing annotation: " + line);
+ jalview.bin.Console.errPrintln(">> missing annotation: " + line);
}
}
else if (annType.equals("GC"))
// }
else
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Warning - couldn't parse sequence annotation row line:\n"
+ line);
// throw new IOException("Error parsing " + line);
annot.annotations.length);
System.arraycopy(els, 0, anns, annot.annotations.length, els.length);
annot.annotations = anns;
- // System.out.println("else: ");
+ // jalview.bin.Console.outPrintln("else: ");
}
return annot;
}
{
return (String) typeIds.get(id);
}
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Warning : Unknown Stockholm annotation type code " + id);
return id;
}
{
return key;
}
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Warning : Unknown Stockholm annotation type: " + type);
return key;
}
protected void processPdbFileWithAnnotate3d(List<SequenceI> rna)
throws Exception
{
- // System.out.println("this is a PDB format and RNA sequence");
+ // jalview.bin.Console.outPrintln("this is a PDB format and RNA sequence");
// note: we use reflection here so that the applet can compile and run
// without the HTTPClient bits and pieces needed for accessing Annotate3D
// web service
processPdbFileWithAnnotate3d(rnaSequences);
} catch (Exception x)
{
- System.err.println("Exceptions when dealing with RNA in pdb file");
+ jalview.bin.Console.errPrintln("Exceptions when dealing with RNA in pdb file");
x.printStackTrace();
}
processWithJmolParser(proteinSequences, true);
} catch (Exception x)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Exceptions from Jmol when processing data in pdb file");
x.printStackTrace();
}
annotations[j] = null;
if (val > 0)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Warning: non-zero value for positional T-COFFEE score for gap at "
+ j + " in sequence " + s.getName());
}
{
// removeValignmentSequences(alignment, docseqs);
docseqs.removeAllElements();
- System.out.println(
+ jalview.bin.Console.outPrintln(
"Sequence deletion from alignment is not implemented.");
}
}
if (alismod)
{
- System.out.println("update alignment in document.");
+ jalview.bin.Console.outPrintln("update alignment in document.");
}
else
{
- System.out.println("alignment in document left unchanged.");
+ jalview.bin.Console.outPrintln("alignment in document left unchanged.");
}
}
else
// unbind alignment from view.
// create new binding and new alignment.
// mark trail on new alignment as being derived from old ?
- System.out.println(
+ jalview.bin.Console.outPrintln(
"update edited alignment to new alignment in document.");
}
}
// METHODS)
{
// verify existing alignment sequence annotation is up to date
- System.out.println("update dataset sequence annotation.");
+ jalview.bin.Console.outPrintln("update dataset sequence annotation.");
}
else
{
// verify existing alignment sequence annotation is up to date
- System.out.println(
+ jalview.bin.Console.outPrintln(
"make new alignment dataset sequence annotation if modification has happened.");
}
}
// METHODS)
{
// verify existing alignment sequence annotation is up to date
- System.out.println("update alignment sequence annotation.");
+ jalview.bin.Console.outPrintln("update alignment sequence annotation.");
}
else
{
// verify existing alignment sequence annotation is up to date
- System.out.println(
+ jalview.bin.Console.outPrintln(
"make new alignment sequence annotation if modification has happened.");
}
}
for (int i = 0; i < ids.size(); i++)
{
Sequence sequence = (Sequence) ids.get(i);
- System.out.println(sequence.getName());
+ jalview.bin.Console.outPrintln(sequence.getName());
BlastThread thread = new BlastThread(sequence);
thread.start();
BlastThread(Sequence sequence)
{
- System.out.println("blasting for: " + sequence.getName());
+ jalview.bin.Console.outPrintln("blasting for: " + sequence.getName());
this.sequence = sequence;
}
else
{
Thread.sleep(10000);
- System.out.println("WSWuBlastClient: I'm alive "
+ jalview.bin.Console.outPrintln("WSWuBlastClient: I'm alive "
+ sequence.getName() + " " + jobid); // log.debug
}
} catch (Exception ex)
{
jobComplete = true;
jobsRunning--;
- System.err.println("WSWUBlastClient error:\n" + exp.toString());
+ jalview.bin.Console.errPrintln("WSWUBlastClient error:\n" + exp.toString());
exp.printStackTrace();
}
}
@Override
public void actionPerformed(ActionEvent e)
{
- // System.out.println(">>>>> Clear cache items");
+ // jalview.bin.Console.outPrintln(">>>>> Clear cache items");
setSelectedItem("");
appCache.deleteCacheItems(cacheKey);
updateCache();
relaxedIdMatching);
} catch (IOException ivfe)
{
- System.err.println(ivfe);
+ jalview.bin.Console.errPrintln(ivfe);
}
/*
}
else if (!"+".equals(strand))
{
- System.err.println("Strand must be specified for alignment");
+ jalview.bin.Console.errPrintln("Strand must be specified for alignment");
return;
}
String[] tokens = region.split(" ");
if (tokens.length != 3)
{
- System.err.println("Malformed Align descriptor: " + region);
+ jalview.bin.Console.errPrintln("Malformed Align descriptor: " + region);
return null;
}
alignCount = Integer.parseInt(tokens[2]);
} catch (NumberFormatException nfe)
{
- System.err.println(nfe.toString());
+ jalview.bin.Console.errPrintln(nfe.toString());
return null;
}
return true;
}
}
- System.err.println("Sorry, I don't handle exonerate model " + model);
+ jalview.bin.Console.errPrintln("Sorry, I don't handle exonerate model " + model);
return false;
}
*/
if ("-".equals(strand))
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Skipping mapping from reverse complement as not yet supported");
return null;
}
List<String> targets = attributes.get(TARGET);
if (targets == null)
{
- System.err.println("'Target' missing in GFF");
+ jalview.bin.Console.errPrintln("'Target' missing in GFF");
return null;
}
String[] tokens = target.split(" ");
if (tokens.length < 3)
{
- System.err.println("Incomplete Target: " + target);
+ jalview.bin.Console.errPrintln("Incomplete Target: " + target);
continue;
}
}
} catch (NumberFormatException nfe)
{
- System.err.println("Invalid start or end in Target " + target);
+ jalview.bin.Console.errPrintln("Invalid start or end in Target " + target);
}
}
*/
if (!trimMapping(from, to, fromRatio, toRatio))
{
- System.err.println("Ignoring mapping from " + Arrays.toString(from)
+ jalview.bin.Console.errPrintln("Ignoring mapping from " + Arrays.toString(from)
+ " to " + Arrays.toString(to) + " as counts don't match!");
return null;
}
{
from[1] += fromOverlap / toRatio;
}
- System.err.println(Arrays.toString(from));
+ jalview.bin.Console.errPrintln(Arrays.toString(from));
return true;
}
else if (fromOverlap < 0 && fromOverlap % fromRatio == 0)
{
to[1] += fromOverlap / fromRatio;
}
- System.err.println(Arrays.toString(to));
+ jalview.bin.Console.errPrintln(Arrays.toString(to));
return true;
}
return sf;
} catch (NumberFormatException nfe)
{
- System.err.println("Invalid number in gff: " + nfe.getMessage());
+ jalview.bin.Console.errPrintln("Invalid number in gff: " + nfe.getMessage());
return null;
}
}
if (!valid)
{
- System.err.println(INVALID_GFF_ATTRIBUTE_FORMAT + s);
+ jalview.bin.Console.errPrintln(INVALID_GFF_ATTRIBUTE_FORMAT + s);
return map;
}
theKey = theKey.trim();
if (theKey.isEmpty())
{
- System.err.println(INVALID_GFF_ATTRIBUTE_FORMAT + s);
+ jalview.bin.Console.errPrintln(INVALID_GFF_ATTRIBUTE_FORMAT + s);
map.clear();
return map;
}
{
// suppress logging here as it reports Uniprot sequence features
// (which do not use SO terms) when auto-configuring feature colours
- // System.out.println("SO term " + term
+ // jalview.bin.Console.outPrintln("SO term " + term
// + " not known - add to model if needed in "
// + getClass().getName());
termsNotFound.add(term);
AlignmentSet last = getLastAlignmentSet();
if (last != null)
{
- System.err.println("Deuniquifying last alignment set.");
+ jalview.bin.Console.errPrintln("Deuniquifying last alignment set.");
last.deuniquifyAlignment();
}
al.add(new AlignmentSet(newal));
fp = new FileParse(file, AppletFormatAdapter.checkProtocol(file));
} catch (Exception e)
{
- System.err.println("Couldn't handle datasource of type " + jtype
+ jalview.bin.Console.errPrintln("Couldn't handle datasource of type " + jtype
+ " using URI " + file);
e.printStackTrace();
return;
}
else
{
- System.out.println("Couldn't parse source type token '"
+ jalview.bin.Console.outPrintln("Couldn't parse source type token '"
+ type.toUpperCase(Locale.ROOT) + "'");
}
}
System.out.print("\n");
}
- System.out.println("Now trying to parse set:");
+ jalview.bin.Console.outPrintln("Now trying to parse set:");
JalviewDataset context;
Object[] newdm;
ParsePackedSet pps;
.getAlignment(context = new JalviewDataset(), dp);
} catch (Exception e)
{
- System.out.println("Test failed for these arguments.\n");
+ jalview.bin.Console.outPrintln("Test failed for these arguments.\n");
e.printStackTrace(System.out);
return;
}
{
for (Object o : newdm)
{
- System.out.println("Will need to create an " + o.getClass());
+ jalview.bin.Console.outPrintln("Will need to create an " + o.getClass());
}
// now test uniquify/deuniquify stuff
{
if (context.getLastAlignmentSet().isModified())
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Initial alignment set was modified and any associated views should be updated.");
}
}
private void conflict(Mapping mjvmapping, SequenceMapping sequenceMapping)
{
- System.err.println("Conflict in update of sequenceMapping "
+ jalview.bin.Console.errPrintln("Conflict in update of sequenceMapping "
+ sequenceMapping.getVorbaId());
}
}
else
{
- System.err.println("WARNING: Unassociated treeNode "
+ jalview.bin.Console.errPrintln("WARNING: Unassociated treeNode "
+ tnode.element().toString() + " "
+ ((tnode.getName() != null)
? " label " + tnode.getName()
occurence = Integer.valueOf(oval).intValue();
} catch (Exception e)
{
- System.err.println("Invalid nodespec '" + nodespec + "'");
+ jalview.bin.Console.errPrintln("Invalid nodespec '" + nodespec + "'");
return null;
}
jalview.datamodel.BinaryNode bn = null;
initialise(vcfFile);
} catch (IOException e)
{
- System.err.println("Error opening VCF file: " + e.getMessage());
+ jalview.bin.Console.errPrintln("Error opening VCF file: " + e.getMessage());
}
// map of species!chromosome!fromAssembly!toAssembly to {fromRange, toRange}
}
} catch (Throwable e)
{
- System.err.println("Error processing VCF: " + e.getMessage());
+ jalview.bin.Console.errPrintln("Error processing VCF: " + e.getMessage());
e.printStackTrace();
if (gui != null)
{
patterns.add(Pattern.compile(token.toUpperCase(Locale.ROOT)));
} catch (PatternSyntaxException e)
{
- System.err.println("Invalid pattern ignored: " + token);
+ jalview.bin.Console.errPrintln("Invalid pattern ignored: " + token);
}
}
return patterns;
{
if (jvlite.debug && dbgMsg != null)
{
- System.err.println(dbgMsg);
+ jalview.bin.Console.errPrintln(dbgMsg);
}
scriptObject.call(_listener, objects);
}
{
if (jvlite.debug)
{
- System.err.println(jex);
+ jalview.bin.Console.errPrintln(jex);
}
if (jex instanceof netscape.javascript.JSException
&& jvlite.jsfallbackEnabled)
jsex[0] = jex;
if (jvlite.debug)
{
- System.err.println("Falling back to javascript: url call");
+ jalview.bin.Console.errPrintln("Falling back to javascript: url call");
}
StringBuffer sb = new StringBuffer(
"javascript:" + _listener + "(");
sb.append(")");
if (jvlite.debug)
{
- System.err.println(sb.toString());
+ jalview.bin.Console.errPrintln(sb.toString());
}
// alternate
URL url = null;
public void selection(SequenceGroup seqsel, ColumnSelection colsel,
HiddenColumns hidden, SelectionSource source)
{
- // System.err.println("Testing selection event relay to
+ // jalview.bin.Console.errPrintln("Testing selection event relay to
// jsfunction:"+_listener);
try
{
;
}
- System.err.println("Relaying selection to jsfunction:" + _listener);
+ jalview.bin.Console.errPrintln("Relaying selection to jsfunction:" + _listener);
executeJavascriptFunction(_listener,
new Object[]
{ src, setid, jvlite.arrayToSeparatorList(seqs),
jvlite.arrayToSeparatorList(cols) });
} catch (Exception ex)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Jalview Javascript exec error: Couldn't send selection message using function '"
+ _listener + "'");
ex.printStackTrace();
if (ex instanceof netscape.javascript.JSException)
{
- System.err.println("Javascript Exception: "
+ jalview.bin.Console.errPrintln("Javascript Exception: "
+ ((netscape.javascript.JSException) ex).getCause()
.toString());
}
} catch (Exception ex)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"JalviewLite javascript error: Couldn't send mouseOver with handler '"
+ _listener + "'");
if (ex instanceof netscape.javascript.JSException)
{
- System.err.println("Javascript Exception: "
+ jalview.bin.Console.errPrintln("Javascript Exception: "
+ ((netscape.javascript.JSException) ex).getMessage());
}
ex.printStackTrace();
"" + (atom.getPdbResNum()), "" + atom.getAtomIndex() });
} catch (Exception ex)
{
- System.err.println("Couldn't execute callback with " + _listenerfn
+ jalview.bin.Console.errPrintln("Couldn't execute callback with " + _listenerfn
+ " for atomSpec: " + atom);
ex.printStackTrace();
}
if (JalviewLite.debug)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
this.getClass().getName() + " modelSet[0]: " + modelSet[0]);
ssm.reportMapping();
}
}
// if (jvlite.debug)
// {
- // System.err.println("Mapped '" + modelSet[m] + "' to "
+ // jalview.bin.Console.errPrintln("Mapped '" + modelSet[m] + "' to "
// + sequence[m].length + " sequences.");
// }
}
executeJavascriptFunction(true, _listenerfn, st);
} catch (Exception ex)
{
- System.err.println("Couldn't execute callback with " + _listenerfn
+ jalview.bin.Console.errPrintln("Couldn't execute callback with " + _listenerfn
+ " using args { " + st[0] + ", " + st[1] + ", " + st[2]
+ "," + st[3] + "}"); // + ","+st[4]+"\n");
ex.printStackTrace();
* executeJavascriptFunction( false, _listenerfn, st = new String[] {
* "colourstruct", "" + ((jalview.appletgui.AlignmentPanel) source).av
* .getViewId(), handle, "" }); } catch (Exception ex) {
- * System.err.println("Couldn't execute callback with " + _listenerfn +
+ * jalview.bin.Console.errPrintln("Couldn't execute callback with " + _listenerfn +
* " using args { " + st[0] + ", " + st[1] + ", " + st[2] + "," + st[3] +
* "\n"); ex.printStackTrace();
*
}
} catch (Exception e)
{
- System.err.println(e.toString());
+ jalview.bin.Console.errPrintln(e.toString());
}
if (Platform.allowMnemonics()) // was "not mac and not JS"
APQHandlers.setAPQHandlers((Desktop) this);
} catch (Exception e)
{
- System.out.println("Cannot set APQHandlers");
+ jalview.bin.Console.outPrintln("Cannot set APQHandlers");
// e.printStackTrace();
} catch (Throwable t)
{
inputURLMenuItem_actionPerformed(null);
} catch (FileFormatException e1)
{
- System.err.println("Error loading from URL: " + e1.getMessage());
+ jalview.bin.Console.errPrintln("Error loading from URL: " + e1.getMessage());
}
}
});
*/
protected void quit()
{
- // System.out.println("********** GDesktop.quit()");
+ // jalview.bin.Console.outPrintln("********** GDesktop.quit()");
}
/**
mainFrame.pack();
} catch (Exception e)
{
- System.out.println(e); // for JavaScript TypeError
+ jalview.bin.Console.outPrintln(e); // for JavaScript TypeError
e.printStackTrace();
}
}
protected void closeAction(int preferredHeight)
{
- // System.out.println(">>>>>>>>>> closing internal frame!!!");
- // System.out.println("width : " + mainFrame.getWidth());
- // System.out.println("heigh : " + mainFrame.getHeight());
- // System.out.println("x : " + mainFrame.getX());
- // System.out.println("y : " + mainFrame.getY());
+ // jalview.bin.Console.outPrintln(">>>>>>>>>> closing internal frame!!!");
+ // jalview.bin.Console.outPrintln("width : " + mainFrame.getWidth());
+ // jalview.bin.Console.outPrintln("heigh : " + mainFrame.getHeight());
+ // jalview.bin.Console.outPrintln("x : " + mainFrame.getX());
+ // jalview.bin.Console.outPrintln("y : " + mainFrame.getY());
tempUserPrefs.put("structureChooser.width", pnl_filter.getWidth());
tempUserPrefs.put("structureChooser.height", preferredHeight);
tempUserPrefs.put("structureChooser.x", mainFrame.getX());
{
String logLine = String.format("%s: %s", loglevel.toString(),
message);
- System.out.println(logLine);
+ jalview.bin.Console.outPrintln(logLine);
if (t != null)
{
if (loglevel.compareTo(LogLevel.DEBUG) <= 0)
t.printStackTrace(System.err);
else
- System.err.println(t.getMessage());
+ jalview.bin.Console.errPrintln(t.getMessage());
}
return false;
}
}
else
{
- // System.out.println("Iteration " + iter);
+ // jalview.bin.Console.outPrintln("Iteration " + iter);
}
g = (d[l] - d[l - 1]) / (2.0 * e[l - 1]);
}
else
{
- // System.out.println("Iteration " + iter);
+ // jalview.bin.Console.outPrintln("Iteration " + iter);
}
g = (d[l] - d[l - 1]) / (2.0 * e[l - 1]);
Float floatValue = Float.valueOf(degrees);
if (cachedRotations.get(axis).containsKey(floatValue))
{
- // System.out.println("getRotation from cache: " + (int) degrees);
+ // jalview.bin.Console.outPrintln("getRotation from cache: " + (int) degrees);
return cachedRotations.get(axis).get(floatValue);
}
}
} catch (Exception x)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"IMPLEMENTATION ERROR: Failed to resolve forward reference for sequence "
+ ref.getSref());
x.printStackTrace();
}
if (unresolved > 0)
{
- System.err.println("Jalview Project Import: There were " + unresolved
+ jalview.bin.Console.errPrintln("Jalview Project Import: There were " + unresolved
+ " forward references left unresolved on the stack.");
}
if (failedtoresolve > 0)
{
- System.err.println("SERIOUS! " + failedtoresolve
+ jalview.bin.Console.errPrintln("SERIOUS! " + failedtoresolve
+ " resolvable forward references failed to resolve.");
}
if (incompleteSeqs != null && incompleteSeqs.size() > 0)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Jalview Project Import: There are " + incompleteSeqs.size()
+ " sequences which may have incomplete metadata.");
if (incompleteSeqs.size() < 10)
{
for (SequenceI s : incompleteSeqs.values())
{
- System.err.println(s.toString());
+ jalview.bin.Console.errPrintln(s.toString());
}
}
else
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Too many to report. Skipping output of incomplete sequences.");
}
}
object.setCreationDate(now);
} catch (DatatypeConfigurationException e)
{
- System.err.println("error writing date: " + e.toString());
+ jalview.bin.Console.errPrintln("error writing date: " + e.toString());
}
object.setVersion(Cache.getDefault("VERSION", "Development Build"));
// HAPPEN! (PF00072.15.stk does this)
// JBPNote: Uncomment to debug writing out of files that do not read
// back in due to ArrayOutOfBoundExceptions.
- // System.err.println("vamsasSeq backref: "+id+"");
- // System.err.println(jds.getName()+"
+ // jalview.bin.Console.errPrintln("vamsasSeq backref: "+id+"");
+ // jalview.bin.Console.errPrintln(jds.getName()+"
// "+jds.getStart()+"-"+jds.getEnd()+" "+jds.getSequenceAsString());
- // System.err.println("Hashcode: "+seqHash(jds));
+ // jalview.bin.Console.errPrintln("Hashcode: "+seqHash(jds));
// SequenceI rsq = (SequenceI) seqRefIds.get(id + "");
- // System.err.println(rsq.getName()+"
+ // jalview.bin.Console.errPrintln(rsq.getName()+"
// "+rsq.getStart()+"-"+rsq.getEnd()+" "+rsq.getSequenceAsString());
- // System.err.println("Hashcode: "+seqHash(rsq));
+ // jalview.bin.Console.errPrintln("Hashcode: "+seqHash(rsq));
}
else
{
try
{
fileName = fileName.replace('\\', '/');
- System.out.println("Writing jar entry " + fileName);
+ jalview.bin.Console.outPrintln("Writing jar entry " + fileName);
JarEntry entry = new JarEntry(fileName);
jout.putNextEntry(entry);
PrintWriter pout = new PrintWriter(
} catch (Exception ex)
{
// TODO: raise error in GUI if marshalling failed.
- System.err.println("Error writing Jalview project");
+ jalview.bin.Console.errPrintln("Error writing Jalview project");
ex.printStackTrace();
}
}
File file = new File(infilePath);
if (file.exists() && jout != null)
{
- System.out.println(
+ jalview.bin.Console.outPrintln(
"Writing jar entry " + jarEntryName + " (" + msg + ")");
jout.putNextEntry(new JarEntry(jarEntryName));
copyAll(is, jout);
});
} catch (Exception x)
{
- System.err.println("Error loading alignment: " + x.getMessage());
+ jalview.bin.Console.errPrintln("Error loading alignment: " + x.getMessage());
}
}
return af;
{
if (bytes != null)
{
- // System.out.println("Jalview2XML: opening byte jarInputStream for
+ // jalview.bin.Console.outPrintln("Jalview2XML: opening byte jarInputStream for
// bytes.length=" + bytes.length);
return new JarInputStream(new ByteArrayInputStream(bytes));
}
if (_url != null)
{
- // System.out.println("Jalview2XML: opening url jarInputStream for "
+ // jalview.bin.Console.outPrintln("Jalview2XML: opening url jarInputStream for "
// + _url);
return new JarInputStream(_url.openStream());
}
else
{
- // System.out.println("Jalview2XML: opening file jarInputStream for
+ // jalview.bin.Console.outPrintln("Jalview2XML: opening file jarInputStream for
// " + file);
return new JarInputStream(new FileInputStream(file));
}
{
ex.printStackTrace();
errorMessage = "Couldn't locate Jalview XML file : " + file;
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Exception whilst loading jalview XML file : " + ex + "\n");
} catch (Exception ex)
{
- System.err.println("Parsing as Jalview Version 2 file failed.");
+ jalview.bin.Console.errPrintln("Parsing as Jalview Version 2 file failed.");
ex.printStackTrace(System.err);
if (attemptversion1parse)
{
}
if (af != null)
{
- System.out.println("Successfully loaded archive file");
+ jalview.bin.Console.outPrintln("Successfully loaded archive file");
return af;
}
ex.printStackTrace();
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Exception whilst loading jalview XML file : " + ex + "\n");
} catch (OutOfMemoryError e)
{
// Don't use the OOM Window here
errorMessage = "Out of memory loading jalview XML file";
- System.err.println("Out of memory whilst loading jalview XML file");
+ jalview.bin.Console.errPrintln("Out of memory whilst loading jalview XML file");
e.printStackTrace();
}
Desktop.addInternalFrame(af, view.getTitle(),
safeInt(view.getWidth()), safeInt(view.getHeight()));
af.setMenusForViewport();
- System.err.println("Failed to restore view " + view.getTitle()
+ jalview.bin.Console.errPrintln("Failed to restore view " + view.getTitle()
+ " to split frame");
}
}
}
else
{
- System.err.println("Problem loading Jalview file: " + errorMessage);
+ jalview.bin.Console.errPrintln("Problem loading Jalview file: " + errorMessage);
}
}
errorMessage = null;
if (tmpSeq.getStart() != jseq.getStart()
|| tmpSeq.getEnd() != jseq.getEnd())
{
- System.err.println(String.format(
+ jalview.bin.Console.errPrintln(String.format(
"Warning JAL-2154 regression: updating start/end for sequence %s from %d/%d to %d/%d",
tmpSeq.getName(), tmpSeq.getStart(), tmpSeq.getEnd(),
jseq.getStart(), jseq.getEnd()));
// XML.
// and then recover its containing af to allow the settings to be applied.
// TODO: fix for vamsas demo
- System.err.println(
+ jalview.bin.Console.errPrintln(
"About to recover a viewport for existing alignment: Sequence set ID is "
+ uniqueSeqSetId);
Object seqsetobj = retrieveExistingObj(uniqueSeqSetId);
if (seqsetobj instanceof String)
{
uniqueSeqSetId = (String) seqsetobj;
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Recovered extant sequence set ID mapping for ID : New Sequence set ID is "
+ uniqueSeqSetId);
}
else
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Warning : Collision between sequence set ID string and existing jalview object mapping.");
}
createOrLinkStructureViewer(entry, af, ap, jprovider);
} catch (Exception e)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Error loading structure viewer: " + e.getMessage());
// failed - try the next one
}
|| version.equalsIgnoreCase("Test")
|| version.equalsIgnoreCase("AUTOMATED BUILD"))
{
- System.err.println("Assuming project file with "
+ jalview.bin.Console.errPrintln("Assuming project file with "
+ (version == null ? "null" : version)
+ " is compatible with Jalview version " + supported);
return true;
//
// @Override
// protected void processKeyEvent(java.awt.event.KeyEvent e) {
- // System.out.println("Jalview2XML AF " + e);
+ // jalview.bin.Console.outPrintln("Jalview2XML AF " + e);
// super.processKeyEvent(e);
//
// }
}
if (matchedAnnotation == null)
{
- System.err.println("Failed to match annotation colour scheme for "
+ jalview.bin.Console.errPrintln("Failed to match annotation colour scheme for "
+ annotationId);
return null;
}
}
// TODO: merges will never happen if we 'know' we have the real dataset
// sequence - this should be detected when id==dssid
- System.err.println(
+ jalview.bin.Console.errPrintln(
"DEBUG Notice: Merged dataset sequence (if you see this often, post at http://issues.jalview.org/browse/JAL-1474)"); // ("
// + (pre ? "prepended" : "") + " "
// + (post ? "appended" : ""));
}
else
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Warning - making up dataset sequence id for DbRef sequence map reference");
sqid = ((Object) ms).toString(); // make up a new hascode for
// undefined dataset sequence hash
} catch (IllegalStateException e)
{
// mixing AND and OR conditions perhaps
- System.err.println(
+ jalview.bin.Console.errPrintln(
String.format("Error reading filter conditions for '%s': %s",
featureType, e.getMessage()));
// return as much as was parsed up to the error
}
else
{
- System.err.println("Malformed compound filter condition");
+ jalview.bin.Console.errPrintln("Malformed compound filter condition");
}
}
}
int iconOffset, int startRes, int column, boolean validRes,
boolean validEnd)
{
- // System.out.println(nonCanColor);
+ // jalview.bin.Console.outPrintln(nonCanColor);
g.setColor(nonCanColor);
int sCol = (lastSSX / charWidth)
boolean diffdownstream = !validRes || !validEnd
|| row_annotations[column] == null
|| !dc.equals(row_annotations[column].displayCharacter);
- // System.out.println("Column "+column+" diff up: "+diffupstream+"
+ // jalview.bin.Console.outPrintln("Column "+column+" diff up: "+diffupstream+"
// down:"+diffdownstream);
// If a closing base pair half of the stem, display a backward arrow
if (column > 0 && Rna.isClosingParenthesis(dc))
{
// int nb_annot = x - temp;
- // System.out.println("\t type :"+lastSS+"\t x :"+x+"\t nbre
+ // jalview.bin.Console.outPrintln("\t type :"+lastSS+"\t x :"+x+"\t nbre
// annot :"+nb_annot);
switch (lastSS)
{
case 'y':
case 'Z':
case 'z':
- // System.out.println(lastSS);
+ // jalview.bin.Console.outPrintln(lastSS);
Color nonCanColor = getNotCanonicalColor(lastSS);
drawNotCanonicalAnnot(g, nonCanColor, row_annotations, lastSSX,
x, y, iconOffset, startRes, column, validRes, validEnd);
}
else
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"rendered with " + renderer.getClass().toString());
}
}
{
if (clipst)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Start clip at : " + yfrom + " (index " + f_i + ")");
}
if (clipend)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"End clip at : " + yto + " (index " + f_to + ")");
}
}
;
- System.err.println("Annotation Rendering time:"
+ jalview.bin.Console.errPrintln("Annotation Rendering time:"
+ (System.currentTimeMillis() - stime));
}
;
// lm is not necessary - we can just use fm - could be off by no more
// than 0.5 px
// LineMetrics lm = g.getFontMetrics(ofont).getLineMetrics("Q", g);
- // System.out.println(asc + " " + dec + " " + (asc - lm.getAscent())
+ // jalview.bin.Console.outPrintln(asc + " " + dec + " " + (asc - lm.getAscent())
// + " " + (dec - lm.getDescent()));
double asc = fm.getAscent();
return new Color(0, 80, 255);
default:
- System.out.println("This is not a interaction : " + lastss);
+ jalview.bin.Console.outPrintln("This is not a interaction : " + lastss);
return null;
}
final String reply = "REST not yet implemented; received "
+ request.getMethod() + ": " + request.getRequestURL()
+ (queryString == null ? "" : "?" + queryString);
- System.out.println(reply);
+ jalview.bin.Console.outPrintln(reply);
response.setHeader("Cache-Control", "no-cache/no-store");
response.setHeader("Content-type", "text/plain");
} catch (Exception ex)
{
// used to try to parse a V1 Castor generated colours file
- System.err.println("Failed to read colour scheme from " + filePath
+ jalview.bin.Console.errPrintln("Failed to read colour scheme from " + filePath
+ " : " + ex.toString());
}
cs.getSchemeClass().getDeclaredConstructor().newInstance());
} catch (InstantiationException | IllegalAccessException e)
{
- System.err.println("Error instantiating colour scheme for "
+ jalview.bin.Console.errPrintln("Error instantiating colour scheme for "
+ cs.toString() + " " + e.getMessage());
e.printStackTrace();
} catch (ReflectiveOperationException roe)
String name = cs.getSchemeName();
if (name == null)
{
- System.err.println("ColourScheme name may not be null");
+ jalview.bin.Console.errPrintln("ColourScheme name may not be null");
return;
}
this.mask = setNums(s);
// for (int i=0; i < mask.length; i++) {
- // System.out.println(mask[i] + " " + ResidueProperties.aa[mask[i]]);
+ // jalview.bin.Console.outPrintln(mask[i] + " " + ResidueProperties.aa[mask[i]]);
// }
}
@Deprecated
public boolean isConserved(int[][] cons2, int col, int size)
{
- System.out.println("DEPRECATED!!!!");
+ jalview.bin.Console.outPrintln("DEPRECATED!!!!");
return isConserved(cons2, col, size, true);
}
if (tot > ((threshold * size) / 100))
{
- // System.out.println("True conserved "+tot+" from "+threshold+" out of
+ // jalview.bin.Console.outPrintln("True conserved "+tot+" from "+threshold+" out of
// "+size+" : "+maskstr);
return true;
}
for (int x = 0; x < this.annotation._rnasecstr.length; x++)
{
- // System.out.println(this.annotation._rnasecstr[x] + " Begin" +
+ // jalview.bin.Console.outPrintln(this.annotation._rnasecstr[x] + " Begin" +
// this.annotation._rnasecstr[x].getBegin());
- // System.out.println(this.annotation._rnasecstr[x].getFeatureGroup());
+ // jalview.bin.Console.outPrintln(this.annotation._rnasecstr[x].getFeatureGroup());
// pairs.put(this.annotation._rnasecstr[x].getBegin(),
// this.annotation._rnasecstr[x].getEnd());
@Override
public Color findColour(char c)
{
- // System.out.println("called"); log.debug
+ // jalview.bin.Console.outPrintln("called"); log.debug
// Generate a random pastel color
return ResidueProperties.purinepyrimidine[ResidueProperties.purinepyrimidineIndex[c]];// jalview.util.ColorUtils.generateRandomColor(Color.white);
{
Color currentColour = Color.white;
String currentHelix = null;
- // System.out.println(c + " " + j);
+ // jalview.bin.Console.outPrintln(c + " " + j);
currentHelix = positionsToHelix.get(j);
- // System.out.println(positionsToHelix.get(j));
+ // jalview.bin.Console.outPrintln(positionsToHelix.get(j));
if (currentHelix != null)
{
currentColour = helixcolorhash.get(currentHelix);
}
- // System.out.println(c + " " + j + " helix " + currentHelix + " " +
+ // jalview.bin.Console.outPrintln(c + " " + j + " helix " + currentHelix + " " +
// currentColour);
return currentColour;
}
{
if (!ttype.toLowerCase(Locale.ROOT).startsWith("no"))
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Ignoring unrecognised threshold type : " + ttype);
}
}
featureColour.setThreshold(Float.valueOf(tval).floatValue());
} catch (Exception e)
{
- System.err.println("Couldn't parse threshold value as a float: ("
+ jalview.bin.Console.errPrintln("Couldn't parse threshold value as a float: ("
+ tval + ")");
}
}
if (gcol.hasMoreTokens())
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Ignoring additional tokens in parameters in graduated colour specification\n");
while (gcol.hasMoreTokens())
{
- System.err.println(BAR + gcol.nextToken());
+ jalview.bin.Console.errPrintln(BAR + gcol.nextToken());
}
- System.err.println("\n");
+ jalview.bin.Console.errPrintln("\n");
}
return featureColour;
} catch (Exception e)
{
/*
- * System.out.println(this.annotation._rnasecstr[x] + " Begin" +
+ * jalview.bin.Console.outPrintln(this.annotation._rnasecstr[x] + " Begin" +
* this.annotation._rnasecstr[x].getBegin());
*/
- // System.out.println(this.annotation._rnasecstr[x].getFeatureGroup());
+ // jalview.bin.Console.outPrintln(this.annotation._rnasecstr[x].getFeatureGroup());
positionsToHelix.put(this.annotation._rnasecstr[x].getBegin(),
this.annotation._rnasecstr[x].getFeatureGroup());
public static void main(String[] args)
{
Hashtable<String, Vector<String>> aaProps = new Hashtable<>();
- System.out.println("my %aa = {");
+ jalview.bin.Console.outPrintln("my %aa = {");
// invert property hashes
for (String pname : propHash.keySet())
{
System.out.print("'" + props.nextElement() + "'");
if (props.hasMoreElements())
{
- System.out.println(", ");
+ jalview.bin.Console.outPrintln(", ");
}
}
- System.out.println("]" + (res.hasMoreElements() ? "," : ""));
+ jalview.bin.Console.outPrintln("]" + (res.hasMoreElements() ? "," : ""));
}
- System.out.println("};");
+ jalview.bin.Console.outPrintln("};");
}
// to here
if (col == null)
{
- System.out.println("Making colour from name: " + colour);
+ jalview.bin.Console.outPrintln("Making colour from name: " + colour);
col = ColorUtils.createColourFromName(colour);
}
}
} catch (Exception ex)
{
- System.out.println(
+ jalview.bin.Console.outPrintln(
"Error parsing userDefinedColours:\n" + token + "\n" + ex);
}
{
if (mappings.isEmpty())
{
- System.err.println("reportMapping: No PDB/Sequence mappings.");
+ jalview.bin.Console.errPrintln("reportMapping: No PDB/Sequence mappings.");
}
else
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"reportMapping: There are " + mappings.size() + " mappings.");
int i = 0;
for (StructureMapping sm : mappings)
{
- System.err.println("mapping " + i++ + " : " + sm.pdbfile);
+ jalview.bin.Console.errPrintln("mapping " + i++ + " : " + sm.pdbfile);
}
}
}
chain.transferResidueAnnotation(siftsMapping, null);
} catch (SiftsException e)
{
- System.err.println(e.getMessage());
+ jalview.bin.Console.errPrintln(e.getMessage());
} catch (Exception e)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Unexpected exception during SIFTS mapping - falling back to NW for this sequence/structure pair");
- System.err.println(e.getMessage());
+ jalview.bin.Console.errPrintln(e.getMessage());
}
}
if (!foundSiftsMappings.isEmpty())
*
* if (mappings[j].sequence == seq && mappings[j].getPdbId().equals(pdbid)
* && mappings[j].pdbfile.equals(sl.getPdbFile())) {
- * System.out.println(pdbid+" "+mappings[j].getPdbId() +"
+ * jalview.bin.Console.outPrintln(pdbid+" "+mappings[j].getPdbId() +"
* "+mappings[j].pdbfile);
*
* java.awt.Color col; for(int index=0; index<seq.getLength(); index++) {
boolean removed = seqmappings.remove(acf);
if (removed && seqmappings.isEmpty())
{ // debug
- System.out.println("All mappings removed");
+ jalview.bin.Console.outPrintln("All mappings removed");
}
}
}
if (waiting)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Timed out waiting for structure viewer to load file "
+ notLoaded);
return false;
}
else
{
- System.out.println(
+ jalview.bin.Console.outPrintln(
"Unexpected key returned from identifiers jalview service");
return idData;
}
// BH 2018 -- added more valuable report
if (errorMessage != null)
{
- System.err.println("IdentifiersUrlProvider: cannot read " + idFileName
+ jalview.bin.Console.errPrintln("IdentifiersUrlProvider: cannot read " + idFileName
+ ": " + errorMessage);
}
return idData;
}
}
- System.out.println(
+ jalview.bin.Console.outPrintln(
"Error initialising UrlProvider - no custom url provider");
return null;
}
// 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");
+ jalview.bin.Console.outPrintln("Hello World 2");
+ jalview.bin.Console.outPrintln("All fonts available to Graphic2D:\n");
GraphicsEnvironment ge = GraphicsEnvironment
.getLocalGraphicsEnvironment();
String[] fontNames = ge.getAvailableFontFamilyNames();
for (int n = 0; n < fontNames.length; n++)
{
- System.out.println(fontNames[n]);
+ jalview.bin.Console.outPrintln(fontNames[n]);
}
// Testing part: simple an error thrown anywhere in this JVM will be printed
// on the Console
// We do it with a seperate Thread becasue we don't wan't to break a Thread
// used by the Console.
- System.out.println("\nLets throw an error on this console");
+ jalview.bin.Console.outPrintln("\nLets throw an error on this console");
errorThrower = new Thread(this);
errorThrower.setDaemon(true);
errorThrower.start();
if (channelPropsURL == null)
{
// complete failure of channel_properties, set all properties to defaults
- System.err.println("Failed to find '/" + CHANNEL_PROPERTIES_FILENAME
+ jalview.bin.Console.errPrintln("Failed to find '/" + CHANNEL_PROPERTIES_FILENAME
+ "' file at '"
+ (channelPropsURL == null ? "null"
: channelPropsURL.toString())
channelPropsIS.close();
} catch (IOException e)
{
- System.err.println(e.getMessage());
+ jalview.bin.Console.errPrintln(e.getMessage());
// return false;
}
}
channelProps.load(is);
} catch (FileNotFoundException e)
{
- System.err.println(e.getMessage());
+ jalview.bin.Console.errPrintln(e.getMessage());
} catch (IOException e)
{
- System.err.println(e.getMessage());
+ jalview.bin.Console.errPrintln(e.getMessage());
}
}
}
}
else
{
- System.err.println("Failed to get channel property '" + key + "'");
+ jalview.bin.Console.errPrintln("Failed to get channel property '" + key + "'");
}
}
return null;
img = imgIcon == null ? null : imgIcon.getImage();
if (img == null)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Failed to load channel image " + key + "=" + path);
if (!useClassDefaultImage)
{
{
return urlMap().getOrDefault(key, null);
}
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Do not use getImageURL(key) before using getImage(key...)");
}
return null;
}
else
{
- System.err.println("Malformed PDB DR line:" + acn);
+ jalview.bin.Console.errPrintln("Malformed PDB DR line:" + acn);
}
}
else
// debug
/*
* for (int s = 0; s <= rg.numSubs(); s++) {
- * System.err.println("Sub " + s + " : " + rg.matchedFrom(s) +
+ * jalview.bin.Console.errPrintln("Sub " + s + " : " + rg.matchedFrom(s) +
* " : " + rg.matchedTo(s) + " : '" + rg.stringMatched(s) + "'");
* }
*/
if (url == null)
{
- System.out.println("Created NO urls.");
+ jalview.bin.Console.outPrintln("Created NO urls.");
}
else
{
- System.out.println("Created a url from " + ((int[]) url[0])[0]
+ jalview.bin.Console.outPrintln("Created a url from " + ((int[]) url[0])[0]
+ "out of " + idstring[0].length + " sequences.");
- System.out.println("Sequences that did not match:");
+ jalview.bin.Console.outPrintln("Sequences that did not match:");
for (int sq = 0; sq < idstring[0].length; sq++)
{
if (!((boolean[]) url[1])[sq])
{
- System.out.println("Seq " + sq + ": " + idstring[0][sq] + "\t: "
+ jalview.bin.Console.outPrintln("Seq " + sq + ": " + idstring[0][sq] + "\t: "
+ idstring[1][sq]);
}
}
- System.out.println("Sequences that DID match:");
+ jalview.bin.Console.outPrintln("Sequences that DID match:");
for (int sq = 0; sq < idstring[0].length; sq++)
{
if (((boolean[]) url[1])[sq])
{
- System.out.println("Seq " + sq + ": " + idstring[0][sq] + "\t: "
+ jalview.bin.Console.outPrintln("Seq " + sq + ": " + idstring[0][sq] + "\t: "
+ idstring[1][sq]);
}
}
- System.out.println("The generated URL:");
- System.out.println(((String[]) url[3])[0]);
+ jalview.bin.Console.outPrintln("The generated URL:");
+ jalview.bin.Console.outPrintln(((String[]) url[3])[0]);
}
}
GroupUrlLink ul = new GroupUrlLink(links[i]);
if (ul.isValid())
{
- System.out.println("\n\n\n");
- System.out.println(
+ jalview.bin.Console.outPrintln("\n\n\n");
+ jalview.bin.Console.outPrintln(
"Link " + i + " " + links[i] + " : " + ul.toString());
- System.out.println(" pref : " + ul.getUrl_prefix());
- System.out.println(" IdReplace : " + ul.getIDRegexReplace());
- System.out.println(" SeqReplace : " + ul.getSeqRegexReplace());
- System.out.println(" Suffixes : " + ul.getUrl_suffix());
+ jalview.bin.Console.outPrintln(" pref : " + ul.getUrl_prefix());
+ jalview.bin.Console.outPrintln(" IdReplace : " + ul.getIDRegexReplace());
+ jalview.bin.Console.outPrintln(" SeqReplace : " + ul.getSeqRegexReplace());
+ jalview.bin.Console.outPrintln(" Suffixes : " + ul.getUrl_suffix());
- System.out.println(
+ jalview.bin.Console.outPrintln(
"<insert input id and sequence strings here> Without onlyIfMatches:");
Object[] urls;
try
testUrls(ul, seqsandids, urls);
} catch (UrlStringTooLongException ex)
{
- System.out.println("too long exception " + ex);
+ jalview.bin.Console.outPrintln("too long exception " + ex);
}
- System.out.println(
+ jalview.bin.Console.outPrintln(
"<insert input id and sequence strings here> With onlyIfMatches set:");
try
{
testUrls(ul, seqsandids, urls);
} catch (UrlStringTooLongException ex)
{
- System.out.println("too long exception " + ex);
+ jalview.bin.Console.outPrintln("too long exception " + ex);
}
}
else
{
- System.err.println("Invalid URLLink : " + links[i] + " : "
+ jalview.bin.Console.errPrintln("Invalid URLLink : " + links[i] + " : "
+ ul.getInvalidMessage());
}
}
public static boolean checkUrlAvailable(URL url, int readTimeout)
throws IOException, ProtocolException
{
- // System.out.println(System.currentTimeMillis() + " " + url);
+ // jalview.bin.Console.outPrintln(System.currentTimeMillis() + " " + url);
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
return null;
} catch (IOException e)
{
- System.err.println(e.getMessage());
+ jalview.bin.Console.errPrintln(e.getMessage());
return null;
}
}
null);
if (JCV == null)
{
- Console.outputMessage(
+ Console.errPrintln(
"Could not obtain JAVA_COMPILE_VERSION for comparison");
return -2;
}
JAVA_COMPILE_VERSION = Integer.parseInt(JCV);
} catch (MalformedURLException e)
{
- System.err.println("Could not find " + buildDetails);
+ jalview.bin.Console.errPrintln("Could not find " + buildDetails);
return -3;
} catch (IOException e)
{
- System.err.println("Could not load " + buildDetails);
+ jalview.bin.Console.errPrintln("Could not load " + buildDetails);
return -4;
} catch (NumberFormatException e)
{
- System.err.println("Could not parse JAVA_COMPILE_VERSION");
+ jalview.bin.Console.errPrintln("Could not parse JAVA_COMPILE_VERSION");
return -5;
}
String JV = System.getProperty("java.version");
if (JV == null)
{
- Console.outputMessage(
- "Could not obtain java.version for comparison");
+ Console.errPrintln("Could not obtain java.version for comparison");
return -2;
}
if (JV.startsWith("1."))
: Integer.parseInt(JV.substring(0, JV.indexOf(".")));
} catch (NumberFormatException e)
{
- System.err.println("Could not parse java.version");
+ jalview.bin.Console.errPrintln("Could not parse java.version");
return -3;
}
return JAVA_VERSION;
if (java_compile_version <= 0 || java_version <= 0)
{
- Console.outputMessage("Could not make Java version check");
+ Console.errPrintln("Could not make Java version check");
return true;
}
// Warn if these java.version and JAVA_COMPILE_VERSION conditions exist
init = true;
} catch (Exception e)
{
- System.err.println("Problems initializing the log4j system\n");
+ jalview.bin.Console.errPrintln("Problems initializing the log4j system\n");
e.printStackTrace(System.err);
}
}
time = mark = t;
if (msg != null)
{
- System.err.println("Platform: timer reset\t\t\t" + msg);
+ jalview.bin.Console.errPrintln("Platform: timer reset\t\t\t" + msg);
}
break;
case TIME_MARK:
}
if (msg != null)
{
- System.err.println("Platform: timer mark\t" + ((t - time) / 1000f)
+ jalview.bin.Console.errPrintln("Platform: timer mark\t" + ((t - time) / 1000f)
+ "\t" + ((t - mark) / 1000f) + "\t" + msg);
}
mark = t;
case TIME_GET:
if (msg != null)
{
- System.err.println("Platform: timer dur\t" + ((t - time) / 1000f)
+ jalview.bin.Console.errPrintln("Platform: timer dur\t" + ((t - time) / 1000f)
+ "\t" + ((duration) / 1000f) + "\t" + msg);
}
set = 0;
* info[key];
*/
- System.out.println(
+ jalview.bin.Console.outPrintln(
"Platform id=" + id + " reading Info." + key + " = " + value);
p.put(id + "_" + key, value);
if (isJS())
{
- System.out.println(
+ jalview.bin.Console.outPrintln(
"Platform adding known access-control-allow-origin * for domain "
+ domain);
/**
* @j2sNative var a =
* decodeURI((document.location.href.replace("&","?").split("?j2s")[0]
* + "?").split("?")[1].split("#")[0]); a &&
- * (System.out.println("URL arguments detected were "+a)) &&
+ * (jalview.bin.Console.outPrintln("URL arguments detected were "+a)) &&
* (J2S.thisApplet.__Info.urlargs = a.split(" "));
* (!J2S.thisApplet.__Info.args || J2S.thisApplet.__Info.args
* == "" || J2S.thisApplet.__Info.args == "??") &&
- * (J2S.thisApplet.__Info.args = a) && (System.out.println("URL
+ * (J2S.thisApplet.__Info.args = a) && (jalview.bin.Console.outPrintln("URL
* arguments were passed to J2S main."));
*/
} catch (Throwable t)
jv.clear();
if (DEBUG)
{
- System.err.println("Array from '" + delimiter
+ jalview.bin.Console.errPrintln("Array from '" + delimiter
+ "' separated List:\n" + v.length);
for (int i = 0; i < v.length; i++)
{
- System.err.println("item " + i + " '" + v[i] + "'");
+ jalview.bin.Console.errPrintln("item " + i + " '" + v[i] + "'");
}
}
return v;
}
if (DEBUG)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Empty Array from '" + delimiter + "' separated List");
}
return null;
{
System.err
.println("Returning '" + separator + "' separated List:\n");
- System.err.println(v);
+ jalview.bin.Console.errPrintln(v);
}
return v.toString();
}
if (DEBUG)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Returning empty '" + separator + "' separated List\n");
}
return "" + separator;
// debug
for (int s = 0; s <= rg.numSubs(); s++)
{
- System.err.println("Sub " + s + " : " + rg.matchedFrom(s)
+ jalview.bin.Console.errPrintln("Sub " + s + " : " + rg.matchedFrom(s)
+ " : " + rg.matchedTo(s) + " : '"
+ rg.stringMatched(s) + "'");
}
}
if (calculator.workingInvolvedWith(alignmentAnnotation))
{
- // System.err.println("grey out ("+alignmentAnnotation.label+")");
+ // jalview.bin.Console.errPrintln("grey out ("+alignmentAnnotation.label+")");
return true;
}
return false;
{
if (sequenceSetID != null)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Warning - overwriting a sequenceSetId for a viewport!");
}
sequenceSetID = new String(newid);
{
if (aa == null)
{
- System.err.println("Null annotation row: ignoring.");
+ jalview.bin.Console.errPrintln("Null annotation row: ignoring.");
continue;
}
if (!aa.visible)
{
if (this == av)
{
- System.err.println("Ignoring recursive setCodingComplement request");
+ jalview.bin.Console.errPrintln("Ignoring recursive setCodingComplement request");
}
else
{
*/
public void setStartEndSeq(int start, int end)
{
- // System.out.println("ViewportRange setStartEndSeq " + start + " " + end);
+ // jalview.bin.Console.outPrintln("ViewportRange setStartEndSeq " + start + " " + end);
int[] oldvalues = updateStartEndSeq(start, end);
int oldstartseq = oldvalues[0];
int oldendseq = oldvalues[1];
{
vpstart = visHeight - h;
}
- // System.out.println("ViewportRanges setviewportStartAndHeight " + vpstart
+ // jalview.bin.Console.outPrintln("ViewportRanges setviewportStartAndHeight " + vpstart
// + " " + start + " " + h + " " + getVisibleAlignmentHeight());
setStartEndSeq(vpstart, vpstart + h - 1);
{
synchronized (inProgress)
{
- // System.err.println("Worker " + worker + " marked as complete.");
+ // jalview.bin.Console.errPrintln("Worker " + worker + " marked as complete.");
inProgress.remove(worker);
List<AlignCalcWorkerI> upd = updating.get(worker.getClass());
if (upd != null)
public boolean isWorking(AlignCalcWorkerI worker)
{
synchronized (inProgress)
- {// System.err.println("isWorking : worker "+(worker!=null ?
+ {// jalview.bin.Console.errPrintln("isWorking : worker "+(worker!=null ?
// worker.getClass():"null")+ " "+hashCode());
return worker != null && inProgress.contains(worker);
}
boolean working=false;
synchronized (inProgress)
{
- // System.err.println("isWorking "+hashCode());
+ // jalview.bin.Console.errPrintln("isWorking "+hashCode());
working |= inProgress.size() > 0;
}
synchronized (updating)
* {
*
* if (isPending(worker)) { worker.abortAndDestroy(); startWorker(worker); }
- * else { System.err.println("Pending exists for " + workerClass); } }
+ * else { jalview.bin.Console.errPrintln("Pending exists for " + workerClass); } }
*/
}
.getCurrentAlignFrame().alignPanel;
if (currentAlignFrame == null)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Can't register calculator as no alignment window has focus");
return;
}
}
else
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Can't register calculator as no alignment window has focus");
}
}
}
while (!calcMan.notifyWorking(this))
{
- // System.err.println("Thread
+ // jalview.bin.Console.errPrintln("Thread
// (Consensus"+Thread.currentThread().getName()+") Waiting around.");
try
{
{
Console.debug("Interrupted sleep waiting for next job poll.", e);
}
- // System.out.println("I'm alive "+alTitle);
+ // jalview.bin.Console.outPrintln("I'm alive "+alTitle);
}
}
if (jobComplete && jobs != null)
}
} catch (Exception e)
{
- System.err.println("Couldn't locate PICR service instance.\n");
+ jalview.bin.Console.errPrintln("Couldn't locate PICR service instance.\n");
e.printStackTrace();
}
while (sdataset.size() > 0 && db < dbSources.length)
{
int maxqlen = 1; // default number of queries made at one time
- System.out.println("Verifying against " + dbSources[db].getDbName());
+ jalview.bin.Console.outPrintln("Verifying against " + dbSources[db].getDbName());
// iterate through db for each remaining un-verified sequence
SequenceI[] currSeqs = new SequenceI[sdataset.size()];
true);
} catch (Exception e)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Exception with Picr for '" + token + "'\n");
e.printStackTrace();
}
// present, and do a transferReferences
// otherwise transfer non sequence x-references directly.
}
- System.out.println(
+ jalview.bin.Console.outPrintln(
"Validated ID against PICR... (for what its worth):"
+ token);
addSeqId(sequence, token);
else
{
// if ()
- // System.out.println("Not querying source with
+ // jalview.bin.Console.outPrintln("Not querying source with
// token="+token+"\n");
addSeqId(sequence, token);
queries.addElement(token.toUpperCase(Locale.ROOT));
DbSourceProxy dbSourceProxy, AlignmentI retrievedAl,
boolean trimDatasetSeqs, List<String> warningMessages)
{
- // System.out.println("trimming ? " + trimDatasetSeqs);
+ // jalview.bin.Console.outPrintln("trimming ? " + trimDatasetSeqs);
if (retrievedAl == null || retrievedAl.getHeight() == 0)
{
return false;
}
}
- System.out.println("Adding dbrefs to " + sequence.getName()
+ jalview.bin.Console.outPrintln("Adding dbrefs to " + sequence.getName()
+ " from " + dbSource + " sequence : "
+ retrievedSeq.getName());
sequence.transferAnnotation(retrievedSeq, mp);
}
// } catch (OutOfMemoryError e)
// {
- // System.err.println("Out of memory when displaying status. Squashing
+ // jalview.bin.Console.errPrintln("Out of memory when displaying status. Squashing
// error.");
// wsInfo.appendProgressText(j.jobnum,
// "..\n(Out of memory when displaying status)\n");
if (!isValidReference(id))
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"(AFClient) Ignoring invalid alphafold query: '" + id + "'");
stopQuery();
return null;
}
} catch (Exception e)
{
- System.err.println("Warning: problems reading temp file " + file);
+ jalview.bin.Console.errPrintln("Warning: problems reading temp file " + file);
return null;
}
return bf;
}
else
{
- System.out.println(
+ jalview.bin.Console.outPrintln(
"No record found for '" + emprefx + ":" + query + "'");
}
}
}
} catch (Exception e)
{
- System.err.println("EMBL Record Features parsing error!");
+ jalview.bin.Console.errPrintln("EMBL Record Features parsing error!");
System.err
.println("Please report the following to help@jalview.org :");
- System.err.println("EMBL Record " + accession);
- System.err.println("Resulted in exception: " + e.getMessage());
+ jalview.bin.Console.errPrintln("EMBL Record " + accession);
+ jalview.bin.Console.errPrintln("Resulted in exception: " + e.getMessage());
e.printStackTrace(System.err);
}
codonStart = Integer.parseInt(value.trim());
} catch (NumberFormatException e)
{
- System.err.println("Invalid codon_start in XML for "
+ jalview.bin.Console.errPrintln("Invalid codon_start in XML for "
+ entry.getAccession() + ": " + e.getMessage());
}
}
* workaround until we handle dna location for CDS sequence
* e.g. location="X53828.1:60..1058" correctly
*/
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Implementation Notice: EMBLCDS records not properly supported yet - Making up the CDNA region of this sequence... may be incorrect ("
+ sourceDb + ":" + entry.getAccession() + ")");
int dnaLength = dna.getLength();
if (translationLength * 3 == (1 - codonStart + dnaLength))
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Not allowing for additional stop codon at end of cDNA fragment... !");
// this might occur for CDS sequences where no features are marked
exons = new int[] { dna.getStart() + (codonStart - 1),
}
if ((translationLength + 1) * 3 == (1 - codonStart + dnaLength))
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Allowing for additional stop codon at end of cDNA fragment... will probably cause an error in VAMSAs!");
exons = new int[] { dna.getStart() + (codonStart - 1),
dna.getEnd() - 3 };
if (!isValidReference(id))
{
- System.err.println("Ignoring invalid pdb query: '" + id + "'");
+ jalview.bin.Console.errPrintln("Ignoring invalid pdb query: '" + id + "'");
stopQuery();
return null;
}
String database = parseIds(ids, querystring);
if (database == null)
{
- System.err.println("Invalid Query string : '" + ids + "'");
- System.err.println("Should be of form 'dbname:q1;q2;q3;q4'");
+ jalview.bin.Console.errPrintln("Invalid Query string : '" + ids + "'");
+ jalview.bin.Console.errPrintln("Should be of form 'dbname:q1;q2;q3;q4'");
return null;
}
}
return (String[]) arl.toArray();
}
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Warning: response code " + responseCode + " for " + url);
} catch (OutOfMemoryError er)
{
- System.out.println("OUT OF MEMORY DOWNLOADING QUERY FROM " + database
+ jalview.bin.Console.outPrintln("OUT OF MEMORY DOWNLOADING QUERY FROM " + database
+ ":\n" + ids);
throw er;
} catch (Exception ex)
if (!ex.getMessage().startsWith(
"uk.ac.ebi.jdbfetch.exceptions.DbfNoEntryFoundException"))
{
- System.err.println("Unexpected exception when retrieving from "
+ jalview.bin.Console.errPrintln("Unexpected exception when retrieving from "
+ database + "\nQuery was : '" + ids + "'");
ex.printStackTrace(System.err);
}
public Annotate3D()
{
- System.out.println("Annotate3D");
+ jalview.bin.Console.outPrintln("Annotate3D");
// try {
// Create a URL for the desired page
// String id = "1HR2";
// OutputStream out1 = null;
// out = new BufferedWriter(new OutputStreamWriter(out1, "temp.rnaml"));
// while ((str = in.readLine()) != null) {
- // System.out.println(str);
+ // jalview.bin.Console.outPrintln(str);
// out.write(str);
// }
// in.close();
public Annotate3D(String path) throws InterruptedException
{
- System.out.println("Annotate3D");
+ jalview.bin.Console.outPrintln("Annotate3D");
try
{
// //URL url = new
// URL("http://paradise-ibmc.u-strasbg.fr/webservices/annotate3d?data="+inFile);
- // System.out.println("Step1");
+ // jalview.bin.Console.outPrintln("Step1");
// FileReader r = new FileReader(inFile);
// BufferedReader in = new BufferedReader(r);
// StringBuffer content = new StringBuffer();
- // System.out.println("Step2");
+ // jalview.bin.Console.outPrintln("Step2");
// while(in.readLine()!=null){
// content.append(in.readLine());
- // //System.out.println("Step3"+in.readLine());
+ // //jalview.bin.Console.outPrintln("Step3"+in.readLine());
// }
//
// String data = URLEncoder.encode("data", "UTF-8") + "=" +
// FileReader r = new FileReader(path);
// BufferedReader in = new BufferedReader(r);
// StringBuffer content = new StringBuffer();
- // System.out.println("Step1");
+ // jalview.bin.Console.outPrintln("Step1");
// while(in.readLine()!=null){
// content.append(in.readLine());
//
// }
- // System.out.println("Step2");
+ // jalview.bin.Console.outPrintln("Step2");
// String data = URLEncoder.encode("data", "UTF-8") + "=" +
// URLEncoder.encode(content.toString(), "UTF-8");
- // System.out.println("Step2");
+ // jalview.bin.Console.outPrintln("Step2");
// URL url = new
// URL("http://paradise-ibmc.u-strasbg.fr/webservices/annotate3d?data="+data);
// DataInputStream is = new DataInputStream(url.openStream());
// String str;
// while ((str = is.readLine()) != null) {
- // System.out.println(str);
+ // jalview.bin.Console.outPrintln(str);
// //out.write(str);
// }
FileReader r = new FileReader(path);
while ((str = in.readLine()) != null)
{
- // System.out.println(str);
+ // jalview.bin.Console.outPrintln(str);
content = content + str;
}
- System.out.println("pdbfile=" + content.toString());
- System.out.println("capacité=" + content.length());
+ jalview.bin.Console.outPrintln("pdbfile=" + content.toString());
+ jalview.bin.Console.outPrintln("capacité=" + content.length());
String paramfile = URLEncoder.encode(content.toString(), "UTF-8");
- System.out.println("param=" + paramfile);
+ jalview.bin.Console.outPrintln("param=" + paramfile);
URL url = new URL(
"http://paradise-ibmc.u-strasbg.fr/webservices/annotate3d?data="
+ content);
String str4;
while ((str4 = is.readLine()) != null)
{
- System.out.println(str4);
+ jalview.bin.Console.outPrintln(str4);
// out.write(str);
}
in.close();
// BufferedReader in1 = new BufferedReader(is);
// OutputStream out1 = null;
- // System.out.println("Step3");
+ // jalview.bin.Console.outPrintln("Step3");
// BufferedWriter out = new BufferedWriter(new OutputStreamWriter(out1,
// "temp.rnaml"));
//
// return;
- // System.out.println(data.length());
- // System.out.println("step2");
+ // jalview.bin.Console.outPrintln(data.length());
+ // jalview.bin.Console.outPrintln("step2");
// URL url = new
// URL("http://paradise-ibmc.u-strasbg.fr/webservices/annotate3d?data="+data);
- // System.out.println("step3");
+ // jalview.bin.Console.outPrintln("step3");
// URLConnection conn = url.openConnection();
// conn.setDoOutput(true);
// OutputStreamWriter writer = new
// //String line;
// while ((line = reader.readLine()) != null) {
// answer.append(line);
- // System.out.println(line);
+ // jalview.bin.Console.outPrintln(line);
// }
// writer.close();
// reader.close();
// out = new BufferedWriter(new FileWriter("temp.rnaml"));
// while ((str = in.readLine()) != null) {
- // System.out.println(str);
+ // jalview.bin.Console.outPrintln(str);
// out.write(str);
- // System.out.println(str);
+ // jalview.bin.Console.outPrintln(str);
// in.close();
// out.close();
// public BufferedWriter getReader()
// {
- // System.out.println("The buffer");
+ // jalview.bin.Console.outPrintln("The buffer");
// return out;
} catch (Exception e)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"jalview.rootRegistry is not a proper url!\nWas set to "
+ RootServiceURL + "\n" + e);
}
WS1Client instance = serviceClientBindings.get(sh.getAbstractName());
if (instance == null)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"WARNING - POSSIBLE IMPLEMENTATION ERROR - cannot find WSClient implementation for "
+ sh.getAbstractName());
}
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(
+ jalview.bin.Console.errPrintln(
"JPredWS Client: Failed to submit the prediction. Quite possibly because of a server error - see below)\n"
+ e.getMessage() + "\n");
j.setJobId(jobsubmit.getJobId());
j.setSubmitted(true);
j.setSubjobComplete(false);
- // System.out.println(WsURL + " Job Id '" + jobId + "'");
+ // jalview.bin.Console.outPrintln(WsURL + " Job Id '" + jobId + "'");
}
else
{
{
// TODO: JBPNote catch timeout or other fault types explicitly
// For unexpected errors
- System.err.println(WebServiceName
+ jalview.bin.Console.errPrintln(WebServiceName
+ "Client: Failed to submit the sequences for alignment (probably a server side problem)\n"
+ "When contacting Server:" + WsUrl + "\n" + e.toString()
+ "\n");
results++;
// if (Cache.isDebugEnabled())
// {
- // System.out.println("Job lob for job
+ // jalview.bin.Console.outPrintln("Job lob for job
// "+jobs[j].getJobId()+":"+jobs[j].getJobnum());
- // System.out.println(jobs[j].getStatus());
+ // jalview.bin.Console.outPrintln(jobs[j].getStatus());
// }
vamsas.objects.simple.Alignment valign = ((MsaResult) ((MsaWSJob) jobs[j]).result)
}
else
{
- System.out.println("MERGE WITH OLD FRAME");
+ jalview.bin.Console.outPrintln("MERGE WITH OLD FRAME");
// TODO: modify alignment in original frame, replacing old for new
// alignment using the commands.EditCommand model to ensure the update can
// be undone
}
} catch (Exception e)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Failed to parse the annotation file associated with the alignment.");
- System.err.println(">>>EOF" + inFile + "\n<<<EOF\n");
+ jalview.bin.Console.errPrintln(">>>EOF" + inFile + "\n<<<EOF\n");
e.printStackTrace(System.err);
}
}
} catch (Exception e)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Failed to parse the Features file associated with the alignment.");
- System.err.println(">>>EOF" + inFile + "\n<<<EOF\n");
+ jalview.bin.Console.errPrintln(">>>EOF" + inFile + "\n<<<EOF\n");
e.printStackTrace(System.err);
}
jalview.io.NewickFile nf = null;
}
} catch (Exception e)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Failed to parse the treeFile associated with the alignment.");
- System.err.println(">>>EOF" + inFile + "\n<<<EOF\n");
+ jalview.bin.Console.errPrintln(">>>EOF" + inFile + "\n<<<EOF\n");
e.printStackTrace(System.err);
}
j.setJobId(jobsubmit.getJobId());
j.setSubmitted(true);
j.setSubjobComplete(false);
- // System.out.println(WsURL + " Job Id '" + jobId + "'");
+ // jalview.bin.Console.outPrintln(WsURL + " Job Id '" + jobId + "'");
}
else
{
{
// TODO: JBPNote catch timeout or other fault types explicitly
// For unexpected errors
- System.err.println(WebServiceName
+ jalview.bin.Console.errPrintln(WebServiceName
+ "Client: Failed to submit the sequences for alignment (probably a server side problem)\n"
+ "When contacting Server:" + WsUrl + "\n" + e.toString()
+ "\n");
{
if (!newFrame)
{
- System.err.println("MERGE WITH OLD FRAME NOT IMPLEMENTED");
+ jalview.bin.Console.errPrintln("MERGE WITH OLD FRAME NOT IMPLEMENTED");
return;
}
// each subjob is an independent alignment for the moment
{
if (cancelJob(rslt))
{
- System.err.println("Cancelled AACon job: " + rslt);
+ jalview.bin.Console.errPrintln("Cancelled AACon job: " + rslt);
}
else
{
- System.err.println("FAILED TO CANCEL AACon job: " + rslt);
+ jalview.bin.Console.errPrintln("FAILED TO CANCEL AACon job: " + rslt);
}
} catch (Exception x)
catch (JobSubmissionException x)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"submission error with " + getServiceActionText() + " :");
x.printStackTrace();
calcMan.disableWorker(this);
} catch (ResultNotAvailableException x)
{
- System.err.println("collection error:\nJob ID: " + rslt);
+ jalview.bin.Console.errPrintln("collection error:\nJob ID: " + rslt);
x.printStackTrace();
calcMan.disableWorker(this);
String id = rslt;
if (cancelJob(rslt))
{
- System.err.println("Cancelled job " + id);
+ jalview.bin.Console.errPrintln("Cancelled job " + id);
}
else
{
- System.err.println("Job " + id + " couldn't be cancelled.");
+ jalview.bin.Console.errPrintln("Job " + id + " couldn't be cancelled.");
}
} catch (Exception q)
{
}
else
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Warning: Ignoring parameter set instance of type "
+ paramset.getClass()
+ " : Bound but not applicable for service at "
registry = Jws2Client.connectToRegistry(jwsserver);
if (registry != null)
{
- // System.err.println("Test Services Output\n"
+ // jalview.bin.Console.errPrintln("Test Services Output\n"
// + registry.testAllServices());
// TODO: enumerate services and test those that haven't been tested
// in the last n-days/hours/etc.
srv_set = registry.getSupportedServices();
// dan test
- System.out.println(
+ jalview.bin.Console.outPrintln(
"registry.getSupportedServices: " + srv_set.toString());
svccategories = registry.getServiceCategories();
// dan test
- // System.out.println("registry.getServiceCategories: " +
+ // jalview.bin.Console.outPrintln("registry.getServiceCategories: " +
// svccategories.toString());
}
} catch (Exception ex)
{
- System.err.println("Exception whilst trying to get at registry:");
+ jalview.bin.Console.errPrintln("Exception whilst trying to get at registry:");
ex.printStackTrace();
// if that failed, then we are probably working with a JABAWS1 server.
// in that case, look for each service endpoint
- System.err.println("JWS2 Discoverer: " + jwsserver
+ jalview.bin.Console.errPrintln("JWS2 Discoverer: " + jwsserver
+ " is a JABAWS1 server. Using hardwired list.");
for (Services srv : JABAWS1SERVERS)
{
service = Jws2Client.connect(jwsserver, srv);
} catch (Exception e)
{
- System.err.println("Jws2 Discoverer: Problem on " + jwsserver
+ jalview.bin.Console.errPrintln("Jws2 Discoverer: Problem on " + jwsserver
+ " with service " + srv + ":\n" + e.getMessage());
if (!(e instanceof javax.xml.ws.WebServiceException))
{
result = true;
} catch (MalformedURLException e)
{
- System.err.println("Invalid server URL: " + server);
+ jalview.bin.Console.errPrintln("Invalid server URL: " + server);
result = false;
} catch (IOException e)
{
- System.err.println("Error connecting to server: " + server + ": "
+ jalview.bin.Console.errPrintln("Error connecting to server: " + server + ": "
+ e.toString());
result = false;
}
List<AlignmentAnnotation> ourAnnot, String typeName,
String calcId, SequenceI dseq, int base, Score scr)
{
- System.out.println("Creating annotation on dseq:" + dseq.getStart()
+ jalview.bin.Console.outPrintln("Creating annotation on dseq:" + dseq.getStart()
+ " base is " + base + " and length=" + dseq.getLength()
+ " == " + scr.getScores().size());
// AlignmentAnnotation annotation = new AlignmentAnnotation(
List<AlignmentAnnotation> ourAnnot, String typeName,
String calcId, SequenceI dseq, int base, Score scr)
{
- System.out.println("Creating annotation on dseq:" + dseq.getStart()
+ jalview.bin.Console.outPrintln("Creating annotation on dseq:" + dseq.getStart()
+ " base is " + base + " and length=" + dseq.getLength()
+ " == " + scr.getScores().size());
// AlignmentAnnotation annotation = new AlignmentAnnotation(
.loadClass("compbio.ws.client.Jws2Client");
} catch (ClassNotFoundException e)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Not enabling JABA Webservices : client jar is not available."
+ "\nPlease check that your webstart JNLP file is up to date!");
running = false;
{
services = new Vector<>();
}
- System.out.println(
+ jalview.bin.Console.outPrintln(
"Discovered service: " + jwsservers + " " + service.toString());
// Jws2Instance service = new Jws2Instance(jwsservers, srv.toString(),
// service2);
{
if (getDiscoverer().services != null)
{
- System.out.println("Changesupport: There are now "
+ jalview.bin.Console.outPrintln("Changesupport: There are now "
+ getDiscoverer().services.size() + " services");
int i = 1;
for (Jws2Instance instance : getDiscoverer().services)
{
- System.out.println("Service " + i++ + " "
+ jalview.bin.Console.outPrintln("Service " + i++ + " "
+ instance.getClass() + "@" + instance.getHost()
+ ": " + instance.getActionText());
}
{
j.setSubmitted(true);
j.setSubjobComplete(false);
- // System.out.println(WsURL + " Job Id '" + jobId + "'");
+ // jalview.bin.Console.outPrintln(WsURL + " Job Id '" + jobId + "'");
return;
}
else
} catch (Error e)
{
// For unexpected errors
- System.err.println(WebServiceName
+ jalview.bin.Console.errPrintln(WebServiceName
+ "Client: Failed to submit the sequences for alignment (probably a server side problem)\n"
+ "When contacting Server:" + WsUrl + "\n");
e.printStackTrace(System.err);
} catch (Exception e)
{
// For unexpected errors
- System.err.println(WebServiceName
+ jalview.bin.Console.errPrintln(WebServiceName
+ "Client: Failed to submit the sequences for alignment (probably a server side problem)\n"
+ "When contacting Server:" + WsUrl + "\n");
e.printStackTrace(System.err);
if (Console.isDebugEnabled())
{
- System.out.println("Job Execution file for job: "
+ jalview.bin.Console.outPrintln("Job Execution file for job: "
+ msjob.getJobId() + " on server " + WsUrl);
- System.out.println(msjob.getStatus());
- System.out.println("*** End of status");
+ jalview.bin.Console.outPrintln(msjob.getStatus());
+ jalview.bin.Console.outPrintln("*** End of status");
}
try
else
{
// TODO 2.9.x feature
- System.out.println("MERGE WITH OLD FRAME");
+ jalview.bin.Console.outPrintln("MERGE WITH OLD FRAME");
// TODO: modify alignment in original frame, replacing old for new
// alignment using the commands.EditCommand model to ensure the update can
// be undone
Option o = options.getArgumentByOptionName(oname);
if (o == null)
{
- System.out.println("WARN ignoring unsuppoted parameter: " + oname);
+ jalview.bin.Console.outPrintln("WARN ignoring unsuppoted parameter: " + oname);
continue;
}
if (o instanceof Parameter)
: param);
} catch (WrongParameterException e)
{
- System.out.println(
+ jalview.bin.Console.outPrintln(
"Problem setting value for the parameter: " + param);
e.printStackTrace();
}
}
} catch (Exception ex)
{
- System.err.println("Exception when retrieving presets for service "
+ jalview.bin.Console.errPrintln("Exception when retrieving presets for service "
+ serviceType + " at " + hosturl);
}
}
* try { URL serviceurl = new URL(hosturl); if (serviceurl.getPort()!=80) {
* return serviceurl.getHost()+":"+serviceurl.getPort(); } return
* serviceurl.getHost(); } catch (Exception e) {
- * System.err.println("Failed to parse service URL '" + hosturl +
+ * jalview.bin.Console.errPrintln("Failed to parse service URL '" + hosturl +
* "' as a valid URL!"); } return null;
*/
}
: null));
} catch (Exception ex)
{
- System.err.println("Unexpected exception creating JabaParamStore.");
+ jalview.bin.Console.errPrintln("Unexpected exception creating JabaParamStore.");
ex.printStackTrace();
}
}
} catch (Exception ex)
{
- System.err.println("Couldn't transform string\n" + content
+ jalview.bin.Console.errPrintln("Couldn't transform string\n" + content
+ "\nException was :");
ex.printStackTrace(System.err);
}
@Override
public void cancelJob()
{
- System.err.println("Cannot cancel this job type: " + service);
+ jalview.bin.Console.errPrintln("Cannot cancel this job type: " + service);
}
@Override
}
} catch (Exception ex)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Serious - RSBS descriptions in user preferences are corrupt!");
ex.printStackTrace();
}
public void pollJob(AWsJob job) throws Exception
{
assert (job instanceof RestJob);
- System.err.println("Debug RestJob: Polling Job");
+ jalview.bin.Console.errPrintln("Debug RestJob: Polling Job");
doPoll((RestJob) job);
}
assert (job instanceof RestJob);
try
{
- System.err.println("Debug RestJob: Posting Job");
+ jalview.bin.Console.errPrintln("Debug RestJob: Posting Job");
doPost((RestJob) job);
} catch (NoValidInputDataException erex)
{
if (!rj.hasValidInput())
{
// invalid input for this job
- System.err.println("Job " + rj.getJobnum()
+ jalview.bin.Console.errPrintln("Job " + rj.getJobnum()
+ " has invalid input. ( " + rj.getStatus() + ")");
if (rj.hasStatus() && !_warnings.contains(rj.getStatus()))
{
seqset = fetcher.getSequenceRecords(qsb.toString());
} catch (Exception ex)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Failed to retrieve the following from " + db);
- System.err.println(qsb);
+ jalview.bin.Console.errPrintln(qsb);
ex.printStackTrace(System.err);
}
// TODO: Merge alignment together - perhaps
{
if (fetcher.getRawRecords() != null)
{
- System.out.println(
+ jalview.bin.Console.outPrintln(
"# Retrieved from " + db + ":" + qsb.toString());
StringBuffer rrb = fetcher.getRawRecords();
/*
/*
* } else { hdr = "# part "+rr; }
*/
- System.out.println(hdr);
+ jalview.bin.Console.outPrintln(hdr);
if (rrb != null)
{
- System.out.println(rrb);
+ jalview.bin.Console.outPrintln(rrb);
}
- System.out.println("# end of " + hdr);
+ jalview.bin.Console.outPrintln("# end of " + hdr);
}
}
}
if (queriesMade.size() > 0)
{
- System.out.println("# Adding " + queriesMade.size()
+ jalview.bin.Console.outPrintln("# Adding " + queriesMade.size()
+ " ids back to queries list for searching again (" + db
+ ")");
queriesLeft.addAll(queriesMade);
Exception ex)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Failed to retrieve the following references from " + db);
int n = 0;
for (String qv : queriesMade)
System.err.print(" " + qv + ";");
if (n++ > 10)
{
- System.err.println();
+ jalview.bin.Console.errPrintln();
n = 0;
}
}
- System.err.println();
+ jalview.bin.Console.errPrintln();
ex.printStackTrace();
}
try (InputStream in = new FileInputStream(siftFile);
GZIPInputStream gzis = new GZIPInputStream(in);)
{
- // System.out.println("File : " + siftFile.getAbsolutePath());
+ // jalview.bin.Console.outPrintln("File : " + siftFile.getAbsolutePath());
JAXBContext jc = JAXBContext.newInstance("jalview.xml.binding.sifts");
XMLStreamReader streamReader = XMLInputFactory.newInstance()
.createXMLStreamReader(gzis);
if (siftsFile.exists())
{
// The line below is required for unit testing... don't comment it out!!!
- System.out.println(">>> SIFTS File already downloaded for " + pdbId);
+ jalview.bin.Console.outPrintln(">>> SIFTS File already downloaded for " + pdbId);
if (isFileOlderThanThreshold(siftsFile,
SiftsSettings.getCacheThresholdInDays()))
diffInDays = (int) ((new Date().getTime()
- attr.lastModifiedTime().toMillis())
/ (1000 * 60 * 60 * 24));
- // System.out.println("Diff in days : " + diffInDays);
+ // jalview.bin.Console.outPrintln("Diff in days : " + diffInDays);
} catch (IOException e)
{
e.printStackTrace();
}
}
- // System.out.println(">> Download ftp url : " + siftsFileFTPURL);
+ // jalview.bin.Console.outPrintln(">> Download ftp url : " + siftsFileFTPURL);
// long now = System.currentTimeMillis();
URL url = new URL(siftsFileFTPURL);
URLConnection conn = url.openConnection();
}
outputStream.close();
inputStream.close();
- // System.out.println(">>> File downloaded : " + downloadedSiftsFile
+ // jalview.bin.Console.outPrintln(">>> File downloaded : " + downloadedSiftsFile
// + " took " + (System.currentTimeMillis() - now) + "ms");
return downloadTo;
}
seq = seq.getDatasetSequence();
}
structId = (chain == null) ? pdbId : pdbId + "|" + chain;
- System.out.println("Getting SIFTS mapping for " + structId + ": seq "
+ jalview.bin.Console.outPrintln("Getting SIFTS mapping for " + structId + ": seq "
+ seq.getName());
final StringBuilder mappingDetails = new StringBuilder(128);
{
List<Integer> omitNonObserved = new ArrayList<>();
int nonObservedShiftIndex = 0, pdbeNonObserved = 0;
- // System.out.println("Generating mappings for : " + entityId);
+ // jalview.bin.Console.outPrintln("Generating mappings for : " + entityId);
Entity entity = null;
entity = getEntityById(entityId);
String originalSeq = AlignSeq.extractGaps(
int firstPDBResNum = UNASSIGNED;
for (Segment segment : segments)
{
- // System.out.println("Mapping segments : " + segment.getSegId() + "\\"s
+ // jalview.bin.Console.outPrintln("Mapping segments : " + segment.getSegId() + "\\"s
// + segStartEnd);
List<Residue> residues = segment.getListResidue().getResidue();
for (Residue residue : residues)
// Arrays.sort(keys);
int firstIndex = keys[0];
int lastIndex = keys[keys.length - 1];
- // System.out.println("Min value " + firstIndex);
- // System.out.println("Max value " + lastIndex);
+ // jalview.bin.Console.outPrintln("Min value " + firstIndex);
+ // jalview.bin.Console.outPrintln("Max value " + lastIndex);
for (int x = firstIndex; x <= lastIndex; x++)
{
if (!resNumMap.containsKey(x) && !omitNonObserved.contains(x))
*/
public Entity getEntityByMostOptimalMatchedId(String chainId)
{
- // System.out.println("---> advanced greedy entityId matching block
+ // jalview.bin.Console.outPrintln("---> advanced greedy entityId matching block
// entered..");
List<Entity> entities = siftsEntry.getEntity();
SiftsEntitySortPojo[] sPojo = new SiftsEntitySortPojo[entities.size()];
++count;
}
Arrays.sort(sPojo, Collections.reverseOrder());
- // System.out.println("highest matched entity : " + sPojo[0].entityId);
- // System.out.println("highest matched pid : " + sPojo[0].pid);
+ // jalview.bin.Console.outPrintln("highest matched entity : " + sPojo[0].entityId);
+ // jalview.bin.Console.outPrintln("highest matched pid : " + sPojo[0].pid);
if (sPojo[0].entityId != null)
{
}
} catch (IOException e)
{
- System.out.println(
+ jalview.bin.Console.outPrintln(
"Exception while closing download file output stream: "
+ e.getMessage());
}
}
} catch (IOException e)
{
- System.out.println("Exception while closing download channel: "
+ jalview.bin.Console.outPrintln("Exception while closing download channel: "
+ e.getMessage());
}
try
}
} catch (IOException e)
{
- System.out.println("Exception while deleting download temp file: "
+ jalview.bin.Console.outPrintln("Exception while deleting download temp file: "
+ e.getMessage());
}
}
String ln = null;
while ((ln = worker.getOutputReader().readLine()) != null)
{
- System.out.println(ln);
+ System.out.println("STDOUT: " + ln);
successfulCMDs.add(ln);
}
while ((ln = worker.getErrorReader().readLine()) != null)
{
- System.err.println(ln);
+ System.err.println("STDERR: " + ln);
+ successfulCMDs.add(ln);
}
}
// number of lines expected on STDERR when Jalview starts up normally
// may need to adjust this if Jalview is excessively noisy ?
+ final int STDOUT_SETUPLINES = 50;
final int STDERR_SETUPLINES = 50;
// thread monitors stderr - bails after SETUP_TIMEOUT or when
public void run()
{
String ln = null;
- int count = 0;
+ int stdoutcount = 0;
+ int stderrcount = 0;
try
{
while ((ln = worker.getOutputReader().readLine()) != null)
{
System.out.println(ln);
successfulCMDs.add(ln);
- if (++count > STDERR_SETUPLINES)
+ if (++stdoutcount > STDOUT_SETUPLINES)
+ {
+ break;
+ }
+ }
+ while ((ln = worker.getErrorReader().readLine()) != null)
+ {
+ System.err.println(ln);
+ successfulCMDs.add(ln);
+ if (++stderrcount > STDERR_SETUPLINES)
{
break;
}
import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;
+import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
file.delete();
}
+ @Test(
+ groups =
+ { "Functional", "testTask1" },
+ dataProvider = "headlessModeOutputToStdout")
+ public void testHeadlessModeOutputToStdout(String args,
+ String comparisonFile, int timeout)
+ {
+ String cmd = args;
+ File file = new File(comparisonFile);
+ Worker worker = getJalviewDesktopRunner(true, cmd, timeout);
+ int b = -1;
+ StringBuilder sb = new StringBuilder();
+ try
+ {
+ while ((b = worker.getOutputReader().read()) != -1)
+ {
+ sb.append(Character.toChars(b));
+ }
+ } catch (IOException e)
+ {
+ Assert.fail("IOException whilst trying to read from jalview process");
+ }
+
+ String comparisonContent = null;
+ try
+ {
+ comparisonContent = new String(Files.readAllBytes(file.toPath()));
+ } catch (IOException e)
+ {
+ Assert.fail("IOException whilst trying to read comparison file");
+ }
+
+ Assert.assertEquals(sb.toString(), comparisonContent,
+ "STDOUT from jalview command did not match the comparison file");
+ }
+
@DataProvider(name = "allInputOperationsData")
public Object[][] getHeadlessModeInputParams()
{
//
};
}
+
+ @DataProvider(name = "headlessModeOutputToStdout")
+ public static Object[][] getHeadlessModeOutputToStdout()
+ {
+ // JBPNote: I'm not clear why need to specify full path for output file
+ // when running tests on build server, but we will keep this patch for now
+ // since it works.
+ // https://issues.jalview.org/browse/JAL-1889?focusedCommentId=21609&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-21609
+ String workingDir = "test/jalview/bin/";
+ return new Object[][] {
+ //
+ { "--open=examples/uniref50.fa --output=-",
+ workingDir + "/uniref50-output.fa", TEST_TIMEOUT },
+ { "--open examples/uniref50.fa --output -",
+ workingDir + "/uniref50-output.fa", TEST_TIMEOUT },
+ //
+ };
+ }
}
{
Desktop.closeDesktop();
}
-
- public static void callJalviewMain(String[] args) {
- if (Jalview.getInstance()!=null) {
+
+ public static void callJalviewMain(String[] args)
+ {
+ if (Jalview.getInstance() != null)
+ {
Jalview.getInstance().doMain(args);
- } else {
+ }
+ else
+ {
Jalview.main(args);
}
}
}
}
- @Test(groups = {"Functional","testTask1"}, dataProvider = "structureImageOutputFiles")
+ @Test(
+ groups =
+ { "Functional", "testTask1" },
+ dataProvider = "structureImageOutputFiles")
public void structureImageOutputTest(String cmdLine, String[] filenames)
throws IOException
{
{
cleanupFiles(filenames);
String[] args = (cmdLine + " --gui").split("\\s+");
- try {
- callJalviewMain(args);
- Commands cmds = Jalview.getInstance().getCommands();
- Assert.assertNotNull(cmds);
- File lastFile = null;
- for (String filename : filenames)
+ try
{
- File file = new File(filename);
- Assert.assertTrue(file.exists(), "File '" + filename
- + "' was not created by '" + cmdLine + "'");
- Assert.assertTrue(file.isFile(), "File '" + filename
- + "' is not a file from '" + cmdLine + "'");
- Assert.assertTrue(Files.size(file.toPath()) > 0, "File '" + filename
- + "' has no content from '" + cmdLine + "'");
- // make sure the successive output files get bigger!
- if (lastFile != null)
- Assert.assertTrue(
- Files.size(file.toPath()) > Files.size(lastFile.toPath()));
- }
+ callJalviewMain(args);
+ Commands cmds = Jalview.getInstance().getCommands();
+ Assert.assertNotNull(cmds);
+ File lastFile = null;
+ for (String filename : filenames)
+ {
+ File file = new File(filename);
+ Assert.assertTrue(file.exists(), "File '" + filename
+ + "' was not created by '" + cmdLine + "'");
+ Assert.assertTrue(file.isFile(), "File '" + filename
+ + "' is not a file from '" + cmdLine + "'");
+ Assert.assertTrue(Files.size(file.toPath()) > 0, "File '" + filename
+ + "' has no content from '" + cmdLine + "'");
+ // make sure the successive output files get bigger!
+ if (lastFile != null)
+ Assert.assertTrue(Files.size(file.toPath()) > Files
+ .size(lastFile.toPath()));
+ }
} catch (Exception x)
{
- Assert.fail("Unexpected exception during argFilesGlobAndSubstitutions",
+ Assert.fail(
+ "Unexpected exception during argFilesGlobAndSubstitutions",
x);
} finally
{
{ testfiles + "/structureimage1.png",
testfiles + "/structureimage2.png",
testfiles + "/structureimage3.png" } },
- /*
{ "--headless --noquit --open=./examples/test_fab41.result/sample.a2m "
+ "--structure=./examples/test_fab41.result/test_fab41_unrelaxed_rank_1_model_3.pdb "
+ "--structureimage=" + testfiles + "/structureimage1.png "
{ testfiles + "/structureimage1.png",
testfiles + "/structureimage2.png",
testfiles + "/structureimage3.png" } },
+ /*
*/
//
};
--- /dev/null
+>FER_CAPAA/1-97 Ferredoxin
+-----------------------------------------------------------ASYKVKLITPDGP
+IEFDCPDDVYILDQAEEAGHDLPYSCRAGSCSSCAGKIAGGAVDQTDGNFLDDDQLEEGWVLTCVAYPQSDV
+TIETHKEAELVG-
+>FER_CAPAN/1-144 Ferredoxin, chloroplast precursor
+MA------SVSATMISTSFMPRKPAVTSL-KPIPNVGE--ALFGLKS-A--NGGKVTCMASYKVKLITPDGP
+IEFDCPDNVYILDQAEEAGHDLPYSCRAGSCSSCAGKIAGGAVDQTDGNFLDDDQLEEGWVLTCVAYPQSDV
+TIETHKEAELVG-
+>FER1_SOLLC/1-144 Ferredoxin-1, chloroplast precursor
+MA------SISGTMISTSFLPRKPAVTSL-KAISNVGE--ALFGLKS-G--RNGRITCMASYKVKLITPEGP
+IEFECPDDVYILDQAEEEGHDLPYSCRAGSCSSCAGKVTAGSVDQSDGNFLDEDQEAAGFVLTCVAYPKGDV
+TIETHKEEELTA-
+>Q93XJ9_SOLTU/1-144 Ferredoxin I precursor
+MA------SISGTMISTSFLPRKPVVTSL-KAISNVGE--ALFGLKS-G--RNGRITCMASYKVKLITPDGP
+IEFECPDDVYILDQAEEEGHDLPYSCRAGSCSSCAGKVTAGTVDQSDGKFLDDDQEAAGFVLTCVAYPKCDV
+TIETHKEEELTA-
+>FER1_PEA/1-149 Ferredoxin-1, chloroplast precursor
+MATT---PALYGTAVSTSFLRTQPMPMSV-TTTKAFSN--GFLGLKT-SLKRGDLAVAMASYKVKLVTPDGT
+QEFECPSDVYILDHAEEVGIDLPYSCRAGSCSSCAGKVVGGEVDQSDGSFLDDEQIEAGFVLTCVAYPTSDV
+VIETHKEEDLTA-
+>Q7XA98_TRIPR/1-152 Ferredoxin I
+MATT---PALYGTAVSTSFMRRQPVPMSV-ATTTTTKAFPSGFGLKSVSTKRGDLAVAMATYKVKLITPEGP
+QEFDCPDDVYILDHAEEVGIELPYSCRAGSCSSCAGKVVNGNVNQEDGSFLDDEQIEGGWVLTCVAFPTSDV
+TIETHKEEELTA-
+>FER1_MESCR/1-148 Ferredoxin-1, chloroplast precursor
+MAAT--TAALSGATMSTAFAPK--TPPMTAALPTNVGR--ALFGLKS-SASR-GRVTAMAAYKVTLVTPEGK
+QELECPDDVYILDAAEEAGIDLPYSCRAGSCSSCAGKVTSGSVNQDDGSFLDDDQIKEGWVLTCVAYPTGDV
+TIETHKEEELTA-
+>FER1_SPIOL/1-147 Ferredoxin-1, chloroplast precursor
+MAAT--TTTMMG--MATTFVPKPQAPPMMAALPSNTGR--SLFGLKT-GSR--GGRMTMAAYKVTLVTPTGN
+VEFQCPDDVYILDAAEEEGIDLPYSCRAGSCSSCAGKLKTGSLNQDDQSFLDDDQIDEGWVLTCAAYPVSDV
+TIETHKEEELTA-
+>FER3_RAPSA/1-96 Ferredoxin, leaf L-A
+-----------------------------------------------------------ATYKVKFITPEGE
+QEVECDDDVYVLDAAEEAGIDLPYSCRAGSCSSCAGKVVSGSVDQSDQSFLDDDQIAEGFVLTCAAYPTSDV
+TIETHREEDMV--
+>FER2_ARATH/1-148 Ferredoxin-2, chloroplast precursor
+MAST----ALSSAIVGTSFIRRSPAPISLRSLPSANTQ--SLFGLKS-GTARGGRVTAMATYKVKFITPEGE
+LEVECDDDVYVLDAAEEAGIDLPYSCRAGSCSSCAGKVVSGSVDQSDQSFLDDEQIGEGFVLTCAAYPTSDV
+TIETHKEEDIV--
+>FER_BRANA/1-96 Ferredoxin
+-----------------------------------------------------------ATYKVKFITPEGE
+QEVECDDDVYVLDAAEEAGIDLPYSCRAGSCSSCAGKVVSGFVDQSDESFLDDDQIAEGFVLTCAAYPTSDV
+TIETHKEEELV--
+>FER1_ARATH/1-148 Ferredoxin-1, chloroplast precursor
+MAST----ALSSAIVSTSFLRRQQTPISLRSLPFANTQ--SLFGLKS-STARGGRVTAMATYKVKFITPEGE
+QEVECEEDVYVLDAAEEAGLDLPYSCRAGSCSSCAGKVVSGSIDQSDQSFLDDEQMSEGYVLTCVAYPTSDV
+VIETHKEEAIM--
+>Q93Z60_ARATH/1-118 At1g10960/T19D16_12
+MAST----ALSSAIVSTSFLRRQQTPISLRSLPFANTQ--SLFGLKS-STARGGRVTAMATYKVKFITPEGE
+QEVECEEDVYVLDAAEEAGLDLPYSCRAGSCSSCAGKVVSGSIDQSDQSFLDD-------------------
+-------------
+>FER1_MAIZE/1-150 Ferredoxin-1, chloroplast precursor
+MATVLGSPRAPAFFFSSSSLRAAPAPTAV--ALPAAKV--GIMGRSA-SSRR--RLRAQATYNVKLITPEGE
+VELQVPDDVYILDQAEEDGIDLPYSCRAGSCSSCAGKVVSGSVDQSDQSYLDDGQIADGWVLTCHAYPTSDV
+VIETHKEEELTGA
+>O80429_MAIZE/1-140 Ferredoxin
+MAAT---------ALSMSILR---APPPCFSSPLRLRV--AVAKPLA-APMRRQLLRAQATYNVKLITPEGE
+VELQVPDDVYILDFAEEEGIDLPFSCRAGSCSSCAGKVVSGSVDQSDQSFLNDNQVADGWVLTCAAYPTSDV
+VIETHKEDDLL--