com.objex.panywhere
Class Allele

java.lang.Object
  extended by com.objex.panywhere.Allele
All Implemented Interfaces:
java.io.Serializable

public class Allele
extends java.lang.Object
implements java.io.Serializable

Defines an Allele object as it relates to the Markers on a chromosome. An allele can be inherited from the mother or from the father. If a full set of Alleles on a marker is inherited from one parent then it is a Haplotype. The Allele class defines all the properties and methods that an Allele may have including how it can be rendered on a Pedigree canvas based on the its properties.

Since:
version 1.01
See Also:
Serialized Form

Field Summary
static java.lang.String MATERNAL
          Represents Allele inherited from the Mother
static java.lang.String PATERNAL
          Represents Allele inherited from the Father
 
Constructor Summary
Allele()
          Creates a new Instance of an Allele class
 
Method Summary
protected  double calcAlleleTextWidth(java.awt.Graphics2D g2d, DrawingContext dc)
           
 Allele cloneAllele()
          Creates and returns a new Allele with the same properties as this Allele.
protected  void draw(java.awt.Graphics2D g2d, double xc, double yc, boolean onFirstMarker, boolean onLastMarker, boolean showHaplotypeBars, java.awt.Font subtextfont)
          Deprecated. Renders the Allele Icon and the Allele ID on the Pedigree surface at a position relative to the Individual Icon and determined by many factors among which is the value of Pedigree.getSubtextYValue().
protected  void draw(java.awt.Graphics2D g2d, double xc, double yc, boolean onFirstMarker, boolean onLastMarker, DrawingContext dc)
          Paints the Allele text and the icon for chromosomes that are being displayed in the Pedigree.
 java.awt.Paint getColor()
          Getter for property color.
 double getHeight()
          Getter for property height.
 java.lang.String getID()
          Getter for property ID.
static int getMaxChars()
          Deprecated. Get the maximum number of Characters for the Allele ID or text. This class variabale can become important when the number of characters in the Allele Text/ID is heigher than the defualt of 3 chars and hennce needs to be factored in for proper rendering of the Allele Text and Icon
 java.lang.String getPaternity()
          Getter for property paternity.
protected  double getTextHeight()
          Getter for property textHeight.
protected  double getTextWidth()
          Getter for property textWidth.
protected  double getTextX()
          Getter for property textX.
protected  double getTextY()
          Getter for property textY.
 java.lang.String getType()
          Getter for property type.
 double getWidth()
          Getter for property width.
 double getX()
          Getter for property x.
 double getY()
          Getter for property y.
 boolean isBottomBar()
          Getter for property bottomBar.
protected  boolean isColorManuallyAssigned()
          Getter for property colorManuallyAssigned.
 boolean isTopBar()
          Getter for property topBar.
 void setBottomBar(boolean bottomBar)
          Setter for property bottomBar.
 void setColor(java.awt.Paint color)
          Setter for property color.
protected  void setColorManuallyAssigned(boolean rhs)
          Setter for property colorManuallyAssigned.
 void setHeight(double rhs)
          Setter for property height.
 void setID(java.lang.String ID)
          Setter for property ID.
static void setMaxChars(int max)
          Deprecated. Sets the maximum number of Characters for the Allele ID or text. This class variabale can become important when the number of characters in the Allele Text/ID is heigher than the defualt of 3 chars and hennce needs to be factored in for proper rendering of the Allele Text and Icon
 void setPaternity(java.lang.String paternity)
          Setter for property paternity.
protected  void setTextHeight(double textHeight)
          Setter for property textHeight.
protected  void setTextWidth(double textWidth)
          Setter for property textWidth.
protected  void setTextX(double textX)
          Setter for property textX.
protected  void setTextY(double textY)
          Setter for property textY.
 void setTopBar(boolean topBar)
          Setter for property topBar.
 void setType(java.lang.String type)
          Setter for property type.
 void setWidth(double aWidth)
          Setter for property width.
 void setX(double x)
          Setter for property x.
 void setY(double y)
          Setter for property y.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MATERNAL

public static final java.lang.String MATERNAL
Represents Allele inherited from the Mother

