pairwise-logo.gif (1266 bytes)

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

Constructor Index

 o PairwiseMap(Array, String, String, int, int)
Default constructor that takes in the minimum amount of information to create a PairwiseMap.
 o PairwiseMap(Array, String, String, int, int, String, String)
This constructor takes in a bit more information that is not mandatory but adds more functionality.

Method Index

 o 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.
 o calculateScaleBarData(int)
This method determines how often to draw a tick on the map and by how much to increment the scalebar label.
 o getDatabaseName()
Returns the database name.
 o getDatabaseURL()
Returns the database URL.
 o getLocus(int)
The index of a locus in the locus array is fed in.
 o getLocusArray()
Returns the array of PairwiseLocus objects.
 o getLocusLocationInArray(String)
Tests to see if there's is a locus within the map with the same name as passed in to the method.
 o getLowestLabel_y_position()
Returns the y position of the lowest locus label in the map.
 o getMapExtentFrom()
Returns the lower level of the map scale extent.
 o getMapExtentTo()
Returns the upper level of the map scale extent.
 o getMapSausageColour()
Returns the colour of the map sausage.
 o getMapScreenLength()
Returns the screen length of the map.
 o getMapTitle()
Returns the map title.
 o getMapTitleScreenPsn()
Sets the on-screen co-ordinates of the title label.
 o getMapUnits()
Returns the map units.
 o getMax_ScaleBarLabel_Length(FontMetrics)
Returns the maximum pixel length of the labels that appear on the scale bar.
 o getScaleBar_LabelIncrement()
Returns the increment in each label along the scale bar.
 o getScaleBar_PixelIncrement()
Returns the distance in pixels between each scalebar tick.
 o getUnitsScreenPsn()
Sets the on-screen co-ordinates of the units label.
 o getURL(int)
Returns the URL to a webACE database to a particular locus.
 o highlightLocus(int)
The index of a locus in the locus array is fed in.
 o isLocusNameInAMap(String)
Checks out whether a locus name is in a map.
 o isMouseInALocus(int, int)
Finds out whether the mouse co-ordinates are within a PairwiseLocus object that is held within the map object.
 o longestLabelInMap(FontMetrics)
Goes through all the PairwiseLocus objects in the map and returns a value corresponding to the longest locus label that is encountered.
 o setMapSausageColour(Color)
Sets the colour of the map sausage.
 o setMapScreenLength(int)
Sets the screen length of the map.
 o setMapTitleScreenPsn(Rectangle)
Gets the on-screen co-ordinates of the title label.
 o setScaleBar_LabelIncrement(int)
Sets the increment in each label along the scale bar.
 o setScaleBar_PixelIncrement(int)
Sets the distance in pixels between each scalebar tick.
 o setUnitsScreenPsn(Rectangle)
Gets the on-screen co-ordinates of the units label.
 o unhighlightLocus(int)
The index of a locus in the locus array is fed in.
 o verifyMapData()
This method is used when the programmer feeds in the actual data objects themselves rather than using the standard file parser.

Constructors

 o 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.
 o 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.

Methods

 o 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.

 o 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.
 o 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.

 o 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.

 o 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.
 o 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.

 o 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.

 o 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.

 o 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.

 o getLocus
 public PairwiseLocus getLocus(int locusNumber)
The index of a locus in the locus array is fed in. The method returns the PairwiseLocus object

 o 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.

 o getLowestLabel_y_position
 public int getLowestLabel_y_position()
Returns the y position of the lowest locus label in the map.

 o 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.

 o getLocusArray
 public Array getLocusArray()
Returns the array of PairwiseLocus objects.

 o getMapUnits
 public String getMapUnits()
Returns the map units.

 o getMapExtentFrom
 public int getMapExtentFrom()
Returns the lower level of the map scale extent.

 o getMapExtentTo
 public int getMapExtentTo()
Returns the upper level of the map scale extent.

 o getMapTitle
 public String getMapTitle()
Returns the map title.

 o getDatabaseName
 public String getDatabaseName()
Returns the database name.

 o getDatabaseURL
 public String getDatabaseURL()
Returns the database URL.

 o getMapScreenLength
 public int getMapScreenLength()
Returns the screen length of the map. This is 600 by default.

 o setMapScreenLength
 public void setMapScreenLength(int mapScreenLength)
Sets the screen length of the map.

 o getMapSausageColour
 public Color getMapSausageColour()
Returns the colour of the map sausage.

 o setMapSausageColour
 public void setMapSausageColour(Color mapSausageColour)
Sets the colour of the map sausage.

 o getScaleBar_LabelIncrement
 public int getScaleBar_LabelIncrement()
Returns the increment in each label along the scale bar.

 o setScaleBar_LabelIncrement
 public void setScaleBar_LabelIncrement(int scaleBar_LabelIncrement)
Sets the increment in each label along the scale bar.

 o getScaleBar_PixelIncrement
 public int getScaleBar_PixelIncrement()
Returns the distance in pixels between each scalebar tick.

 o setScaleBar_PixelIncrement
 public void setScaleBar_PixelIncrement(int scaleBar_PixelIncrement)
Sets the distance in pixels between each scalebar tick.

 o getUnitsScreenPsn
 public Rectangle getUnitsScreenPsn()
Sets the on-screen co-ordinates of the units label.

 o setUnitsScreenPsn
 public void setUnitsScreenPsn(Rectangle unitsScreenPsn)
Gets the on-screen co-ordinates of the units label.

 o getMapTitleScreenPsn
 public Rectangle getMapTitleScreenPsn()
Sets the on-screen co-ordinates of the title label.

 o 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