// $Id: StructureInfo.java,v 1.2 2007/02/13 19:08:40 Sasha Buzko Exp $ // // Copyright (c) 2000-2003 San Diego Supercomputer Center (SDSC), // a facility operated by the University of California, // San Diego (UCSD), San Diego, California, USA. // // Users and possessors of this source code are hereby granted a // nonexclusive, royalty-free copyright and design patent license to // use this code in individual software. License is not granted for // commercial resale, in whole or in part, without prior written // permission from SDSC. This source is provided "AS IS" without express // or implied warranty of any kind. // // For further information, please see: http://mbt.sdsc.edu // // History: // $Log: StructureInfo.java,v $ // Revision 1.2 2007/02/13 19:08:40 Sasha Buzko // *** empty log message *** // // Revision 1.1 2006/05/20 17:02:06 Sasha Buzko // Updated version // // Revision 1.1 2006/04/30 20:14:05 Sasha Buzko // New version of the app // // Revision 1.1 2006/04/15 19:42:27 Sasha Buzko // Initial commit // // Revision 1.1 2005/11/13 04:35:26 Administrator // *** empty log message *** // // Revision 1.1 2003/09/22 17:32:41 moreland // Added general structure information class. // // Revision 1.0 2003/09/19 23:38:39 moreland // First version. // package edu.sdsc.mbt; /** * Implements a StructureComponent container for Structure information data. * This information includes data such as authors, dates, and data sources. *

* See the "PROGRAMMING NOTE" section of the StructureComponent class. *

* @see edu.sdsc.mbt.StructureComponent * @see edu.sdsc.mbt.Structure *

