Class DocumentType<T>


  • public final class DocumentType<T>
    extends java.lang.Object
    Declares one Geneious plugin document type used for associating icons and human readable names with PluginDocument classes. You can use either one of the static instances:

    Or DocumentTypes may be generated a plugin via GeneiousPlugin.getDocumentTypes()

    • Constructor Detail

      • DocumentType

        public DocumentType​(java.lang.String name,
                            java.lang.Class<T> classOfDocument,
                            Icons icon)
        constructor.
        Parameters:
        name - human readable name of document type
        classOfDocument - Java class of document, should extend PluginDocument
        icon - icon for documents of that type. May be null.
      • DocumentType

        public DocumentType​(java.lang.String name,
                            java.lang.Class<T> classOfDocument,
                            java.lang.Class overrideClass,
                            Icons icon)
        Parameters:
        name - human readable name of document type
        classOfDocument - Java class of document, should extend PluginDocument
        overrideClass - an optional alternative class that can be set on a document using OVERRIDE_DOCUMENT_TYPE_KEY to change its icon etc (may be null). Doesn't need to be a subclass of PluginDocument
        icon - icon for documents of that type. May be null.
        Since:
        API 4.700 (Geneious 7.0.0)
    • Method Detail

      • isSequenceList

        public static boolean isSequenceList​(PluginDocument document)
        Parameters:
        document - the document (may be null in which case this will return false)
        Returns:
        true iff this document is a SequenceListDocument
      • isSequenceList

        public static boolean isSequenceList​(AnnotatedPluginDocument annotatedPluginDocument)
        Parameters:
        annotatedPluginDocument - the document (may be null in which case this will return false)
        Returns:
        true iff this document is a SequenceListDocument
      • isSequence

        public static boolean isSequence​(PluginDocument document)
        Parameters:
        document - the document (may be null in which case this will return false)
        Returns:
        true iff this document is a SequenceDocument
      • isNucleotideSequence

        public static boolean isNucleotideSequence​(PluginDocument document)
        Parameters:
        document - the document (may be null in which case this will return false)
        Returns:
        true iff this document is a NucleotideSequenceDocument
        Since:
        API 4.40 (Geneious 5.4.0)
      • isAminoAcidSequence

        public static boolean isAminoAcidSequence​(PluginDocument document)
        Parameters:
        document - the document (may be null in which case this will return false)
        Returns:
        true iff this document is a AminoAcidSequenceDocument
        Since:
        API 4.40 (Geneious 5.4.0)
      • isSequence

        public static boolean isSequence​(AnnotatedPluginDocument annotatedPluginDocument)
        Parameters:
        annotatedPluginDocument - the document (may be null in which case this will return false)
        Returns:
        true iff this document is a SequenceDocument
      • isNucleotideSequence

        public static boolean isNucleotideSequence​(AnnotatedPluginDocument annotatedPluginDocument)
        Parameters:
        annotatedPluginDocument - the document (may be null in which case this will return false)
        Returns:
        true iff this document is a NucleotideSequenceDocument
        Since:
        API 4.40 (Geneious 5.4.0)
      • isAminoAcidSequence

        public static boolean isAminoAcidSequence​(AnnotatedPluginDocument annotatedPluginDocument)
        Parameters:
        annotatedPluginDocument - the document (may be null in which case this will return false)
        Returns:
        true iff this document is a AminoAcidSequenceDocument
        Since:
        API 4.40 (Geneious 5.4.0)
      • isAlignment

        public static boolean isAlignment​(PluginDocument document)
        Parameters:
        document - the document (may be null in which case this will return false)
        Returns:
        true iff this document is a SequenceAlignmentDocument
      • isAlignment

        public static boolean isAlignment​(AnnotatedPluginDocument annotatedPluginDocument)
        Parameters:
        annotatedPluginDocument - the document (may be null in which case this will return false)
        Returns:
        true iff this document is a SequenceAlignmentDocument
      • isAlignmentAndNotSequence

        public static boolean isAlignmentAndNotSequence​(PluginDocument document)
        Parameters:
        document - the document (may be null in which case this will return false)
        Returns:
        true iff this document is a SequenceAlignmentDocument and not a SequenceDocument (so it will return false on a CombinedAlignmentAndSequenceDocument
      • isAlignmentAndNotSequence

        public static boolean isAlignmentAndNotSequence​(AnnotatedPluginDocument document)
        Parameters:
        document - the document (may be null in which case this will return false)
        Returns:
        true iff this document is a SequenceAlignmentDocument and not a SequenceDocument (so it will return false on a CombinedAlignmentAndSequenceDocument
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • matches

        public boolean matches​(AnnotatedPluginDocument document)
        Checks if the given document matches this DocumentType
        Parameters:
        document - the document to check if its type is this DocumentType
        Returns:
        true if this document matches this document type
        Since:
        API 4.810 (Geneious 8.1.0)
      • matches

        public static boolean matches​(java.util.Set<DocumentType> documentTypes,
                                      AnnotatedPluginDocument document)
        Returns true if the given document is at least one of the given document types.
        Parameters:
        documentTypes - the document types to check if this document is at least one of
        document - the document to check
        Returns:
        true if the given document is at least one of the given document types.
        Since:
        API 4.810 (Geneious 8.1.0)