public static class SequenceTrack.Manager extends Object implements XMLSerializable.OldVersionCompatible
SequenceTrack| Modifier and Type | Class and Description |
|---|---|
static interface |
SequenceTrack.Manager.Provider
An interface implemented by
SequenceDocuments or SequenceAlignmentDocuments to indicate they provide sequence tracks. |
| Constructor and Description |
|---|
SequenceTrack.Manager(PluginDocument associatedPluginDocument)
Constructs a new empty manager with no tracks.
|
SequenceTrack.Manager(PluginDocument associatedPluginDocument,
org.jdom.Element element)
Recreates a manager from XML.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addTrack(SequenceTrack track)
Adds a new track to this sequence.
|
SequenceTrack.Manager |
createGapInsertingManager(PluginDocument associatedPluginDocument,
SequenceGapInformation sequenceGapInformation,
boolean reverseToo,
SimpleListener listenerToNotifyAboutDirectChangesToGappedManager)
Creates a new manager that inserts gaps into annotations relative to this manager.
|
SequenceTrack.Manager |
createGapRemovingManager(PluginDocument associatedPluginDocument,
SequenceGapInformation sequenceGapInformation,
boolean reverseToo,
SimpleListener listenerToNotifyAboutDirectChangesToGappedManager)
Creates a new manager that removes gaps from annotations relative to this manager.
|
List<SequenceTrack> |
getTracks()
Gets all tracks on this sequence.
|
static String |
getUniqueTrackName(List<SequenceTrack.Manager> managers,
String namePrefix)
Creates a name unique among all tracks in all these managers.
|
static String |
getUniqueTrackName(Set<String> namesNotAllowed,
String namePrefix)
Creates a track name that isn't in a given set of names.
|
String |
getUniqueTrackName(String namePrefix)
Creates a name unique among all tracks in this manager.
|
Geneious.MajorVersion |
getVersionSupport(XMLSerializable.VersionSupportType versionType)
Gets either the latest version this class can serialize to via
XMLSerializable.OldVersionCompatible.toXML(com.biomatters.geneious.publicapi.plugin.Geneious.MajorVersion, jebl.util.ProgressListener)
or the most recent version in which the XML returned from XMLSerializable.OldVersionCompatible.toXML(com.biomatters.geneious.publicapi.plugin.Geneious.MajorVersion, jebl.util.ProgressListener) last changed. |
static SequenceTrack.Manager |
readObject(PluginDocument associatedPluginDocument,
DataInput in)
Reads this object from a DataInput.
|
void |
removeTrack(SequenceTrack track)
Removes an existing track.
|
org.jdom.Element |
toXML()
Serializes this manager to XML, using
PluginDocument.FILE_DATA_ATTRIBUTE_NAME where appropriate. |
org.jdom.Element |
toXML(Geneious.MajorVersion majorVersion,
ProgressListener progressListener)
Serializes this manager to XML, using
PluginDocument.FILE_DATA_ATTRIBUTE_NAME where appropriate. |
void |
writeObject(DataOutput out,
ProgressListener progressListener)
Writes this manager to a DataOutput
|
void |
writeObject(Geneious.MajorVersion majorVersion,
DataOutput out,
ProgressListener progressListener)
Writes this manager to a DataOutput
|
public SequenceTrack.Manager(PluginDocument associatedPluginDocument)
associatedPluginDocument - the document (sequence or alignment) this track manager is associated with. This is only used to prevent the document getting garbage collected while the track is being modified but not yet saved. This may be null.public SequenceTrack.Manager(PluginDocument associatedPluginDocument, org.jdom.Element element) throws XMLSerializationException
associatedPluginDocument - the document (sequence or alignment) this track manager is associated with. This is only used to prevent the document getting garbage collected while the track is being modified but not yet saved. This may be null.element - an element returned previously from toXML()XMLSerializationException - if there is a problem deserializingpublic Geneious.MajorVersion getVersionSupport(XMLSerializable.VersionSupportType versionType)
XMLSerializable.OldVersionCompatibleXMLSerializable.OldVersionCompatible.toXML(com.biomatters.geneious.publicapi.plugin.Geneious.MajorVersion, jebl.util.ProgressListener)
or the most recent version in which the XML returned from XMLSerializable.OldVersionCompatible.toXML(com.biomatters.geneious.publicapi.plugin.Geneious.MajorVersion, jebl.util.ProgressListener) last changed.getVersionSupport in interface XMLSerializable.OldVersionCompatibleversionType - specifies which version property to returnpublic org.jdom.Element toXML()
PluginDocument.FILE_DATA_ATTRIBUTE_NAME where appropriate.public org.jdom.Element toXML(Geneious.MajorVersion majorVersion, ProgressListener progressListener)
PluginDocument.FILE_DATA_ATTRIBUTE_NAME where appropriate.toXML in interface XMLSerializable.OldVersionCompatiblemajorVersion - a Geneious version that must be able to deserialize this XMLprogressListener - for reporting progress and cancellingpublic void writeObject(DataOutput out, ProgressListener progressListener) throws IOException
out - the output to write to.progressListener - for reporting progress and cancellingIOException - if there is a problem writing to the output.SequenceTrack.readObject(java.io.DataInput)public void writeObject(Geneious.MajorVersion majorVersion, DataOutput out, ProgressListener progressListener) throws IOException
majorVersion - a Geneious version that must be able to deserialize this dataout - the output to write to.progressListener - for reporting progress and cancellingIOException - if there is a problem writing to the output.SequenceTrack.readObject(java.io.DataInput)public static SequenceTrack.Manager readObject(PluginDocument associatedPluginDocument, DataInput in) throws IOException
writeObject(java.io.DataOutput, jebl.util.ProgressListener)associatedPluginDocument - the document (sequence or alignment) this track manager is associated with. This is only used to prevent the document getting garbage collected while the track is being modified but not yet saved. This may be null.in - the input to read fromIOException - if there is a problem reading from the inputwriteObject(java.io.DataOutput, jebl.util.ProgressListener)public static String getUniqueTrackName(Set<String> namesNotAllowed, String namePrefix)
SequenceAnnotationGenerators need not worry about generating unique track names.
The sequence viewer and core Geneious will handle doing it by calling this method.namesNotAllowed - a set of track names which the returned name won't be.namePrefix - a prefix for the newly created track name. If no track exists with this name, then the returned name will be equal to this prefix.getUniqueTrackName(String)public static String getUniqueTrackName(List<SequenceTrack.Manager> managers, String namePrefix)
SequenceAnnotationGenerators need not worry about generating unique track names.
The sequence viewer and core Geneious will handle doing it by calling this method.managers - a list of track managers to consider. This list itself must not be null (but may be empty). Individual entries in the list may be null.namePrefix - a prefix for the newly created track name. If no track exists with this name, then the returned name will be equal to this prefix.getUniqueTrackName(String)public String getUniqueTrackName(String namePrefix)
SequenceAnnotationGenerators need not worry about generating unique track names.
The sequence viewer and core Geneious will handle doing it by calling this method.namePrefix - a prefix for the newly created track name. If no track exists with this name, then the returned name will be equal to this prefix.getUniqueTrackName(java.util.List, String)public List<SequenceTrack> getTracks()
addTrack(SequenceTrack) or removeTrack(SequenceTrack).
To modify tracks, just use appropriate methods on one of the returned tracks and call AnnotatedPluginDocument.saveDocument() afterwards.
The returned tracks do not include "no track" annotations for annotations on a sequence which are not in tracks. These are only available via SequenceDocument.getSequenceAnnotations().
The returned tracks only have a small amount of meta data loaded, so this method will be fast. Full track data is loaded on demand via SequenceTrack.getSequenceAnnotations(jebl.util.ProgressListener).public void addTrack(SequenceTrack track)
AnnotatedPluginDocument.saveDocument() also needs to be called to make the changes permanent.track - the new track.public void removeTrack(SequenceTrack track)
AnnotatedPluginDocument.saveDocument() also needs to be called to make the changes permanent.track - the track to remove, which must be one of the tracks returned from getTracks()IllegalArgumentException - if the track isn't one of the tracks returned from getTracks()public SequenceTrack.Manager createGapInsertingManager(PluginDocument associatedPluginDocument, SequenceGapInformation sequenceGapInformation, boolean reverseToo, SimpleListener listenerToNotifyAboutDirectChangesToGappedManager)
associatedPluginDocument - the document (sequence or alignment) this track manager is associated with. This is only used to prevent the document getting garbage collected while the track is being modified but not yet saved. This may be null.sequenceGapInformation - contains information about the gaps to be insertedreverseToo - true to reverse all annotations toolistenerToNotifyAboutDirectChangesToGappedManager - a listener to notify whenever the returned manager or any of its tracks are directly modified. May be null.public SequenceTrack.Manager createGapRemovingManager(PluginDocument associatedPluginDocument, SequenceGapInformation sequenceGapInformation, boolean reverseToo, SimpleListener listenerToNotifyAboutDirectChangesToGappedManager)
associatedPluginDocument - the document (sequence or alignment) this track manager is associated with. This is only used to prevent the document getting garbage collected while the track is being modified but not yet saved. This may be null.sequenceGapInformation - contains information about the gaps to be removereverseToo - true to reverse all annotations toolistenerToNotifyAboutDirectChangesToGappedManager - a listener to notify whenever the returned manager or any of its tracks are directly modified. May be null.