org.jmol.util
Class ColorEncoder
java.lang.Object
org.jmol.util.ColorEncoder
public class ColorEncoder
- extends java.lang.Object
Method Summary |
private static int |
colorIndex(int q,
int segmentCount)
|
private static java.lang.String |
fixName(java.lang.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)
|
java.util.Map |
getColorKey()
|
int |
getColorScheme(java.lang.String colorScheme,
boolean defaultToRoygb,
boolean isOverloaded)
|
int[] |
getColorSchemeArray(int palette)
|
static java.lang.String |
getColorSchemeList(int[] scheme)
|
java.lang.String |
getColorSchemeName()
|
java.lang.String |
getColorSchemeName(int i)
|
private int[] |
getPaletteBW()
|
private int[] |
getPaletteWB()
|
static int[] |
getRasmolScale()
|
private static int |
getSchemeIndex(java.lang.String colorScheme)
|
private int |
getSegmentCount(int palette)
|
int |
getState(java.lang.StringBuffer s)
|
private int |
makeColorScheme(java.lang.String name,
int[] scale,
boolean isOverloaded)
|
static int |
quantize(float val,
float lo,
float hi,
int segmentCount)
|
void |
setColorScheme(java.lang.String colorScheme,
boolean isTranslucent)
|
void |
setRange(float lo,
float hi,
boolean isReversed)
|
private void |
setThisScheme(java.lang.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 |
GRAY
private static final int GRAY
- See Also:
- Constant Field Values
BYELEMENT_PREFIX
public static final java.lang.String BYELEMENT_PREFIX
- See Also:
- Constant Field Values
BYRESIDUE_PREFIX
public static final java.lang.String BYRESIDUE_PREFIX
- See Also:
- Constant Field Values
BYELEMENT_JMOL
private static final java.lang.String BYELEMENT_JMOL
- See Also:
- Constant Field Values
BYELEMENT_RASMOL
private static final java.lang.String BYELEMENT_RASMOL
- See Also:
- Constant Field Values
BYRESIDUE_SHAPELY
private static final java.lang.String BYRESIDUE_SHAPELY
- See Also:
- Constant Field Values
BYRESIDUE_AMINO
private static final java.lang.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 java.lang.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 java.util.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
java.lang.String thisName
isColorIndex
boolean isColorIndex
propertyColorEncoder
ColorEncoder propertyColorEncoder
ColorEncoder
public ColorEncoder(ColorEncoder propertyColorEncoder)
getSchemeIndex
private static final int getSchemeIndex(java.lang.String colorScheme)
fixName
private static final java.lang.String fixName(java.lang.String name)
makeColorScheme
private int makeColorScheme(java.lang.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(java.lang.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(java.lang.String name,
int[] scale)
getArgb
public int getArgb(float val)
getColorIndex
public short getColorIndex(float val)
getColorKey
public java.util.Map getColorKey()
setColorScheme
public void setColorScheme(java.lang.String colorScheme,
boolean isTranslucent)
- Parameters:
colorScheme
- isTranslucent
-
setRange
public void setRange(float lo,
float hi,
boolean isReversed)
getColorSchemeName
public java.lang.String getColorSchemeName()
getColorSchemeName
public java.lang.String getColorSchemeName(int i)
getColorSchemeList
public static final java.lang.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(java.lang.StringBuffer s)