edu.mssm.crover.domain2d
Interface Domain2D

All Superinterfaces:
Drawing
All Known Implementing Classes:
BetaStrandDomain, CtermDomain, ExtremityDomain, FreeLoop, HelicalDomain, InvalidDomain, ProteinSegmentDomain, TwoEndsDomain, TwoEndsDraggableDomain

public interface Domain2D
extends Drawing

This interface is implemented by all the sequence domains rendered on a DrawingSurface.


Method Summary
 void calculateDeltas()
          Compute delta_start and delta_end: the position of the first and last residue as drawn by the domain2D.
 void connectEnd(Solver solver, Domain2D next)
          Instructs the domain to connect its end to the start of the next domain passed as argument.
 void connectPosition(Solver solver)
          Instructs the domain to register its position with the solver passed as argument.
 void connectStart(Solver solver, Domain2D previous)
          Instructs the domain to connect its start to the end of the previous domain passed as argument.
 void dispose()
          Dispose of this domain2d.
 ConstrainedPoint firstResiduePos()
          Returns the position of the first residue of this domain as a ConstrainedPoint.
 Component getComp()
           
 Point2D getDirection()
          Returns the direction of drawing of this domain, defined as the vector tangent to the direction of drawing of the residue chain at the exit of the domain.
 String getId()
          Returns the id of this domain.
 void hideFirst(boolean hs)
          Loop spacer adustements require that the last residue of the last domain and the first residue of the next domain not to be displayed/controlled by the other domains.
 void hideLast(boolean hs)
          see hideFirst.
 ConstrainedPoint lastResiduePos()
          Returns the position of the last residue of this domain as a ConstrainedPoint.
 void layoutResidues()
          Layout the residues in the domain.
 ConstrainedPoint position()
          Returns the position of this domain as a ConstrainedPoint.
 void setDirection(Point2D direction)
          Sets the direction vector for this domain.
 void setDragging(boolean state)
          Enable/disable the dragging of a domain.
 void setId(String id)
          Sets the id for this domain.
 void setRange(BiologicalSequence seq, int start, int end)
          Instructs the domain to render the part of sequence seq made of the residues between start and end, extremities included.
 void setSpacer(Point2D spacer)
          Sets the spacer vector for this domain.
 void useResidueModelFactory(ResidueModelFactory rmf)
          Change the ResidueModelFactory used to create the residue models.
 
Methods inherited from interface edu.mssm.crover.domain2d.Drawing
getComponent, getParent, getSurface, suggestLocation, suggestLocation
 

Method Detail

setId

void setId(String id)
Sets the id for this domain.


getId

String getId()
Returns the id of this domain. The identifier can be used to track domains.


setRange

void setRange(BiologicalSequence seq,
              int start,
              int end)
              throws InvalidRange
Instructs the domain to render the part of sequence seq made of the residues between start and end, extremities included.
Calling this method could be expensive as the number of residues may be altered and the layout recalculated. Implementors are advised to optimize their code to enable a dynamic adjustement of the range of the domain provided by the diagram editor (yet to be written). Interestingly, it has to be noted that this kind of dynamic adjustement is likely to translate the range over the sequence, add or remove a residue from the range. So some implementations can be choosen to accomodate these local changes that will reuse the previous layout and residues (from the previous invocation of setRange()).

Throws:
InvalidRange

getComp

Component getComp()

firstResiduePos

ConstrainedPoint firstResiduePos()
Returns the position of the first residue of this domain as a ConstrainedPoint.


lastResiduePos

ConstrainedPoint lastResiduePos()
Returns the position of the last residue of this domain as a ConstrainedPoint.


position

ConstrainedPoint position()
Returns the position of this domain as a ConstrainedPoint.

Specified by:
position in interface Drawing

getDirection

Point2D getDirection()
Returns the direction of drawing of this domain, defined as the vector tangent to the direction of drawing of the residue chain at the exit of the domain.
This is used by loops to determine their tangential orientation when connecting two domains. Stricly, there should be two directions: a entry direction and an exit direction. At the moment, for helices and strands it is not expected that the directions will be different so we conveniently keep only one method. This could change as needed.


useResidueModelFactory

void useResidueModelFactory(ResidueModelFactory rmf)
Change the ResidueModelFactory used to create the residue models. The change is taken into account the next time setRange() is invoked on this Domain2D.


connectStart

void connectStart(Solver solver,
                  Domain2D previous)
Instructs the domain to connect its start to the end of the previous domain passed as argument. The solver argument could be a constraint solver used to enforce the various constraints of the diagram. It is not yet clear if the constraint solver will be kept for interactive diagram edition. This is experimental..


connectEnd

void connectEnd(Solver solver,
                Domain2D next)
Instructs the domain to connect its end to the start of the next domain passed as argument. The solver argument could be a constraint solver used to enforce the various constraints of the diagram. It is not yet clear if the constraint solver will be kept for interactive diagram edition. This is experimental..


connectPosition

void connectPosition(Solver solver)
Instructs the domain to register its position with the solver passed as argument. Experimental...


calculateDeltas

void calculateDeltas()
Compute delta_start and delta_end: the position of the first and last residue as drawn by the domain2D.


hideFirst

void hideFirst(boolean hs)
Loop spacer adustements require that the last residue of the last domain and the first residue of the next domain not to be displayed/controlled by the other domains. To do so, the loop domain uses hideFirst and hideLast on its previous and follower domain.


hideLast

void hideLast(boolean hs)
see hideFirst.


setSpacer

void setSpacer(Point2D spacer)
Sets the spacer vector for this domain. The spacer is only indicative: different implementations of Domain2D can interpret it differently. For instance, loops will try to adjust to fit the spacer vector as closely as possible, helices will change the direction of their drawing to fit the direction of the indicated spacer.


setDirection

void setDirection(Point2D direction)
Sets the direction vector for this domain. Some domain display depend on the value of direction (general direction of drawing), other do not. The choice is left to the domain implementor. Helices should adjust to allow rotations of the domain. Loops are highly constrained by surrounding domains and aesthetic constrained, so are unlikely to adjust their display to this parameter.


layoutResidues

void layoutResidues()
Layout the residues in the domain. Determine the size of the domain and set it. After this method has executed the positions of the first and last residue are know relatively to the domain position.

See Also:
firstResiduePos(), lastResiduePos()

setDragging

void setDragging(boolean state)
Enable/disable the dragging of a domain. Most of the time this is a convenient method to access the DBS model and turn the dragging on/off.

See Also:
DBSModel

dispose

void dispose()
Dispose of this domain2d. Release all the references, unregister any observer, etc.

Specified by:
dispose in interface Drawing


Copyright © 2004 Weill Cornell Medical College. All Rights Reserved.