AFLPgui
Class ScatterGraph

java.lang.Object
  |
  +--AFLPgui.Graph
        |
        +--AFLPgui.ScatterGraph

public class ScatterGraph
extends Graph

This class provides a way to draw a graph on a graphics object. This makes it easy for different graphs to be drawn. This one will show the distribution of peak heights. For every lane, the heighest peak's value will be plotted. All of the lanes will be plotted at the same horizontal position. If a lane has more than one peak, a different color will be used, as opposed to those lanes which have only one peak in the specified region. The region is a range of sizes, in bp, which is specified when the graph is drawn.

See Also:
Graph

Constructor Summary
ScatterGraph()
          Creates a new graph where those lanes with one peak in the defined region will be black and those with more than one peak will be red.
ScatterGraph(java.awt.Color singlePeak, java.awt.Color multiPeak)
          Creates a new graph with the specified parameters.
 
Method Summary
 void drawGraph(java.awt.Graphics g, int x, int y, int width, int height, int bottom_border, double scale, double minSize, double maxSize, DataList lanes)
          Draw the scatter graph with the specified properties.
protected  double findMax(DataList peakList)
          Gives the maximum height for all of the peaks in the given list.
 int getPreferredWidth()
          Gives the preferred width of this graph.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScatterGraph

public ScatterGraph()
Creates a new graph where those lanes with one peak in the defined region will be black and those with more than one peak will be red.

ScatterGraph

public ScatterGraph(java.awt.Color singlePeak,
                    java.awt.Color multiPeak)
Creates a new graph with the specified parameters.
Parameters:
singlePeak - the color for a lane that has only one peak in the region.
multiPeak - the color for a lane that has multiple peaks.
Method Detail

drawGraph

public void drawGraph(java.awt.Graphics g,
                      int x,
                      int y,
                      int width,
                      int height,
                      int bottom_border,
                      double scale,
                      double minSize,
                      double maxSize,
                      DataList lanes)
Draw the scatter graph with the specified properties.
Overrides:
drawGraph in class Graph
Parameters:
g - the graphics to draw on
x - the x coordinate of the upper left corner of the graph area. (The position of the vertical axis)
y - the y coordinate of the upper left corner of the graph
width - the width of the graph area.
height - the height of the graph
scale - the scale of the graph, pixel = intensity*scale
minSize - the minimum size, in bp, that the graph should include
maxSize - the maximum size, in bp, that the graph should include
lanes - the lanes to include in the graph.

getPreferredWidth

public int getPreferredWidth()
Gives the preferred width of this graph. Since the scatter graphs width is independent of the number of lanes, this is useful since the graph does not need to be very wide
Overrides:
getPreferredWidth in class Graph
Returns:
gives a value of 20 pixels.

findMax

protected double findMax(DataList peakList)
Gives the maximum height for all of the peaks in the given list.
Parameters:
peakList - the peaks to find the maximum height in.
Returns:
the largest height value contained by any peak