Class SequenceTrack.Manager

    • Constructor Detail

      • Manager

        public Manager​(PluginDocument associatedPluginDocument)
        Constructs a new empty manager with no tracks.
        Parameters:
        associatedPluginDocument - the document (sequence or alignment) this track manager is associated with. This is used to prevent the document getting garbage collected while the track is being modified but not yet saved, and to set the modification status (if applicable). This may be null.
      • Manager

        public Manager​(PluginDocument associatedPluginDocument,
                       org.jdom.Element element)
                throws XMLSerializationException
        Recreates a manager from XML.
        Parameters:
        associatedPluginDocument - the document (sequence or alignment) this track manager is associated with. This is used to prevent the document getting garbage collected while the track is being modified but not yet saved, and to set the modification status (if applicable). This may be null.
        element - an element returned previously from toXML()
        Throws:
        XMLSerializationException - if there is a problem deserializing
    • Method Detail

      • writeObject

        public void writeObject​(java.io.DataOutput out,
                                jebl.util.ProgressListener progressListener)
                         throws java.io.IOException
        Writes this manager to a DataOutput
        Parameters:
        out - the output to write to.
        progressListener - for reporting progress and cancelling
        Throws:
        java.io.IOException - if there is a problem writing to the output.
        See Also:
        SequenceTrack.readObject(java.io.DataInput)
      • writeObject

        public void writeObject​(Geneious.MajorVersion majorVersion,
                                java.io.DataOutput out,
                                jebl.util.ProgressListener progressListener)
                         throws java.io.IOException
        Writes this manager to a DataOutput
        Parameters:
        majorVersion - a Geneious version that must be able to deserialize this data
        out - the output to write to.
        progressListener - for reporting progress and cancelling
        Throws:
        java.io.IOException - if there is a problem writing to the output.
        Since:
        API 4.600 (Geneious 6.0.0)
        See Also:
        SequenceTrack.readObject(java.io.DataInput)
      • readObject

        public static SequenceTrack.Manager readObject​(PluginDocument associatedPluginDocument,
                                                       java.io.DataInput in)
                                                throws java.io.IOException
        Reads this object from a DataInput. This should only be data previously written to using writeObject(java.io.DataOutput, jebl.util.ProgressListener)
        Parameters:
        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 from
        Returns:
        the manager read from the input.
        Throws:
        java.io.IOException - if there is a problem reading from the input
        See Also:
        writeObject(java.io.DataOutput, jebl.util.ProgressListener)
      • getUniqueTrackName

        public static java.lang.String getUniqueTrackName​(java.util.Set<java.lang.String> namesNotAllowed,
                                                          java.lang.String namePrefix)
        Creates a track name that isn't in a given set of names. SequenceAnnotationGenerators need not worry about generating unique track names. The sequence viewer and core Geneious will handle doing it by calling this method.
        Parameters:
        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.
        Returns:
        a name that starts with namePrefix and is not in the namesNotAllowed set.
        Since:
        API 4.51 (Geneious 5.5.1)
        See Also:
        getUniqueTrackName(String)
      • getUniqueTrackName

        public static java.lang.String getUniqueTrackName​(java.util.List<SequenceTrack.Manager> managers,
                                                          java.lang.String namePrefix)
        Creates a name unique among all tracks in all these managers. SequenceAnnotationGenerators need not worry about generating unique track names. The sequence viewer and core Geneious will handle doing it by calling this method.
        Parameters:
        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.
        Returns:
        a name not used by any track in any of these managers
        See Also:
        getUniqueTrackName(String)
      • getUniqueTrackName

        public java.lang.String getUniqueTrackName​(java.lang.String namePrefix)
        Creates a name unique among all tracks in this manager. SequenceAnnotationGenerators need not worry about generating unique track names. The sequence viewer and core Geneious will handle doing it by calling this method.
        Parameters:
        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.
        Returns:
        a name not used by any track in this manager
        See Also:
        getUniqueTrackName(java.util.List, String)
      • removeTrack

        public void removeTrack​(SequenceTrack track)
        Removes an existing track. AnnotatedPluginDocument.saveDocument() also needs to be called to make the changes permanent.
        Parameters:
        track - the track to remove, which must be one of the tracks returned from getTracks()
        Throws:
        java.lang.IllegalArgumentException - if the track isn't one of the tracks returned from getTracks()
      • createGapInsertingManager

        public SequenceTrack.Manager createGapInsertingManager​(PluginDocument associatedPluginDocument,
                                                               SequenceGapInformation sequenceGapInformation,
                                                               boolean reverseToo,
                                                               org.virion.jam.util.SimpleListener listenerToNotifyAboutDirectChangesToGappedManager)
        Creates a new manager that inserts gaps into annotations relative to this manager. Changes to either this or the returned manager are automatically propagated to each other.
        Parameters:
        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 inserted
        reverseToo - true to reverse all annotations too
        listenerToNotifyAboutDirectChangesToGappedManager - a listener to notify whenever the returned manager or any of its tracks are directly modified. May be null.
        Returns:
        a new manager that inserts gaps into annotations relative to this manager.
      • createGapRemovingManager

        public SequenceTrack.Manager createGapRemovingManager​(PluginDocument associatedPluginDocument,
                                                              SequenceGapInformation sequenceGapInformation,
                                                              boolean reverseToo,
                                                              org.virion.jam.util.SimpleListener listenerToNotifyAboutDirectChangesToGappedManager)
        Creates a new manager that removes gaps from annotations relative to this manager. Changes to either this or the returned manager are automatically propagated to each other.
        Parameters:
        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 remove
        reverseToo - true to reverse all annotations too
        listenerToNotifyAboutDirectChangesToGappedManager - a listener to notify whenever the returned manager or any of its tracks are directly modified. May be null.
        Returns:
        a new manager that removes gaps from annotations relative to this manager.
        Since:
        API 4.51 (Geneious 5.5.1)