org.proteinshader.structure.enums
Enum CPKColorEnum

java.lang.Object
  extended by java.lang.Enum<CPKColorEnum>
      extended by org.proteinshader.structure.enums.CPKColorEnum
All Implemented Interfaces:
Serializable, Comparable<CPKColorEnum>

public enum CPKColorEnum
extends Enum<CPKColorEnum>

Provides an enumeration of the CPK color scheme that is needed by AtomEnum. The CPK color scheme was developed by Corey, Pauling, and Koltun for use by chemists and molecular biologists for coloring atoms in molecular models.

The CPK values used here were taken from a web page on the RasMol Reference Manual: http://www.umass.edu/microbio/chime/pe/shared/cpk-rgb.htm

The RGB values are shown below on a 0 to 255 scale, but they are converted to floats on a scale from 0.0 to 1.0 by the private constructor for CPKColorEnum.


Enum Constant Summary
BLUE
          RGB = ( 0, 0, 255) for sodium
BROWN
          RGB = (165, 42, 42) for zinc, copper, nickel, and bromine
DARK_GRAY
          RGB = (128, 128, 144) for calcium, magnesium, aluminium, titanium, chromium, and silver
DEEP_PINK
          RGB = (255, 20, 147) for unknown (or not otherwise specified)
FIREBRICK
          RGB = (178, 34, 34) for lithium
FOREST_GREEN
          RGB = ( 34, 139, 34) for magnesium
GOLDENROD
          RGB = (218, 165, 32) for fluorine, silicon, gold
GREEN
          RGB = ( 0, 255, 0) for chlorine and boron
LIGHT_BLUE
          RGB = (143, 143, 255) for nitrogen
LIGHT_GRAY
          RGB = (200, 200, 200) for carbon
ORANGE
          RGB = (255, 165, 0) for phosphorus, iron, and barium
PINK
          RGB = (255, 192, 203) for helium
PURPLE
          RGB = (160, 32, 240) for iodine
RED
          RGB = (240, 0, 0) for oxygen
SULPHUR_YELLOW
          RGB = (255, 200, 50) for sulphur
WHITE
          RGB = (255, 255, 255) for hydrogen
 
Method Summary
 float getBlue()
          Returns the blue component of the RGBA color as a float in the range from 0.0 to 1.0, inclusive.
 float getGreen()
          Returns the green component of the RGBA color as a float in the range from 0.0 to 1.0, inclusive.
 float getRed()
          Returns the red component of the RGBA color as a float in the range from 0.0 to 1.0, inclusive.
static CPKColorEnum valueOf(String name)
          Returns the enum constant of this type with the specified name.
static CPKColorEnum[] values()
          Returns an array containing the constants of this enum type, in the order they're declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

LIGHT_GRAY

public static final CPKColorEnum LIGHT_GRAY
RGB = (200, 200, 200) for carbon


RED

public static final CPKColorEnum RED
RGB = (240, 0, 0) for oxygen


WHITE

public static final CPKColorEnum WHITE
RGB = (255, 255, 255) for hydrogen


LIGHT_BLUE

public static final CPKColorEnum LIGHT_BLUE
RGB = (143, 143, 255) for nitrogen


SULPHUR_YELLOW

public static final CPKColorEnum SULPHUR_YELLOW
RGB = (255, 200, 50) for sulphur


GREEN

public static final CPKColorEnum GREEN
RGB = ( 0, 255, 0) for chlorine and boron


ORANGE

public static final CPKColorEnum ORANGE
RGB = (255, 165, 0) for phosphorus, iron, and barium


BLUE

public static final CPKColorEnum BLUE
RGB = ( 0, 0, 255) for sodium


FOREST_GREEN

public static final CPKColorEnum FOREST_GREEN
RGB = ( 34, 139, 34) for magnesium


BROWN

public static final CPKColorEnum BROWN
RGB = (165, 42, 42) for zinc, copper, nickel, and bromine


DARK_GRAY

public static final CPKColorEnum DARK_GRAY
RGB = (128, 128, 144) for calcium, magnesium, aluminium, titanium, chromium, and silver


GOLDENROD

public static final CPKColorEnum GOLDENROD
RGB = (218, 165, 32) for fluorine, silicon, gold


PURPLE

public static final CPKColorEnum PURPLE
RGB = (160, 32, 240) for iodine


FIREBRICK

public static final CPKColorEnum FIREBRICK
RGB = (178, 34, 34) for lithium


PINK

public static final CPKColorEnum PINK
RGB = (255, 192, 203) for helium


DEEP_PINK

public static final CPKColorEnum DEEP_PINK
RGB = (255, 20, 147) for unknown (or not otherwise specified)

Method Detail

values

public static final CPKColorEnum[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(CPKColorEnum c : CPKColorEnum.values())
        System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they're declared

valueOf

public static CPKColorEnum valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name

getRed

public float getRed()
Returns the red component of the RGBA color as a float in the range from 0.0 to 1.0, inclusive.

Returns:
The red value as a float.

getGreen

public float getGreen()
Returns the green component of the RGBA color as a float in the range from 0.0 to 1.0, inclusive.

Returns:
The green value as a float.

getBlue

public float getBlue()
Returns the blue component of the RGBA color as a float in the range from 0.0 to 1.0, inclusive.

Returns:
The blue value as a float.


Copyright © 2007-2008