See Also:
Constant Field Values

PATERNAL

public static final java.lang.String PATERNAL
Represents Allele inherited from the Father

See Also:
Constant Field Values
Constructor Detail

Allele

public Allele()
Creates a new Instance of an Allele class

Method Detail

setMaxChars

public static void setMaxChars(int max)
Deprecated. Sets the maximum number of Characters for the Allele ID or text. This class variabale can become important when the number of characters in the Allele Text/ID is heigher than the defualt of 3 chars and hennce needs to be factored in for proper rendering of the Allele Text and Icon


getMaxChars

public static int getMaxChars()
Deprecated. Get the maximum number of Characters for the Allele ID or text. This class variabale can become important when the number of characters in the Allele Text/ID is heigher than the defualt of 3 chars and hennce needs to be factored in for proper rendering of the Allele Text and Icon


getID

public java.lang.String getID()
Getter for property ID.

Returns:
Value of property ID. Null will be returned if the ID property is not set.

setID

public void setID(java.lang.String ID)
Setter for property ID.

Parameters:
ID - New value of property ID.

draw

protected void draw(java.awt.Graphics2D g2d,
                    double xc,
                    double yc,
                    boolean onFirstMarker,
                    boolean onLastMarker,
                    boolean showHaplotypeBars,
                    java.awt.Font subtextfont)
             throws java.lang.Exception
Deprecated. Renders the Allele Icon and the Allele ID on the Pedigree surface at a position relative to the Individual Icon and determined by many factors among which is the value of Pedigree.getSubtextYValue().

Parameters:
xc - The XCoordinate of the middle of the bottom edge of the Person Icon. This is where the Allele and Haplotype bars and text will be drawn from.
yc - The YCoordinate of Allele Icon top left corner
onFirstMarker - True if the Allele in question is on the first Marker in the sequence (set) False otherwise. This flag if used to determine whether or not to draw a full outline around the Allele box.
onLastMarker - True if the Allele in question is on the last Marker in the sequence (set) False otherwise. This flag if used to determine whether or not to draw a full outline around the Allele box.
showHaplotypeBars - If true then the Haplotype bars must be displayed otherwise only the Allele text is drawn.
Throws:
java.lang.Exception

getType

public java.lang.String getType()
Getter for property type. The Allele type designates the type of the Allele. Common Allele types are HLA-A, HLA-B, HLA-DR etc

Returns:
Value of property type.

setType

public void setType(java.lang.String type)
Setter for property type. The Allele type designates the type of the Allele. Common Allele types are HLA-A, HLA-B, HLA-DR etc

Parameters:
type - New value of property type.

getPaternity

public java.lang.String getPaternity()
Getter for property paternity. The partenity of the Allele inheritance. Possible types are Allele.MATERNAL and Allele.PATERNAL

Returns:
Value of property paternity.

setPaternity

public void setPaternity(java.lang.String paternity)
Setter for property paternity. The partenity of the Allele inheritance. Possible types are Allele.MATERNAL and Allele.PATERNAL

Parameters:
paternity - New value of property paternity.

getY

public double getY()
Getter for property y. The YC of the top left corner of the Allele Icon

Returns:
Value of property y.

setY

public void setY(double y)
Setter for property y. The YC of the top left corner of the Allele Icon

Parameters:
y - New value of property y.

getX

public double getX()
Getter for property x. The XC of the top left corner of the Allele Icon

Returns:
Value of property x.

setX

public void setX(double x)
Setter for property x. The XC of the top left corner of the Allele Icon

Parameters:
x - New value of property x.

getHeight

public double getHeight()
Getter for property height.

Returns:
Value of property height.

setHeight

public void setHeight(double rhs)
Setter for property height.

Parameters:
rhs - New value of property height.

getWidth

public double getWidth()
Getter for property width.

Returns:
Value of property width.

setWidth

public void setWidth(double aWidth)
Setter for property width.

Parameters:
aWidth - New value of property width.

getColor

public java.awt.Paint getColor()
Getter for property color.

Returns:
Value of property color.

setColor

public void setColor(java.awt.Paint color)
Setter for property color.

