com.objex.panywhere
Class SymbolRenderer

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

public class SymbolRenderer
extends java.lang.Object

The Symbol Renderer object performs the rendering of Individual's Symbol icons on the pedigree given the data obtained from the SymbolModel associated with this Renderer. It queries the appropriate properties of the Symbol model and draws the Icons accordingly. It is possible to write one's own SymbolRenderer class by extending this class and overriding the appropriate rendering methods. Since the SymbolRenderer is used by the IndividualRenderer to paint Symbols, once a custom SymbolRenderer has been created you would then use method IndividualRender.setSymbolRenderer(CustomRenderer) so that you register the new custom renderer.

Since:
ver1.01

Constructor Summary
SymbolRenderer()
          Creates a new instance of SymbolRenderer with a NULL data source / model
SymbolRenderer(SymbolModel dataModel)
          Creates a new instance of SymbolRenderer
 
Method Summary
protected  void draw(double x, double y, double width, double height, boolean isFemale, java.awt.Graphics2D g2d)
          Displays the view of the Symbol based on the property values.
protected  void draw(double x, double y, double width, double height, java.awt.Graphics2D g2d, boolean unknown, boolean isFemale)
          Displays the view of the Symbol based on the property values.
 SymbolModel getDataModel()
          Getter for property dataModel.
 void setDataModel(SymbolModel dataModel)
          Setter for property dataModel.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SymbolRenderer

public SymbolRenderer(SymbolModel dataModel)
Creates a new instance of SymbolRenderer

Parameters:
dataModel - The Symbol data model from which the data will be quiried for the construction of the view

SymbolRenderer

public SymbolRenderer()
Creates a new instance of SymbolRenderer with a NULL data source / model

Method Detail

draw

protected void draw(double x,
                    double y,
                    double width,
                    double height,
                    boolean isFemale,
                    java.awt.Graphics2D g2d)
Displays the view of the Symbol based on the property values. The Symbol Icon is painted as part of the Individual Icon

Parameters:
x - The X coordinate of the Symbol Icon's top left corner. This must coincide with Individual Icon's X coordinate
y - The Y coordinate of the Symbol Icon's top left corner. This must coincide with Individual Icon's Y coordinate
width - The current Pedigree Icon width
height - The current Pedigree Icon height
g2d - The graphics context
isFemale - A boolean indicating whether or not the Individual to whom this Symbol is assigned is female.

draw

protected void draw(double x,
                    double y,
                    double width,
                    double height,
                    java.awt.Graphics2D g2d,
                    boolean unknown,
                    boolean isFemale)
Displays the view of the Symbol based on the property values. The Symbol Icon is painted as part of the Individual Icon

Parameters:
x - The X coordinate of the Symbol Icon's top left corner. This must coincide with Individual Icon's X coordinate
y - The Y coordinate of the Symbol Icon's top left corner. This must coincide with Individual Icon's Y coordinate
width - The current Pedigree Icon width
height - The current Pedigree Icon height
g2d - The graphics context for drawing purposes
unknown - True if gender of Invoking Individual is marked as Unkwown, false otherwise
isFemale - True if gender of Individual is Female, and false of it is Male Fixed a bug that was making quadrant dots drawn out of place for Icons representing Unkonwn Gender

getDataModel

public SymbolModel getDataModel()
Getter for property dataModel. It retrieves the current data source or model that will be used to create view of Icon. An implementation of the SymbolModel will have been assigned as the data source;

Returns:
Value of property dataModel.

setDataModel

public void setDataModel(SymbolModel dataModel)
Setter for property dataModel. The datamodel (being the Symbol) must be specified for this Rendering engine to display anything at all.

Parameters:
dataModel - New value of property dataModel.