com.objex.panywhere
Class IndividualRenderer

java.lang.Object
  extended by com.objex.panywhere.IndividualRenderer

public class IndividualRenderer
extends java.lang.Object

Class defines all the rendering methods that help paint icons for Individuals on the Pedigree canvas. A typical use will be to create a new Renderer everytime when an Individual is about to be rendered or to have a Render object pre-defined / created and only changing the data source by calling the method IndividualRenderer.setModel(Individual). This class also uses the default SymbolRenderer class defined to render Symbols for Individuals. To change and use a new Renderer for Symbols use the the method IndividualRenderer.setSymbolRender(). Also to create a new IndividualRenderer, you may subclass this class and override its rendering methods. We recommend that you do not do so.

Since:
ver1.01

Field Summary
 Pedigree m_PedigreeViewer
           
 
Constructor Summary
IndividualRenderer(Pedigree aPedigreeViewer)
          Creates a new Individual Renderer with no datasource/Individual data model specified
 
Method Summary
protected  void drawBlueid(java.awt.Graphics2D g2d, double w, double h)
          Draws the Blue ID NO for the Individual.
protected  void drawBlueid(java.awt.Graphics2D g2d, DrawingContext dc)
          Draws the Blue ID NO for the Individual.
protected  void drawIcontext(java.awt.Graphics2D g2d, double w, double h)
          Draws the Icontext for the Individual subject
protected  void drawSubtext(java.awt.Graphics2D g2d, double w, double h, double subtextY, java.awt.Font subtextfont, boolean showHaplotypeBars)
          Draws the Icon subtext for the Individual.
protected  void drawSubtext(java.awt.Graphics2D g2d, DrawingContext dc)
          Draws the Icon subtext for the Individual.
protected  java.awt.geom.Rectangle2D getBoundingRec(double w, double h)
           
 Individual getModel()
          Getter for property model.
protected  java.awt.geom.GeneralPath getProbandArrowShape(double w, double h)
          Creates and returns the shape of a proband symbol which is an arrow pointing towards the proband Icon.
protected  java.awt.Shape getShapeOutline(double x, double y, double w, double h)
           
 SymbolRenderer getSymbolRenderer()
          Getter for property symbolRenderer.
protected  java.awt.geom.GeneralPath paintProbandArrowShapeLL(double w, double h, double x, double y, java.awt.Graphics2D g2d)
          Draw the Lower Left Proband Arrow
protected  java.awt.geom.GeneralPath paintProbandArrowShapeLR(double w, double h, double x, double y, java.awt.Graphics2D g2d)
          Draw the Lower Lower Right Proband Arrow
protected  java.awt.geom.GeneralPath paintProbandArrowShapeUL(double w, double h, double x, double y, java.awt.Graphics2D g2d)
          Draw the Upper Left Proband Arrow
protected  java.awt.geom.GeneralPath paintProbandArrowShapeUR(double w, double h, double x, double y, java.awt.Graphics2D g2d)
          Draw the Upper Right Proband Arrow
protected  void render(java.awt.Graphics2D g2d, double x, double y, double w, double h)
          Draws the shape outline and symbols for the Individual's Icon at position specified.
protected  void render(java.awt.Graphics2D g2d, DrawingContext dc)
          Draws the appropriate icon for the Individual specified as the data model for this Renderer.
protected  void render(java.awt.Graphics2D g2d, DrawingContext dc, double x, double y)
           
 void setModel(Individual rhs)
          Setter for property model.
 void setSymbolRenderer(SymbolRenderer symbolRenderer)
          Setter for property symbolRenderer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_PedigreeViewer

public transient Pedigree m_PedigreeViewer
Constructor Detail

IndividualRenderer

public IndividualRenderer(Pedigree aPedigreeViewer)
Creates a new Individual Renderer with no datasource/Individual data model specified

Method Detail

getProbandArrowShape

protected java.awt.geom.GeneralPath getProbandArrowShape(double w,
                                                         double h)
Creates and returns the shape of a proband symbol which is an arrow pointing towards the proband Icon.

Parameters:
w - The iconwidth
h - The iconheight
Returns:
A GeneralPath object which represents Proband Symbol

paintProbandArrowShapeLR

protected java.awt.geom.GeneralPath paintProbandArrowShapeLR(double w,
                                                             double h,
                                                             double x,
                                                             double y,
                                                             java.awt.Graphics2D g2d)
Draw the Lower Lower Right Proband Arrow

Parameters:
w - The iconwidth
h - The Iconheight
x - The X-Coordinate of the Individual / Proband
y - The Y-Coordinate of the Individual / Proband
g2d - The graphics context
Returns:
A GeneralPath object which represents Proband Symbol

paintProbandArrowShapeUR

protected java.awt.geom.GeneralPath paintProbandArrowShapeUR(double w,
                                                             double h,
                                                             double x,
                                                             double y,
                                                             java.awt.Graphics2D g2d)
Draw the Upper Right Proband Arrow

Parameters:
w - The iconwidth
h - The Iconheight
x - The X-Coordinate of the Individual / Proband
y - The Y-Coordinate of the Individual / Proband
g2d - The graphics context
Returns:
A GeneralPath object which represents Proband Symbol

paintProbandArrowShapeUL

protected java.awt.geom.GeneralPath paintProbandArrowShapeUL(double w,
                                                             double h,
                                                             double x,
                                                             double y,
                                                             java.awt.Graphics2D g2d)
Draw the Upper Left Proband Arrow

Parameters:
w - The iconwidth
h - The Iconheight
x - The X-Coordinate of the Individual / Proband
y - The Y-Coordinate of the Individual / Proband
g2d - The graphics context
Returns:
A GeneralPath object which represents Proband Symbol

