edu.mssm.crover.domain2d
Class AbstractLoopTemplate

java.lang.Object
  |
  +--edu.mssm.crover.domain2d.AbstractLoopTemplate
All Implemented Interfaces:
LoopTemplate
Direct Known Subclasses:
AlgorithmicLoopTemplate, MultiPointLoopTemplate

public abstract class AbstractLoopTemplate
extends java.lang.Object
implements LoopTemplate


Field Summary
protected  java.awt.geom.Point2D[] adapted
          Adapted control points.
protected  java.awt.geom.Point2D[] controls
          Original control points.
protected  java.awt.geom.Point2D entryDirection
           
protected  java.awt.geom.Point2D exitDirection
           
protected  int FIT
           
protected  java.awt.geom.Point2D[] glyph_pos
           
protected  int notFit
           
protected  java.awt.geom.Point2D spacer
          The spacer that this template match.
protected  int TIMEOUT_EXPIRED
           
protected  int TOO_MUCH_RESIDUES
           
protected  int UNDEFINED
           
 
Constructor Summary
AbstractLoopTemplate(java.awt.geom.Point2D spacer, java.awt.geom.Point2D entryDirection, java.awt.geom.Point2D exitDirection, int numpoints)
           
 
Method Summary
 void adapt(int numglyph, double dist)
          Adapts the template to accomodate numglyphs glyphs separated by a distance dist.
protected abstract  void adaptWithParameter(double l, java.awt.geom.Point2D[] array)
           
protected abstract  double adjustParameter(double l, int fit)
           
protected  double distance(double x, double y, double last_x, double last_y)
           
protected  double distance(java.awt.geom.Point2D a, java.awt.geom.Point2D b)
           
 java.awt.geom.Point2D[] getAdapted()
          Adapted control points.
 java.awt.geom.Point2D[] getControls()
          Original control points.
 java.awt.geom.Point2D[] getGlyphPositions()
          Returns the positions of the glyphs when laid out on the adaptated curve.
 java.awt.geom.Point2D getP0()
          Returns the first control point.
 java.awt.geom.Point2D getPn()
          Returns the last control point.
 java.awt.geom.Point2D getSpacer()
          The spacer that this template match.
 int glyphsNotDisplayed()
          Returns the number of glyphs that cannot fit on the adpated template.
protected abstract  double initialParameter()
           
protected abstract  boolean isParameterValid(double l)
           
protected abstract  double parameterMaxValue()
           
protected abstract  double parameterMinValue()
           
 void setPossibleEllipses(int number)
          Sets the maximum number of ellipsis for this template.
abstract  void setSpacer(java.awt.geom.Point2D newspacer)
          Instructs the template to adapt to a new spacer.
protected  int spaceResiduesOnAdaptedCurve(int numres, double required_distance)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

entryDirection

protected java.awt.geom.Point2D entryDirection

exitDirection

protected java.awt.geom.Point2D exitDirection

controls

protected java.awt.geom.Point2D[] controls
Original control points. P0 is at (0,0), Pn is at spacer


adapted

protected java.awt.geom.Point2D[] adapted
Adapted control points. These control point positions are calculated so that the Pn-P0 is still equal to the spacer while the template now accomodates a certain number of residues.


glyph_pos

protected java.awt.geom.Point2D[] glyph_pos

spacer

protected java.awt.geom.Point2D spacer
The spacer that this template match. It is equal to Pn-P0.


notFit

protected int notFit

TIMEOUT_EXPIRED

protected final int TIMEOUT_EXPIRED
See Also:
Constant Field Values

FIT

protected final int FIT
See Also:
Constant Field Values

TOO_MUCH_RESIDUES

protected final int TOO_MUCH_RESIDUES
See Also:
Constant Field Values

UNDEFINED

protected final int UNDEFINED
See Also:
Constant Field Values
Constructor Detail

AbstractLoopTemplate

public AbstractLoopTemplate(java.awt.geom.Point2D spacer,
                            java.awt.geom.Point2D entryDirection,
                            java.awt.geom.Point2D exitDirection,
                            int numpoints)
Method Detail

getControls

public java.awt.geom.Point2D[] getControls()
Description copied from interface: LoopTemplate
Original control points. P0 is at (0,0), Pn is at spacer

Specified by:
getControls in interface LoopTemplate

getAdapted

public java.awt.geom.Point2D[] getAdapted()
Description copied from interface: LoopTemplate
Adapted control points. These control point positions are calculated so that the Pn-P0 is still equal to the spacer while the template now accomodates a certain number of residues.

Specified by:
getAdapted in interface LoopTemplate

getGlyphPositions

public java.awt.geom.Point2D[] getGlyphPositions()
Description copied from interface: LoopTemplate
Returns the positions of the glyphs when laid out on the adaptated curve.

Specified by:
getGlyphPositions in interface LoopTemplate

getSpacer

public java.awt.geom.Point2D getSpacer()
Description copied from interface: LoopTemplate
The spacer that this template match. It is equal to Pn-P0.

Specified by:
getSpacer in interface LoopTemplate

setSpacer

public abstract void setSpacer(java.awt.geom.Point2D newspacer)
Instructs the template to adapt to a new spacer. The control points are algorithmically adjusted to the spacer. There is no effect on the result of getControls() but subsequent calls to adapt create adapted points with this new spacer.

Specified by:
setSpacer in interface LoopTemplate

getP0

public java.awt.geom.Point2D getP0()
Description copied from interface: LoopTemplate
Returns the first control point.

Specified by:
getP0 in interface LoopTemplate

getPn

public java.awt.geom.Point2D getPn()
Description copied from interface: LoopTemplate
Returns the last control point.

Specified by:
getPn in interface LoopTemplate

adapt

public void adapt(int numglyph,
                  double dist)
Adapts the template to accomodate numglyphs glyphs separated by a distance dist.

Specified by:
adapt in interface LoopTemplate

glyphsNotDisplayed

public int glyphsNotDisplayed()
Description copied from interface: LoopTemplate
Returns the number of glyphs that cannot fit on the adpated template. Negative values indicate that more residues could fit on the curve that actually do.

Specified by:
glyphsNotDisplayed in interface LoopTemplate

isParameterValid

protected abstract boolean isParameterValid(double l)

adjustParameter

protected abstract double adjustParameter(double l,
                                          int fit)

initialParameter

protected abstract double initialParameter()

parameterMinValue

protected abstract double parameterMinValue()

parameterMaxValue

protected abstract double parameterMaxValue()

spaceResiduesOnAdaptedCurve

protected int spaceResiduesOnAdaptedCurve(int numres,
                                          double required_distance)

adaptWithParameter

protected abstract void adaptWithParameter(double l,
                                           java.awt.geom.Point2D[] array)

setPossibleEllipses

public void setPossibleEllipses(int number)
Description copied from interface: LoopTemplate
Sets the maximum number of ellipsis for this template. The template adjusts the length of the glyph position array according to the maximum number of ellipsis you provide.

Specified by:
setPossibleEllipses in interface LoopTemplate

distance

protected double distance(double x,
                          double y,
                          double last_x,
                          double last_y)

distance

protected double distance(java.awt.geom.Point2D a,
                          java.awt.geom.Point2D b)


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