|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.proteinshader.structure.Region
public abstract class Region
Abstract class that contains references to a region of a Chain of
AminoAcids.
The known subclasses are Loop, Helix and BetaStrand.
Constructor Summary | |
---|---|
Region(String startResidueID,
String endResidueID,
Chain chain)
Constructor for use by subclasses. |
Method Summary | |
---|---|
abstract void |
accept(Visitor visitor)
Accepts a Visitor and does a callback. |
protected void |
createSegments(SegmentFactory factory)
This protected method should be called by the constructor of concrete subclasses of Region so that the Segment objects for the Region can be created with the appropriate type of SegmentFactory. |
AminoAcid |
getAminoAcidAfterRegion()
Returns the AminoAcid after this Region (or null if it does not exist). |
AminoAcid |
getAminoAcidBeforeRegion()
Returns the AminoAcid before this Region (or null if it does not exist). |
String |
getChainID()
Returns the ID of the Chain that this Region belongs to. |
String |
getEndResidueID()
Returns the ID of the last Residue in the sequence. |
String |
getModelID()
Returns the ID of the Model that this Region belongs to. |
Segment |
getSegment(String segmentID)
Returns the Segment with the requested segmentID (if it exists). |
String |
getStartResidueID()
Returns the ID of the first Residue in the sequence. |
String |
getStructureID()
Returns the ID of the Structure that this Region belongs to. |
Iterator<AminoAcid> |
iteratorAminoAcids()
Returns an Iterator for the AminoAcids referred to by this Region. |
Iterator<Segment> |
iteratorSegments()
Returns an Iterator for the Segments owned by this Region. |
protected void |
markAminoAcids(String regionID,
RegionEnum regionType)
Used to mark each AminoAcid with the ID and type of Region it belongs to. |
int |
numberOfAminoAcids()
Returns the number of AminoAcids referred to by this Region. |
int |
numberOfSegments()
Returns the number of Segments owned by this Region. |
String |
processID(String id,
String typeOfID)
Returns the ID after trimming any leading or trailing whitespace. |
void |
setSegmentAlpha(float alpha)
Sets the alpha component of the RGBA color for all Segments held by this Region. |
void |
setSegmentAlphaToDefault()
The defalult alpha value is 1.0. |
void |
setSegmentRGB(float red,
float green,
float blue)
Sets the RGB color on all Segments held by this Region. |
void |
setSegmentRGBToDefault()
The default RGB color is determined by the Region type. |
void |
setSegmentsToAminoAcidColors()
Sets the color of each Segment in the Region to the AAColorEnum for the AminoAcid the Segment corresponds to. |
void |
setSegmentsToRegionColor()
Sets the color of each Segment in the Region to the default color for the type of Region the Segment belongs to. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Region(String startResidueID, String endResidueID, Chain chain) throws InvalidRegionException, InvalidIDException
startResidueID
- ID of the first AminoAcid in the sequence.endResidueID
- ID of the last AminoAcid in the sequence.chain
- address of the Chain the Region is being added to.
InvalidRegionException
- if the sequence of AminoAcids
(with at least two Residues)
cannot be found on the Chain.
InvalidIDException
- if startResidueID or endResidueID is
null or does not have at least one
non-whitespace character.Method Detail |
---|
protected void createSegments(SegmentFactory factory)
factory
- a SegmentFactory created by a subclass of Region.public abstract void accept(Visitor visitor) throws VisitorException
accept
in interface Visitable
visitor
- the Visitor to do a callback with.
VisitorException
- if an error occurs while an object is
being visited.public String getStartResidueID()
public String getEndResidueID()
public Segment getSegment(String segmentID)
segmentID
- the same as the residueID of the AminoAcid
that the Segment corresponds to.
public AminoAcid getAminoAcidBeforeRegion()
public AminoAcid getAminoAcidAfterRegion()
public String getChainID()
public String getModelID()
public String getStructureID()
public Iterator<AminoAcid> iteratorAminoAcids()
public int numberOfAminoAcids()
public Iterator<Segment> iteratorSegments()
public void setSegmentRGB(float red, float green, float blue) throws ColorOutOfRangeException
red
- component of the RGBA color.green
- component of the RGBA color.blue
- component of the RGBA color.
ColorOutOfRangeException
- if a color value is less than
0.0 or greater than 1.0.public void setSegmentAlpha(float alpha) throws ColorOutOfRangeException
alpha
- component of the RGBA color.
ColorOutOfRangeException
- if alpha is less than 0.0 or
greater than 1.0.public void setSegmentsToAminoAcidColors()
public void setSegmentsToRegionColor()
public void setSegmentRGBToDefault()
public void setSegmentAlphaToDefault()
public int numberOfSegments()
public String processID(String id, String typeOfID) throws InvalidIDException
processID
in interface IDTest
id
- the ID.typeOfID
- the type of ID (for possible inclusion in a error
message).
InvalidIDException
- if the trimmed ID does not have at
least one character.protected void markAminoAcids(String regionID, RegionEnum regionType)
regionID
- will be a loopID, helixID, or a betaStrandID.regionType
- will be LOOP, HELIX, or BETA_STRAND.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |