edu.mssm.crover.domain2d
Class UniqueResidueModelFactory

java.lang.Object
  |
  +--edu.mssm.crover.domain2d.UniqueResidueModelFactory
All Implemented Interfaces:
ResidueGlyphRenderingAttributes, ResidueModelFactory

public class UniqueResidueModelFactory
extends java.lang.Object
implements ResidueModelFactory, ResidueGlyphRenderingAttributes

The simplest implantation of ResidueModelFactory. Simply creates a new instance of a ResidueModel each time createResidueModel() is invoked.

See Also:
SharedResidueModelFactory

Field Summary
 ResidueColorScheme colorscheme
           
protected  boolean outline
           
protected  int shape
           
 
Constructor Summary
UniqueResidueModelFactory()
           
 
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.
 ResidueColorScheme getColorScheme()
          Gets the current color scheme.
 boolean getDefaultResidueGlyphOutline()
          Get the suggested default outline attribute.
 int getDefaultResidueShape()
          Get the shape of residues that are not hyperlinked.
 java.awt.Color getForegroundColor(char label, int position)
          Returns the foreground color for a given residue.
 int getLinkedResidueShape()
          Get the shape of residues that are hyperlinked.
 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)
          Returns a string that represent the residue number as an integer.
 void parseAnnotations(BiologicalAnnotations annotations)
          Parse sequence annotations.
 void release(ResidueModel model)
          Release the model.
 void setColorScheme(ResidueColorScheme rcs)
          Sets the color scheme.
 void setDefaultResidueGlyphOutline(boolean outline)
          Sets the outline attribute for future instances of ResidueGlyph.
 void setDefaultResidueShape(int shape)
          Sets the shape of linked residues.
 void setLinkedResidueShape(int shape)
          Sets the shape of linked residues.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

colorscheme

public ResidueColorScheme colorscheme

shape

protected int shape

outline

protected boolean outline
Constructor Detail

UniqueResidueModelFactory

public UniqueResidueModelFactory()
Method Detail

setColorScheme

public void setColorScheme(ResidueColorScheme rcs)
Sets the color scheme. The color scheme determines the association of the color with each residue of the sequence.

Specified by:
setColorScheme in interface ResidueModelFactory
See Also:
ResidueModelFactory.getForegroundColor(char, int), ResidueModelFactory.getBackgroundColor(char, int)

getColorScheme

public ResidueColorScheme getColorScheme()
Gets the current color scheme.


createResidueModel

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

Specified by:
createResidueModel in interface ResidueModelFactory

getBackgroundColor

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

Specified by:
getBackgroundColor in interface ResidueModelFactory
See Also:
ResidueColorScheme

getForegroundColor

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

Specified by:
getForegroundColor in interface ResidueModelFactory
See Also:
ResidueColorScheme

getModels

public java.util.Enumeration getModels()
Description copied from interface: ResidueModelFactory
Returns the model built by this factory.

Specified by:
getModels in interface ResidueModelFactory

getModelCount

public int getModelCount()
Description copied from interface: ResidueModelFactory
Returns the number of models this factory built.

Specified by:
getModelCount in interface ResidueModelFactory

setDefaultResidueGlyphOutline

public void setDefaultResidueGlyphOutline(boolean outline)
Description copied from interface: ResidueGlyphRenderingAttributes
Sets the outline attribute for future instances of ResidueGlyph.

Specified by:
setDefaultResidueGlyphOutline in interface ResidueGlyphRenderingAttributes
Parameters:
outline - an outline display is suggested when true.
See Also:
for usage.

getDefaultResidueGlyphOutline

public boolean getDefaultResidueGlyphOutline()
Description copied from interface: ResidueGlyphRenderingAttributes
Get the suggested default outline attribute.

Specified by:
getDefaultResidueGlyphOutline in interface ResidueGlyphRenderingAttributes

release

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

Specified by:
release in interface ResidueModelFactory

getNumbering

public java.lang.String getNumbering(java.lang.Object numbering)
Returns a string that represent the residue number as an integer. The number starts at 1 for the first residue of a sequence.

Specified by:
getNumbering in interface ResidueModelFactory

parseAnnotations

public void parseAnnotations(BiologicalAnnotations annotations)
Parse sequence annotations. Now, extracts residues which are hyperlinked and set the linked state in the corresponding model.

Specified by:
parseAnnotations in interface ResidueModelFactory

setLinkedResidueShape

public void setLinkedResidueShape(int shape)
Description copied from interface: ResidueGlyphRenderingAttributes
Sets the shape of linked residues. Hyperlinked residues will have this shape by default. * When not set, linked residues have the same shape that non linked residues. Invalid shapes are silently ignored. * @param Type of the shape, as defined in ResidueGlyph

Specified by:
setLinkedResidueShape in interface ResidueGlyphRenderingAttributes
See Also:
ResidueGlyph.CIRCLE_SHAPE, edu.mssm.crover.domain2d.ResidueGlyph#RECTANGULAR_SHAPE, *

setDefaultResidueShape

public void setDefaultResidueShape(int shape)
Description copied from interface: ResidueGlyphRenderingAttributes
Sets the shape of linked residues. Residues will have this shape by default, unless hyperlinked. When not set, the shape of residues defaults to circles. Invalid shapes are silently ignored.

Specified by:
setDefaultResidueShape in interface ResidueGlyphRenderingAttributes
See Also:
ResidueGlyph.CIRCLE_SHAPE, edu.mssm.crover.domain2d.ResidueGlyph#RECTANGULAR_SHAPE, ResidueGlyph.OCTAGONAL_SHAPE

getLinkedResidueShape

public int getLinkedResidueShape()
Description copied from interface: ResidueGlyphRenderingAttributes
Get the shape of residues that are hyperlinked.

Specified by:
getLinkedResidueShape in interface ResidueGlyphRenderingAttributes
Returns:
Shape of the residues.
See Also:
for shape definitions.

getDefaultResidueShape

public int getDefaultResidueShape()
Description copied from interface: ResidueGlyphRenderingAttributes
Get the shape of residues that are not hyperlinked.

Specified by:
getDefaultResidueShape in interface ResidueGlyphRenderingAttributes


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