edu.mssm.crover.domain2d
Class ColorAnnotationsColorScheme

java.lang.Object
  |
  +--edu.mssm.crover.domain2d.ColorAnnotationsColorScheme
All Implemented Interfaces:
ResidueColorScheme, java.io.Serializable

public class ColorAnnotationsColorScheme
extends java.lang.Object
implements ResidueColorScheme, java.io.Serializable

Colors residues according to the sequence annotations. When no annotations are available, the choice of the colors defaults to another ResidueColorScheme.

See Also:
Serialized Form

Constructor Summary
ColorAnnotationsColorScheme(ResidueColorScheme defaultCS)
           
 
Method Summary
 void addResidues(int[] positions, java.awt.Color color)
          Cache the specified residue positions and color.
 java.awt.Color findColor(int position)
           
 java.awt.Color getBackgroundColor(char label, int position)
          Returns the background color.
 java.awt.Color getForegroundColor(char label, int position)
          Returns the foreground color.
 java.lang.String getInformation()
          Returns a descriptive text about this ColorScheme.
 java.lang.String getShortName()
          Returns a shortname for this ColorScheme.
 void parseAnnotations(BiologicalAnnotations annotations)
          Compiles the coloring from the annotations.
 void removeAllResidues()
          Cleans the residue/color association cache.
 void setDefaultScheme(ResidueColorScheme defaultCS)
          Sets the default color scheme.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ColorAnnotationsColorScheme

public ColorAnnotationsColorScheme(ResidueColorScheme defaultCS)
Method Detail

setDefaultScheme

public void setDefaultScheme(ResidueColorScheme defaultCS)
Sets the default color scheme.


getForegroundColor

public java.awt.Color getForegroundColor(char label,
                                         int position)
Returns the foreground color. When a color annotation is associated with this residue, this color is returned. Otherwise, the choice is delegated to the background scheme.

Specified by:
getForegroundColor in interface ResidueColorScheme

getBackgroundColor

public java.awt.Color getBackgroundColor(char label,
                                         int position)
Returns the background color. The residue position is ignored for that purpose.

Specified by:
getBackgroundColor in interface ResidueColorScheme

getShortName

public java.lang.String getShortName()
Description copied from interface: ResidueColorScheme
Returns a shortname for this ColorScheme. This string is typically less than 10 characters and can be presented to the user to let him choose between several colorscheme.

Specified by:
getShortName in interface ResidueColorScheme

getInformation

public java.lang.String getInformation()
Description copied from interface: ResidueColorScheme
Returns a descriptive text about this ColorScheme. This text should explain the choice and attribution of the colors to the residues of the sequences.

Specified by:
getInformation in interface ResidueColorScheme

parseAnnotations

public void parseAnnotations(BiologicalAnnotations annotations)
Compiles the coloring from the annotations. This method must be called after color annotations have been added to the sequence. It builds a summary of color annotations that speeds up the color lookup for each residue.


addResidues

public void addResidues(int[] positions,
                        java.awt.Color color)
Cache the specified residue positions and color.


removeAllResidues

public void removeAllResidues()
Cleans the residue/color association cache.


findColor

public java.awt.Color findColor(int position)


Copyright @ 2003 Mount Sinai School of Medicine. All Rights Reserved.