*/
package jalview.io;
-import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.datamodel.AlignedCodonFrame;
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.GraphLine;
private void buildSkipList()
{
skipList = new Hashtable();
- AlignFrame[] al = Desktop.getAlignFrames();
+ AlignFrame[] al = Desktop.getDesktopAlignFrames();
for (int f = 0; al != null && f < al.length; f++)
{
skipList.put(al[f].getViewport().getSequenceSetId(), al[f]);
Vobject obj = getjv2vObj(seqsetidobj);
if (obj != null && !(obj instanceof Alignment))
{
- Cache.warn(
+ Console.warn(
"IMPLEMENTATION ERROR?: Unexpected mapping for unmapped jalview string object content:"
+ seqsetidobj + " to object " + obj);
}
}
else
{
- Cache.warn("Unexpected mapping for Jalview String Object ID "
+ Console.warn("Unexpected mapping for Jalview String Object ID "
+ seqsetidobj + " to another jalview dataset object "
+ seqsetidobj);
}
}
}
- if (Cache.isDebugEnabled())
+ if (Console.isDebugEnabled())
{
- Cache.debug(
+ Console.debug(
"Returning null VorbaID binding for jalview object " + jvobj);
}
return null;
if (id == null)
{
id = cdoc.registerObject(vobj);
- Cache.debug(
+ Console.debug(
"Registering new object and returning null for getvObj2jv");
return null;
}
if (id == null || vobj.getVorbaId() == null
|| cdoc.getObject(id) != vobj)
{
- Cache.error("Failed to get id for "
+ Console.error("Failed to get id for "
+ (vobj.isRegisterable() ? "registerable"
: "unregisterable")
+ " object " + vobj);
if (vobj2jv.containsKey(vobj.getVorbaId())
&& !((VorbaId) vobj2jv.get(vobj.getVorbaId())).equals(jvobj))
{
- Cache.debug(
+ Console.debug(
"Warning? Overwriting existing vamsas id binding for "
+ vobj.getVorbaId(),
new Exception(MessageManager.getString(
else if (jv2vobj.containsKey(jvobj)
&& !((VorbaId) jv2vobj.get(jvobj)).equals(vobj.getVorbaId()))
{
- Cache.debug(
+ Console.debug(
"Warning? Overwriting existing jalview object binding for "
+ jvobj,
new Exception("Overwriting jalview object binding."));
* bindjvvobj")); }
*/
// we just update the hash's regardless!
- Cache.debug("Binding " + vobj.getVorbaId() + " to " + jvobj);
+ Console.debug("Binding " + vobj.getVorbaId() + " to " + jvobj);
vobj2jv.put(vobj.getVorbaId(), jvobj);
// JBPNote - better implementing a hybrid invertible hash.
jv2vobj.put(jvobj, vobj.getVorbaId());
DataSet dataset = null;
if (jds == null)
{
- Cache.warn("Creating new dataset for an alignment.");
+ Console.warn("Creating new dataset for an alignment.");
jal.setDataset(null);
jds = jal.getDataset();
}
if (dataset == null)
{
- Cache.warn("Creating new vamsas dataset for alignment view "
+ Console.warn("Creating new vamsas dataset for alignment view "
+ av.getSequenceSetId());
// we create a new dataset on the default vamsas root.
root = cdoc.getVamsasRoots()[0]; // default vamsas root for modifying.
{
// 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.");
}
}
if (aa[i].groupRef != null)
{
// TODO: store any group associated annotation references
- Cache.warn(
+ Console.warn(
"Group associated sequence annotation is not stored in VAMSAS document.");
continue;
}
// LOCK METHODS)
{
// verify annotation - update (perhaps)
- Cache.info(
+ Console.info(
"update alignment sequence annotation. not yet implemented.");
}
else
{
// verify annotation - update (perhaps)
- Cache.info(
+ Console.info(
"updated alignment sequence annotation added.");
}
}
}
if (getjv2vObj(jvalsq.getDatasetSequence()) == null)
{
- Cache.warn(
+ Console.warn(
"Serious Implementation error - Unbound dataset sequence in alignment: "
+ jvalsq.getDatasetSequence());
}
alseq.setDescription(valseq.getDescription());
modal = true;
}
- if (modal && Cache.isDebugEnabled())
+ if (modal && Console.isDebugEnabled())
{
- Cache.debug(
+ Console.debug(
"Updating apparently edited sequence " + alseq.getName());
}
}
}
else
{
- Cache.error(
+ Console.error(
"Invalid dataset sequence id (null) for alignment sequence "
+ valseq.getVorbaId());
}
// 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.");
}
}
@Override
public JarInputStream getJarInputStream() throws IOException
{
- Cache.debug(
+ Console.debug(
"Returning client input stream for Jalview from Vamsas Document.");
return new JarInputStream(cappdata.getClientInputStream());
}
@Override
public JarInputStream getJarInputStream() throws IOException
{
- Cache.debug(
+ Console.debug(
"Returning user input stream for Jalview from Vamsas Document.");
return new JarInputStream(cappdata.getUserInputStream());
}
// TODO implement this : af.getNumberOfViews
String seqsetidobj = av.getSequenceSetId();
views = Desktop.getViewports(seqsetidobj);
- Cache.debug("Found " + (views == null ? " no " : "" + views.length)
- + " views for '" + av.getSequenceSetId() + "'");
+ Console.debug("Found " + (views == null ? " no " : "" + views.length)
+ + " views for '" + av.getSequenceSetId() + "'");
if (views.length > 1)
{
// we need to close the original document view.
} catch (Exception e)
{
// TODO raise GUI warning if user requests it.
- Cache.error(
+ Console.error(
"Couldn't update jalview client application data. Giving up - local settings probably lost.",
e);
}
}
else
{
- Cache.error(
+ Console.error(
"Couldn't access client application data for vamsas session. This is probably a vamsas client bug.");
}
}
int jremain = 0;
if (jdataset == null)
{
- Cache.debug("Initialising new jalview dataset fields");
+ Console.debug("Initialising new jalview dataset fields");
newds = true;
dsseqs = new Vector();
}
else
{
- Cache.debug("Update jalview dataset from vamsas.");
+ Console.debug("Update jalview dataset from vamsas.");
jremain = jdataset.getHeight();
dsseqs = jdataset.getSequences();
}
dsseqs.set(i, null);
}
jdataset = new jalview.datamodel.Alignment(seqs);
- Cache.debug("New vamsas dataset imported into jalview.");
+ Console.debug("New vamsas dataset imported into jalview.");
bindjvvobj(jdataset, dataset);
}
// ////////
// annotations
if (dsSeq == null)
{
- Cache.warn(
+ Console.warn(
"Couldn't resolve jalview sequenceI for dataset object reference "
+ ((Vobject) dataset
.getDataSetAnnotations(dsa)
// JBPNote: we could just add them to all alignments but
// that may complicate cross references in the jalview
// datamodel
- Cache.warn(
+ Console.warn(
"Ignoring dataset annotation with annotationElements. Not yet supported in jalview.");
}
}
}
else
{
- Cache.warn(
+ Console.warn(
"Ignoring multiply referenced dataset sequence annotation for binding to datsaet sequence features.");
}
}
// OBJECT LOCK
// METHODS)
{
- Cache.info(
+ Console.info(
"UNIMPLEMENTED: not recovering user modifiable sequence alignment annotation");
// TODO: should at least replace with new one - otherwise
// things will break
dsseqs.set(i, null);
}
jal = new jalview.datamodel.Alignment(seqs);
- Cache.debug("New vamsas alignment imported into jalview "
+ Console.debug("New vamsas alignment imported into jalview "
+ alignment.getVorbaId().getId());
jal.setDataset(jdataset);
}
// jan.update(getjAlignmentAnnotation(jal, an[a])); // update
// from another annotation object in place.
- Cache.debug(
+ Console.debug(
"update from vamsas alignment annotation to existing jalview alignment annotation.");
if (an[j].getModifiable() == null) // TODO: USE VAMSAS
// LIBRARY OBJECT LOCK
{
// TODO: user defined annotation is totally mutable... - so
// load it up or throw away if locally edited.
- Cache.info(
+ Console.info(
"NOT IMPLEMENTED - Recovering user-modifiable annotation - yet...");
}
// TODO: compare annotation element rows
AlignFrame alignFrame;
if (av == null)
{
- Cache.debug("New alignframe for alignment "
+ Console.debug("New alignframe for alignment "
+ alignment.getVorbaId());
// ///////////////////////////////
// construct alignment view
}
// TODO: automatically create meaningful title for a vamsas
// alignment using its provenance.
- if (Cache.isDebugEnabled())
+ if (Console.isDebugEnabled())
{
title = title + "(" + alignment.getVorbaId() + ")";
vstree.UpdateSequenceTreeMap(tp);
} catch (RuntimeException e)
{
- Cache.warn("update of labels failed.", e);
+ Console.warn("update of labels failed.", e);
}
}
else
{
- Cache.warn("Cannot create tree for tree " + t
+ Console.warn("Cannot create tree for tree " + t
+ " in document ("
+ alignment.getTree(t).getVorbaId());
}
if (anot[row][pos] != null)
{
// only time this should happen is if the After flag is set.
- Cache.debug("Ignoring duplicate annotation site at " + pos);
+ Console.debug("Ignoring duplicate annotation site at " + pos);
continue;
}
if (anot[1 - row][pos] != null)
else if (glyphs[g].getDict().equals(
uk.ac.vamsas.objects.utils.GlyphDictionary.PROTEIN_HD_HYDRO))
{
- Cache.debug("ignoring hydrophobicity glyph marker.");
+ Console.debug("ignoring hydrophobicity glyph marker.");
AeContent[HASHPHOB] = true;
char c = (dc = glyphs[g].getContent()).charAt(0);
// dc may get overwritten - but we still set the colour.
}
else
{
- Cache.debug(
+ Console.debug(
"IMPLEMENTATION TODO: Ignoring unknown glyph type "
+ glyphs[g].getDict());
}
AeContent[HASVALS] = true;
if (ae[aa].getValueCount() > 1)
{
- Cache.warn(
+ Console.warn(
"ignoring additional " + (ae[aa].getValueCount() - 1)
+ " values in annotation element.");
}
}
else
{
- Cache.warn("Ignoring out of bound annotation element " + aa
+ Console.warn("Ignoring out of bound annotation element " + aa
+ " in " + annotation.getVorbaId().getId());
}
}
val = Float.valueOf(props[p].getContent());
} catch (Exception e)
{
- Cache.warn("Failed to parse threshold property");
+ Console.warn("Failed to parse threshold property");
}
if (val != null)
{
}
if (parsedRangeAnnotation == null)
{
- Cache.debug(
+ Console.debug(
"Inserting empty annotation row elements for a whole-alignment annotation.");
}
else
{
if (parsedRangeAnnotation[3] != null)
{
- Cache.warn("Ignoring 'After' annotation row in "
+ Console.warn("Ignoring 'After' annotation row in "
+ annotation.getVorbaId());
}
jalview.datamodel.Annotation[] arow = (jalview.datamodel.Annotation[]) parsedRangeAnnotation[2];
}
if (annotation.getLinkCount() > 0)
{
- Cache.warn("Ignoring " + annotation.getLinkCount()
+ Console.warn("Ignoring " + annotation.getLinkCount()
+ "links added to AlignmentAnnotation.");
}
if (annotation.getModifiable() == null
}
} catch (Exception e)
{
- Cache.info(
+ Console.info(
"UNIMPLEMENTED : Couldn't parse non-integer group value for setting graphGroup correctly.");
}
return jan;
DataSet dataset = null;
if (jal.getDataset() == null)
{
- Cache.warn("Creating new dataset for an alignment.");
+ Console.warn("Creating new dataset for an alignment.");
jal.setDataset(null);
}
dataset = (DataSet) ((Alignment) getjv2vObj(
if (dataset == null)
{
dataset = (DataSet) getjv2vObj(jal.getDataset());
- Cache.error(
+ Console.error(
"Can't find the correct dataset for the alignment in this view. Creating new one.");
}
}
else
{
- Cache.warn(
+ Console.warn(
"NO Vamsas Binding for local sequence! NOT CREATING MAPPING FOR "
+ dmps[smp].getDisplayId(true) + " to "
+ mps[smp].getTo().getName());