* @author John L. Moreland */ public class StructureInfo extends StructureComponent implements java.lang.Cloneable, java.io.Serializable { // // Constructor // /** * Creates a new StructureInfo object and initializes the StructureComponent * "structure" field. */ public StructureInfo( ) { } // // StructureComponent methods // /** * Copy all of the field values from the parameter object into "this". */ public void copy( StructureComponent structureComponent ) { structure = structureComponent.structure; StructureInfo structureInfo = (StructureInfo) structureComponent; idCode = structureInfo.idCode; compoundName = structureInfo.compoundName; releaseDate[0] = structureInfo.releaseDate[0]; releaseDate[1] = structureInfo.releaseDate[1]; releaseDate[2] = structureInfo.releaseDate[2]; authors = structureInfo.authors; primaryReference = structureInfo.primaryReference; sourceSpecies = structureInfo.sourceSpecies; determinationMethod = structureInfo.determinationMethod; } /** * Clone this object. */ public Object clone( ) throws CloneNotSupportedException { return super.clone( ); } /** * This method returns the fully qualified name of this class. *

* This name is used by the StructureComponentRegistry class to enable * dynamic registration and discovery of new StructureComponent * sub-classes/types. The name is also used to create a unique integer * indentifier for each type in order to make run-time type comparisons * fast. */ private static String className = null; public static String getClassName() { if ( className == null ) className = ((new Throwable()).getStackTrace())[0].getClassName(); return className; } /** * This method returns the fully qualified name of this class. */ public String getStructureComponentType( ) { return className; } // // StructureInfo fields // /** * The PDB-ID code by which this entry is registered. * For example, "2CPK", "4HHB", "10MH", etc. */ private String idCode = null; /** * The name of this macromolecular structure. * For example, "c-AMP-Dependent Protein Kinase (E.C. 2.7.1.37) (cAPK) * (Catalytic Subunit)". */ private String compoundName = null; /** * The date on which this entry was released. * releaseDate[0] = year. * releaseDate[1] = month. * releaseDate[2] = day. * For example, "1993-1-15". */ private int releaseDate[] = { 1900, 1, 1 }; /** * The authors of this entry. * For example, "D. R. Knighton, J. Zheng, L. F. Ten Eyck, V. A. Ashford, * N.-H. Xuong, S. S. Taylor, J. M. Sowadski". */ private String authors = null; /** * The primary citation reference for this entry. * For example, "Knighton, D. R., Zheng, J. H., Ten Eyck, L. F., Ashford, * V. A., Xuong, N. H., Taylor, S. S., Sowadski, J. M.: Crystal structure of * the catalytic subunit of cyclic adenosine monophosphate-dependent protein * kinase. Science 253 pp. 407 (1991)". */ private String primaryReference = null; /** * The source species of this compound. * For example, "Mus musculus". */ private String sourceSpecies = null; /** * The exerimental method used to determine this compound. * For example, "X-ray Diffraction". */ private String determinationMethod = null; // // StructureInfo methods // /** * Set the PDB-ID code by which this entry is registered. * For example, "2CPK", "4HHB", "10MH", etc. */ public void setIdCode( String code ) { if ( code != null ) idCode = code; } /** * Get the PDB-ID code by which this entry is registered. * For example, "2CPK", "4HHB", "10MH", etc. */ public String getIdCode( ) { return idCode; } /** * Set the name of this macromolecular structure. * For example, "c-AMP-Dependent Protein Kinase (E.C. 2.7.1.37) (cAPK) * (Catalytic Subunit)". */ public void setCompoundName( String name ) { if ( name != null ) compoundName = name; } /** * Get the name of this macromolecular structure. * For example, "c-AMP-Dependent Protein Kinase (E.C. 2.7.1.37) (cAPK) * (Catalytic Subunit)". */ public String getCompoundName( ) { return compoundName; } /** * Set the date on which this entry was released. * date[0] = year. * date[1] = month. * date[2] = day. * For example, "1993-1-15". */ public void setReleaseDate( int date[] ) { if ( date[0] <= 0 ) return; if ( date[0] > 3000 ) return; if ( date[1] < 1 ) return; if ( date[1] > 12 ) return; if ( date[2] < 1 ) return; if ( date[2] > 31 ) return; releaseDate[0] = date[0]; releaseDate[1] = date[1]; releaseDate[2] = date[2]; } /** * Get the date on which this entry was released. * date[0] = year. * date[1] = month. * date[2] = day. * For example, "1993-1-15". */ public void getReleaseDate( int date[] ) { if ( date == null ) return; if ( date.length != releaseDate.length ) return; date[0] = releaseDate[0]; date[1] = releaseDate[1]; date[2] = releaseDate[2]; } /** * Set the authors of this entry. * For example, "D. R. Knighton, J. Zheng, L. F. Ten Eyck, V. A. Ashford, * N.-H. Xuong, S. S. Taylor, J. M. Sowadski". */ public void setAuthors( String names ) { if ( names != null ) authors = names; } /** * Get the authors of this entry. * For example, "D. R. Knighton, J. Zheng, L. F. Ten Eyck, V. A. Ashford, * N.-H. Xuong, S. S. Taylor, J. M. Sowadski". */ public String getAuthors( ) { return authors; } /** * Set the primary citation reference for this entry. * For example, "Knighton, D. R., Zheng, J. H., Ten Eyck, L. F., Ashford, * V. A., Xuong, N. H., Taylor, S. S., Sowadski, J. M.: Crystal structure of * the catalytic subunit of cyclic adenosine monophosphate-dependent protein * kinase. Science 253 pp. 407 (1991)". */ public void setPrimaryReference( String reference ) { if ( reference != null ) primaryReference = reference; } /** * Get the primary citation reference for this entry. * For example, "Knighton, D. R., Zheng, J. H., Ten Eyck, L. F., Ashford, * V. A., Xuong, N. H., Taylor, S. S., Sowadski, J. M.: Crystal structure of * the catalytic subunit of cyclic adenosine monophosphate-dependent protein * kinase. Science 253 pp. 407 (1991)". */ public String getPrimaryReference( ) { return primaryReference; } /** * Set the source species of this compound. * For example, "Mus musculus". */ public void setSourceSpecies( String species ) { if ( species != null ) sourceSpecies = species; } /** * Get the source species of this compound. * For example, "Mus musculus". */ public String getSourceSpecies( ) { return sourceSpecies; } /** * Set the exerimental method used to determine this compound. * For example, "X-ray Diffraction". */ public void setDeterminationMethod( String method ) { if ( method != null ) determinationMethod = method; } /** * Get the exerimental method used to determine this compound. * For example, "X-ray Diffraction". */ public String getDeterminationMethod( ) { return determinationMethod; } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { out.defaultWriteObject(); } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { in.defaultReadObject(); } public boolean isVisible(){ return true; } }