// $Id: AtomRadiusByCpk.java,v 1.2 2007/02/13 19:08:41 Sasha Buzko Exp $ // // Copyright (c) 2000-2003 San Diego Supercomputer Center (SDSC), // a facility operated jointly by the University of California, // San Diego (UCSD) and General Atomics, 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: AtomRadiusByCpk.java,v $ // Revision 1.2 2007/02/13 19:08:41 Sasha Buzko // *** empty log message *** // // Revision 1.1 2006/05/20 17:02:02 Sasha Buzko // Updated version // // Revision 1.1 2006/04/30 20:13:57 Sasha Buzko // New version of the app // // Revision 1.1 2006/04/15 19:42:21 Sasha Buzko // Initial commit // // Revision 1.4 2006/02/24 22:26:54 Administrator // *** empty log message *** // // Revision 1.3 2006/02/20 18:03:23 Administrator // *** empty log message *** // // Revision 1.2 2005/11/13 23:44:34 Administrator // *** empty log message *** // // Revision 1.1 2005/11/13 04:35:11 Administrator // *** empty log message *** // // Revision 1.1 2003/09/16 21:09:05 moreland // Renamed "AtomRadiusByElement" to "AtomRadiusByCpk". // Added "AtomRadiusByScaledCpk" class. // // Revision 1.4 2003/09/15 20:23:11 moreland // Simplified wording of registered descriptive names. // // Revision 1.3 2003/04/23 23:09:27 moreland // Changed get methods from using an index to an object reference for style context. // // Revision 1.2 2003/04/03 18:28:10 moreland // Changed Atom field "type" to "element" due to naming and meaning conflict. // // Revision 1.1 2003/02/27 21:06:33 moreland // Began adding classes for viewable "Styles" (colors, sizes, forms, etc). // // Revision 1.0 2003/02/25 18:33:19 moreland // First implementation. // package edu.sdsc.mbt.viewables; import edu.sdsc.mbt.viewables.AtomRadius; import edu.sdsc.mbt.Atom; import edu.sdsc.mbt.util.*; /** * This class implements the AtomRadius interface by applying a radius * to the given an Atom by using the ElementRadius class. *

* @see edu.sdsc.mbt.viewables.AtomRadius * @see edu.sdsc.mbt.Atom * @see edu.sdsc.mbt.util.PeriodicTable * @see edu.sdsc.mbt.util.Element * @see edu.sdsc.mbt.viewables.ElementStyles *

* @author John L. Moreland */ public class AtomRadiusByCpk implements AtomRadius { public static final String NAME = "By CPK"; // Holds a singleton instance of this class. private static AtomRadiusByCpk singleton = null; /** * The constructor is PRIVATE so that the "create" method * is used to produce a singleton instance of this class. */ private AtomRadiusByCpk( ) { } /** * Return the singleton instance of this class. */ public static AtomRadiusByCpk create( ) { if ( singleton == null ) singleton = new AtomRadiusByCpk( ); return singleton; } /** * Produce a radius based upon the atom element type. */ public double getAtomRadius( Atom atom ) { return ElementProperties.getAtomRadius( atom.element ) * StylesPreferences.cpkRadiusScale; } }