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
-
CPG_Locus()
- Empty constructor
-
CPG_Locus(String, double, double, double, double, String, int[])
- Constructor for loci making up a double map.
-
CPG_Locus(String, double, double, String, int[])
- Constructor for loci making up a single map.
-
getColour(Color)
-
-
getError1()
- Returns the error of position 1
-
getError2()
- Returns the error of position 2.
-
getHomologyGroup()
- Returns a string representation of the homology group.
-
getIntCodeOfColour()
-
-
getLocusOwns()
- Returns the locusOwns array, the array describing the other loci in the map that the locus is homologous to .
-
getName()
- Returns the name of the locus.
-
getPosition1()
- Returns position 1.
-
getPosition2()
- Returns position 2.
-
getTextArea()
- Returns a rectangle object corresponding to the area on the screen occupied by the locus label.
-
getXLabelPosition()
- Returns the x co-ordinate of the locus label
-
getYLabelPosition()
- Returns the y co-ordinate of the locus label
-
isPointWithinLocus(int, int, int)
- Returns whether or not the clicked point on the screen was within the bounds of the label area.
-
setColour(int)
- Called when the locus is highlight.
-
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.
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.
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.
CPG_Locus
public CPG_Locus()
- Empty constructor
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
getColour
public Color getColour(Color lineAndBoxColour)
getHomologyGroup
public String getHomologyGroup()
- Returns a string representation of the homology group.
- Parameters:
- The - homology group
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.
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.
getXLabelPosition
public int getXLabelPosition()
- Returns the x co-ordinate of the locus label
- Returns:
- The x co-ordinate.
getYLabelPosition
public int getYLabelPosition()
- Returns the y co-ordinate of the locus label
- Returns:
- The y co-ordinate.
getName
public String getName()
- Returns the name of the locus.
- Returns:
- The locus name.
getPosition1
public double getPosition1()
- Returns position 1.
- Returns:
- Position 1.
getPosition2
public double getPosition2()
- Returns position 2.
- Returns:
- Position 2.
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.
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.
getIntCodeOfColour
public int getIntCodeOfColour()
getError1
public double getError1()
- Returns the error of position 1
- Returns:
- Error of position 1.
getError2
public double getError2()
- Returns the error of position 2.
- Returns:
- Error of position 2.
All Packages Class Hierarchy This Package Previous Next Index