paintProbandArrowShapeLL

protected java.awt.geom.GeneralPath paintProbandArrowShapeLL(double w,
                                                             double h,
                                                             double x,
                                                             double y,
                                                             java.awt.Graphics2D g2d)
Draw the Lower Left Proband Arrow

Parameters:
w - The iconwidth
h - The Iconheight
x - The X-Coordinate of the Individual / Proband
y - The Y-Coordinate of the Individual / Proband
g2d - The graphics context
Returns:
A GeneralPath object which represents Proband Symbol

getShapeOutline

protected java.awt.Shape getShapeOutline(double x,
                                         double y,
                                         double w,
                                         double h)
Parameters:
x - The X location of the shape
y - The Y location of the shape
w - The drawing context's Individual Icon width
h - The drawing context's Individual Icon height
Returns:
The Actual shape outline for Icon of the Individual for whom this is the Renderer

getBoundingRec

protected java.awt.geom.Rectangle2D getBoundingRec(double w,
                                                   double h)
Parameters:
w - The drawing context's Individual Icon width
h - The drawing context's Individual Icon height
Returns:
The bounding rectangle for current Icon for the individual, taking into account location and other properties.

render

protected void render(java.awt.Graphics2D g2d,
                      double x,
                      double y,
                      double w,
                      double h)
Draws the shape outline and symbols for the Individual's Icon at position specified. This rendering method is used to render outlines of Individual Icons during dragging of Individuals when such dragging is done in outline mode as opposed to when it is in livedragging mode.

Parameters:
g2d - The drawing context / paintbrush passed on from the panel on which the drawing is happening
x - The X Location to draw
y - The Y lcoation to draw
w - The Icon width currently ruling on the Pedigree
h - The Icon height currently ruling on the Pedigree

render

protected void render(java.awt.Graphics2D g2d,
                      DrawingContext dc)
Draws the appropriate icon for the Individual specified as the data model for this Renderer. It also uses the Symbol Renderer and the Allele Renderer objects to perform the painting of the requite views for the Symbols and Alleles.

Parameters:
g2d - The drawing context / paintbrush passed on from the panel on which the drawing is happening
dc - The PedigreeViewer drawing context. This encasuplates the various Pedigree related attributes that are used during drawing

render

protected void render(java.awt.Graphics2D g2d,
                      DrawingContext dc,
                      double x,
                      double y)

drawSubtext

protected void drawSubtext(java.awt.Graphics2D g2d,
                           double w,
                           double h,
                           double subtextY,
                           java.awt.Font subtextfont,
                           boolean showHaplotypeBars)
Draws the Icon subtext for the Individual. It also calls the relevent routines to draw the Alleles and haplotype bars if the Individual has any genotype data being tracked.

Parameters:
g2d - The drawing context / paintbrush passed on from the panel on which the drawing is happening
w - The Icon width currently ruling on the Pedigree
h - The Icon height currently ruling on the Pedigree
showHaplotypeBars - If true then the Haplotype will be displayed for each Allele otherwise only the Allele text is drawn.
Since:
Version 1.01 to include Allele and Haplotype Bars

drawSubtext

protected void drawSubtext(java.awt.Graphics2D g2d,
                           DrawingContext dc)
Draws the Icon subtext for the Individual. It also calls the relevent routines to draw the Alleles and haplotype bars if the Individual has any genotype data being tracked.

Parameters:
g2d - The drawing context / paintbrush passed on from the panel on which the drawing is happening
dc - The PedigreeViewer drawing context. This encasuplates the various Pedigree related attributes that are used during drawing

drawIcontext

protected void drawIcontext(java.awt.Graphics2D g2d,
                            double w,
                            double h)
Draws the Icontext for the Individual subject

Parameters:
g2d - The drawing context / paintbrush passed on from the panel on which the drawing is happening
w - The Icon width currently ruling on the Pedigree
h - The Icon height currently ruling on the Pedigree

drawBlueid

protected void drawBlueid(java.awt.Graphics2D g2d,
                          double w,
                          double h)
Draws the Blue ID NO for the Individual. BlueID no is the position of an Individual within the generation

Parameters:
g2d - The drawing context / paintbrush passed on from the panel on which the drawing is happening
w - The Icon width currently ruling on the Pedigree
h - The Icon height currently ruling on the Pedigree

drawBlueid

protected void drawBlueid(java.awt.Graphics2D g2d,
                          DrawingContext dc)
Draws the Blue ID NO for the Individual. BlueID no is the position of an Individual within the generation

Parameters:
g2d - The drawing context / paintbrush passed on from the panel on which the drawing is happening
dc - The PedigreeViewer drawing context. This encasuplates the various Pedigree related attributes that are used during drawing

getModel

public Individual getModel()
Getter for property model. The model represents the current Individual for whom a view is to be rendered by the Renderer

Returns:
Value of property model.

setModel

public void setModel(Individual rhs)
Setter for property model. The model represents the current Individual for whom a view is to be rendered by the Renderer

Parameters:
rhs - New value of property model.

getSymbolRenderer

public SymbolRenderer getSymbolRenderer()
Getter for property symbolRenderer. The SymbolRenderer performs the painting of Symbols for Individuals on the Pedigree.

Returns:
Value of property symbolRenderer.

setSymbolRenderer

public void setSymbolRenderer(SymbolRenderer symbolRenderer)
Setter for property symbolRenderer. The SymbolRenderer performs the painting of Symbols for Individuals on the Pedigree.

Parameters:
symbolRenderer - New value of property symbolRenderer.