Class DefaultMolecularStructureDocument

    • Field Detail

      • MAXIMUM_HTML_TEXT_LENGTH

        protected static final int MAXIMUM_HTML_TEXT_LENGTH
        The maximum length of the getStructure() text returned from toHTML() before it has had HTML characters escaped. This is significantly less than PluginDocument.MAXIMUM_HTML_LENGTH to make the escaped text unlikely to exceed PluginDocument.MAXIMUM_HTML_LENGTH, but even if it does exceed that, it will just get prematurely truncated.
        See Also:
        Constant Field Values
    • Constructor Detail

      • DefaultMolecularStructureDocument

        public DefaultMolecularStructureDocument()
    • Method Detail

      • setDefaultValues

        public void setDefaultValues​(java.lang.String defaultName,
                                     java.util.Date defaultDate,
                                     java.lang.String data)
        Save internally name, creation date and contents.
        Parameters:
        defaultName - document name
        defaultDate - creation date
        data - contents in various formats
      • getDisplayableFields

        public java.util.List<DocumentField> getDisplayableFields()
        Description copied from interface: PluginDocument
        A list of columns for display in the main document panel. This function only defines the columns available to display, not the particular values of these columns, which are returned by PluginDocument.getFieldValue(String).

        Each column is specified by a Field. The fields should be obtained from a call to the appropriate Field.createXXXXField, where XXXX is the appropriate type.

        While it is not required, it is recommended that a PluginDocument handle returning a complete list of its displayable fields before the document has been properly constructed via a call to XMLSerializable.fromXML(org.jdom.Element) The returned list need not and should not be modifiable.

        Specified by:
        getDisplayableFields in interface PluginDocument
        Overrides:
        getDisplayableFields in class AbstractPluginDocument
        Returns:
        a list of document fields (or null to indicate no displayable fields)
      • getDescription

        public java.lang.String getDescription()
        Description copied from interface: PluginDocument
        A human readable single line of text describing this document, to appear in the description field in the document table.
        Specified by:
        getDescription in interface PluginDocument
        Returns:
        a one line simple text description of the document, or null if no description is available.
      • getName

        public java.lang.String getName()
        Description copied from interface: PluginDocument
        A short name (preferably one or two words) for the document.

        If this PluginDocument is wrapped inside an AnnotatedPluginDocument then this method will be overridden and delegate back to AnnotatedPluginDocument.getName(). One way to look at it is that when you call PluginDocument.getName() you will get the current name of the document. If you are implementing PluginDocument.getName() then you are returning the default name for the document.

        Specified by:
        getName in interface PluginDocument
        Returns:
        document name. Cannot be null but may be an empty string.
      • toHTML

        public java.lang.String toHTML()
        Description copied from interface: PluginDocument
        Provide a textual view of document. The contents should be at most 30K-60K characters. One reason is that this text is rendered using JTextPane, which is horrendously slow when handling large text. The more fundamental reason is that large amounts of text are generally not useful for a user. The whole idea of using a tool such as Geneious is to provide specialized viewers which make the large amount of bioinformatics data perceivable and comprehensible to a human user.

        Return an HTML body fragment (i.e. a fragment which sits inside a <body></body> tag). (Header,stylesheet and annotations are automatically added by GENEious code).

        Can optionally return an entire html tag set, as long as the first six characters are <html>

        Specified by:
        toHTML in interface PluginDocument
        Returns:
        an HTML fragment of tag set, or null to have no text view.
      • getStructure

        public java.lang.String getStructure()
        Description copied from interface: MolecularStructureDocument
        A string representing the molecule structure. Can be in any format recognised by Jmol. Currently supported formats include:
        • ABINIT
        • ACES II
        • ADF - Amsterdam Density Functional
        • CML v2.0
        • GAMESS
        • Gaussian 92/94/98
        • Ghemical MM
        • Jaguar
        • MDL molfile
        • PDB
        • CIF/mmCIF
        • XYZ (single and multiple frame)
        Specified by:
        getStructure in interface MolecularStructureDocument
        Returns:
        3D data