org.strbio.util.graph
Class BarPlot

java.lang.Object
  extended by org.strbio.util.graph.BarPlot
All Implemented Interfaces:
Graphable2D

public class BarPlot
extends java.lang.Object
implements Graphable2D

A component that displays a bar graph.

  Version 1.0, 1/7/00 - original version.
  

Version:
1.0, 1/7/00
Author:
JMC

Field Summary
protected  DVector bars
          This is a vector containint the y coordinates of the bars.
 double barWidth
          What percent of the available width do the bars fill?
 
Constructor Summary
BarPlot(DVector x)
          initialize with a set of bars.
 
Method Summary
 Legend getLegend()
          gets the legend, or none if n/a
 double maxX()
          maximum x value that will be graphed.
 double maxY()
          maximum y value that will be graphed.
 double minX()
          minimum x value that will be graphed.
 double minY()
          minimum y value that will be graphed.
 void paintGraph(java.awt.Graphics g, java.awt.Rectangle r, Graph2D gr)
          draw the graph, in a given rectangle.
 void setBars(DVector x)
          Sets the bars being drawn.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

barWidth

public final double barWidth
What percent of the available width do the bars fill?

See Also:
Constant Field Values

bars

protected DVector bars
This is a vector containint the y coordinates of the bars.

Constructor Detail

BarPlot

public BarPlot(DVector x)
initialize with a set of bars.

Method Detail

setBars

public void setBars(DVector x)
Sets the bars being drawn. Does not copy data.


minX

public double minX()
Description copied from interface: Graphable2D
minimum x value that will be graphed.

Specified by:
minX in interface Graphable2D

minY

public double minY()
Description copied from interface: Graphable2D
minimum y value that will be graphed.

Specified by:
minY in interface Graphable2D

maxX

public double maxX()
Description copied from interface: Graphable2D
maximum x value that will be graphed.

Specified by:
maxX in interface Graphable2D

maxY

public double maxY()
Description copied from interface: Graphable2D
maximum y value that will be graphed.

Specified by:
maxY in interface Graphable2D

getLegend

public Legend getLegend()
Description copied from interface: Graphable2D
gets the legend, or none if n/a

Specified by:
getLegend in interface Graphable2D

paintGraph

public void paintGraph(java.awt.Graphics g,
                       java.awt.Rectangle r,
                       Graph2D gr)
Description copied from interface: Graphable2D
draw the graph, in a given rectangle. Should not clear the background, since more than 1 could be drawn.

Specified by:
paintGraph in interface Graphable2D