edu.mssm.crover.domain2d
Interface GlyphLink

All Known Implementing Classes:
GlyphLinkImpl, ProteinSegmentLinkImpl

public interface GlyphLink


Method Summary
 Dimension getDimension()
          Obtains the dimension of the glyph (valid when shape is rectangular.
 Point2D getLocation(DrawingSurface ds)
          Returns the location of this glyph.
 double getRadius()
          Get the radius of a circle shaped glyph.
 int getRangeEnd()
          Returns the last residue of the range this glyph represents.
 int getRangeStart()
          Returns the first residue of the range this glyph represents.
 int getResidueNumber()
          Returns the position on the sequence that this glyph represents.
 int getShape()
          Returns the shape of the geometrical area "covered" by this glyph.
 String getURL()
          Returns the URL associated with this glyph linl.
 boolean isHidden()
          Get the visibility of this glyph.
 boolean isRange()
          Determines wether the glyph represents a range of residues or a single residue.
 void setURL(String URL)
          Sets the URL to which this link point.
 

Method Detail

getShape

int getShape()
Returns the shape of the geometrical area "covered" by this glyph.

See Also:
GlyphLinkImpl.SHAPE_CIRCLE, GlyphLinkImpl.SHAPE_UNSUPPORTED

getRadius

double getRadius()
                 throws InvalidState
Get the radius of a circle shaped glyph. Only valid when getShape() returns SHAPE_CIRCLE.

Throws:
InvalidState - Thrown when the shape is not circular.
See Also:
getShape()

getResidueNumber

int getResidueNumber()
Returns the position on the sequence that this glyph represents.

Returns:
The position on the sequence (starts at zero) or -1 when it is not available.

isHidden

boolean isHidden()
Get the visibility of this glyph.

Returns:
true when this glyph is hidden, false when it is visible.

isRange

boolean isRange()
Determines wether the glyph represents a range of residues or a single residue. Some glyphs, like the EllipsisGlyph represent a range of residues that start at getRangeStart() and end at getRangeEnd(). For this glyphs, these method returns true. When the glyph represents a single residue, it returns false.

Returns:
true when the glyph represents a range of residues, false otherwise.
See Also:
getRangeStart(), getRangeEnd()

getRangeStart

int getRangeStart()
Returns the first residue of the range this glyph represents. When the residue does not represent a range, the following is true
getRangeStart()==getResidueNumber().

Returns:
The position on the sequence for the first residue of the range or -1 when not available.
See Also:
isRange(), getRangeEnd()

getRangeEnd

int getRangeEnd()
Returns the last residue of the range this glyph represents. When the residue does not represent a range, the following is true
getRangeStart()==getResidueNumber().

Returns:
The position on the sequence for the last residue of the range or -1 when not available.
See Also:
isRange(), getRangeStart()

getLocation

Point2D getLocation(DrawingSurface ds)
                    throws InvalidState
Returns the location of this glyph. A hidden glyph has no location. The location is the point at the upper left corner of the bounding box that encloses the shape. It is not the center of the circular shape... You have been warned :-) Strong assumption here: The glyphs are immediate children of the Domain2D component, which is immediate child of the DrawingSurface.

Returns:
The location of the glyph on the page.
Throws:
InvalidState - Thrown when the glyph is hidden.

getURL

String getURL()
Returns the URL associated with this glyph linl. The URL may be null (for instance, for links associated to residues, in which case the URL is stored in tha annotations of the BiologicalSequence).


setURL

void setURL(String URL)
Sets the URL to which this link point.


getDimension

Dimension getDimension()
                       throws InvalidState
Obtains the dimension of the glyph (valid when shape is rectangular.

Throws:
InvalidState


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