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
-
CPGMap()
- Initialises an instance of the class but does not create any maps or graphical representation;
'HeresSomeData()' has to be called.
-
addActionListener(ActionListener)
-
-
fullNumbersToggle()
-
-
getBackgroundColour()
- Returns the background colour of the canvas.
-
getBoxSize()
- Returns the size of the little boxes drawn beside the loci labels.
-
getErrorBarsOn()
- Returns whether the error bars are turned on or not
-
getErrorSausageColour()
- Returns the colour of the error bars drawn over the sausages.
-
getFullNumbers()
- Returns whether the numbers shown along the scale bar are shown as the complete numbers
or as exponents.
-
getHighlightedLocus()
-
-
getLabelFont()
- Returns the font used on the labels and titles.
-
getLineAndBoxColour()
- Returns the colour of the lines, little boxes and labels.
-
getLineDistance()
- Returns the length of the distance between the sausages and the little boxes.
-
getMapSeparationDistance()
- Returns the value of the distance between adjacent maps.
-
getMapTitles()
- Returns a list of the map titles.
-
getMaxNumbersInLabel()
- Returns the maximum number of digits shown in a label.
-
getMouseMotionSensitive()
- Returns whether mouseMotionSensitive.
-
getNoOfMaps()
- Returns the number of maps.
-
getSausageColour()
- Returns the colour of the map sausages.
-
getSausageWidth()
- Returns the width of the sausages.
-
getUnitsLHS()
- Retuns the units appering at the top of the maps on the left-hand side maps.
-
getUnitsRHS()
- Returns the units appering at the top of the maps on the right-hand side maps.
-
getYHeaderToMapDistance()
- Returns the distance from the top of the canvas to where the maps are drawn.
-
heresSomeData(boolean, Vector, String[])
- This is the method that is called to make double/sinlge maps out of a set of data.
-
isDoubleMapData()
- Returns whether the data passed to the component is describes double maps or not.
-
isFullNumbers(boolean)
- Sets whether the numbers shown along the scale bar are shown as the complete numbers
or as exponents.
-
isMouseMotionSensitive(boolean)
- Changes the mouse user-interaction mode of the component.
-
mouseClicked(MouseEvent)
- Called when the canvas is activated with the mouse if 'mouseMotionSensitive' is set to false.
-
mouseDragged(MouseEvent)
- Part of interface, not used.
-
mouseEntered(MouseEvent)
- Part of interface, not used.
-
mouseExited(MouseEvent)
- Part of interface, not used.
-
mouseMoved(MouseEvent)
- Called when the canvas is activated with the mouse if 'mouseMotionSensitive' is set to true.
-
mousePressed(MouseEvent)
- Part of interface, not used.
-
mouseReleased(MouseEvent)
- Part of interface, not used.
-
paint(Graphics)
- Draws the maps on the Graphics object.
-
processActionEvent(ActionEvent)
-
-
removeActionListener(ActionListener)
-
-
setBackgroundColour(Color)
- Sets the background colour of the canvas.
-
setBoxSize(int)
- Sets the size of the little boxes drawn beside the loci labels.
-
setErrorBarsOn(boolean)
- Sets whether the error bars are turned on or not.
-
setErrorSausageColour(Color)
- Sets the colour of the error bars drawn over the sausages.
-
setLabelFont(Font)
- Sets the font used on the labels and titles.
-
setLineAndBoxColour(Color)
- Sets the colour of the lines, little boxes and labels.
-
setLineDistance(int)
- Sets the distance between the sausages and the little boxes.
-
setMagnification(int[])
- This method is called when the user wishes to change the values of the magnification of the maps.
-
setMapSeparationDistance(int)
- Sets the distance between two adjacent maps.
-
setMapTitles(String[])
- Sets the titles of the maps.
-
setMaxNumbersInLabel(int)
- Sets the maximum number of digits shown in a label.
-
setSausageColour(Color)
- Sets the colour of the map sausages.
-
setSausageWidth(int)
- Sets the width of the map sausages.
-
setUnitsLHS(String)
- Sets the units appering at the top of the maps on the left-hand side maps.
-
setUnitsRHS(String)
- Sets the units appering at the top of the maps on the right-hand side maps.
-
setYHeaderToMapDistance(int)
- Sets the distance from the top of the canvas to where the maps are drawn.
-
toggleErrorBarsOn()
- Toggles the error bars between being on and off.
-
toggleMouseMotionSensitive()
-
-
undoLastZoom()
- Returns the sizes of the AWT components to the last zoom values.
-
undoZoomToDefaults()
- Returns the the sizes of the AWT components to the program defaults.
-
update(Graphics)
- Overrides the paint method when making a buffered image.
-
zoomMapComponents(double)
- Zooms all of the AWT component sizes on the maps relative to the percentageZoom value passed
in to the method.
CPGMap
public CPGMap()
- Initialises an instance of the class but does not create any maps or graphical representation;
'HeresSomeData()' has to be called.
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.
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.
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.
undoLastZoom
public void undoLastZoom()
- Returns the sizes of the AWT components to the last zoom values.
undoZoomToDefaults
public void undoZoomToDefaults()
- Returns the the sizes of the AWT components to the program defaults.
update
public void update(Graphics g)
- Overrides the paint method when making a buffered image.
- Overrides:
- update in class Component
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
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.
mousePressed
public void mousePressed(MouseEvent parm1)
- Part of interface, not used.
mouseReleased
public void mouseReleased(MouseEvent parm1)
- Part of interface, not used.
mouseEntered
public void mouseEntered(MouseEvent parm1)
- Part of interface, not used.
mouseExited
public void mouseExited(MouseEvent parm1)
- Part of interface, not used.
mouseDragged
public void mouseDragged(MouseEvent parm1)
- Part of interface, not used.
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.
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.
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.
toggleMouseMotionSensitive
public void toggleMouseMotionSensitive()
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.
getSausageWidth
public int getSausageWidth()
- Returns the width of the sausages. Default is 10.
- Returns:
- The width of the sausage in pixels.
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.
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.
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.
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.
setMapSeparationDistance
public void setMapSeparationDistance(int mapSeparationDistance)
- Sets the distance between two adjacent maps. Default is 20.
- Parameters:
- The - separation distance in pixels.
getMapSeparationDistance
public int getMapSeparationDistance()
- Returns the value of the distance between adjacent maps. Default is 20.
- Returns:
- The distance between maps in pixels.
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.
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.
getNoOfMaps
public int getNoOfMaps()
- Returns the number of maps.
- Returns:
- The number of maps.
isDoubleMapData
public boolean isDoubleMapData()
- Returns whether the data passed to the component is describes double maps or not.
setBoxSize
public void setBoxSize(int boxSize)
- Sets the size of the little boxes drawn beside the loci labels. Default is 6.
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.
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.
getUnitsLHS
public String getUnitsLHS()
- Retuns the units appering at the top of the maps on the left-hand side maps. Default is 'CM'.
getErrorBarsOn
public boolean getErrorBarsOn()
- Returns whether the error bars are turned on or not
setErrorBarsOn
public void setErrorBarsOn(boolean errorBarsOn)
- Sets whether the error bars are turned on or not.
toggleErrorBarsOn
public void toggleErrorBarsOn()
- Toggles the error bars between being on and off.
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.
getUnitsRHS
public String getUnitsRHS()
- Returns the units appering at the top of the maps on the right-hand side maps. Default is 'MB'.
setBackgroundColour
public void setBackgroundColour(Color backgroundColour)
- Sets the background colour of the canvas. Default is white.
- Parameters:
- backgroundColour - The background colour.
getBackgroundColour
public Color getBackgroundColour()
- Returns the background colour of the canvas. Default is white.
- Returns:
- The background colour.
setSausageColour
public void setSausageColour(Color sausageColour)
- Sets the colour of the map sausages. Default is green.
- Parameters:
- The - sausage colour.
getSausageColour
public Color getSausageColour()
- Returns the colour of the map sausages. Default is green.
- Returns:
- The sausage colour.
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.
getErrorSausageColour
public Color getErrorSausageColour()
- Returns the colour of the error bars drawn over the sausages. Default is yellow.
- Returns:
- The error sausage colour.
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.
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.
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.
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.
fullNumbersToggle
public void fullNumbersToggle()
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.
getMaxNumbersInLabel
public int getMaxNumbersInLabel()
- Returns the maximum number of digits shown in a label. Default is 6.
- Returns:
- The maximum number of digits.
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.
getLabelFont
public Font getLabelFont()
- Returns the font used on the labels and titles. Default is 'Arial, Font.PLAIN, 10'.
- Returns:
- The label font.
addActionListener
public synchronized void addActionListener(ActionListener l)
removeActionListener
public synchronized void removeActionListener(ActionListener l)
processActionEvent
protected void processActionEvent(ActionEvent e)
getHighlightedLocus
public CPG_Locus getHighlightedLocus()
All Packages Class Hierarchy This Package Previous Next Index