org.concord.biologica.ui
Class PedigreeObject

java.lang.Object
  |
  +--org.concord.biologica.ui.PedigreeObject
Direct Known Subclasses:
PedigreeFamily, PedigreeOrganism

public abstract class PedigreeObject
extends java.lang.Object

An object that manages the state for a graphical object shown in the pedigree view.


Field Summary
protected  int height
          The height of the pedigree object as drawn
protected  int width
          The width of the pedigree object as drawn
protected  int xLocation
          The X location of the top left corner of object
protected  int yLocation
          The Y location of the top left corner of the object
 
Constructor Summary
PedigreeObject()
          Default constructor
 
Method Summary
 boolean canSqueeze()
          Can this object be squeezed? Mainly used for PedigreeFamilies.
 java.awt.Point getBottomMidPoint()
          Get midpoint along bottom of object .
 int getHeight()
          Get the height
 int getLeftMostParentX()
          Get X position of leftmost parent.
 void getMinimumMaximum(java.awt.Point aMinPoint, java.awt.Point aMaxPoint)
          Get the minimum and maximum positions
 int getRightMostParentX()
          Get X position of rightmost parent.
 java.awt.Point getTopLeftPoint()
          Get the top left point of the pedigree object.
 java.awt.Point getTopMidPoint()
          Get midpoint along top of object .
 int getWidth()
          Get the width
 int getXLocation()
          Get the X location
 int getYLocation()
          Get the Y location
abstract  void paint(java.awt.Graphics g, PedigreeOrganismView pedigreeOrganismView, Trait trait, int fontHeight, SelectionSet selectionSet, SelectionSet highlightSet)
          Paint the object with the given Graphics object on the given PedigreeOrganismView.
 void paintConnections(java.awt.Graphics g, PedigreeOrganismView aPedigreeOrganismView, Trait trait, int fontHeight, SelectionSet selectionSet, SelectionSet highlightSet)
          Paint the connections.
 boolean pick(int xPick, int yPick)
          Pick this object, determining if the given x,y location is on the object.
 java.awt.Dimension placeChildren()
          Place children.
 void placeConnections()
          Place the connections.
 void resetSqueezeFactor()
          Reset squeeze factor.
 void setHeight(int aHeight)
          Set the height
 void setWidth(int aWidth)
          Set the width
 void setXLocation(int anXLocation)
          Set the X location
 void setYLocation(int aYLocation)
          Set the Y location
 java.awt.Dimension squeeze()
          Squeeze object.
 void translate(int xDelta, int yDelta)
          Translate the organism by the given amount
 boolean within(int xTopLeft, int yTopLeft, int xBottomRight, int yBottomRight)
          Is this organism within the given rectangle? We'll consider a organism within the rectangle if the rectangle contains some portion of the organism.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

xLocation

protected int xLocation
The X location of the top left corner of object

yLocation

protected int yLocation
The Y location of the top left corner of the object

width

protected int width
The width of the pedigree object as drawn

height

protected int height
The height of the pedigree object as drawn
Constructor Detail

PedigreeObject

public PedigreeObject()
Default constructor
Method Detail

getXLocation

public int getXLocation()
Get the X location
Returns:
int - x location

setXLocation

public void setXLocation(int anXLocation)
Set the X location
Parameters:
anXLocation - int - x location

getYLocation

public int getYLocation()
Get the Y location
Returns:
int - y location

setYLocation

public void setYLocation(int aYLocation)
Set the Y location
Parameters:
aYLocation - int - y location

getWidth

public int getWidth()
Get the width
Returns:
int - width

setWidth

public void setWidth(int aWidth)
Set the width
Parameters:
aWidth - int - width

getHeight

public int getHeight()
Get the height
Returns:
int - height

setHeight

public void setHeight(int aHeight)
Set the height
Parameters:
aHeight - int - height

getTopLeftPoint

public java.awt.Point getTopLeftPoint()
Get the top left point of the pedigree object.
Returns:
Point - top left point of the object

getBottomMidPoint

public java.awt.Point getBottomMidPoint()
Get midpoint along bottom of object .
Returns:
Point - midpoint along bottom of object

getTopMidPoint

public java.awt.Point getTopMidPoint()
Get midpoint along top of object .
Returns:
Point - midpoint along top of object

getMinimumMaximum

public void getMinimumMaximum(java.awt.Point aMinPoint,
                              java.awt.Point aMaxPoint)
Get the minimum and maximum positions

translate

public void translate(int xDelta,
                      int yDelta)
Translate the organism by the given amount
Parameters:
xDelta - int - x delta
yDelta - int - y delta

pick

public boolean pick(int xPick,
                    int yPick)
Pick this object, determining if the given x,y location is on the object.

Parameters:
xPick - int - x location of pick
yPick - int - y location of pick
Returns:
boolean - is object at the given pick location

within

public boolean within(int xTopLeft,
                      int yTopLeft,
                      int xBottomRight,
                      int yBottomRight)
Is this organism within the given rectangle? We'll consider a organism within the rectangle if the rectangle contains some portion of the organism.

Parameters:
xTopLeft - int - x top left coordinate
yTopLeft - int - y top left coordinate
xBottomRight - int - x bottom right coordinate
yBottomRight - int - y bottom right coordinate
Returns:
boolean - is the object within the given rectangle?

canSqueeze

public boolean canSqueeze()
Can this object be squeezed? Mainly used for PedigreeFamilies.
Returns:
boolean - true or false. Default implementation returns false.

squeeze

public java.awt.Dimension squeeze()
Squeeze object. Mainly used for PedigreeFamilies.
Returns:
Dimension - resulting dimension for placement of object.

placeChildren

public java.awt.Dimension placeChildren()
Place children. Mainly used for PedigreeFamilies.
Returns:
Dimension - resulting dimension for placement of object.

resetSqueezeFactor

public void resetSqueezeFactor()
Reset squeeze factor. Mainly used for PedigreeFamilies.

getLeftMostParentX

public int getLeftMostParentX()
Get X position of leftmost parent. Mainly used for PedigreeFamilies.
Returns:
int - X position. Default implementation returns -1.

getRightMostParentX

public int getRightMostParentX()
Get X position of rightmost parent. Mainly used for PedigreeFamilies.
Returns:
int - X position. Default implementation returns -1.

placeConnections

public void placeConnections()
Place the connections. Mainly used for PedigreeFamilies.

paintConnections

public void paintConnections(java.awt.Graphics g,
                             PedigreeOrganismView aPedigreeOrganismView,
                             Trait trait,
                             int fontHeight,
                             SelectionSet selectionSet,
                             SelectionSet highlightSet)
Paint the connections. Mainly used for PedigreeFamilies.
Parameters:
g - Graphics - graphics object to use in painting
pedigreeOrganismView - PedigreeOrganismView - the pedigree organism view
trait - Trait - the trait to show, may be null
fontHeight - int - the font height
selectionSet - selectionSet - view's selection set

paint

public abstract void paint(java.awt.Graphics g,
                           PedigreeOrganismView pedigreeOrganismView,
                           Trait trait,
                           int fontHeight,
                           SelectionSet selectionSet,
                           SelectionSet highlightSet)
Paint the object with the given Graphics object on the given PedigreeOrganismView.

Parameters:
g - Graphics - graphics object to use in painting
pedigreeOrganismView - PedigreeOrganismView - the pedigree organism view
trait - Trait - the trait to show, may be null
fontHeight - int - the font height
selectionSet - selectionSet - view's selection set