org.jmol.util
Class ColorEncoder

java.lang.Object
  extended by org.jmol.util.ColorEncoder

public class ColorEncoder
extends Object


Field Summary
static int ALT
           
static int AMINO
           
private  int[] argbsAmino
           
private  int[] argbsCpk
           
private  int[] argbsRoygb
           
private  int[] argbsRwb
           
private  int[] argbsShapely
           
static int BGYOR
           
static int BW
           
static int BWR
           
private static String BYELEMENT_JMOL
           
static String BYELEMENT_PREFIX
           
private static String BYELEMENT_RASMOL
           
private static String BYRESIDUE_AMINO
           
static String BYRESIDUE_PREFIX
           
private static String BYRESIDUE_SHAPELY
           
private static String[] colorSchemes
           
 int currentPalette
           
private static int GRAY
           
 float hi
           
static int HIGH
           
private  int ihalf
           
(package private)  boolean isColorIndex
           
 boolean isReversed
           
 boolean isTranslucent
           
static int JMOL
           
 float lo
           
static int LOW
           
private  int[] paletteBW
           
private  int[] paletteWB
           
(package private)  ColorEncoder propertyColorEncoder
           
static int RASMOL
           
private static int[] rasmolScale
           
static int RESU
           
static int ROYGB
           
static int RWB
           
 Map schemes
           
static int SHAPELY
           
(package private)  String thisName
           
(package private)  int[] thisScale
           
static int USER
           
(package private)  int[] userScale
           
static int WB
           
 
Constructor Summary
ColorEncoder(ColorEncoder propertyColorEncoder)
           
 
Method Summary
private static int colorIndex(int q, int segmentCount)
           
private static String fixName(String name)
           
 int getArgb(float val)
           
 int getArgbFromPalette(float val, float lo, float hi, int palette)
           
 short getColorIndex(float val)
           
 short getColorIndexFromPalette(float val, float lo, float hi, int palette, boolean isTranslucent)
           
 Map getColorKey()
           
 int getColorScheme(String colorScheme, boolean defaultToRoygb, boolean isOverloaded)
           
 int[] getColorSchemeArray(int palette)
           
static String getColorSchemeList(int[] scheme)
           
 String getColorSchemeName()
           
 String getColorSchemeName(int i)
           
private  int[] getPaletteBW()
           
private  int[] getPaletteWB()
           
static int[] getRasmolScale()
           
private static int getSchemeIndex(String colorScheme)
           
private  int getSegmentCount(int palette)
           
 int getState(StringBuffer s)
           
private  int makeColorScheme(String name, int[] scale, boolean isOverloaded)
           
static int quantize(float val, float lo, float hi, int segmentCount)
           
 void setColorScheme(String colorScheme, boolean isTranslucent)
           
 void setRange(float lo, float hi, boolean isReversed)
           
private  void setThisScheme(String name, int[] scale)
           
 void setUserScale(int[] scale)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GRAY

private static final int GRAY
See Also:
Constant Field Values

BYELEMENT_PREFIX

public static final String BYELEMENT_PREFIX
See Also:
Constant Field Values

BYRESIDUE_PREFIX

public static final String BYRESIDUE_PREFIX
See Also:
Constant Field Values

BYELEMENT_JMOL

private static final String BYELEMENT_JMOL
See Also:
Constant Field Values

BYELEMENT_RASMOL

private static final String BYELEMENT_RASMOL
See Also:
Constant Field Values

BYRESIDUE_SHAPELY

private static final String BYRESIDUE_SHAPELY
See Also:
Constant Field Values

BYRESIDUE_AMINO

private static final String BYRESIDUE_AMINO
See Also:
Constant Field Values

ROYGB

public static final int ROYGB
See Also:
Constant Field Values

BGYOR

public static final int BGYOR
See Also:
Constant Field Values

JMOL

public static final int JMOL
See Also:
Constant Field Values

RASMOL

public static final int RASMOL
See Also:
Constant Field Values

SHAPELY

public static final int SHAPELY
See Also:
Constant Field Values

AMINO

public static final int AMINO
See Also:
Constant Field Values

RWB

public static final int RWB
See Also:
Constant Field Values

BWR

public static final int BWR
See Also:
Constant Field Values

LOW

public static final int LOW
See Also:
Constant Field Values

HIGH

public static final int HIGH
See Also:
Constant Field Values

BW

public static final int BW
See Also:
Constant Field Values

WB

public static final int WB
See Also:
Constant Field Values

USER

public static final int USER
See Also:
Constant Field Values

RESU

public static final int RESU
See Also:
Constant Field Values

ALT

public static final int ALT
See Also:
Constant Field Values

colorSchemes

private static final String[] colorSchemes

paletteBW

private int[] paletteBW

paletteWB

private int[] paletteWB

argbsCpk

private int[] argbsCpk

argbsRoygb

private int[] argbsRoygb

argbsRwb

private int[] argbsRwb

argbsShapely

private int[] argbsShapely

argbsAmino

private int[] argbsAmino

ihalf

private int ihalf

rasmolScale

private static int[] rasmolScale

schemes

public Map schemes

currentPalette

public int currentPalette

isTranslucent

public boolean isTranslucent

lo

public float lo

hi

public float hi

isReversed

public boolean isReversed

userScale

int[] userScale

thisScale

int[] thisScale

thisName

String thisName

isColorIndex

boolean isColorIndex

propertyColorEncoder

ColorEncoder propertyColorEncoder
Constructor Detail

ColorEncoder

public ColorEncoder(ColorEncoder propertyColorEncoder)
Method Detail

getSchemeIndex

private static final int getSchemeIndex(String colorScheme)

fixName

private static final String fixName(String name)

makeColorScheme

private int makeColorScheme(String name,
                            int[] scale,
                            boolean isOverloaded)
Parameters:
name -
scale - if null, then this is a reset.
isOverloaded - if TRUE,
Returns:
>= 0 for a default color scheme

getColorScheme

public int getColorScheme(String colorScheme,
                          boolean defaultToRoygb,
                          boolean isOverloaded)
Parameters:
colorScheme - name or name= or name=[x......] [x......] ....
defaultToRoygb -
isOverloaded -
Returns:
paletteID

setUserScale

public void setUserScale(int[] scale)

getColorSchemeArray

public int[] getColorSchemeArray(int palette)

getColorIndexFromPalette

public short getColorIndexFromPalette(float val,
                                      float lo,
                                      float hi,
                                      int palette,
                                      boolean isTranslucent)

getArgbFromPalette

public int getArgbFromPalette(float val,
                              float lo,
                              float hi,
                              int palette)

getSegmentCount

private int getSegmentCount(int palette)

setThisScheme

private void setThisScheme(String name,
                           int[] scale)

getArgb

public int getArgb(float val)

getColorIndex

public short getColorIndex(float val)

getColorKey

public Map getColorKey()

setColorScheme

public void setColorScheme(String colorScheme,
                           boolean isTranslucent)
Parameters:
colorScheme -
isTranslucent -

setRange

public void setRange(float lo,
                     float hi,
                     boolean isReversed)

getColorSchemeName

public String getColorSchemeName()

getColorSchemeName

public String getColorSchemeName(int i)

getColorSchemeList

public static final String getColorSchemeList(int[] scheme)

getRasmolScale

public static final int[] getRasmolScale()

getPaletteWB

private int[] getPaletteWB()

getPaletteBW

private int[] getPaletteBW()

quantize

public static final int quantize(float val,
                                 float lo,
                                 float hi,
                                 int segmentCount)

colorIndex

private static final int colorIndex(int q,
                                    int segmentCount)

getState

public int getState(StringBuffer s)