Class DefaultMolecularStructureDocument
- java.lang.Object
-
- com.biomatters.geneious.publicapi.documents.AbstractPluginDocument
-
- com.biomatters.geneious.publicapi.implementations.structure.DefaultMolecularStructureDocument
-
- All Implemented Interfaces:
PluginDocument
,MolecularStructureDocument
,XMLSerializable
,XMLSerializable.OldVersionCompatible
- Direct Known Subclasses:
CmlDocument
,GprDocument
,HinDocument
,MolDocument
,NwoDocument
,PdbDocument
,XyzDocument
public class DefaultMolecularStructureDocument extends AbstractPluginDocument implements MolecularStructureDocument
An implementation of a MolecularStructureDocument.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.biomatters.geneious.publicapi.documents.PluginDocument
PluginDocument.ReferencedDocumentsAlwaysLoaded, PluginDocument.ReferencedDocumentsNotLoaded, PluginDocument.SizeRequiredToLoadIntoMemoryProvider
-
Nested classes/interfaces inherited from interface com.biomatters.geneious.publicapi.documents.XMLSerializable
XMLSerializable.OldVersionCompatible, XMLSerializable.VersionSupportType
-
-
Field Summary
Fields Modifier and Type Field Description protected static int
MAXIMUM_HTML_TEXT_LENGTH
The maximum length of thegetStructure()
text returned fromtoHTML()
before it has had HTML characters escaped.-
Fields inherited from interface com.biomatters.geneious.publicapi.documents.PluginDocument
FILE_DATA_ATTRIBUTE_NAME, MAXIMUM_HTML_LENGTH, MODIFIED_DATE_FIELD
-
Fields inherited from interface com.biomatters.geneious.publicapi.documents.XMLSerializable
ROOT_ELEMENT_NAME
-
-
Constructor Summary
Constructors Constructor Description DefaultMolecularStructureDocument()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getDescription()
A human readable single line of text describing this document, to appear in the description field in the document table.java.util.List<DocumentField>
getDisplayableFields()
A list of columns for display in the main document panel.java.lang.String
getName()
A short name (preferably one or two words) for the document.java.lang.String
getStructure()
A string representing the molecule structure.void
setDefaultValues(java.lang.String defaultName, java.util.Date defaultDate, java.lang.String data)
Save internally name, creation date and contents.java.lang.String
toHTML()
Provide a textual view of document.-
Methods inherited from class com.biomatters.geneious.publicapi.documents.AbstractPluginDocument
addDisplayableField, addReferencedDocumentUrn, clearReferencedDocumentUrns, createFromBaseElement, fromXML, getBaseElement, getBaseElementString, getCreationDate, getFieldValue, getFieldValueCodes, getReferencedDocumentUrns, getURN, getVersionSupport, hasProperties, setBaseElement, setCreated, setFieldValue, setFieldValue, setFieldValues, setURN, toXML, toXML
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.biomatters.geneious.publicapi.documents.PluginDocument
getCreationDate, getFieldValue, getURN
-
Methods inherited from interface com.biomatters.geneious.publicapi.documents.XMLSerializable
fromXML, toXML
-
-
-
-
Field Detail
-
MAXIMUM_HTML_TEXT_LENGTH
protected static final int MAXIMUM_HTML_TEXT_LENGTH
The maximum length of thegetStructure()
text returned fromtoHTML()
before it has had HTML characters escaped. This is significantly less thanPluginDocument.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
-
-
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 namedefaultDate
- creation datedata
- 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 byPluginDocument.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 toXMLSerializable.fromXML(org.jdom.Element)
The returned list need not and should not be modifiable.- Specified by:
getDisplayableFields
in interfacePluginDocument
- Overrides:
getDisplayableFields
in classAbstractPluginDocument
- 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 interfacePluginDocument
- 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 anAnnotatedPluginDocument
then this method will be overridden and delegate back toAnnotatedPluginDocument.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 interfacePluginDocument
- 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 interfacePluginDocument
- 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 interfaceMolecularStructureDocument
- Returns:
- 3D data
-
-