edu.mssm.crover.domain2d
Interface ResidueModelFactory

All Superinterfaces:
ResidueGlyphRenderingAttributes
All Known Implementing Classes:
SharedResidueModelFactory, UniqueResidueModelFactory

public interface ResidueModelFactory
extends ResidueGlyphRenderingAttributes

Factory to create ResidueModels. Contains convenience methods to get the colors associated with a residue glyph, to obtain the models created by this factory and provides a way to customize the numbering scheme used for labeling the residue glyphs.


Method Summary
 ResidueModel createResidueModel(java.lang.Object sequence, java.lang.Object ResidueNumber, char label)
          Create a residue model.
 java.awt.Color getBackgroundColor(char label, int position)
          Returns the background color for a given residue.
 java.awt.Color getForegroundColor(char label, int position)
          Returns the foreground color for a given residue.
 int getModelCount()
          Returns the number of models this factory built.
 java.util.Enumeration getModels()
          Returns the model built by this factory.
 java.lang.String getNumbering(java.lang.Object numbering)
          Converts the numbering implementation to a string representation.
 void parseAnnotations(BiologicalAnnotations annotations)
          Parses the annotations.
 void release(ResidueModel model)
          Release the model.
 void setColorScheme(ResidueColorScheme rcs)
          Sets the residue color scheme to be delegate color requests to.
 
Methods inherited from interface edu.mssm.crover.domain2d.ResidueGlyphRenderingAttributes
getDefaultResidueGlyphOutline, getDefaultResidueShape, getLinkedResidueShape, setDefaultResidueGlyphOutline, setDefaultResidueShape, setLinkedResidueShape
 

Method Detail

createResidueModel

public ResidueModel createResidueModel(java.lang.Object sequence,
                                       java.lang.Object ResidueNumber,
                                       char label)
Create a residue model. This method is overloaded by the implementation.


getBackgroundColor

public java.awt.Color getBackgroundColor(char label,
                                         int position)
Returns the background color for a given residue. This operation is usually delegated to a ResidueColorScheme implementation.

See Also:
ResidueColorScheme

getForegroundColor

public java.awt.Color getForegroundColor(char label,
                                         int position)
Returns the foreground color for a given residue. This operation is usually delegated to a ResidueColorScheme implementation.

See Also:
ResidueColorScheme

setColorScheme

public void setColorScheme(ResidueColorScheme rcs)
Sets the residue color scheme to be delegate color requests to.

See Also:
getForegroundColor(char, int), getBackgroundColor(char, int)

getModels

public java.util.Enumeration getModels()
Returns the model built by this factory.


getModelCount

public int getModelCount()
Returns the number of models this factory built.


release

public void release(ResidueModel model)
Release the model. In order to be garbage collected, a model must be released from the factory that created it.


getNumbering

public java.lang.String getNumbering(java.lang.Object numbering)
Converts the numbering implementation to a string representation. Implementations of this factory interface will customize the rendering of the residue number to specific purposes. The numbering can be as simple as an Integer that encodes the position of the residue in the sequence or as complex as required for custom numbering schemes.


parseAnnotations

public void parseAnnotations(BiologicalAnnotations annotations)
Parses the annotations. Extracts information from annotations relevant to construct new residue models. At this time, extracts if given residues are hyperlinked or not.



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