edu.mssm.crover.domain2d
Class SharedResidueModelFactory

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

public class SharedResidueModelFactory
extends java.lang.Object
implements ResidueModelFactory

Factory to create residue models shared among different views. When no previous residue model was created for a sequence, at a given position, a new model is instanciated, otherwise, the previous model is returned.


Field Summary
 ResidueColorScheme colorscheme
           
protected  boolean outline
           
 
Constructor Summary
SharedResidueModelFactory()
           
 
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)
          Invalid shapes are silently ignored.
 void setLinkedResidueShape(int shape)
          Invalid shapes are silently ignored.
 void setShareBrushing(boolean state)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

colorscheme

public ResidueColorScheme colorscheme

outline

protected boolean outline
Constructor Detail

SharedResidueModelFactory

public SharedResidueModelFactory()
Method Detail

setShareBrushing

public void setShareBrushing(boolean state)

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

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

setLinkedResidueShape

public void setLinkedResidueShape(int shape)
Invalid shapes are silently ignored.

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

setDefaultResidueShape

public void setDefaultResidueShape(int shape)
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

parseAnnotations

public void parseAnnotations(BiologicalAnnotations annotations)
Parse sequence annotations. Now, extracts residues which are hyperlinked and set the linked state in the corresponding model. N.B. parseAnnotations is currently not implemented in SharedResidueModelFactory

Specified by:
parseAnnotations 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


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