// $Id: AtomRadiusByConstant.java,v 1.1 2006/05/20 17:02:02 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: AtomRadiusByConstant.java,v $ // Revision 1.1 2006/05/20 17:02:02 Sasha Buzko // Updated version // // Revision 1.1 2006/04/30 20:13:58 Sasha Buzko // New version of the app // // Revision 1.1 2006/04/15 19:42:22 Sasha Buzko // Initial commit // // Revision 1.2 2005/11/13 23:44:33 Administrator // *** empty log message *** // // Revision 1.1 2005/11/13 04:35:16 Administrator // *** empty log message *** // // Revision 1.1 2003/12/16 21:42:42 moreland // Added new style implementation classes. // // Revision 1.0 2003/12/15 18:33:19 moreland // First implementation. // package edu.sdsc.mbt.viewables; import edu.sdsc.mbt.viewables.AtomRadius; import edu.sdsc.mbt.Atom; /** * This class implements the AtomRadius interface by applying a radius * to the given an Atom by using the radius of the bond. *
* @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 AtomRadiusByConstant implements AtomRadius { public static final String NAME = "By Constant (Smooth Bonds)"; // The constant radius to use. private double radius = StylesPreferences.ballRadius; // Holds a singleton instance of this class. private static AtomRadiusByConstant singleton = null; /** * The constructor is PRIVATE so that the "create" method * is used to produce a singleton instance of this class. */ private AtomRadiusByConstant( ) { } /** * Return the singleton instance of this class. */ public static AtomRadiusByConstant create( ) { if ( singleton == null ) singleton = new AtomRadiusByConstant( ); return singleton; } /** * Produce a radius based upon the atom element type. */ public double getAtomRadius( Atom atom ) { return radius; } /** * Set the constant radius. */ public void setRadius( double radius ) { this.radius = radius; } /** * Get the constant radius. */ public double getRadius( ) { return radius; } }