All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class CPGMap.CPGMap

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Canvas
                   |
                   +----CPGMap.CPGMap

public class CPGMap
extends Canvas
implements MouseListener, MouseMotionListener
This is the main class of CPGMap. To create a CPGMap create an instance of the class and call the method 'heresSomeData(boolean, Vector, String[]).

Author:
Jeremy Dickson
See Also:
CPGMapUtilites, CPG_Locus, MapAndLocusNumber

Constructor Index

 o CPGMap()
Initialises an instance of the class but does not create any maps or graphical representation; 'HeresSomeData()' has to be called.

Method Index

 o addActionListener(ActionListener)
 o fullNumbersToggle()
 o getBackgroundColour()
Returns the background colour of the canvas.
 o getBoxSize()
Returns the size of the little boxes drawn beside the loci labels.
 o getErrorBarsOn()
Returns whether the error bars are turned on or not
 o getErrorSausageColour()
Returns the colour of the error bars drawn over the sausages.
 o getFullNumbers()
Returns whether the numbers shown along the scale bar are shown as the complete numbers or as exponents.
 o getHighlightedLocus()
 o getLabelFont()
Returns the font used on the labels and titles.
 o getLineAndBoxColour()
Returns the colour of the lines, little boxes and labels.
 o getLineDistance()
Returns the length of the distance between the sausages and the little boxes.
 o getMapSeparationDistance()
Returns the value of the distance between adjacent maps.
 o getMapTitles()
Returns a list of the map titles.
 o getMaxNumbersInLabel()
Returns the maximum number of digits shown in a label.
 o getMouseMotionSensitive()
Returns whether mouseMotionSensitive.
 o getNoOfMaps()
Returns the number of maps.
 o getSausageColour()
Returns the colour of the map sausages.
 o getSausageWidth()
Returns the width of the sausages.
 o getUnitsLHS()
Retuns the units appering at the top of the maps on the left-hand side maps.
 o getUnitsRHS()
Returns the units appering at the top of the maps on the right-hand side maps.
 o getYHeaderToMapDistance()
Returns the distance from the top of the canvas to where the maps are drawn.
 o heresSomeData(boolean, Vector, String[])
This is the method that is called to make double/sinlge maps out of a set of data.
 o isDoubleMapData()
Returns whether the data passed to the component is describes double maps or not.
 o isFullNumbers(boolean)
Sets whether the numbers shown along the scale bar are shown as the complete numbers or as exponents.
 o isMouseMotionSensitive(boolean)
Changes the mouse user-interaction mode of the component.
 o mouseClicked(MouseEvent)
Called when the canvas is activated with the mouse if 'mouseMotionSensitive' is set to false.
 o mouseDragged(MouseEvent)
Part of interface, not used.
 o mouseEntered(MouseEvent)
Part of interface, not used.
 o mouseExited(MouseEvent)
Part of interface, not used.
 o mouseMoved(MouseEvent)
Called when the canvas is activated with the mouse if 'mouseMotionSensitive' is set to true.
 o mousePressed(MouseEvent)
Part of interface, not used.
 o mouseReleased(MouseEvent)
Part of interface, not used.
 o paint(Graphics)
Draws the maps on the Graphics object.
 o processActionEvent(ActionEvent)
 o removeActionListener(ActionListener)
 o setBackgroundColour(Color)
Sets the background colour of the canvas.
 o setBoxSize(int)
Sets the size of the little boxes drawn beside the loci labels.
 o setErrorBarsOn(boolean)
Sets whether the error bars are turned on or not.
 o setErrorSausageColour(Color)
Sets the colour of the error bars drawn over the sausages.
 o setLabelFont(Font)
Sets the font used on the labels and titles.
 o setLineAndBoxColour(Color)
Sets the colour of the lines, little boxes and labels.
 o setLineDistance(int)
Sets the distance between the sausages and the little boxes.
 o setMagnification(int[])
This method is called when the user wishes to change the values of the magnification of the maps.
 o setMapSeparationDistance(int)
Sets the distance between two adjacent maps.
 o setMapTitles(String[])
Sets the titles of the maps.
 o setMaxNumbersInLabel(int)
Sets the maximum number of digits shown in a label.
 o setSausageColour(Color)
Sets the colour of the map sausages.
 o setSausageWidth(int)
Sets the width of the map sausages.
 o setUnitsLHS(String)
Sets the units appering at the top of the maps on the left-hand side maps.
 o setUnitsRHS(String)
Sets the units appering at the top of the maps on the right-hand side maps.
 o setYHeaderToMapDistance(int)
Sets the distance from the top of the canvas to where the maps are drawn.
 o toggleErrorBarsOn()
Toggles the error bars between being on and off.
 o toggleMouseMotionSensitive()
 o undoLastZoom()
Returns the sizes of the AWT components to the last zoom values.
 o undoZoomToDefaults()
Returns the the sizes of the AWT components to the program defaults.
 o update(Graphics)
Overrides the paint method when making a buffered image.
 o zoomMapComponents(double)
Zooms all of the AWT component sizes on the maps relative to the percentageZoom value passed in to the method.

