util
Class ColorScheme

java.lang.Object
  extended by util.ColorScheme

public class ColorScheme
extends java.lang.Object

This class represents the color scheme for the amino acids in the alignment.


Field Summary
static java.lang.String CLUSTAL_X
           
static java.util.HashMap<java.lang.Character,java.awt.Color> defScheme
          Default Clustal X color scheme.
static java.lang.String HDF
           
static java.util.HashMap<java.lang.Character,java.lang.Double> hdfScheme
          Hdf color scheme.
static java.lang.String MW
           
static java.util.HashMap<java.lang.Character,java.lang.Double> mwScheme
          MW color scheme.
static int PAL_RED_BLUE
           
static int PAL_RED_GREEN_BLUE
           
static int PALETTE_HEIGHT
           
static double PALETTE_STEPS
           
static int PALETTE_TEXT_MARGIN
           
static int PALETTE_WIDTH
           
static java.lang.String POL_G
           
static java.util.HashMap<java.lang.Character,java.lang.Double> polScheme
          Pol G color scheme.
static java.lang.String USER_DEF
           
 
Constructor Summary
ColorScheme()
          Constructor of the color scheme hash map.
 
Method Summary
static void addGradualScheme(java.util.HashMap<java.lang.Character,java.lang.Double> colorScheme, java.lang.String schemeName)
          Function to add a new numeric color scheme.
static boolean containsKey(java.lang.Character key)
           
static java.awt.Color getColor(java.lang.Character key)
          Get the color associated to residue on current color scheme
static java.awt.Color getColorFromValue(double value, double maxValue, double minValue, double scale, int colorPalette)
          Function to get the color associated to value in the specified range and palette.
static int getColorPalette()
          Getter for colorPallete
static int getColorScheme()
          Getter for new color scheme
static java.util.Vector<java.lang.String> getColorSchemeNames()
           
static ColorSchemeInfo getPaletteImage()
          Function which shows an image of the current palette
static void init()
           
static boolean loadColorScheme(AlignFrame alignFrame)
          Function which shows a file dialog to load a new color schema
static void setColorPalette(int colorPaletteCode)
          Changes color pallete and reclacule colors for all numeric color schemes
static void setColorScheme(java.lang.String colorSchemeName)
          Setter for new color scheme
static void setUserDefSchemeValues(java.util.HashMap<java.lang.Character,java.lang.Double> newUserDefSchemeValues)
          Setter for user defined color scheme
static void updatePaletteImage(ColorSchemeInfo paletteCanvas)
          Function which shows an image of the current palette
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLUSTAL_X

public static final java.lang.String CLUSTAL_X
See Also:
Constant Field Values

MW

public static final java.lang.String MW
See Also:
Constant Field Values

POL_G

public static final java.lang.String POL_G
See Also:
Constant Field Values

HDF

public static final java.lang.String HDF
See Also:
Constant Field Values

USER_DEF

public static final java.lang.String USER_DEF
See Also:
Constant Field Values

PAL_RED_GREEN_BLUE

public static final int PAL_RED_GREEN_BLUE
See Also:
Constant Field Values

PAL_RED_BLUE

public static final int PAL_RED_BLUE
See Also:
Constant Field Values

PALETTE_WIDTH

public static final int PALETTE_WIDTH
See Also:
Constant Field Values

PALETTE_HEIGHT

public static final int PALETTE_HEIGHT
See Also:
Constant Field Values

PALETTE_TEXT_MARGIN

public static final int PALETTE_TEXT_MARGIN
See Also:
Constant Field Values

PALETTE_STEPS

public static final double PALETTE_STEPS
See Also:
Constant Field Values

defScheme

public static final java.util.HashMap<java.lang.Character,java.awt.Color> defScheme
Default Clustal X color scheme.


mwScheme

public static final java.util.HashMap<java.lang.Character,java.lang.Double> mwScheme
MW color scheme.


polScheme

public static final java.util.HashMap<java.lang.Character,java.lang.Double> polScheme
Pol G color scheme.


hdfScheme

public static final java.util.HashMap<java.lang.Character,java.lang.Double> hdfScheme
Hdf color scheme.

Constructor Detail

ColorScheme

public ColorScheme()
Constructor of the color scheme hash map.

Method Detail

init

public static void init()

getColor

public static java.awt.Color getColor(java.lang.Character key)
Get the color associated to residue on current color scheme

Parameters:
Residue - to find color
Returns:
Color associated to residue on current color scheme

setColorPalette

public static void setColorPalette(int colorPaletteCode)
Changes color pallete and reclacule colors for all numeric color schemes

Parameters:
Identifier - of color palette

getColorPalette

public static int getColorPalette()
Getter for colorPallete

Returns:
Identifier of color palette

setUserDefSchemeValues

public static void setUserDefSchemeValues(java.util.HashMap<java.lang.Character,java.lang.Double> newUserDefSchemeValues)
Setter for user defined color scheme

Parameters:
New - user defined color scheme

addGradualScheme

public static void addGradualScheme(java.util.HashMap<java.lang.Character,java.lang.Double> colorScheme,
                                    java.lang.String schemeName)
Function to add a new numeric color scheme.

Parameters:
colorScheme - HashMap with values of new color scheme
schemeName - Name of the new scheme

getColorFromValue

public static java.awt.Color getColorFromValue(double value,
                                               double maxValue,
                                               double minValue,
                                               double scale,
                                               int colorPalette)
Function to get the color associated to value in the specified range and palette.

Parameters:
value - Value to get color
maxValue - Maximum value in range
minValue - Minimum value in range
colorPalette - Identifier of the color palette
Returns:
Color associated to given value in the specified range and palette

containsKey

public static boolean containsKey(java.lang.Character key)

setColorScheme

public static void setColorScheme(java.lang.String colorSchemeName)
Setter for new color scheme

Parameters:
colorSchemeName - Selected color scheme name

getColorScheme

public static int getColorScheme()
Getter for new color scheme

Returns:
Identifier of the selected color scheme name

getColorSchemeNames

public static java.util.Vector<java.lang.String> getColorSchemeNames()

loadColorScheme

public static boolean loadColorScheme(AlignFrame alignFrame)
Function which shows a file dialog to load a new color schema

Parameters:
alignFrame - Main frame of the application

getPaletteImage

public static ColorSchemeInfo getPaletteImage()
Function which shows an image of the current palette


updatePaletteImage

public static void updatePaletteImage(ColorSchemeInfo paletteCanvas)
Function which shows an image of the current palette