All Packages Class Hierarchy This Package Previous Next Index
Class PairwiseComparativeMap.PairwiseMap
java.lang.Object
|
+----PairwiseComparativeMap.PairwiseMap
- public class PairwiseMap
- extends Object
This class is a data structure class that describes a number of PairwiseLocus objects
that are bundled together to form a map. The map has a title, units and extents; two
numbers that describe the two extents that the map should be painted from and to. The
map can have a database name and URL that allow the program to call up the database
through a web browser.
- Version:
- 1.0
- Author:
- Written by Jeremy Dickson for the UK Crop Plant Bioinformatics Network, October 1998.
- See Also:
- PCM_FileParser, PairwiseLocus, PairwiseComparativeMapData, PairwiseHomologys
-
PairwiseMap(Array, String, String, int, int)
- Default constructor that takes in the minimum amount of information to create a PairwiseMap.
-
PairwiseMap(Array, String, String, int, int, String, String)
- This constructor takes in a bit more information that is not mandatory but adds more functionality.
-
calculateLociPsns(boolean, boolean, int, int, FontMetrics)
- This method calculates where all the ticks corresponding to the loci positions should
be drawn and where the locus labels should also be drawn.
-
calculateScaleBarData(int)
- This method determines how often to draw a tick on the map and by how much to
increment the scalebar label.
-
getDatabaseName()
- Returns the database name.
-
getDatabaseURL()
- Returns the database URL.
-
getLocus(int)
- The index of a locus in the locus array is fed in.
-
getLocusArray()
- Returns the array of PairwiseLocus objects.
-
getLocusLocationInArray(String)
- Tests to see if there's is a locus within the map with the same name as passed in
to the method.
-
getLowestLabel_y_position()
- Returns the y position of the lowest locus label in the map.
-
getMapExtentFrom()
- Returns the lower level of the map scale extent.
-
getMapExtentTo()
- Returns the upper level of the map scale extent.
-
getMapSausageColour()
- Returns the colour of the map sausage.
-
getMapScreenLength()
- Returns the screen length of the map.
-
getMapTitle()
- Returns the map title.
-
getMapTitleScreenPsn()
- Sets the on-screen co-ordinates of the title label.
-
getMapUnits()
- Returns the map units.
-
getMax_ScaleBarLabel_Length(FontMetrics)
- Returns the maximum pixel length of the labels that appear on the scale bar.
-
getScaleBar_LabelIncrement()
- Returns the increment in each label along the scale bar.
-
getScaleBar_PixelIncrement()
- Returns the distance in pixels between each scalebar tick.
-
getUnitsScreenPsn()
- Sets the on-screen co-ordinates of the units label.
-
getURL(int)
- Returns the URL to a webACE database to a particular locus.
-
highlightLocus(int)
- The index of a locus in the locus array is fed in.
-
isLocusNameInAMap(String)
- Checks out whether a locus name is in a map.
-
isMouseInALocus(int, int)
- Finds out whether the mouse co-ordinates are within a PairwiseLocus object that is held
within the map object.
-
longestLabelInMap(FontMetrics)
- Goes through all the PairwiseLocus objects in the map and returns a value corresponding to
the longest locus label that is encountered.
-
setMapSausageColour(Color)
- Sets the colour of the map sausage.
-
setMapScreenLength(int)
- Sets the screen length of the map.
-
setMapTitleScreenPsn(Rectangle)
- Gets the on-screen co-ordinates of the title label.
-
setScaleBar_LabelIncrement(int)
- Sets the increment in each label along the scale bar.
-
setScaleBar_PixelIncrement(int)
- Sets the distance in pixels between each scalebar tick.
-
setUnitsScreenPsn(Rectangle)
- Gets the on-screen co-ordinates of the units label.
-
unhighlightLocus(int)
- The index of a locus in the locus array is fed in.
-
verifyMapData()
- This method is used when the programmer feeds in the actual data objects themselves
rather than using the standard file parser.
PairwiseMap
public PairwiseMap(Array loci,
String mapTitle,
String mapUnits,
int mapExtentFrom,
int mapExtentTo)
- Default constructor that takes in the minimum amount of information to create a PairwiseMap.
- Parameters:
- loci - The JGL Array of PairwiseLocus objects
- mapTitle - The map title.
- mapUnits - The map units.
- mapExtentFrom - The map extent from.
- mapExtentTo - The map extent to.
PairwiseMap
public PairwiseMap(Array loci,
String mapTitle,
String mapUnits,
int mapExtentFrom,
int mapExtentTo,
String databaseName,
String databaseURL)
- This constructor takes in a bit more information that is not mandatory but adds more functionality.
- Parameters:
- databaseName - The name of the database.
- databaseURL - The base URL of the database.
getLocusLocationInArray
public int getLocusLocationInArray(String locusName)
- Tests to see if there's is a locus within the map with the same name as passed in
to the method. If so, the index of it's position in the array is returned. If not
-1 is returned.
getMax_ScaleBarLabel_Length
public int getMax_ScaleBarLabel_Length(FontMetrics scaleFontMetrics)
- Returns the maximum pixel length of the labels that appear on the scale bar.
- Parameters:
- scaleFontMetrics - The font metrics of the font being used to draw the scale labels.
longestLabelInMap
public int longestLabelInMap(FontMetrics locusFont)
- Goes through all the PairwiseLocus objects in the map and returns a value corresponding to
the longest locus label that is encountered.
calculateScaleBarData
public void calculateScaleBarData(int scaleTickSeparation)
- This method determines how often to draw a tick on the map and by how much to
increment the scalebar label. It takes in a value that corresponds to the approximate
tick seperation that is required, e.g. 50 pixels.
calculateLociPsns
public void calculateLociPsns(boolean inverted,
boolean LHS,
int start_y,
int start_x,
FontMetrics metrics)
- This method calculates where all the ticks corresponding to the loci positions should
be drawn and where the locus labels should also be drawn. These are two different
values as the labels can be displaced down the map when the loci are close together.
- Parameters:
- inverted - Whether the map is inverted or not, i.e. whether zero is at the top of
the page or at the bottom.
- LHS - Should be set to true if the map is being drawn on the left-hand side
of the page.
- start_y - Where that map should start to be drawn on the y axis.
- start_x - The position by the locus pointer line where the label should be drawn on the x axis.
- metrics - The font metrics of the labels.
getURL
public String getURL(int locusNo)
- Returns the URL to a webACE database to a particular locus. The position of the particular
locus in the PairwiseLocus array is given and a string representation of the url is
returned.
isMouseInALocus
public int isMouseInALocus(int x,
int y)
- Finds out whether the mouse co-ordinates are within a PairwiseLocus object that is held
within the map object. If they are, an int corresponding to the locus index in the
array is returned. If not, -1 is returned.
unhighlightLocus
public void unhighlightLocus(int locusNo)
- The index of a locus in the locus array is fed in. The method turns off the highlighting
toggle on this locus.
highlightLocus
public void highlightLocus(int locusNo)
- The index of a locus in the locus array is fed in. The method turns on the highlighting
toggle on this locus.
getLocus
public PairwiseLocus getLocus(int locusNumber)
- The index of a locus in the locus array is fed in. The method returns the PairwiseLocus
object
verifyMapData
public boolean verifyMapData()
- This method is used when the programmer feeds in the actual data objects themselves
rather than using the standard file parser. If everything seems to be ok with the
file, true is returned. False is returned otherwise.
getLowestLabel_y_position
public int getLowestLabel_y_position()
- Returns the y position of the lowest locus label in the map.
isLocusNameInAMap
public int isLocusNameInAMap(String locusName)
- Checks out whether a locus name is in a map. Returns the index to the loci array
if it is and -1 if it is not.
getLocusArray
public Array getLocusArray()
- Returns the array of PairwiseLocus objects.
getMapUnits
public String getMapUnits()
- Returns the map units.
getMapExtentFrom
public int getMapExtentFrom()
- Returns the lower level of the map scale extent.
getMapExtentTo
public int getMapExtentTo()
- Returns the upper level of the map scale extent.
getMapTitle
public String getMapTitle()
- Returns the map title.
getDatabaseName
public String getDatabaseName()
- Returns the database name.
getDatabaseURL
public String getDatabaseURL()
- Returns the database URL.
getMapScreenLength
public int getMapScreenLength()
- Returns the screen length of the map. This is 600 by default.
setMapScreenLength
public void setMapScreenLength(int mapScreenLength)
- Sets the screen length of the map.
getMapSausageColour
public Color getMapSausageColour()
- Returns the colour of the map sausage.
setMapSausageColour
public void setMapSausageColour(Color mapSausageColour)
- Sets the colour of the map sausage.
getScaleBar_LabelIncrement
public int getScaleBar_LabelIncrement()
- Returns the increment in each label along the scale bar.
setScaleBar_LabelIncrement
public void setScaleBar_LabelIncrement(int scaleBar_LabelIncrement)
- Sets the increment in each label along the scale bar.
getScaleBar_PixelIncrement
public int getScaleBar_PixelIncrement()
- Returns the distance in pixels between each scalebar tick.
setScaleBar_PixelIncrement
public void setScaleBar_PixelIncrement(int scaleBar_PixelIncrement)
- Sets the distance in pixels between each scalebar tick.
getUnitsScreenPsn
public Rectangle getUnitsScreenPsn()
- Sets the on-screen co-ordinates of the units label.
setUnitsScreenPsn
public void setUnitsScreenPsn(Rectangle unitsScreenPsn)
- Gets the on-screen co-ordinates of the units label.
getMapTitleScreenPsn
public Rectangle getMapTitleScreenPsn()
- Sets the on-screen co-ordinates of the title label.
setMapTitleScreenPsn
public void setMapTitleScreenPsn(Rectangle mapTitleScreenPsn)
- Gets the on-screen co-ordinates of the title label.
All Packages Class Hierarchy This Package Previous Next Index
|