Class UniColor

java.lang.Object
org.openscience.cdk.renderer.color.UniColor
All Implemented Interfaces:
IAtomColorer

public class UniColor extends Object implements IAtomColorer
Defines an atom color that draws as a single uniform color.
Author:
John May
  • Constructor Details

    • UniColor

      public UniColor(Color color)
      Create a uniform atom colorer.
      Parameters:
      color - the color
  • Method Details

    • getAtomColor

      public Color getAtomColor(IAtom atom)
      Returns the color for a certain atom type.
      Specified by:
      getAtomColor in interface IAtomColorer
      Parameters:
      atom - the atom whose color is desired
      Returns:
      the color of the specified atom
    • getAtomColor

      public Color 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.
      Specified by:
      getAtomColor in interface IAtomColorer
      Parameters:
      atom - the atom in question
      defaultColor - the color to use if the atom type of this atom cannot be identified
      Returns:
      the color of the specified atom