Class CDK2DAtomColors
java.lang.Object
org.openscience.cdk.renderer.color.CDK2DAtomColors
- All Implemented Interfaces:
Serializable, IAtomColorer
Gives a short table of atom colors for 2D display. The coloring is loosely
based on Jmol CPK.
The internal color map can be modified by invoking the set method. For convenience the set method
returns the colorer instance for chaining.
IAtomColorer colorer = new CDK2DAtomColors().set("H", Color.LIGHT_GRAY)
.set("O", Color.RED.lighter());
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetAtomColor(IAtom atom) Returns the color for a certain atom type.getAtomColor(IAtom atom, Color defaultColor) Returns the color for a certain atom type, and uses the given default color if it fails to identify the atom type.
-
Constructor Details
-
CDK2DAtomColors
public CDK2DAtomColors()
-
-
Method Details
-
getAtomColor
Returns the color for a certain atom type.- Specified by:
getAtomColorin interfaceIAtomColorer- Parameters:
atom- the atom whose color is desired- Returns:
- the color of the specified atom
-
getAtomColor
Returns the color for a certain atom type, and uses the given default color if it fails to identify the atom type.- Specified by:
getAtomColorin interfaceIAtomColorer- Parameters:
atom- the atom in questiondefaultColor- the color to use if the atom type of this atom cannot be identified- Returns:
- the color of the specified atom
-