edu.mssm.crover.representation
Class Color_Annotation

java.lang.Object
  |
  +--edu.mssm.crover.representation.Annotation
        |
        +--edu.mssm.crover.representation.Color_Annotation
All Implemented Interfaces:
BiologicalAnnotation, RootObject, java.io.Serializable
Direct Known Subclasses:
Extended_ColorAnnotation

public class Color_Annotation
extends Annotation

Colors groups of residues according to a property. Defines a color, with a description of the property it encodes and the set of residues that share this color. The organisation by property helps filter Color_Annotation to keep only the nodes the user is interrested in. The package domain2d includes classes to represent color annotations in the different diagramatic representations it provides. When a residue is "colored" by several Color_Annotations, the actual color that will be rendered on this residue is dependant on the order of the annotations in the Annotations object. The "last" coloring should take effect. (Unfortunately, the order of annotations instances is not specified.)

Author:
Fabien Campagne
See Also:
edu.mssm.crover.domain2d, Serialized Form

Field Summary
 
Fields inherited from class edu.mssm.crover.representation.Annotation
origin
 
Constructor Summary
Color_Annotation()
          Constructs an empty color annotation.
 
Method Summary
 void clearResidue(int seq_pos)
          Clear a residue from this color.
 boolean describesResidue(int position)
          Does this annotation describes this residue ?
 java.awt.Color getColor()
          Returns the color associated with the set of residues.
 java.lang.String getInfo()
          Returns a consise text that describes the nature of this annotation.
 int[] getResidues()
          Returns the positions of the residues painted with this color.
 java.lang.String getShortName()
          Returns the shortname of this color.
static void main(java.lang.String[] args)
           
 void paintResidue(int seq_pos)
          Paint a residue with this color.
 void setColor(java.awt.Color color)
          Sets the color associated with the set of residues.
 void setShortName(java.lang.String name)
          Sets the shortname for this color.
 java.lang.String toString()
           
 
Methods inherited from class edu.mssm.crover.representation.Annotation
getOrigin, setOrigin
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Color_Annotation

public Color_Annotation()
Constructs an empty color annotation.

Method Detail

getShortName

public java.lang.String getShortName()
Returns the shortname of this color. The shortname will be presented to the user as an association between the color and what is represents.

See Also:
setShortName(String name)

setShortName

public void setShortName(java.lang.String name)
Sets the shortname for this color. The shortname is a name that should be about 10 characters long and is designed to be used for browsing purposes.

See Also:
getShortName()

setColor

public void setColor(java.awt.Color color)
Sets the color associated with the set of residues.


getColor

public java.awt.Color getColor()
Returns the color associated with the set of residues.


toString

public java.lang.String toString()
Overrides:
toString in class Annotation

paintResidue

public void paintResidue(int seq_pos)
Paint a residue with this color. Effectively adds the position to the list of positions to be colored with this color. Does nothing when the residue is already "colored".

See Also:
clearResidue(int)

clearResidue

public void clearResidue(int seq_pos)
Clear a residue from this color. Effectively removes the position to the list of positions to be colored with this color. Does nothing when the residue is already "cleared" from this color. A residue that has been cleared from one color can still be "colored", through another Color_Annotation.

See Also:
paintResidue(int)

getResidues

public int[] getResidues()
Returns the positions of the residues painted with this color.

Returns:
An array of residue positions on the sequence.

getInfo

public java.lang.String getInfo()
Description copied from interface: BiologicalAnnotation
Returns a consise text that describes the nature of this annotation. This text is constant over several instances of the same class.

Specified by:
getInfo in interface BiologicalAnnotation
Specified by:
getInfo in class Annotation

describesResidue

public boolean describesResidue(int position)
Does this annotation describes this residue ?

Returns:
True when the residue color is being described by this annotation, False otherwise.

main

public static void main(java.lang.String[] args)


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