Parameters:
color - New value of property color.

isTopBar

public boolean isTopBar()
Getter for property topBar.

Returns:
Value of property topBar.

setTopBar

public void setTopBar(boolean topBar)
Setter for property topBar.

Parameters:
topBar - New value of property topBar.

isBottomBar

public boolean isBottomBar()
Getter for property bottomBar.

Returns:
Value of property bottomBar.

setBottomBar

public void setBottomBar(boolean bottomBar)
Setter for property bottomBar.

Parameters:
bottomBar - New value of property bottomBar.

getTextY

protected double getTextY()
Getter for property textY.

Returns:
Value of property textY.

setTextY

protected void setTextY(double textY)
Setter for property textY.

Parameters:
textY - New value of property textY.

getTextX

protected double getTextX()
Getter for property textX.

Returns:
Value of property textX.

setTextX

protected void setTextX(double textX)
Setter for property textX.

Parameters:
textX - New value of property textX.

getTextWidth

protected double getTextWidth()
Getter for property textWidth.

Returns:
Value of property textWidth.

setTextWidth

protected void setTextWidth(double textWidth)
Setter for property textWidth.

Parameters:
textWidth - New value of property textWidth.

getTextHeight

protected double getTextHeight()
Getter for property textHeight.

Returns:
Value of property textHeight.

setTextHeight

protected void setTextHeight(double textHeight)
Setter for property textHeight.

Parameters:
textHeight - New value of property textHeight.

isColorManuallyAssigned

protected boolean isColorManuallyAssigned()
Getter for property colorManuallyAssigned. When this property is set to TRUE, no changes will be made by the smartHaplotyping algorithms to the Color of this Allele and it will be preserverd in all cases except when a user overides it again. The user of this Allele class must ensure that no automatic haplotyping changes are made to the Allele color when this property is set and only allow those changes that come from the user changing the colors manually

Returns:
Value of property colorManuallyAssigned.

setColorManuallyAssigned

protected void setColorManuallyAssigned(boolean rhs)
Setter for property colorManuallyAssigned. When this property is set to TRUE, no changes will be made by the smartHaplotyping algorithms to the Color of this Allele and it will be preserverd in all cases except when a user overides it again. The user of this Allele class must ensure that no automatic haplotyping changes are made to the Allele color when this property is set and only allow those changes that come from the user changing the colors manually

Parameters:
rhs - New value of property colorManuallyAssigned.

cloneAllele

public Allele cloneAllele()
Creates and returns a new Allele with the same properties as this Allele.


draw

protected void draw(java.awt.Graphics2D g2d,
                    double xc,
                    double yc,
                    boolean onFirstMarker,
                    boolean onLastMarker,
                    DrawingContext dc)
Paints the Allele text and the icon for chromosomes that are being displayed in the Pedigree. Some calculations to set the properties of the Allele must be executed before this method is called, including the setting of the AlleleTextWidth, markerDisplayWidth and markerDisplayHeight.

Parameters:
xc - The X-Coordinate of the Individual's icon
yc - The Y-Coordinate on which the left corner of the Allele Icon will be drawn
dc - The control's drawing context with some atributes used in rendering. Of importance to the Allele painting is the dc.dlleleTextWidth, dc.markerDisplayWIdth and dc.markerDisplayHeight among others. These properties must have been predetermined before this method is called in order for the Allele Icons and text to be painted properly and to fit. @see calcAlleleTextWidth(Graphics2D, DrawingContext)
onFirstMarker - True if the Allele in question is on the first Marker in the sequence (set) False otherwise. This flag if used to determine whether or not to draw a full outline around the Allele box.
onLastMarker - True if the Allele in question is on the last Marker in the sequence (set) False otherwise. This flag if used to determine whether or not to draw a full outline around the Allele box.

calcAlleleTextWidth

protected double calcAlleleTextWidth(java.awt.Graphics2D g2d,
                                     DrawingContext dc)
Parameters:
g2d - The current graphics context
dc - The Drawing context from which the properties to that will be used to render this Allele are obtained.
Returns:
The current width of this Allele's text in the context of the Graphics contect and the control's DrawingContext