Constructors

 o CPGMap
 public CPGMap()
Initialises an instance of the class but does not create any maps or graphical representation; 'HeresSomeData()' has to be called.

Methods

 o heresSomeData
 public void heresSomeData(boolean isThereDoubleMapData,
                           Vector locusData,
                           String mapTitles[])
This is the method that is called to make double/sinlge maps out of a set of data. The data is packaged as a two-dimensional vector of 'CPG_Locus' objects.

Parameters:
isThereDoubleMapData - Whether The data included describes double or single maps.
locusData - The two-dimensional vector of CPG_Locus objects to be made in to maps.
mapTitles - The titles of the maps in the same order as the maps in the locusData vector.
 o setMagnification
 public void setMagnification(int magnificationValues[])
This method is called when the user wishes to change the values of the magnification of the maps. In the case of double maps, the LHS and the RHS are independantly magnifiable.

Parameters:
magnificationValues - Corresponds to the desired size, (in pixels), of each map. Values for each map, (or half-map in the case of double maps), are entered in the array in map order from left to right.
 o zoomMapComponents
 public void zoomMapComponents(double percentageZoom)
Zooms all of the AWT component sizes on the maps relative to the percentageZoom value passed in to the method.

Parameters:
percentageZoom - The percentage the user wishes to increase the component sizes by. Must be between -50.0 and 200.0.
 o undoLastZoom
 public void undoLastZoom()
Returns the sizes of the AWT components to the last zoom values.

 o undoZoomToDefaults
 public void undoZoomToDefaults()
Returns the the sizes of the AWT components to the program defaults.

 o update
 public void update(Graphics g)
Overrides the paint method when making a buffered image.

Overrides:
update in class Component
 o paint
 public void paint(Graphics g)
Draws the maps on the Graphics object.

Parameters:
g - The graphics object on to which the maps are drawn.
Overrides:
paint in class Canvas
 o mouseClicked
 public void mouseClicked(MouseEvent parm1)
Called when the canvas is activated with the mouse if 'mouseMotionSensitive' is set to false. Initiates a cascade of events eventually highlighting a locus and it's homologues if the mouse is positioned over a label.

 o mousePressed
 public void mousePressed(MouseEvent parm1)
Part of interface, not used.

 o mouseReleased
 public void mouseReleased(MouseEvent parm1)
Part of interface, not used.

 o mouseEntered
 public void mouseEntered(MouseEvent parm1)
Part of interface, not used.

 o mouseExited
 public void mouseExited(MouseEvent parm1)
Part of interface, not used.

 o mouseDragged
 public void mouseDragged(MouseEvent parm1)
Part of interface, not used.

 o mouseMoved
 public void mouseMoved(MouseEvent parm1)
Called when the canvas is activated with the mouse if 'mouseMotionSensitive' is set to true. Initiates a cascade of events eventually highlighting a locus and it's homologues if the mouse is positioned over a label.

 o isMouseMotionSensitive
 public void isMouseMotionSensitive(boolean mouseMotionSensitive)
Changes the mouse user-interaction mode of the component. Default is true.

Parameters:
sensitive - When set to true the map labels highlight when the mouse hovers over them. When set to false the map labels highlight when the user clicks the canvas.
 o getMouseMotionSensitive
 public boolean getMouseMotionSensitive()
Returns whether mouseMotionSensitive. If true the locus labels highlight when the user hovers the mouse over them. If false the user must click the labels to make them highlight. Default is true.

Returns:
Whether the component is mouse motion sensitive or click sensitive.
 o toggleMouseMotionSensitive
 public void toggleMouseMotionSensitive()
 o setSausageWidth
 public void setSausageWidth(int sausageWidth)
Sets the width of the map sausages. Default is 10.

Parameters:
sausageWidth - The width of the sausages in pixels.
 o getSausageWidth
 public int getSausageWidth()
Returns the width of the sausages. Default is 10.

Returns:
The width of the sausage in pixels.
 o setLineDistance
 public void setLineDistance(int lineDistance)
Sets the distance between the sausages and the little boxes. Default is 40.

Parameters:
lineDistance - The length in pixels of the lines.
 o getLineDistance
 public int getLineDistance()
Returns the length of the distance between the sausages and the little boxes. Default is 40.

Returns:
The length of the line in pixels.
 o setMapTitles
 public void setMapTitles(String mapTitles[])
Sets the titles of the maps.

Parameters:
mapTitles - A string array of the map titles from left to right across the canvas.
 o getMapTitles
 public String[] getMapTitles()
Returns a list of the map titles.

Returns:
A string array of the map titles from left to right across the canvas.
 o setMapSeparationDistance
 public void setMapSeparationDistance(int mapSeparationDistance)
Sets the distance between two adjacent maps. Default is 20.

Parameters:
The - separation distance in pixels.
 o getMapSeparationDistance
 public int getMapSeparationDistance()
Returns the value of the distance between adjacent maps. Default is 20.

Returns:
The distance between maps in pixels.
 o setYHeaderToMapDistance
 public void setYHeaderToMapDistance(int yHeaderToMapDistance)
