All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class CPGMap.CPG_Locus

java.lang.Object
   |
   +----CPGMap.CPG_Locus

public class CPG_Locus
extends Object
This class forms the backbone of the data storage facilities of CPGMap. All the information describing an individual locus is stored in an instance of this class.

Available data fields are:

Locus Name.

Position 1 on map.

Position 2 on map, (double map only, RHS).

Error of position 1.

Error of position 2, (double map only, RHS).

Locus owns- an integer list of the loci that the locus owns, (or homologous to), in the same map.

Homology Group- the name of the group assigned to loci homologous which are to it.

Each instance of a CPG_Locus is assigned a colour. The default colour is black. The user of the program CPGMap can highlight a locus by hovering the mouse over the locus label or alternatively clicking it. The method below, setColour, is called for the locus in question which sets the locus to a different colour and therefore highlighting it.

Author:
Jeremy Dickson

Constructor Index

 o CPG_Locus()
Empty constructor
 o CPG_Locus(String, double, double, double, double, String, int[])
Constructor for loci making up a double map.
 o CPG_Locus(String, double, double, String, int[])
Constructor for loci making up a single map.

Method Index

 o getColour(Color)
 o getError1()
Returns the error of position 1
 o getError2()
Returns the error of position 2.
 o getHomologyGroup()
Returns a string representation of the homology group.
 o getIntCodeOfColour()
 o getLocusOwns()
Returns the locusOwns array, the array describing the other loci in the map that the locus is homologous to .
 o getName()
Returns the name of the locus.
 o getPosition1()
Returns position 1.
 o getPosition2()
Returns position 2.
 o getTextArea()
Returns a rectangle object corresponding to the area on the screen occupied by the locus label.
 o getXLabelPosition()
Returns the x co-ordinate of the locus label
 o getYLabelPosition()
Returns the y co-ordinate of the locus label
 o isPointWithinLocus(int, int, int)
Returns whether or not the clicked point on the screen was within the bounds of the label area.
 o setColour(int)
Called when the locus is highlight.
 o setRectangularLabelArea(int, int, int, int)
Sets a local rectangle object to a value directly corresponding to the area on the screen occupied by the locus label.

Constructors

 o CPG_Locus
 public CPG_Locus(String name,
                  double position1,
                  double error1,
                  String homologyGroup,
                  int locusOwns[])
Constructor for loci making up a single map. If the error of position is not required, -1 should be passed to the method in the error1 field. If the homologyGroup is not required, 0 or "" should be passed to it. If the locusOwns is not required, a blank int array should be passed to it.

Parameters:
name - The name of the locus appearing on the map.
position1 - The position of the locus on the original map.
error1 - The error of position 1.
homologyGroup - The homology group which the locus belongs to.
locusOwns - The loci on the same map which the locus bears homology to.
 o CPG_Locus
 public CPG_Locus(String name,
                  double position1,
                  double error1,
                  double position2,
                  double error2,
                  String homologyGroup,
                  int locusOwns[])
Constructor for loci making up a double map. If the error of position on either map is not required, -1 should be passed to the method in the error fields. If the homologyGroup is not required, 0 or "" should be passed to it. If the locusOwns is not required, a blank int array should be passed to it.

Parameters:
name - The name of the locus appearing on the map.
position1 - The position of the locus on the first original map. This corresponds to it's position on the LHS of the double map.
position2 - The position of the locus on the original map. This corresponds to it's position on the RHS of the double map.
error1 - The error of position 1.
error2 - The error of position 1.
homologyGroup - The homology group which the locus belongs to.
locusOwns - The loci on the same map which the locus bears homology to.
 o CPG_Locus
 public CPG_Locus()
Empty constructor

Methods

 o setColour
 public void setColour(int colour)
Called when the locus is highlight. The default colour is black.

Parameters:
colour - The value of this int determines the highlight colour

0 = black

1 = red

2 = orange

3 = yellow

4 = blue

 o getColour
 public Color getColour(Color lineAndBoxColour)
 o getHomologyGroup
 public String getHomologyGroup()
Returns a string representation of the homology group.

Parameters:
The - homology group
 o getTextArea
 public Rectangle getTextArea()
Returns a rectangle object corresponding to the area on the screen occupied by the locus label.

Returns:
The label area rectangle.
 o setRectangularLabelArea
 public void setRectangularLabelArea(int x,
                                     int y,
                                     int w,
                                     int h)
Sets a local rectangle object to a value directly corresponding to the area on the screen occupied by the locus label.

Returns:
The label area rectangle.
 o getXLabelPosition
 public int getXLabelPosition()
Returns the x co-ordinate of the locus label

Returns:
The x co-ordinate.
 o getYLabelPosition
 public int getYLabelPosition()
Returns the y co-ordinate of the locus label

Returns:
The y co-ordinate.
 o getName
 public String getName()
Returns the name of the locus.

Returns:
The locus name.
 o getPosition1
 public double getPosition1()
Returns position 1.

Returns:
Position 1.
 o getPosition2
 public double getPosition2()
Returns position 2.

Returns:
Position 2.
 o getLocusOwns
 public int[] getLocusOwns()
Returns the locusOwns array, the array describing the other loci in the map that the locus is homologous to .

Parameters:
The - locusOwns array.
 o isPointWithinLocus
 public boolean isPointWithinLocus(int x,
                                   int y,
                                   int textOffset)
Returns whether or not the clicked point on the screen was within the bounds of the label area.

Returns:
If true, the click was within the locus label.
 o getIntCodeOfColour
 public int getIntCodeOfColour()
 o getError1
 public double getError1()
Returns the error of position 1

Returns:
Error of position 1.
 o getError2
 public double getError2()
Returns the error of position 2.

Returns:
Error of position 2.

All Packages  Class Hierarchy  This Package  Previous  Next  Index