Sets the distance from the top of the canvas to where the maps are drawn. Default is 50.

Parameters:
yHeaderToMapDistance - The distance in pixels.
 o getYHeaderToMapDistance
 public int getYHeaderToMapDistance()
Returns the distance from the top of the canvas to where the maps are drawn. Default is 50.

Returns:
The distance in pixels.
 o getNoOfMaps
 public int getNoOfMaps()
Returns the number of maps.

Returns:
The number of maps.
 o isDoubleMapData
 public boolean isDoubleMapData()
Returns whether the data passed to the component is describes double maps or not.

 o setBoxSize
 public void setBoxSize(int boxSize)
Sets the size of the little boxes drawn beside the loci labels. Default is 6.

 o getBoxSize
 public int getBoxSize()
Returns the size of the little boxes drawn beside the loci labels. Default is 6.

Returns:
The size of the boxes in pixels.
 o setUnitsLHS
 public void setUnitsLHS(String unitsLHS)
Sets the units appering at the top of the maps on the left-hand side maps. Default is 'CM'.

Parameters:
unitsLHS - The units.
 o getUnitsLHS
 public String getUnitsLHS()
Retuns the units appering at the top of the maps on the left-hand side maps. Default is 'CM'.

 o getErrorBarsOn
 public boolean getErrorBarsOn()
Returns whether the error bars are turned on or not

 o setErrorBarsOn
 public void setErrorBarsOn(boolean errorBarsOn)
Sets whether the error bars are turned on or not.

 o toggleErrorBarsOn
 public void toggleErrorBarsOn()
Toggles the error bars between being on and off.

 o setUnitsRHS
 public void setUnitsRHS(String unitsRHS)
Sets the units appering at the top of the maps on the right-hand side maps. Default is 'MB'.

Parameters:
unitsRHS - The units.
 o getUnitsRHS
 public String getUnitsRHS()
Returns the units appering at the top of the maps on the right-hand side maps. Default is 'MB'.

 o setBackgroundColour
 public void setBackgroundColour(Color backgroundColour)
Sets the background colour of the canvas. Default is white.

Parameters:
backgroundColour - The background colour.
 o getBackgroundColour
 public Color getBackgroundColour()
Returns the background colour of the canvas. Default is white.

Returns:
The background colour.
 o setSausageColour
 public void setSausageColour(Color sausageColour)
Sets the colour of the map sausages. Default is green.

Parameters:
The - sausage colour.
 o getSausageColour
 public Color getSausageColour()
Returns the colour of the map sausages. Default is green.

Returns:
The sausage colour.
 o setErrorSausageColour
 public void setErrorSausageColour(Color errorSausageColour)
Sets the colour of the error bars drawn over the sausages. Default is yellow.

Parameters:
errorSausageColour - The error sausage colour.
 o getErrorSausageColour
 public Color getErrorSausageColour()
Returns the colour of the error bars drawn over the sausages. Default is yellow.

Returns:
The error sausage colour.
 o setLineAndBoxColour
 public void setLineAndBoxColour(Color lineAndBoxColour)
Sets the colour of the lines, little boxes and labels. Default is black.

Parameters:
lineAndBoxColour - The colour of the boxes, lines and labels.
 o getLineAndBoxColour
 public Color getLineAndBoxColour()
Returns the colour of the lines, little boxes and labels. Default is black.

Returns:
The colour of the lines, boxes and labels.
 o isFullNumbers
 public void isFullNumbers(boolean full)
Sets whether the numbers shown along the scale bar are shown as the complete numbers or as exponents. Default is true.

Parameters:
full - If true, the scale numbers are shown in full. If false, the numbers are shown as exponents.
 o getFullNumbers
 public boolean getFullNumbers()
Returns whether the numbers shown along the scale bar are shown as the complete numbers or as exponents. Default is true.

Returns:
If true, the scale numbers are shown in full. If false, the numbers are shown as exponents.
 o fullNumbersToggle
 public void fullNumbersToggle()
 o setMaxNumbersInLabel
 public void setMaxNumbersInLabel(int maxNumbers)
Sets the maximum number of digits shown in a label. Default is 6.

Parameters:
maxNumbers - The maximum number of digits.
 o getMaxNumbersInLabel
 public int getMaxNumbersInLabel()
Returns the maximum number of digits shown in a label. Default is 6.

Returns:
The maximum number of digits.
 o setLabelFont
 public void setLabelFont(Font labelFont)
Sets the font used on the labels and titles. Default is 'Arial, Font.PLAIN, 10'.

Parameters:
labelFont - The label font.
 o getLabelFont
 public Font getLabelFont()
Returns the font used on the labels and titles. Default is 'Arial, Font.PLAIN, 10'.

Returns:
The label font.
 o addActionListener
 public synchronized void addActionListener(ActionListener l)
 o removeActionListener
 public synchronized void removeActionListener(ActionListener l)
 o processActionEvent
 protected void processActionEvent(ActionEvent e)
 o getHighlightedLocus
 public CPG_Locus getHighlightedLocus()

All Packages  Class Hierarchy  This Package  Previous  Next  Index